updated Copyright info
[strongswan.git] / src / libimcv / imc / imc_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 imc_state_t imc_state
19 * @{ @ingroup imc_state
20 */
21
22 #ifndef IMC_STATE_H_
23 #define IMC_STATE_H_
24
25 #include <tncif.h>
26
27 #include <library.h>
28
29 typedef struct imc_state_t imc_state_t;
30
31 /**
32 * Internal state of an IMC connection instance
33 */
34 struct imc_state_t {
35
36 /**
37 * Get the TNCS connection I
38 D attached to the state
39 *
40 * @return TNCS connection ID of the state
41 */
42 TNC_ConnectionID (*get_connection_id)(imc_state_t *this);
43
44 /**
45 * Checks if long message types are supported for this TNCCS connection
46 *
47 * @return TRUE if set, FALSE otherwise
48 */
49 bool (*has_long)(imc_state_t *this);
50
51 /**
52 * Checks if the exclusive delivery is supported for this TNCCS connection
53 *
54 * @return TRUE if set, FALSE otherwise
55 */
56 bool (*has_excl)(imc_state_t *this);
57
58 /**
59 * Sets the long message types and exclusive flags for this TNCCS connection
60 *
61 * @param has_long TNCCS connection supports long message types
62 * @param has_excl TNCCS connection supports exclusive delivery
63 * @return TRUE if set, FALSE otherwise
64 */
65 void (*set_flags)(imc_state_t *this, bool has_long, bool has_excl);
66
67 /**
68 * Set the maximum size of a PA-TNC message for this TNCCS connection
69 *
70 * @max_msg_len maximum size of a PA-TNC message
71 */
72 void (*set_max_msg_len)(imc_state_t *this, u_int32_t max_msg_len);
73
74 /**
75 * Get the maximum size of a PA-TNC message for this TNCCS connection
76 *
77 * @return maximum size of a PA-TNC message
78 */
79 u_int32_t (*get_max_msg_len)(imc_state_t *this);
80
81 /**
82 * Change the connection state
83 *
84 * @param new_state new connection state
85 */
86 void (*change_state)(imc_state_t *this, TNC_ConnectionState new_state);
87
88 /**
89 * Destroys an imc_state_t object
90 */
91 void (*destroy)(imc_state_t *this);
92 };
93
94 #endif /** IMC_STATE_H_ @}*/