|
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_TYPE_SIMPLE_CONFIG_H_) |
|
22 #define _EAP_TYPE_SIMPLE_CONFIG_H_ |
|
23 |
|
24 #if defined(USE_EAP_SIMPLE_CONFIG) |
|
25 |
|
26 #include "eap_tools.h" |
|
27 #include "eap_am_export.h" |
|
28 #include "abs_eap_am_type_simple_config.h" |
|
29 #include "eap_am_network_id.h" |
|
30 #include "abs_eap_base_type.h" |
|
31 #include "eap_base_type.h" |
|
32 #include "eap_variable_data.h" |
|
33 #include "abs_eap_base_timer.h" |
|
34 #include "eap_crypto_api.h" |
|
35 #include "eap_protocol_layer.h" |
|
36 #include "eap_type_simple_config_types.h" |
|
37 #include "abs_simple_config_base_record.h" |
|
38 #include "eap_master_session_key.h" |
|
39 #include "simple_config_types.h" |
|
40 |
|
41 class eap_simple_config_header_c; |
|
42 class abs_eap_am_tools_c; |
|
43 class abs_eap_base_type_c; |
|
44 class eap_am_type_simple_config_c; |
|
45 class simple_config_base_record_c; |
|
46 |
|
47 //-------------------------------------------------- |
|
48 |
|
49 |
|
50 /// This class is implementation of SIMPLE_CONFIG type. See more detailed design and architecture document <a href="../../type/simple_config/documentation/EAP_SIMPLE_CONFIG.doc">EAP_SIMPLE_CONFIG.doc</a>. |
|
51 class EAP_EXPORT eap_type_simple_config_c |
|
52 : public abs_eap_base_timer_c |
|
53 , public eap_base_type_c |
|
54 , public abs_eap_am_type_simple_config_c |
|
55 , public abs_simple_config_base_record_c |
|
56 { |
|
57 private: |
|
58 //-------------------------------------------------- |
|
59 |
|
60 /// This is pointer to the tools class. |
|
61 abs_eap_am_tools_c * const m_am_tools; |
|
62 |
|
63 /// This is pointer to adaptation module of SIMPLE_CONFIG type. |
|
64 eap_am_type_simple_config_c * m_am_type_simple_config; |
|
65 |
|
66 /// This is pointer to SIMPLE_CONFIG implementation. |
|
67 simple_config_base_record_c * m_simple_config_record; |
|
68 |
|
69 /// This is the realm part of NAI of the authenticator. |
|
70 /// Client uses this as a realm part on the NAI. |
|
71 eap_variable_data_c m_nai_realm; |
|
72 |
|
73 /// This is the full NAI of the client. |
|
74 eap_variable_data_c m_NAI; |
|
75 |
|
76 /// This is network identity of the sent packet from this authentication session. |
|
77 eap_am_network_id_c m_send_network_id; |
|
78 |
|
79 /// This is offset in bytes of the EAP-type header in the packet buffer. |
|
80 /// Offset is described in abs_eap_base_type_c::get_header_offset(). |
|
81 u32_t m_simple_config_header_offset; |
|
82 |
|
83 /// This is maximum transfer unit in bytes. |
|
84 /// MTU is described in abs_eap_base_type_c::get_header_offset(). |
|
85 u32_t m_MTU; |
|
86 |
|
87 /// This is length of the trailer in bytes. |
|
88 /// Trailer length is described in abs_eap_base_type_c::get_header_offset(). |
|
89 u32_t m_trailer_length; |
|
90 |
|
91 /// This is the state of this authentication session. |
|
92 eap_type_simple_config_state_variable_e m_state; |
|
93 |
|
94 /// This is the saved previous state of this authentication session. |
|
95 eap_type_simple_config_state_variable_e m_saved_previous_state; |
|
96 |
|
97 /// This is the state of reassembly. |
|
98 eap_type_simple_config_reassembly_state_e m_reassembly_state; |
|
99 |
|
100 /// This is the saved previous state of reassembly. |
|
101 eap_type_simple_config_reassembly_state_e m_saved_previous_reassembly_state; |
|
102 |
|
103 /// This is the offset of next fragment to be send from m_simple_config_message_buffer. |
|
104 u32_t m_simple_config_message_send_offset; |
|
105 |
|
106 /// This is the buffer for SIMPLE_CONFIG-message reassembly and fragmentation. |
|
107 eap_variable_data_c m_simple_config_message_buffer; |
|
108 |
|
109 u8_t m_first_fragment_eap_identifier; |
|
110 |
|
111 bool m_free_am_type_simple_config; |
|
112 |
|
113 bool m_free_simple_config_record; |
|
114 |
|
115 /// This indicates whether this object was generated successfully. |
|
116 bool m_is_valid; |
|
117 |
|
118 /// This indicates whether this object is client (true) or server (false). |
|
119 /// In terms of EAP-protocol whether this network entity is EAP-supplicant (true) or EAP-authenticator (false). |
|
120 bool m_is_client; |
|
121 |
|
122 /// True value of this flag indicates the identifier of the EAP-Response/Identity must be checked. |
|
123 /// This is not possible cases where identifier of the EAP-Request/Identity is generated by other network entities. |
|
124 bool m_check_identifier_of_eap_identity_response; |
|
125 |
|
126 |
|
127 /// True value means this is a test version of SIMPLE_CONFIG. |
|
128 bool m_simple_config_test_version; |
|
129 |
|
130 /// This flag forces check of NAI realm. Realm must be the same as given in EAP_SIMPLE_CONFIG_manual_realm configuration option. |
|
131 /// Default value is false, check is not done by default. |
|
132 bool m_check_nai_realm; |
|
133 |
|
134 /// This flag indicates whether the EAP-Failure was received. |
|
135 /// On successfull authentication bogus EAP-Failure is ignored. |
|
136 bool m_failure_message_received; |
|
137 |
|
138 /// This variable is set true when authentication finished successfully. |
|
139 bool m_authentication_finished_successfully; |
|
140 |
|
141 /// This variable stores the last used EAP-Identifier. |
|
142 /// Client will always send EAP-Response with this identifier. |
|
143 /// Server will always send EAP-Request with this identifier increased by one. |
|
144 /// Server increase this identifier after successfull packet send. |
|
145 u8_t m_last_eap_identifier; |
|
146 |
|
147 /// This flag is set true when shutdown is called. |
|
148 /// This is for internal sanity check. |
|
149 bool m_shutdown_was_called; |
|
150 |
|
151 // This variable contains the type of the WSC message (fragment) being sent. |
|
152 simple_config_Message_Type_e m_simple_config_message_type; |
|
153 |
|
154 //-------------------------------------------------- |
|
155 |
|
156 /** |
|
157 * This function returns the domain name, realm part of NAI. |
|
158 */ |
|
159 EAP_FUNC_IMPORT eap_variable_data_c * get_nai_realm(); |
|
160 |
|
161 /** |
|
162 * This function returns the full NAI. |
|
163 */ |
|
164 EAP_FUNC_IMPORT eap_variable_data_c * get_NAI(); |
|
165 |
|
166 /** |
|
167 * This is the situation before the update_buffer_indexes() call. |
|
168 * @code |
|
169 * |
|
170 * |<---------buffer_offset-------->|<----------buffer_free----------------->| |
|
171 * | | | |
|
172 * | +-----+---------------+--------------------+ | |
|
173 * | | EAP | data | new payload | | |
|
174 * | +-----+---------------+--------------------+ | |
|
175 * | | | |
|
176 * |<-offset->|<----MTU----------------------------------------------------->|<-trailer->| |
|
177 * | | |
|
178 * |<-----------------------maximum_buffer_size----------------------------------------->| |
|
179 * |
|
180 * @endcode |
|
181 * |
|
182 * This is the situation after the update_buffer_indexes() call. |
|
183 * @code |
|
184 * |
|
185 * |<-----------------buffer_offset--------------------->|<---buffer_free--->| |
|
186 * | | | |
|
187 * | +-----+---------------+--------------------+ | |
|
188 * | | EAP | data | new payload | | |
|
189 * | +-----+---------------+--------------------+ | |
|
190 * | | | |
|
191 * |<-offset->|<----MTU----------------------------------------------------->|<-trailer->| |
|
192 * | | |
|
193 * |<-----------------------maximum_buffer_size----------------------------------------->| |
|
194 * |
|
195 * @endcode |
|
196 * |
|
197 * Note maximum_buffer_size could be larger than (m_simple_config_header_offset + m_MTU + m_trailer_length). |
|
198 */ |
|
199 EAP_FUNC_IMPORT void update_buffer_indexes( |
|
200 const u32_t maximum_buffer_size, |
|
201 const u32_t payload_size, |
|
202 u32_t * const buffer_offset, |
|
203 u32_t * const buffer_free); |
|
204 |
|
205 /** |
|
206 * This is the situation before the update_payload_indexes() call. |
|
207 * @code |
|
208 * |
|
209 * |<---------buffer_offset-------->|<----------buffer_free----------------->| |
|
210 * | | | |
|
211 * | |<-data_offset->|<--------data_free--------------------->| |
|
212 * | | | | |
|
213 * | | |<---payload_size--->| | |
|
214 * | | | | | |
|
215 * | +-----+---------------+--------------------+ | |
|
216 * | | EAP | data | new payload | | |
|
217 * | +-----+---------------+--------------------+ | |
|
218 * | | | |
|
219 * |<-offset->|<----MTU----------------------------------------------------->|<-trailer->| |
|
220 * | | |
|
221 * |<-----------------------maximum_buffer_size----------------------------------------->| |
|
222 * |
|
223 * @endcode |
|
224 * |
|
225 * This is the situation after the update_payload_indexes() call. |
|
226 * @code |
|
227 * |
|
228 * |<-----------------buffer_offset--------------------->|<---buffer_free--->| |
|
229 * | | | |
|
230 * | |<----------data_offset------------->|<----data_free---->| |
|
231 * | | | | |
|
232 * | | |<---payload_size--->| | |
|
233 * | | | | | |
|
234 * | +-----+---------------+--------------------+ | |
|
235 * | | EAP | data | new payload | | |
|
236 * | +-----+---------------+--------------------+ | |
|
237 * | | | |
|
238 * |<-offset->|<----MTU----------------------------------------------------->|<-trailer->| |
|
239 * | | |
|
240 * |<-----------------------maximum_buffer_size----------------------------------------->| |
|
241 * |
|
242 * @endcode |
|
243 * |
|
244 * Note maximum_buffer_size could be larger than (m_simple_config_header_offset + m_MTU + m_trailer_length). |
|
245 */ |
|
246 EAP_FUNC_IMPORT void update_payload_indexes( |
|
247 const u32_t maximum_buffer_size, |
|
248 const u32_t eap_header_size, |
|
249 const u32_t payload_size, |
|
250 u32_t * const data_offset, |
|
251 u32_t * const data_free, |
|
252 u32_t * const buffer_offset, |
|
253 u32_t * const buffer_free); |
|
254 |
|
255 /** |
|
256 * This function reads the identity payload. Identity is stored to handler->get_identity(). |
|
257 */ |
|
258 EAP_FUNC_IMPORT eap_status_e parse_identity( |
|
259 const u8_t * const identity, ///< This is pointer to received EAP-Identity buffer. |
|
260 const u32_t identity_length ///< This is length of received EAP-Identity buffer. |
|
261 ); |
|
262 |
|
263 /** |
|
264 * This function chechs NAI. |
|
265 */ |
|
266 EAP_FUNC_IMPORT eap_status_e check_NAI( |
|
267 const u8_t * const identity, |
|
268 const u32_t identity_length, |
|
269 const u8_t * const at_character); |
|
270 |
|
271 /** |
|
272 * This function traces the EAP packet. |
|
273 */ |
|
274 EAP_FUNC_IMPORT void packet_trace( |
|
275 eap_const_string prefix, |
|
276 const eap_am_network_id_c * const receive_network_id, |
|
277 eap_header_wr_c * const received_eap, |
|
278 const u32_t eap_packet_length); |
|
279 |
|
280 /** |
|
281 * This function finishes the successfull authentication. |
|
282 * Generated keys are offered to lower layer. |
|
283 * Connection handle is initialised. |
|
284 */ |
|
285 EAP_FUNC_IMPORT eap_status_e finish_successful_authentication(); |
|
286 |
|
287 /** |
|
288 * This function sends a notification of possible failed authentication |
|
289 * to lower layer. |
|
290 */ |
|
291 EAP_FUNC_IMPORT eap_status_e send_final_notification(); |
|
292 |
|
293 |
|
294 /** |
|
295 * This function returns the state of this authentication session. |
|
296 */ |
|
297 EAP_FUNC_IMPORT eap_type_simple_config_state_variable_e get_state() const; |
|
298 |
|
299 /** |
|
300 * This function sets the new state and notifies the lower layer of this change. |
|
301 */ |
|
302 EAP_FUNC_IMPORT void set_state(const eap_type_simple_config_state_variable_e state); |
|
303 |
|
304 /** |
|
305 * This function saves the current m_state to m_saved_previous_state. |
|
306 * The saved state is restored in error case. |
|
307 */ |
|
308 EAP_FUNC_IMPORT void save_current_state(); |
|
309 |
|
310 /** |
|
311 * This function restores the saved state. |
|
312 */ |
|
313 EAP_FUNC_IMPORT void restore_saved_previous_state(); |
|
314 |
|
315 |
|
316 /** |
|
317 * This function returns the state of reassembly. |
|
318 */ |
|
319 EAP_FUNC_IMPORT eap_type_simple_config_reassembly_state_e get_reassembly_state() const; |
|
320 |
|
321 /** |
|
322 * This function sets the new reassembly state. |
|
323 */ |
|
324 EAP_FUNC_IMPORT void set_reassembly_state(const eap_type_simple_config_reassembly_state_e state); |
|
325 |
|
326 /** |
|
327 * This function saves the current m_reassembly_state to m_saved_previous_reassembly_state. |
|
328 * The saved state is restored in error case. |
|
329 */ |
|
330 EAP_FUNC_IMPORT void save_current_reassembly_state(); |
|
331 |
|
332 /** |
|
333 * This function restores the saved reassembly state. |
|
334 */ |
|
335 EAP_FUNC_IMPORT void restore_saved_reassembly_state(); |
|
336 |
|
337 |
|
338 /** |
|
339 * This function returns the send network identity of this session. |
|
340 */ |
|
341 EAP_FUNC_IMPORT eap_am_network_id_c * get_send_network_id(); |
|
342 |
|
343 /** |
|
344 * This function stores the last EAP-Identifier. |
|
345 */ |
|
346 EAP_FUNC_IMPORT void set_last_eap_identifier(const u8_t last_eap_identifier); |
|
347 |
|
348 /** |
|
349 * This function returns the last stored EAP-Identifier. |
|
350 */ |
|
351 EAP_FUNC_IMPORT u8_t get_last_eap_identifier() const; |
|
352 |
|
353 eap_status_e check_received_eap_identifier( |
|
354 const eap_header_wr_c * const eap_header); |
|
355 |
|
356 |
|
357 /** |
|
358 * This function returns string of the current state. This is for trace purposes. |
|
359 */ |
|
360 EAP_FUNC_IMPORT eap_const_string get_state_string() const; |
|
361 |
|
362 /** |
|
363 * This function returns string of the current state. This is for trace purposes. |
|
364 */ |
|
365 EAP_FUNC_IMPORT eap_const_string get_saved_previous_state_string() const; |
|
366 |
|
367 /** |
|
368 * This function returns string of the current reassembly state. This is for trace purposes. |
|
369 */ |
|
370 EAP_FUNC_IMPORT eap_const_string get_reassembly_state_string() const; |
|
371 |
|
372 |
|
373 /** |
|
374 * This function sets the m_failure_message_received flag true. |
|
375 */ |
|
376 EAP_FUNC_IMPORT void set_failure_message_received(); |
|
377 |
|
378 /** |
|
379 * This function sets the m_failure_message_received flag false. |
|
380 */ |
|
381 EAP_FUNC_IMPORT void unset_failure_message_received(); |
|
382 |
|
383 /** |
|
384 * This function returns the m_failure_message_received flag. |
|
385 */ |
|
386 EAP_FUNC_IMPORT bool get_failure_message_received() const; |
|
387 |
|
388 /** |
|
389 * This function sends an simple config fragment acknowledge. |
|
390 */ |
|
391 EAP_FUNC_IMPORT eap_status_e send_sc_frag_ack(); |
|
392 |
|
393 /** |
|
394 * This function sends EAP-SIMPLE_CONFIG Start message. |
|
395 */ |
|
396 EAP_FUNC_IMPORT eap_status_e send_simple_config_start_message( |
|
397 const u8_t next_eap_identifier ///< This is EAP-Identifier of next EAP packet. |
|
398 ); |
|
399 |
|
400 /** |
|
401 * This function sends starts EAP-SIMPLE_CONFIG after a start message is received. |
|
402 */ |
|
403 EAP_FUNC_IMPORT eap_status_e start_simple_config_authentication( |
|
404 const eap_am_network_id_c * const receive_network_id, ///< This is the network identity of the received EAP packet. |
|
405 const eap_variable_data_c * const NAI ///< This is the full NAI of the client. |
|
406 ); |
|
407 |
|
408 /** |
|
409 * This function extracts the SIMPLE_CONFIG-record message from m_simple_config_message_buffer and forwards it to simple_config_base_record_c object. |
|
410 */ |
|
411 EAP_FUNC_IMPORT eap_status_e simple_config_message_process( |
|
412 const eap_am_network_id_c * const receive_network_id, ///< This is the network identity of the received EAP packet. |
|
413 eap_simple_config_header_c * const received_simple_config, ///< This is pointer to EAP header including EAP-SIMPLE_CONFIG fields. |
|
414 const u32_t simple_config_packet_length ///< This is length of received EAP-SIMPLE_CONFIG packet. |
|
415 ); |
|
416 |
|
417 /** |
|
418 * This function sends the EAP-SIMPLE_CONFIG message from rm_simple_config_reassembly_buffer. |
|
419 */ |
|
420 EAP_FUNC_IMPORT eap_status_e eap_simple_config_fragment_send(); |
|
421 |
|
422 EAP_FUNC_IMPORT eap_status_e handle_eap_identity_query( |
|
423 const eap_am_network_id_c * const receive_network_id, |
|
424 const u8_t eap_identifier, |
|
425 const bool use_manual_username, |
|
426 const eap_variable_data_c * const manual_username, |
|
427 const bool use_manual_realm, |
|
428 const eap_variable_data_c * const manual_realm |
|
429 ); |
|
430 |
|
431 //-------------------------------------------------- |
|
432 protected: |
|
433 //-------------------------------------------------- |
|
434 |
|
435 //-------------------------------------------------- |
|
436 public: |
|
437 //-------------------------------------------------- |
|
438 |
|
439 /** |
|
440 * Destructor cancels all timers and deletes member attributes. |
|
441 */ |
|
442 EAP_FUNC_IMPORT virtual ~eap_type_simple_config_c(); |
|
443 |
|
444 /** |
|
445 * Constructor initializes all member attributes. |
|
446 */ |
|
447 EAP_FUNC_IMPORT eap_type_simple_config_c( |
|
448 abs_eap_am_tools_c * const tools, ///< This is pointer to the tools AM of current platform. |
|
449 abs_eap_base_type_c * const partner, ///< This is back pointer to object which created this object. |
|
450 eap_am_type_simple_config_c * const am_type_simple_config, ///< This is pointer to adaptation module of EAP-SIMPLE_CONFIG type. |
|
451 const bool free_am_type_simple_config, |
|
452 simple_config_base_record_c * const simple_config_record, /// This is pointer to SIMPLE_CONFIG implementation. |
|
453 const bool free_simple_config_record, |
|
454 const bool is_client_when_true, ///< Indicates whether this is client (true) or server (false). |
|
455 const eap_type_value_e current_eap_type, ///< This the current EAP-type (SIMPLE_CONFIG or PEAP). |
|
456 const eap_am_network_id_c * const receive_network_id ///< The network id used for this session. |
|
457 ); |
|
458 |
|
459 /** |
|
460 * This function creates reassembly state string. |
|
461 */ |
|
462 EAP_FUNC_IMPORT static eap_const_string get_reassembly_state_string(eap_type_simple_config_reassembly_state_e state); |
|
463 |
|
464 /** |
|
465 * This function creates state string. |
|
466 */ |
|
467 EAP_FUNC_IMPORT static eap_const_string get_state_string(eap_type_simple_config_state_variable_e state); |
|
468 |
|
469 |
|
470 /** |
|
471 * This function tells if the object is a client or a server.. |
|
472 */ |
|
473 EAP_FUNC_IMPORT bool get_is_client(); |
|
474 |
|
475 // This is commented in abs_eap_am_type_simple_config_c::complete_eap_identity_query(). |
|
476 EAP_FUNC_IMPORT eap_status_e complete_eap_identity_query( |
|
477 const eap_am_network_id_c * const receive_network_id, |
|
478 const u8_t eap_identifier, |
|
479 const eap_status_e completion_status, |
|
480 const bool use_manual_username, |
|
481 const eap_variable_data_c * const manual_username, |
|
482 const bool use_manual_realm, |
|
483 const eap_variable_data_c * const manual_realm |
|
484 ); |
|
485 |
|
486 /** |
|
487 * The partner class calls this function when EAP-SIMPLE_CONFIG packet is received. |
|
488 * see also eap_base_type_c::packet_process(). |
|
489 */ |
|
490 EAP_FUNC_IMPORT eap_status_e packet_process( |
|
491 const eap_am_network_id_c * const receive_network_id, ///< This is the network identity of the received EAP packet. |
|
492 eap_header_wr_c * const eap, ///< This is pointer to EAP header and data. |
|
493 const u32_t eap_packet_length ///< This is length of received EAP packet. |
|
494 ); |
|
495 |
|
496 /** |
|
497 * This function processes the EAP-Response/Identity. |
|
498 */ |
|
499 EAP_FUNC_IMPORT eap_status_e eap_identity_response_packet_process( |
|
500 const eap_am_network_id_c * const receive_network_id, ///< This is the network identity of the received EAP packet. |
|
501 eap_header_wr_c * const received_eap, ///< This is pointer to EAP header and data. |
|
502 const u32_t eap_packet_length ///< This is length of received EAP packet. |
|
503 ); |
|
504 |
|
505 /** |
|
506 * This function processes the EAP-SIMPLE_CONFIG packets. |
|
507 */ |
|
508 EAP_FUNC_IMPORT eap_status_e simple_config_packet_process( |
|
509 const eap_am_network_id_c * const receive_network_id, ///< This is the network identity of the received EAP packet. |
|
510 eap_simple_config_header_c * const received_simple_config, ///< This is pointer to EAP header including EAP-SIMPLE_CONFIG fields. |
|
511 const u32_t simple_config_packet_length ///< This is length of received EAP-SIMPLE_CONFIG packet. |
|
512 ); |
|
513 |
|
514 // This is commented in abs_eap_base_timer_c::timer_delete_data(). |
|
515 EAP_FUNC_IMPORT eap_status_e timer_expired( |
|
516 const u32_t id, void *data |
|
517 ); |
|
518 |
|
519 // This is commented in abs_eap_base_timer_c::timer_delete_data(). |
|
520 EAP_FUNC_IMPORT eap_status_e timer_delete_data( |
|
521 const u32_t id, void *data |
|
522 ); |
|
523 |
|
524 // This is commented in eap_base_type_c::set_is_valid(). |
|
525 EAP_FUNC_IMPORT void set_is_valid(); |
|
526 |
|
527 // This is commented in eap_base_type_c::get_is_valid(). |
|
528 EAP_FUNC_IMPORT bool get_is_valid(); |
|
529 |
|
530 // This is commented in eap_base_type_c::configure(). |
|
531 EAP_FUNC_IMPORT eap_status_e configure(); |
|
532 |
|
533 // This is commented in eap_base_type_c::shutdown(). |
|
534 EAP_FUNC_IMPORT eap_status_e shutdown(); |
|
535 |
|
536 // This is commented in eap_base_type_c::query_eap_identity(). |
|
537 EAP_FUNC_IMPORT eap_status_e query_eap_identity( |
|
538 const bool must_be_synchronous, |
|
539 eap_variable_data_c * const identity, |
|
540 const eap_am_network_id_c * const receive_network_id, |
|
541 const u8_t eap_identifier); |
|
542 |
|
543 // This is commented in eap_base_type_c::query_eap_identity(). |
|
544 EAP_FUNC_IMPORT eap_status_e set_initial_eap_identifier( |
|
545 const eap_am_network_id_c * const receive_network_id, |
|
546 const u8_t initial_identifier); |
|
547 |
|
548 // This is commented in eap_base_type_c::eap_acknowledge(). |
|
549 EAP_FUNC_IMPORT eap_status_e eap_acknowledge( |
|
550 const eap_am_network_id_c * const receive_network_id); |
|
551 |
|
552 /** |
|
553 * This function must reset the state of object to same as |
|
554 * state was after the configure() function call. |
|
555 * If object reset succeeds this function must return eap_status_ok. |
|
556 * If object reset fails this function must return corresponding error status. |
|
557 * @return This function returns the status of reset operation. |
|
558 */ |
|
559 EAP_FUNC_IMPORT eap_status_e reset(); |
|
560 |
|
561 /// @see abs_simple_config_base_record_c::state_notification(). |
|
562 EAP_FUNC_IMPORT void state_notification( |
|
563 const abs_eap_state_notification_c * const state |
|
564 ); |
|
565 |
|
566 /// @see abs_simple_config_base_record_c::packet_send(). |
|
567 EAP_FUNC_IMPORT eap_status_e simple_config_packet_send( |
|
568 eap_buf_chain_wr_c * const sent_packet, |
|
569 const simple_config_Message_Type_e message_type); |
|
570 |
|
571 /// @see abs_simple_config_base_record_c::packet_send(). |
|
572 EAP_FUNC_IMPORT eap_status_e packet_send( |
|
573 const eap_am_network_id_c * const network_id, |
|
574 eap_buf_chain_wr_c * const sent_packet, |
|
575 const u32_t header_offset, |
|
576 const u32_t data_length, |
|
577 const u32_t buffer_length); |
|
578 |
|
579 /// @see abs_simple_config_base_record_c::get_header_offset(). |
|
580 EAP_FUNC_IMPORT u32_t get_header_offset( |
|
581 u32_t * const MTU, |
|
582 u32_t * const trailer_length |
|
583 ); |
|
584 |
|
585 /// @see abs_simple_config_base_record_c::restart_authentication(). |
|
586 EAP_FUNC_IMPORT eap_status_e restart_authentication( |
|
587 const eap_am_network_id_c * const receive_network_id, |
|
588 const bool is_client_when_true, |
|
589 const bool force_clean_restart, |
|
590 const bool from_timer); |
|
591 |
|
592 /// @see abs_simple_config_base_record_c::read_configure(). |
|
593 EAP_FUNC_IMPORT virtual eap_status_e read_configure( |
|
594 const eap_configuration_field_c * const field, |
|
595 eap_variable_data_c * const data |
|
596 ); |
|
597 |
|
598 /// @see abs_simple_config_base_record_c::write_configure(). |
|
599 EAP_FUNC_IMPORT virtual eap_status_e write_configure( |
|
600 const eap_configuration_field_c * const field, |
|
601 eap_variable_data_c * const data |
|
602 ); |
|
603 |
|
604 /// @see abs_simple_config_base_record_c::set_timer(). |
|
605 EAP_FUNC_IMPORT eap_status_e set_timer( |
|
606 abs_eap_base_timer_c * const p_initializer, |
|
607 const u32_t p_id, |
|
608 void * const p_data, |
|
609 const u32_t p_time_ms); |
|
610 |
|
611 /// @see abs_simple_config_base_record_c::cancel_timer(). |
|
612 EAP_FUNC_IMPORT eap_status_e cancel_timer( |
|
613 abs_eap_base_timer_c * const p_initializer, |
|
614 const u32_t p_id); |
|
615 |
|
616 /// @see abs_simple_config_base_record_c::cancel_all_timers(). |
|
617 EAP_FUNC_IMPORT eap_status_e cancel_all_timers(); |
|
618 |
|
619 /// @see abs_simple_config_base_record_c::load_module(). |
|
620 EAP_FUNC_IMPORT eap_status_e load_module( |
|
621 const eap_type_value_e type, |
|
622 const eap_type_value_e /* tunneling_type */, |
|
623 abs_eap_base_type_c * const partner, |
|
624 eap_base_type_c ** const eap_type, |
|
625 const bool is_client_when_true, |
|
626 const eap_am_network_id_c * const receive_network_id); |
|
627 |
|
628 /// @see abs_simple_config_base_record_c::unload_module(). |
|
629 EAP_FUNC_IMPORT eap_status_e unload_module(const eap_type_value_e type); |
|
630 |
|
631 /// @see abs_simple_config_base_record_c::packet_data_crypto_keys(). |
|
632 EAP_FUNC_IMPORT eap_status_e packet_data_crypto_keys( |
|
633 const eap_am_network_id_c * const send_network_id, |
|
634 const eap_master_session_key_c * const master_session_key); |
|
635 |
|
636 /// @see abs_simple_config_base_record_c::check_is_valid_eap_type(). |
|
637 EAP_FUNC_IMPORT eap_status_e check_is_valid_eap_type(const eap_type_value_e eap_type); |
|
638 |
|
639 /// @see abs_simple_config_base_record_c::get_eap_type_list(). |
|
640 EAP_FUNC_IMPORT eap_status_e get_eap_type_list( |
|
641 eap_array_c<eap_type_value_e> * const eap_type_list); |
|
642 |
|
643 /// @see abs_simple_config_base_record_c::set_session_timeout(). |
|
644 EAP_FUNC_IMPORT eap_status_e set_session_timeout( |
|
645 const u32_t session_timeout_ms); |
|
646 |
|
647 EAP_FUNC_IMPORT eap_status_e add_rogue_ap(eap_array_c<eap_rogue_ap_entry_c> & rogue_ap_list); |
|
648 |
|
649 //-------------------------------------------------- |
|
650 }; // class eap_type_simple_config_c |
|
651 |
|
652 #endif //#if defined(USE_EAP_SIMPLE_CONFIG) |
|
653 |
|
654 #endif //#if !defined(_EAP_TYPE_SIMPLE_CONFIG_H_) |
|
655 |
|
656 //-------------------------------------------------- |
|
657 |
|
658 |
|
659 |
|
660 // End. |