Use PWG HCD PA-TNC subtypes to transport HCD attributes
[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 #include <tncif_pa_subtypes.h>
31
32 typedef struct imv_hcd_state_t imv_hcd_state_t;
33 typedef enum imv_hcd_attr_t imv_hcd_attr_t;
34 typedef enum imv_hcd_handshake_state_t imv_hcd_handshake_state_t;
35 typedef enum os_settings_t os_settings_t;
36
37 /**
38 * Flag set when corresponding attribute has been received
39 */
40 enum imv_hcd_attr_t {
41 IMV_HCD_ATTR_NONE = 0,
42 IMV_HCD_ATTR_DEFAULT_PWD_ENABLED = (1<<0),
43 IMV_HCD_ATTR_FIREWALL_SETTING = (1<<1),
44 IMV_HCD_ATTR_FORWARDING_ENABLED = (1<<2),
45 IMV_HCD_ATTR_MACHINE_TYPE_MODEL = (1<<3),
46 IMV_HCD_ATTR_PSTN_FAX_ENABLED = (1<<4),
47 IMV_HCD_ATTR_TIME_SOURCE = (1<<5),
48 IMV_HCD_ATTR_USER_APP_ENABLED = (1<<6),
49 IMV_HCD_ATTR_USER_APP_PERSIST_ENABLED = (1<<7),
50 IMV_HCD_ATTR_VENDOR_NAME = (1<<8),
51 IMV_HCD_ATTR_VENDOR_SMI_CODE = (1<<9),
52 IMV_HCD_ATTR_CERTIFICATION_STATE = (1<<10),
53 IMV_HCD_ATTR_CONFIGURATION_STATE = (1<<11),
54
55 IMV_HCD_ATTR_SYSTEM_ONLY = (1<<12)-1,
56
57 IMV_HCD_ATTR_NATURAL_LANG = (1<<12),
58 IMV_HCD_ATTR_FIRMWARE_NAME = (1<<13),
59 IMV_HCD_ATTR_RESIDENT_APP_NAME = (1<<14),
60 IMV_HCD_ATTR_USER_APP_NAME = (1<<15),
61
62 IMV_HCD_ATTR_MUST = (1<<16)-1
63 };
64
65 /**
66 * IMV OS Handshake States (state machine)
67 */
68 enum imv_hcd_handshake_state_t {
69 IMV_HCD_STATE_INIT,
70 IMV_HCD_STATE_ATTR_REQ,
71 IMV_HCD_STATE_END
72 };
73
74 /**
75 * Internal state of an imv_hcd_t connection instance
76 */
77 struct imv_hcd_state_t {
78
79 /**
80 * imv_state_t interface
81 */
82 imv_state_t interface;
83
84 /**
85 * Set state of the handshake
86 *
87 * @param new_state the handshake state of IMV
88 */
89 void (*set_handshake_state)(imv_hcd_state_t *this,
90 imv_hcd_handshake_state_t new_state);
91
92 /**
93 * Get state of the handshake
94 *
95 * @return the handshake state of IMV
96 */
97 imv_hcd_handshake_state_t (*get_handshake_state)(imv_hcd_state_t *this);
98
99 /**
100 * Set the PWG HCD PA subtype currently being handled
101 *
102 * @param subtype PWG HCD PA subtype
103 */
104 void (*set_subtype)(imv_hcd_state_t *this, pa_subtype_pwg_t subtype);
105
106 /**
107 * Set User Application Disabled
108 */
109 void (*set_user_app_disabled)(imv_hcd_state_t *this);
110
111 };
112
113 /**
114 * Create an imv_hcd_state_t instance
115 *
116 * @param id connection ID
117 */
118 imv_state_t* imv_hcd_state_create(TNC_ConnectionID id);
119
120 #endif /** IMV_HCD_STATE_H_ @}*/