moved TSS into pts object
[strongswan.git] / src / libimcv / plugins / imc_attestation / imc_attestation_state.h
1 /*
2 * Copyright (C) 2011 Sansar Choinyambuu
3 * HSR Hochschule fuer Technik Rapperswil
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16 /**
17 *
18 * @defgroup imc_attestation_state_t imc_attestation_state
19 * @{ @ingroup imc_attestation_state
20 */
21
22 #ifndef IMC_ATTESTATION_STATE_H_
23 #define IMC_ATTESTATION_STATE_H_
24
25 #include <imc/imc_state.h>
26 #include <tcg/pts/pts.h>
27 #include <library.h>
28
29 typedef struct imc_attestation_state_t imc_attestation_state_t;
30 typedef enum imc_attestation_handshake_state_t imc_attestation_handshake_state_t;
31
32 /**
33 * IMC Attestation Handshake States (state machine)
34 */
35 enum imc_attestation_handshake_state_t {
36 IMC_ATTESTATION_STATE_INIT,
37 IMC_ATTESTATION_STATE_REQ_PROTO_CAPS,
38 IMC_ATTESTATION_STATE_REQ_MEAS_ALGO,
39 IMC_ATTESTATION_STATE_GET_TPM_INFO,
40 IMC_ATTESTATION_STATE_GET_AIK,
41 IMC_ATTESTATION_STATE_REQ_FUNCT_COMP_EVID,
42 IMC_ATTESTATION_STATE_GEN_ATTEST_EVID,
43 IMC_ATTESTATION_STATE_REQ_FILE_METADATA,
44 IMC_ATTESTATION_STATE_REQ_FILE_MEAS,
45 IMC_ATTESTATION_STATE_REQ_IML,
46 };
47
48 /**
49 * Internal state of an imc_attestation_t connection instance
50 */
51 struct imc_attestation_state_t {
52
53 /**
54 * imc_state_t interface
55 */
56 imc_state_t interface;
57
58 /**
59 * Get state of the handshake
60 *
61 * @return the handshake state of IMC
62 */
63 imc_attestation_handshake_state_t (*get_handshake_state)(imc_attestation_state_t *this);
64
65 /**
66 * Set state of the handshake
67 *
68 * @param new_state the handshake state of IMC
69 */
70 void (*set_handshake_state)(imc_attestation_state_t *this,
71 imc_attestation_handshake_state_t new_state);
72
73 /**
74 * Get the PTS object
75 *
76 * @return PTS object
77 */
78 pts_t* (*get_pts)(imc_attestation_state_t *this);
79
80 };
81
82 /**
83 * Create an imc_attestation_state_t instance
84 *
85 * @param id connection ID
86 */
87 imc_state_t* imc_attestation_state_create(TNC_ConnectionID id);
88
89 #endif /** IMC_ATTESTATION_STATE_H_ @}*/