]>
Commit | Line | Data |
---|---|---|
b48ffcb1 AS |
1 | /* |
2 | * Copyright (C) 2015 Andreas Steffen | |
19ef2aec TB |
3 | * |
4 | * Copyright (C) secunet Security Networks AG | |
b48ffcb1 AS |
5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | |
7 | * under the terms of the GNU General Public License as published by the | |
8 | * Free Software Foundation; either version 2 of the License, or (at your | |
9 | * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. | |
10 | * | |
11 | * This program is distributed in the hope that it will be useful, but | |
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
13 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 | * for more details. | |
15 | */ | |
16 | ||
17 | /** | |
18 | * @defgroup imv_hcd imv_hcd | |
19 | * @ingroup libimcv_plugins | |
20 | * | |
21 | * @defgroup imv_hcd_state_t imv_hcd_state | |
22 | * @{ @ingroup imv_hcd | |
23 | */ | |
24 | ||
25 | #ifndef IMV_HCD_STATE_H_ | |
26 | #define IMV_HCD_STATE_H_ | |
27 | ||
28 | #include <imv/imv_state.h> | |
29 | #include <library.h> | |
30 | ||
18472ac2 AS |
31 | #include <tncif_pa_subtypes.h> |
32 | ||
b48ffcb1 | 33 | typedef struct imv_hcd_state_t imv_hcd_state_t; |
18472ac2 | 34 | typedef enum imv_hcd_attr_t imv_hcd_attr_t; |
b48ffcb1 AS |
35 | typedef enum imv_hcd_handshake_state_t imv_hcd_handshake_state_t; |
36 | typedef enum os_settings_t os_settings_t; | |
37 | ||
18472ac2 AS |
38 | /** |
39 | * Flag set when corresponding attribute has been received | |
40 | */ | |
41 | enum imv_hcd_attr_t { | |
42 | IMV_HCD_ATTR_NONE = 0, | |
43 | IMV_HCD_ATTR_DEFAULT_PWD_ENABLED = (1<<0), | |
44 | IMV_HCD_ATTR_FIREWALL_SETTING = (1<<1), | |
45 | IMV_HCD_ATTR_FORWARDING_ENABLED = (1<<2), | |
46 | IMV_HCD_ATTR_MACHINE_TYPE_MODEL = (1<<3), | |
47 | IMV_HCD_ATTR_PSTN_FAX_ENABLED = (1<<4), | |
48 | IMV_HCD_ATTR_TIME_SOURCE = (1<<5), | |
49 | IMV_HCD_ATTR_USER_APP_ENABLED = (1<<6), | |
50 | IMV_HCD_ATTR_USER_APP_PERSIST_ENABLED = (1<<7), | |
51 | IMV_HCD_ATTR_VENDOR_NAME = (1<<8), | |
52 | IMV_HCD_ATTR_VENDOR_SMI_CODE = (1<<9), | |
53 | IMV_HCD_ATTR_CERTIFICATION_STATE = (1<<10), | |
54 | IMV_HCD_ATTR_CONFIGURATION_STATE = (1<<11), | |
55 | ||
56 | IMV_HCD_ATTR_SYSTEM_ONLY = (1<<12)-1, | |
57 | ||
58 | IMV_HCD_ATTR_NATURAL_LANG = (1<<12), | |
59 | IMV_HCD_ATTR_FIRMWARE_NAME = (1<<13), | |
60 | IMV_HCD_ATTR_RESIDENT_APP_NAME = (1<<14), | |
61 | IMV_HCD_ATTR_USER_APP_NAME = (1<<15), | |
62 | ||
63 | IMV_HCD_ATTR_MUST = (1<<16)-1 | |
64 | }; | |
65 | ||
b48ffcb1 AS |
66 | /** |
67 | * IMV OS Handshake States (state machine) | |
68 | */ | |
69 | enum imv_hcd_handshake_state_t { | |
70 | IMV_HCD_STATE_INIT, | |
71 | IMV_HCD_STATE_ATTR_REQ, | |
72 | IMV_HCD_STATE_END | |
73 | }; | |
74 | ||
75 | /** | |
76 | * Internal state of an imv_hcd_t connection instance | |
77 | */ | |
78 | struct imv_hcd_state_t { | |
79 | ||
80 | /** | |
81 | * imv_state_t interface | |
82 | */ | |
83 | imv_state_t interface; | |
84 | ||
85 | /** | |
86 | * Set state of the handshake | |
87 | * | |
88 | * @param new_state the handshake state of IMV | |
89 | */ | |
90 | void (*set_handshake_state)(imv_hcd_state_t *this, | |
91 | imv_hcd_handshake_state_t new_state); | |
92 | ||
93 | /** | |
94 | * Get state of the handshake | |
95 | * | |
96 | * @return the handshake state of IMV | |
97 | */ | |
98 | imv_hcd_handshake_state_t (*get_handshake_state)(imv_hcd_state_t *this); | |
99 | ||
18472ac2 AS |
100 | /** |
101 | * Set the PWG HCD PA subtype currently being handled | |
102 | * | |
103 | * @param subtype PWG HCD PA subtype | |
104 | */ | |
105 | void (*set_subtype)(imv_hcd_state_t *this, pa_subtype_pwg_t subtype); | |
106 | ||
107 | /** | |
108 | * Set User Application Disabled | |
109 | */ | |
110 | void (*set_user_app_disabled)(imv_hcd_state_t *this); | |
111 | ||
b48ffcb1 AS |
112 | }; |
113 | ||
114 | /** | |
115 | * Create an imv_hcd_state_t instance | |
116 | * | |
117 | * @param id connection ID | |
118 | */ | |
119 | imv_state_t* imv_hcd_state_create(TNC_ConnectionID id); | |
120 | ||
121 | #endif /** IMV_HCD_STATE_H_ @}*/ |