|
1 /* |
|
2 * Copyright (c) 2001-2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: EAP and WLAN authentication protocols. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #if !defined(_EAP_STATE_NOTIFICATION_H_) |
|
22 #define _EAP_STATE_NOTIFICATION_H_ |
|
23 |
|
24 #include "eap_variable_data.h" |
|
25 #include "eap_am_export.h" |
|
26 #include "eap_protocol_layer.h" |
|
27 #include "abs_eap_state_notification.h" |
|
28 |
|
29 |
|
30 /// A eap_state_notification_c class. |
|
31 /// This is used for state change indications of EAP-protocol. |
|
32 /// EAP-Success and EAP-Failure are sent based on eap_state_variable_e::eap_state_authentication_finished_successfully |
|
33 /// and eap_state_variable_e::eap_state_authentication_terminated_unsuccessfully notifications. |
|
34 class EAP_EXPORT eap_state_notification_c |
|
35 : public abs_eap_state_notification_c |
|
36 { |
|
37 private: |
|
38 //-------------------------------------------------- |
|
39 |
|
40 abs_eap_am_tools_c * const m_am_tools; ///< This is pointer to the tools class. @see abs_eap_am_tools_c. |
|
41 |
|
42 eap_protocol_layer_e m_layer; ///< Here is the protocol layer (EAP type). |
|
43 |
|
44 eap_variable_data_c m_notification_string; ///< Here is the notification string. |
|
45 |
|
46 bool m_needs_confirmation_from_user; ///< This flag tells whether user interaction is required. |
|
47 |
|
48 u32_t m_protocol; ///< Here are other protocols than EAP-types. |
|
49 |
|
50 eap_type_value_e m_eap_type; ///< Here is the EAP type. This is needed for extented EAP-types. |
|
51 |
|
52 u32_t m_previous_state; ///< Here is the previous state of the EAP type. |
|
53 |
|
54 u32_t m_current_state; ///< Here is the current state of the EAP type. |
|
55 |
|
56 const eap_am_network_id_c *m_send_network_id; ///< This is the send network identity the notification concerns. |
|
57 |
|
58 bool m_is_client; ///< This indicates whether the notifier is client (true) or server (false). |
|
59 |
|
60 u8_t m_eap_identifier; ///< EAP-Identifier could be used in EAP packet send. EAP-Success and EAP-Failure are sent using this value. |
|
61 |
|
62 bool m_allow_send_eap_success; |
|
63 |
|
64 eap_status_e m_authentication_error; ///< This shows the error when m_layer is eap_protocol_layer_general and m_current_state is eap_general_state_authentication_error. |
|
65 |
|
66 //-------------------------------------------------- |
|
67 protected: |
|
68 //-------------------------------------------------- |
|
69 |
|
70 //-------------------------------------------------- |
|
71 public: |
|
72 //-------------------------------------------------- |
|
73 |
|
74 /** |
|
75 * The destructor of the eap_state_notification_c class does nothing special. |
|
76 */ |
|
77 EAP_FUNC_IMPORT virtual ~eap_state_notification_c(); |
|
78 |
|
79 /** |
|
80 * The constructor of the eap_state_notification_c class does nothing special. |
|
81 */ |
|
82 EAP_FUNC_IMPORT eap_state_notification_c( |
|
83 abs_eap_am_tools_c * const tools, |
|
84 const eap_am_network_id_c * const send_network_id, |
|
85 bool is_client, |
|
86 eap_state_notification_generic_e, |
|
87 eap_protocol_layer_e layer, |
|
88 u32_t protocol, |
|
89 u32_t previous_state, |
|
90 u32_t current_state, |
|
91 u8_t eap_identifier, |
|
92 bool allow_send_eap_success); |
|
93 |
|
94 |
|
95 #if defined(USE_EAP_EXPANDED_TYPES) |
|
96 |
|
97 EAP_FUNC_IMPORT eap_state_notification_c( |
|
98 abs_eap_am_tools_c * const tools, |
|
99 const eap_am_network_id_c * const send_network_id, |
|
100 bool is_client, |
|
101 eap_state_notification_eap_e, |
|
102 eap_protocol_layer_e layer, |
|
103 eap_type_value_e eap_type, |
|
104 u32_t previous_state, |
|
105 u32_t current_state, |
|
106 u8_t eap_identifier, |
|
107 bool allow_send_eap_success); |
|
108 |
|
109 #endif //#if defined(USE_EAP_EXPANDED_TYPES) |
|
110 |
|
111 |
|
112 EAP_FUNC_IMPORT eap_state_notification_c( |
|
113 abs_eap_am_tools_c * const tools, |
|
114 const eap_am_network_id_c * const send_network_id, |
|
115 bool is_client, |
|
116 eap_state_notification_eap_e, |
|
117 eap_protocol_layer_e layer, |
|
118 eap_type_ietf_values_e eap_type, |
|
119 u32_t previous_state, |
|
120 u32_t current_state, |
|
121 u8_t eap_identifier, |
|
122 bool allow_send_eap_success); |
|
123 |
|
124 // This is commented in abs_eap_state_notification_c::get_send_network_id(). |
|
125 EAP_FUNC_IMPORT const eap_am_network_id_c * get_send_network_id() const; |
|
126 |
|
127 // This is commented in abs_eap_state_notification_c::get_protocol_layer(). |
|
128 EAP_FUNC_IMPORT eap_protocol_layer_e get_protocol_layer() const; |
|
129 |
|
130 // This is commented in abs_eap_state_notification_c::get_protocol(). |
|
131 EAP_FUNC_IMPORT u32_t get_protocol() const; |
|
132 |
|
133 // This is commented in abs_eap_state_notification_c::get_eap_type(). |
|
134 EAP_FUNC_IMPORT eap_type_value_e get_eap_type() const; |
|
135 |
|
136 // This is commented in abs_eap_state_notification_c::get_previous_state(). |
|
137 EAP_FUNC_IMPORT u32_t get_previous_state() const; |
|
138 |
|
139 // This is commented in abs_eap_state_notification_c::get_previous_state_string(). |
|
140 EAP_FUNC_IMPORT eap_const_string get_previous_state_string() const; |
|
141 |
|
142 // This is commented in abs_eap_state_notification_c::get_current_state(). |
|
143 EAP_FUNC_IMPORT u32_t get_current_state() const; |
|
144 |
|
145 // This is commented in abs_eap_state_notification_c::get_current_state_string(). |
|
146 EAP_FUNC_IMPORT eap_const_string get_current_state_string() const; |
|
147 |
|
148 // This is commented in abs_eap_state_notification_c::get_is_client(). |
|
149 EAP_FUNC_IMPORT bool get_is_client() const; |
|
150 |
|
151 // This is commented in abs_eap_state_notification_c::get_eap_identifier(). |
|
152 EAP_FUNC_IMPORT u8_t get_eap_identifier() const; |
|
153 |
|
154 // This is commented in abs_eap_state_notification_c::get_allow_send_eap_success(). |
|
155 EAP_FUNC_IMPORT bool get_allow_send_eap_success() const; |
|
156 |
|
157 // This is commented in abs_eap_state_notification_c::set_notification_string(). |
|
158 EAP_FUNC_IMPORT eap_status_e set_notification_string( |
|
159 const eap_variable_data_c * const notification_string, |
|
160 const bool needs_confirmation_from_user); |
|
161 |
|
162 // This is commented in abs_eap_state_notification_c::get_notification_string(). |
|
163 EAP_FUNC_IMPORT const eap_variable_data_c * get_notification_string() const; |
|
164 |
|
165 // This is commented in abs_eap_state_notification_c::get_needs_confirmation_from_user(). |
|
166 EAP_FUNC_IMPORT bool get_needs_confirmation_from_user() const; |
|
167 |
|
168 |
|
169 // This is commented in abs_eap_state_notification_c::set_authentication_error(). |
|
170 EAP_FUNC_IMPORT void set_authentication_error(const eap_status_e error); |
|
171 |
|
172 // This is commented in abs_eap_state_notification_c::get_authentication_error(). |
|
173 EAP_FUNC_IMPORT eap_status_e get_authentication_error() const; |
|
174 |
|
175 |
|
176 EAP_FUNC_IMPORT static eap_const_string get_state_string(const u32_t protocol_layer, const u32_t state); |
|
177 |
|
178 |
|
179 EAP_FUNC_IMPORT static eap_const_string get_protocol_layer_string(const u32_t protocol_layer); |
|
180 |
|
181 EAP_FUNC_IMPORT eap_const_string get_protocol_layer_string() const; |
|
182 |
|
183 |
|
184 EAP_FUNC_IMPORT static eap_const_string get_protocol_string(const u32_t protocol_layer, const u32_t state); |
|
185 |
|
186 EAP_FUNC_IMPORT eap_const_string get_protocol_string() const; |
|
187 |
|
188 //-------------------------------------------------- |
|
189 }; // class eap_state_notification_c |
|
190 |
|
191 #endif //#if !defined(_EAP_STATE_NOTIFICATION_H_) |
|
192 |
|
193 //-------------------------------------------------- |
|
194 |
|
195 |
|
196 |
|
197 // End. |