14 * Description: EAP and WLAN authentication protocols. |
14 * Description: EAP and WLAN authentication protocols. |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 /* |
18 /* |
19 * %version: 9.1.2 % |
19 * %version: 24 % |
20 */ |
20 */ |
21 |
21 |
22 #if !defined(_EAP_SESSION_CORE_H_) |
22 #if !defined(_EAP_SESSION_CORE_H_) |
23 #define _EAP_SESSION_CORE_H_ |
23 #define _EAP_SESSION_CORE_H_ |
24 |
24 |
25 #include "eap_tools.h" |
25 #include "eap_tools.h" |
26 #include "eap_am_export.h" |
26 #include "eap_am_export.h" |
27 #include "abs_eap_core.h" |
27 #include "abs_eap_session_core.h" |
28 #include "eap_core_map.h" |
28 #include "eap_core_map.h" |
29 #include "abs_eap_stack_interface.h" |
29 #include "abs_eap_stack_interface.h" |
30 |
30 #include "eap_session_core_base.h" |
31 class eap_core_c; |
31 #include "eap_base_type.h" |
|
32 #include "eap_core.h" |
|
33 |
32 class eap_network_id_selector_c; |
34 class eap_network_id_selector_c; |
33 |
35 |
34 |
36 |
35 /** |
37 /** |
36 * This is the timer ID used with abs_eap_am_tools_c::set_timer() and abs_eap_am_tools_c::cancel_timer(). |
38 * This is the timer ID used with abs_eap_am_tools_c::set_timer() and abs_eap_am_tools_c::cancel_timer(). |
51 class EAP_EXPORT eap_session_core_c |
53 class EAP_EXPORT eap_session_core_c |
52 : public abs_eap_core_c |
54 : public abs_eap_core_c |
53 , public abs_eap_core_map_c |
55 , public abs_eap_core_map_c |
54 , public abs_eap_base_timer_c |
56 , public abs_eap_base_timer_c |
55 , public abs_eap_stack_interface_c |
57 , public abs_eap_stack_interface_c |
|
58 , public eap_session_core_base_c |
56 { |
59 { |
57 private: |
60 private: |
58 //-------------------------------------------------- |
61 //-------------------------------------------------- |
59 |
62 |
60 /// This is back pointer to object which created this object. |
63 /// This is back pointer to object which created this object. |
61 /// Packets are sent to the partner. |
64 /// Packets are sent to the partner. |
62 abs_eap_core_c * const m_partner; |
65 abs_eap_session_core_c * const m_partner; |
63 |
66 |
64 /// This is pointer to the tools class. |
67 /// This is pointer to the tools class. |
65 abs_eap_am_tools_c * const m_am_tools; |
68 abs_eap_am_tools_c * const m_am_tools; |
66 |
69 |
67 /// This stores EAP authentication session objects using eap_variable_data selector. |
70 /// This stores EAP authentication session objects using eap_variable_data selector. |
118 * as a client (true) or server (false), in terms of EAP-protocol |
121 * as a client (true) or server (false), in terms of EAP-protocol |
119 * whether this network entity is EAP-supplicant (true) or EAP-authenticator (false). |
122 * whether this network entity is EAP-supplicant (true) or EAP-authenticator (false). |
120 */ |
123 */ |
121 EAP_FUNC_IMPORT eap_session_core_c( |
124 EAP_FUNC_IMPORT eap_session_core_c( |
122 abs_eap_am_tools_c * const tools, |
125 abs_eap_am_tools_c * const tools, |
123 abs_eap_core_c * const partner, |
126 abs_eap_session_core_c * const partner, |
124 const bool is_client_when_true); |
127 const bool is_client_when_true); |
125 |
128 |
126 /** |
129 /** |
127 * This function must reset the state of object to same as |
130 * This function must reset the state of object to same as |
128 * state was after the configure() function call. |
131 * state was after the configure() function call. |
136 * This function cancels all EAP-sessions. |
139 * This function cancels all EAP-sessions. |
137 * If this succeeds this function must return eap_status_ok. |
140 * If this succeeds this function must return eap_status_ok. |
138 * If this fails this function must return corresponding error status. |
141 * If this fails this function must return corresponding error status. |
139 * @return This function returns the status of operation. |
142 * @return This function returns the status of operation. |
140 */ |
143 */ |
141 EAP_FUNC_IMPORT eap_status_e synchronous_cancel_all_eap_sessions(); |
144 EAP_FUNC_IMPORT eap_status_e cancel_all_eap_sessions(); |
142 |
145 |
143 // This is documented in abs_eap_stack_interface_c::packet_process(). |
146 // This is documented in abs_eap_stack_interface_c::packet_process(). |
144 EAP_FUNC_IMPORT eap_status_e packet_process( |
147 EAP_FUNC_IMPORT eap_status_e packet_process( |
145 const eap_am_network_id_c * const receive_network_id, |
148 const eap_am_network_id_c * const receive_network_id, |
146 eap_general_header_base_c * const packet_data, |
149 eap_general_header_base_c * const packet_data, |
163 const u32_t buffer_length); |
166 const u32_t buffer_length); |
164 |
167 |
165 /** |
168 /** |
166 * The get_partner() function returns pointer to partner class. |
169 * The get_partner() function returns pointer to partner class. |
167 */ |
170 */ |
168 EAP_FUNC_IMPORT abs_eap_core_c * get_partner(); |
171 EAP_FUNC_IMPORT abs_eap_session_core_c * get_partner(); |
169 |
172 |
170 /** |
173 /** |
171 * The get_header_offset() function obtains the header offset of EAP-packet. |
174 * The get_header_offset() function obtains the header offset of EAP-packet. |
172 * @param MTU_length is pointer to variable to store the maximum transfer unit (MTU). |
175 * @param MTU_length is pointer to variable to store the maximum transfer unit (MTU). |
173 * MTU is the maximum EAP-packet length in bytes |
176 * MTU is the maximum EAP-packet length in bytes |
314 const eap_am_network_id_c * const receive_network_id, |
317 const eap_am_network_id_c * const receive_network_id, |
315 const bool is_client_when_true, |
318 const bool is_client_when_true, |
316 const bool force_clean_restart, |
319 const bool force_clean_restart, |
317 const bool from_timer = false); |
320 const bool from_timer = false); |
318 |
321 |
319 #if defined(USE_EAPOL_KEY_STATE_OPTIMIZED_4_WAY_HANDSHAKE) |
|
320 /** |
322 /** |
321 * This function creates EAP session object synchronously. |
323 * This function creates EAP session object synchronously. |
322 * @param receive_network_id identifies the removed EAP session. |
324 * @param receive_network_id identifies the removed EAP session. |
323 */ |
325 */ |
324 EAP_FUNC_IMPORT eap_status_e synchronous_create_eap_session( |
326 EAP_FUNC_IMPORT eap_status_e create_eap_session( |
325 const eap_am_network_id_c * const receive_network_id); |
327 const eap_am_network_id_c * const receive_network_id); |
326 #endif //#if defined(USE_EAPOL_KEY_STATE_OPTIMIZED_4_WAY_HANDSHAKE) |
|
327 |
328 |
328 /** |
329 /** |
329 * This function removes EAP session object synchronously. |
330 * This function removes EAP session object synchronously. |
330 * @param receive_network_id identifies the removed EAP session. |
331 * @param receive_network_id identifies the removed EAP session. |
331 */ |
332 */ |
332 EAP_FUNC_IMPORT eap_status_e synchronous_remove_eap_session( |
333 EAP_FUNC_IMPORT eap_status_e remove_eap_session( |
|
334 const bool complete_to_lower_layer, |
333 const eap_am_network_id_c * const receive_network_id); |
335 const eap_am_network_id_c * const receive_network_id); |
334 |
336 |
335 /** |
337 /** |
336 * This function removes EAP session object asynchronously. |
338 * This function removes EAP session object asynchronously. |
337 * @param send_network_id identifies the removed EAP session. |
339 * @param send_network_id identifies the removed EAP session. |
356 EAP_FUNC_IMPORT eap_status_e cancel_timer( |
358 EAP_FUNC_IMPORT eap_status_e cancel_timer( |
357 abs_eap_base_timer_c * const p_initializer, |
359 abs_eap_base_timer_c * const p_initializer, |
358 const u32_t p_id); |
360 const u32_t p_id); |
359 |
361 |
360 // |
362 // |
361 EAP_FUNC_IMPORT eap_status_e cancel_all_timers(); |
|
362 |
|
363 // |
|
364 EAP_FUNC_IMPORT eap_status_e check_is_valid_eap_type(const eap_type_value_e eap_type); |
363 EAP_FUNC_IMPORT eap_status_e check_is_valid_eap_type(const eap_type_value_e eap_type); |
365 |
364 |
366 /// @see abs_eap_core_c::get_eap_type_list(). |
365 /// @see abs_eap_core_c::get_eap_type_list(). |
367 EAP_FUNC_IMPORT eap_status_e get_eap_type_list( |
366 EAP_FUNC_IMPORT eap_status_e get_eap_type_list( |
368 eap_array_c<eap_type_value_e> * const eap_type_list); |
367 eap_array_c<eap_type_value_e> * const eap_type_list); |
372 |
371 |
373 // This is documented in abs_eap_core_c::set_session_timeout(). |
372 // This is documented in abs_eap_core_c::set_session_timeout(). |
374 EAP_FUNC_IMPORT eap_status_e set_session_timeout( |
373 EAP_FUNC_IMPORT eap_status_e set_session_timeout( |
375 const u32_t session_timeout_ms); |
374 const u32_t session_timeout_ms); |
376 |
375 |
|
376 EAP_FUNC_IMPORT eap_status_e set_eap_database_reference_values( |
|
377 const eap_variable_data_c * const reference); |
|
378 |
|
379 EAP_FUNC_IMPORT eap_status_e get_802_11_authentication_mode( |
|
380 const eap_am_network_id_c * const receive_network_id, |
|
381 const eapol_key_authentication_type_e authentication_type, |
|
382 const eap_variable_data_c * const SSID, |
|
383 const eap_variable_data_c * const preshared_key); |
|
384 |
|
385 EAP_FUNC_IMPORT eap_status_e complete_get_802_11_authentication_mode( |
|
386 const eap_status_e completion_status, |
|
387 const eap_am_network_id_c * const receive_network_id, |
|
388 const eapol_key_802_11_authentication_mode_e mode); |
|
389 |
377 //-------------------------------------------------- |
390 //-------------------------------------------------- |
378 }; // class eap_session_core_c |
391 }; // class eap_session_core_c |
379 |
392 |
380 #endif //#if !defined(_EAP_SESSION_CORE_H_) |
393 #endif //#if !defined(_EAP_SESSION_CORE_H_) |
381 |
394 |