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