2 * Copyright (C) 2011 Sansar Choinyambuu
3 * HSR Hochschule fuer Technik Rapperswil
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>.
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
18 * @defgroup imv_attestation_state_t imv_attestation_state
19 * @{ @ingroup imv_attestation_state
22 #ifndef IMV_ATTESTATION_STATE_H_
23 #define IMV_ATTESTATION_STATE_H_
25 #include <imv/imv_state.h>
29 typedef struct imv_attestation_state_t imv_attestation_state_t
;
30 typedef enum imv_attestation_handshake_state_t imv_attestation_handshake_state_t
;
33 * IMV Attestation Handshake States (state machine)
35 enum imv_attestation_handshake_state_t
{
36 IMV_ATTESTATION_STATE_INIT
,
37 IMV_ATTESTATION_STATE_MEAS
,
38 IMV_ATTESTATION_STATE_COMP_EVID
,
39 IMV_ATTESTATION_STATE_IML
,
40 IMV_ATTESTATION_STATE_END
,
44 * Internal state of an imv_attestation_t connection instance
46 struct imv_attestation_state_t
{
49 * imv_state_t interface
51 imv_state_t interface
;
54 * Get state of the handshake
56 * @return the handshake state of IMV
58 imv_attestation_handshake_state_t (*get_handshake_state
)(imv_attestation_state_t
*this);
61 * Set state of the handshake
63 * @param new_state the handshake state of IMV
65 void (*set_handshake_state
)(imv_attestation_state_t
*this,
66 imv_attestation_handshake_state_t new_state
);
73 pts_t
* (*get_pts
)(imv_attestation_state_t
*this);
76 * Add an entry to the list of pending file/directory measurement requests
78 * @param id unique request ID
79 * @param is_dir TRUE if directory
81 void (*add_request
)(imv_attestation_state_t
*this, int id
, bool is_dir
);
84 * Returns the number of pending file/directory measurement requests
86 * @return number of pending requests
88 int (*get_request_count
)(imv_attestation_state_t
*this);
91 * Check for presence of request_id and if found remove it from the list
93 * @param id unique request ID
94 * @param is_dir return TRUE if request was for a directory
95 * @return TRUE if request ID found, FALSE otherwise
97 bool (*check_off_request
)(imv_attestation_state_t
*this, int id
,
103 * Create an imv_attestation_state_t instance
105 * @param id connection ID
107 imv_state_t
* imv_attestation_state_create(TNC_ConnectionID id
);
109 #endif /** IMV_ATTESTATION_STATE_H_ @}*/