centralized processing of assessment information
[strongswan.git] / src / libimcv / imv / imv_state.h
1 /*
2 * Copyright (C) 2011-2012 Andreas Steffen
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 imv_state_t imv_state
19 * @{ @ingroup imv_state
20 */
21
22 #ifndef IMV_STATE_H_
23 #define IMV_STATE_H_
24
25 #include <tncifimv.h>
26
27 #include <library.h>
28
29 typedef struct imv_state_t imv_state_t;
30
31 /**
32 * Internal state of an IMV connection instance
33 */
34 struct imv_state_t {
35
36 /**
37 * Get the TNCS connection ID attached to the state
38 *
39 * @return TNCS connection ID of the state
40 */
41 TNC_ConnectionID (*get_connection_id)(imv_state_t *this);
42
43 /**
44 * Checks if long message types are supported for this TNCCS connection
45 *
46 * @return TRUE if set, FALSE otherwise
47 */
48 bool (*has_long)(imv_state_t *this);
49
50 /**
51 * Checks if the exclusive delivery is supported for this TNCCS connection
52 *
53 * @return TRUE if set, FALSE otherwise
54 */
55 bool (*has_excl)(imv_state_t *this);
56
57 /**
58 * Sets the long message types and exclusive flags for this TNCCS connection
59 *
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
63 */
64 void (*set_flags)(imv_state_t *this, bool has_long, bool has_excl);
65
66 /**
67 * Set the maximum size of a PA-TNC message for this TNCCS connection
68 *
69 * @max_msg_len maximum size of a PA-TNC message
70 */
71 void (*set_max_msg_len)(imv_state_t *this, u_int32_t max_msg_len);
72
73 /**
74 * Get the maximum size of a PA-TNC message for this TNCCS connection
75 *
76 * @return maximum size of a PA-TNC message
77 */
78 u_int32_t (*get_max_msg_len)(imv_state_t *this);
79
80 /**
81 * Change the connection state
82 *
83 * @param new_state new connection state
84 */
85 void (*change_state)(imv_state_t *this, TNC_ConnectionState new_state);
86
87 /**
88 * Get IMV action recommendation and evaluation result
89 *
90 * @param rec IMV action recommendation
91 * @param eval IMV evaluation result
92 *
93 */
94 void (*get_recommendation)(imv_state_t *this,
95 TNC_IMV_Action_Recommendation *rec,
96 TNC_IMV_Evaluation_Result *eval);
97
98 /**
99 * Set IMV action recommendation and evaluation result
100 *
101 * @param rec IMV action recommendation
102 * @param eval IMV evaluation result
103 *
104 */
105 void (*set_recommendation)(imv_state_t *this,
106 TNC_IMV_Action_Recommendation rec,
107 TNC_IMV_Evaluation_Result eval);
108
109 /**
110 * Get reason string based on the preferred language
111 *
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
116 */
117 bool (*get_reason_string)(imv_state_t *this,
118 enumerator_t *language_enumerator,
119 char **reason_string, char **reason_language);
120
121 /**
122 * Get remediation instructions based on the preferred language
123 *
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
129 */
130 bool (*get_remediation_instructions)(imv_state_t *this,
131 enumerator_t *language_enumerator,
132 char **string, char **lang_code,
133 char **uri);
134
135 /**
136 * Destroys an imv_state_t object
137 */
138 void (*destroy)(imv_state_t *this);
139 };
140
141 #endif /** IMV_STATE_H_ @}*/