store the long and excl flags in the connection state
[strongswan.git] / src / libimcv / imv / imv_state.h
1 /*
2 * Copyright (C) 2011 Andreas Steffen, HSR Hochschule fuer Technik Rapperswil
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 */
14
15 /**
16 *
17 * @defgroup imv_state_t imv_state
18 * @{ @ingroup imv_state
19 */
20
21 #ifndef IMV_STATE_H_
22 #define IMV_STATE_H_
23
24 #include <tncifimv.h>
25
26 #include <library.h>
27
28 typedef struct imv_state_t imv_state_t;
29
30 /**
31 * Internal state of an IMV connection instance
32 */
33 struct imv_state_t {
34
35 /**
36 * Get the TNCS connection ID attached to the state
37 *
38 * @return TNCS connection ID of the state
39 */
40 TNC_ConnectionID (*get_connection_id)(imv_state_t *this);
41
42 /**
43 * Checks if long message types are supported for this TNCCS connection
44 *
45 * @return TRUE if set, FALSE otherwise
46 */
47 bool (*has_long)(imv_state_t *this);
48
49 /**
50 * Checks if the exclusive delivery is supported for this TNCCS connection
51 *
52 * @return TRUE if set, FALSE otherwise
53 */
54 bool (*has_excl)(imv_state_t *this);
55
56 /**
57 * Sets the long message types and exclusive flags for this TNCCS connection
58 *
59 * @param has_long TNCCS connection supports long message types
60 * @param has_excl TNCCS connection supports exclusive delivery
61 * @return TRUE if set, FALSE otherwise
62 */
63 void (*set_flags)(imv_state_t *this, bool has_long, bool has_excl);
64
65 /**
66 * Change the connection state
67 *
68 * @param new_state new connection state
69 */
70 void (*change_state)(imv_state_t *this, TNC_ConnectionState new_state);
71
72 /**
73 * Get IMV action recommendation and evaluation result
74 *
75 * @param rec IMV action recommendation
76 * @param eval IMV evaluation result
77 *
78 */
79 void (*get_recommendation)(imv_state_t *this,
80 TNC_IMV_Action_Recommendation *rec,
81 TNC_IMV_Evaluation_Result *eval);
82
83 /**
84 * Set IMV action recommendation and evaluation result
85 *
86 * @param rec IMV action recommendation
87 * @param eval IMV evaluation result
88 *
89 */
90 void (*set_recommendation)(imv_state_t *this,
91 TNC_IMV_Action_Recommendation rec,
92 TNC_IMV_Evaluation_Result eval);
93
94 /**
95 * Get reason string based on the preferred language
96 *
97 * @param preferred_language preferred language
98 * @param reason_string reason string
99 * @param language code language of the returned reason string
100 * @return TRUE if a reason string was found
101 */
102 bool (*get_reason_string)(imv_state_t *this, chunk_t preferred_language,
103 chunk_t *reason_string, chunk_t *language_code);
104
105 /**
106 * Destroys an imv_state_t object
107 */
108 void (*destroy)(imv_state_t *this);
109 };
110
111 #endif /** IMV_STATE_H_ @}*/