2 * Copyright (C) 2011-2012 Andreas Steffen
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_state_t imv_state
19 * @{ @ingroup imv_state
29 typedef struct imv_state_t imv_state_t
;
32 * Internal state of an IMV connection instance
37 * Get the TNCS connection ID attached to the state
39 * @return TNCS connection ID of the state
41 TNC_ConnectionID (*get_connection_id
)(imv_state_t
*this);
44 * Checks if long message types are supported for this TNCCS connection
46 * @return TRUE if set, FALSE otherwise
48 bool (*has_long
)(imv_state_t
*this);
51 * Checks if the exclusive delivery is supported for this TNCCS connection
53 * @return TRUE if set, FALSE otherwise
55 bool (*has_excl
)(imv_state_t
*this);
58 * Sets the long message types and exclusive flags for this TNCCS connection
60 * @param has_long TNCCS connection supports long message types
61 * @param has_excl TNCCS connection supports exclusive delivery
62 * @return TRUE if set, FALSE otherwise
64 void (*set_flags
)(imv_state_t
*this, bool has_long
, bool has_excl
);
67 * Set the maximum size of a PA-TNC message for this TNCCS connection
69 * @max_msg_len maximum size of a PA-TNC message
71 void (*set_max_msg_len
)(imv_state_t
*this, u_int32_t max_msg_len
);
74 * Get the maximum size of a PA-TNC message for this TNCCS connection
76 * @return maximum size of a PA-TNC message
78 u_int32_t (*get_max_msg_len
)(imv_state_t
*this);
81 * Change the connection state
83 * @param new_state new connection state
85 void (*change_state
)(imv_state_t
*this, TNC_ConnectionState new_state
);
88 * Get IMV action recommendation and evaluation result
90 * @param rec IMV action recommendation
91 * @param eval IMV evaluation result
94 void (*get_recommendation
)(imv_state_t
*this,
95 TNC_IMV_Action_Recommendation
*rec
,
96 TNC_IMV_Evaluation_Result
*eval
);
99 * Set IMV action recommendation and evaluation result
101 * @param rec IMV action recommendation
102 * @param eval IMV evaluation result
105 void (*set_recommendation
)(imv_state_t
*this,
106 TNC_IMV_Action_Recommendation rec
,
107 TNC_IMV_Evaluation_Result eval
);
110 * Get reason string based on the preferred language
112 * @param language_enumerator language enumerator
113 * @param reason_string reason string
114 * @param reason_language language of the returned reason string
115 * @return TRUE if a reason string was found
117 bool (*get_reason_string
)(imv_state_t
*this,
118 enumerator_t
*language_enumerator
,
119 char **reason_string
, char **reason_language
);
122 * Get remediation instructions based on the preferred language
124 * @param language_enumerator language enumerator
125 * @param string remediation instruction string
126 * @param lang_code language of the remediation instructions
127 * @param uri remediation URI
128 * @return TRUE if remediation instructions were found
130 bool (*get_remediation_instructions
)(imv_state_t
*this,
131 enumerator_t
*language_enumerator
,
132 char **string
, char **lang_code
,
136 * Destroys an imv_state_t object
138 void (*destroy
)(imv_state_t
*this);
141 #endif /** IMV_STATE_H_ @}*/