2b1c02c23ea8900e167718b9e1bcc631e73195fb
[strongswan.git] / src / libimcv / plugins / imv_hcd / imv_hcd_state.h
1 /*
2 * Copyright (C) 2015 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 * @defgroup imv_hcd imv_hcd
18 * @ingroup libimcv_plugins
19 *
20 * @defgroup imv_hcd_state_t imv_hcd_state
21 * @{ @ingroup imv_hcd
22 */
23
24 #ifndef IMV_HCD_STATE_H_
25 #define IMV_HCD_STATE_H_
26
27 #include <imv/imv_state.h>
28 #include <library.h>
29
30 typedef struct imv_hcd_state_t imv_hcd_state_t;
31 typedef enum imv_hcd_handshake_state_t imv_hcd_handshake_state_t;
32 typedef enum os_settings_t os_settings_t;
33
34 /**
35 * IMV OS Handshake States (state machine)
36 */
37 enum imv_hcd_handshake_state_t {
38 IMV_HCD_STATE_INIT,
39 IMV_HCD_STATE_ATTR_REQ,
40 IMV_HCD_STATE_END
41 };
42
43 /**
44 * Internal state of an imv_hcd_t connection instance
45 */
46 struct imv_hcd_state_t {
47
48 /**
49 * imv_state_t interface
50 */
51 imv_state_t interface;
52
53 /**
54 * Set state of the handshake
55 *
56 * @param new_state the handshake state of IMV
57 */
58 void (*set_handshake_state)(imv_hcd_state_t *this,
59 imv_hcd_handshake_state_t new_state);
60
61 /**
62 * Get state of the handshake
63 *
64 * @return the handshake state of IMV
65 */
66 imv_hcd_handshake_state_t (*get_handshake_state)(imv_hcd_state_t *this);
67
68 };
69
70 /**
71 * Create an imv_hcd_state_t instance
72 *
73 * @param id connection ID
74 */
75 imv_state_t* imv_hcd_state_create(TNC_ConnectionID id);
76
77 #endif /** IMV_HCD_STATE_H_ @}*/