Merge branch 'ikev1-clean' into ikev1-master
[strongswan.git] / src / libimcv / imc / imc_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 imc_state_t imc_state
18 * @{ @ingroup imc_state
19 */
20
21 #ifndef IMC_STATE_H_
22 #define IMC_STATE_H_
23
24 #include <tncif.h>
25
26 #include <library.h>
27
28 typedef struct imc_state_t imc_state_t;
29
30 /**
31 * Internal state of an IMC connection instance
32 */
33 struct imc_state_t {
34
35 /**
36 * Get the TNCS connection I
37 D attached to the state
38 *
39 * @return TNCS connection ID of the state
40 */
41 TNC_ConnectionID (*get_connection_id)(imc_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)(imc_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)(imc_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)(imc_state_t *this, bool has_long, bool has_excl);
65
66 /**
67 * Change the connection state
68 *
69 * @param new_state new connection state
70 */
71 void (*change_state)(imc_state_t *this, TNC_ConnectionState new_state);
72
73 /**
74 * Destroys an imc_state_t object
75 */
76 void (*destroy)(imc_state_t *this);
77 };
78
79 #endif /** IMC_STATE_H_ @}*/