eapol/eapol_framework/eapol_common/am/include/eapol_am_wlan_authentication.h
branchRCL_3
changeset 18 bad0cc58d154
parent 2 1c7bc153c08e
child 19 c74b3d9f6b9e
equal deleted inserted replaced
17:30e048a7b597 18:bad0cc58d154
    14 * Description:  EAP and WLAN authentication protocols.
    14 * Description:  EAP and WLAN authentication protocols.
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 /*
    18 /*
    19 * %version: 2.1.2 %
    19 * %version: %
    20 */
    20 */
    21 
    21 
    22 #if !defined(_EAPOL_AM_WLAN_AUTHENTICATION_H_)
    22 #if !defined(_EAPOL_AM_WLAN_AUTHENTICATION_H_)
    23 #define _EAPOL_AM_WLAN_AUTHENTICATION_H_
    23 #define _EAPOL_AM_WLAN_AUTHENTICATION_H_
    24 
    24 
    32 class abs_eap_am_tools_c;
    32 class abs_eap_am_tools_c;
    33 class abs_eap_base_type_c;
    33 class abs_eap_base_type_c;
    34 class eap_base_type_c;
    34 class eap_base_type_c;
    35 class eap_am_network_id_c;
    35 class eap_am_network_id_c;
    36 class eap_type_selection_c;
    36 class eap_type_selection_c;
    37 class abs_eapol_wlan_database_reference_if_c;
       
    38 class abs_eap_state_notification_c;
    37 class abs_eap_state_notification_c;
       
    38 #include "eap_database_reference_if.h"
    39 
    39 
    40 #if defined(USE_EAP_SIMPLE_CONFIG)
    40 #if defined(USE_EAP_SIMPLE_CONFIG)
    41 class abs_eap_configuration_if_c;
    41 class abs_eap_configuration_if_c;
    42 #endif // #if defined(USE_EAP_SIMPLE_CONFIG)
    42 #endif // #if defined(USE_EAP_SIMPLE_CONFIG)
    43 
    43 
    44 
    44 
    45 /// This is interface to adaptation module of class eapol_wlan_authentication_c.
    45 /// This is interface to adaptation module of class eapol_wlan_authentication_c.
    46 class EAP_EXPORT eapol_am_wlan_authentication_c
    46 class EAP_EXPORT eapol_am_wlan_authentication_c
       
    47 : public eap_database_reference_if_c
    47 {
    48 {
    48 private:
    49 private:
    49 	//--------------------------------------------------
    50 	//--------------------------------------------------
    50 
    51 
    51 	//--------------------------------------------------
    52 	//--------------------------------------------------
    55 	//--------------------------------------------------
    56 	//--------------------------------------------------
    56 public:
    57 public:
    57 	//--------------------------------------------------
    58 	//--------------------------------------------------
    58 
    59 
    59 	// 
    60 	// 
    60 	virtual ~eapol_am_wlan_authentication_c();
    61 	EAP_FUNC_IMPORT virtual ~eapol_am_wlan_authentication_c();
    61 
    62 
    62 	/// @param tools: Constructor takes parameter tools that is pointer to adaptation of the platform.
    63 	/// @param tools: Constructor takes parameter tools that is pointer to adaptation of the platform.
    63 	/// @param is_client_when_true: Second parameter is true when object is client and false when object is server.
    64 	/// @param is_client_when_true: Second parameter is true when object is client and false when object is server.
    64 	/// @param wlan_database_reference: third parameter is pointer to interface to read the current database reference.
    65 	/// @param wlan_database_reference: third parameter is pointer to interface to read the current database reference.
    65 	EAP_FUNC_IMPORT static eapol_am_wlan_authentication_c * new_eapol_am_wlan_authentication(
    66 	EAP_FUNC_IMPORT static eapol_am_wlan_authentication_c * new_eapol_am_wlan_authentication(
    66 		abs_eap_am_tools_c * const tools,
    67 		abs_eap_am_tools_c * const tools,
    67 		const bool is_client_when_true,
    68 		const bool is_client_when_true
    68 		const abs_eapol_wlan_database_reference_if_c * const wlan_database_reference
       
    69 		);
    69 		);
    70 
    70 
    71 	/// This is documented in abs_eap_stack_interface_c::get_is_valid().
    71 	/// This is documented in abs_eap_stack_interface_c::get_is_valid().
    72 	virtual bool get_is_valid() = 0;
    72 	virtual bool get_is_valid() = 0;
    73 
    73 
    83 #if defined(USE_EAP_SIMPLE_CONFIG)
    83 #if defined(USE_EAP_SIMPLE_CONFIG)
    84 		, abs_eap_configuration_if_c * const configuration_if
    84 		, abs_eap_configuration_if_c * const configuration_if
    85 #endif // #if defined(USE_EAP_SIMPLE_CONFIG)
    85 #endif // #if defined(USE_EAP_SIMPLE_CONFIG)
    86 		) = 0;
    86 		) = 0;
    87 
    87 
    88 	/// Function resets current EAP-configuration.
    88 	/// Function resets current WPA-configuration.
    89 	virtual eap_status_e reset_eap_configuration() = 0;
    89 	virtual eap_status_e reset_wpa_configuration() = 0;
    90 
    90 
    91 	/// Function sets the new WLAN parameters.
    91 	/// Function sets the new WLAN parameters.
    92 	virtual eap_status_e set_wlan_parameters(
    92 	virtual eap_status_e set_wlan_parameters(
    93 		const eap_variable_data_c * const SSID,
    93 		const eap_variable_data_c * const SSID,
    94 		const bool WPA_override_enabled,
    94 		const bool WPA_override_enabled,
   103 	/// Previous connection was disassiciated.
   103 	/// Previous connection was disassiciated.
   104 	virtual eap_status_e disassociation(
   104 	virtual eap_status_e disassociation(
   105 		const eap_am_network_id_c * const receive_network_id ///< source includes remote address, destination includes local address.
   105 		const eap_am_network_id_c * const receive_network_id ///< source includes remote address, destination includes local address.
   106 		) = 0;
   106 		) = 0;
   107 
   107 
   108 	/**
       
   109 	 * This function queries the selected and active EAP-types that can be used
       
   110 	 * in current connection.
       
   111 	 */
       
   112 	virtual eap_status_e get_selected_eap_types(
       
   113 		eap_array_c<eap_type_selection_c> * const selected_eap_types) = 0;
       
   114 
       
   115 	/// Function gets the current WLAN configuration, now only the HASH of the WPA(2)-PSK.
   108 	/// Function gets the current WLAN configuration, now only the HASH of the WPA(2)-PSK.
   116 	virtual eap_status_e get_wlan_configuration(
   109 	virtual eap_status_e get_wlan_configuration(
   117 		eap_variable_data_c * const wpa_preshared_key_hash) = 0;
   110 		eap_variable_data_c * const wpa_preshared_key_hash) = 0;
   118 
   111 
   119 	/**
   112 	/**
   124 	 */
   117 	 */
   125 	virtual eap_status_e authentication_finished(
   118 	virtual eap_status_e authentication_finished(
   126 		const bool when_true_successfull,
   119 		const bool when_true_successfull,
   127 		const eap_type_value_e eap_type,
   120 		const eap_type_value_e eap_type,
   128 		const eapol_key_authentication_type_e authentication_type) = 0;
   121 		const eapol_key_authentication_type_e authentication_type) = 0;
   129 
       
   130 	/**
       
   131 	 * The load_module() function function indicates the lower level to
       
   132 	 * load new module of EAP-type.
       
   133 	 * @param type is the requested EAP-type.
       
   134 	 * @param tunneling_type is the EAP-type that tunnels the type. When plain EAP-type is used this parameter is eap_type_none.
       
   135 	 * @param partner is pointer to the caller object.
       
   136 	 * The partner of the new created EAP-type object is the caller object.
       
   137 	 * @param eap_type is a pointer to a pointer of EAP-type object.
       
   138 	 * Adaptation module sets eap_type pointer to created EAP-type object.
       
   139 	 * @param is_client_when_true parameter indicates whether the network entity should
       
   140 	 * act as a client (true) or server (false), in terms of EAP-protocol whether
       
   141 	 * this network entity is EAP-supplicant (true) or EAP-authenticator (false).
       
   142 	 * @param receive_network_id includes the addresses (network identity) and packet type.
       
   143 	 */
       
   144 	virtual eap_status_e load_module(
       
   145 		const eap_type_value_e type,
       
   146 		const eap_type_value_e tunneling_type,
       
   147 		abs_eap_base_type_c * const partner,
       
   148 		eap_base_type_c ** const eap_type,
       
   149 		const bool is_client_when_true,
       
   150 		const eap_am_network_id_c * const receive_network_id ///< source includes remote address, destination includes local address.
       
   151 		) = 0;
       
   152 
       
   153 	/**
       
   154 	 * The unload_module() function unloads the module of a EAP-type. 
       
   155 	 * @param eap_type is the requested EAP-type.
       
   156 	 */
       
   157 	virtual eap_status_e unload_module(
       
   158 		const eap_type_value_e type) = 0;
       
   159 
   122 
   160 	/**
   123 	/**
   161 	 * The read_configure() function reads the configuration data identified
   124 	 * The read_configure() function reads the configuration data identified
   162 	 * by the field string of field_length bytes length. Adaptation module must direct
   125 	 * by the field string of field_length bytes length. Adaptation module must direct
   163 	 * the query to some persistent store.
   126 	 * the query to some persistent store.
   215 	 * Adaptation module internally implements the timer.
   178 	 * Adaptation module internally implements the timer.
   216 	 */
   179 	 */
   217 	virtual eap_status_e cancel_all_timers() = 0;
   180 	virtual eap_status_e cancel_all_timers() = 0;
   218 
   181 
   219 	/**
   182 	/**
   220 	 * This function queries the validity of EAP-type.
       
   221 	 * Lower layer should return eap_status_ok if this EAP-type is supported.
       
   222 	 */
       
   223 	virtual eap_status_e check_is_valid_eap_type(const eap_type_value_e eap_type) = 0;
       
   224 
       
   225 	/**
       
   226 	 * This function queries the list of supported EAP-types.
       
   227 	 * Lower layer should return eap_status_ok if this call succeeds.
       
   228 	 * @param eap_type_list will include the list of supported EAP-types. Each value in list
       
   229 	 * is type of u32_t and represent one supported EAP-type. List consists of subsequent u32_t type values.
       
   230 	 */
       
   231 	virtual eap_status_e get_eap_type_list(
       
   232 		eap_array_c<eap_type_value_e> * const eap_type_list) = 0;
       
   233 
       
   234 	/**
       
   235 	 * This is notification of internal state transition.
   183 	 * This is notification of internal state transition.
   236 	 * This is used for notifications, debugging and protocol testing.
   184 	 * This is used for notifications, debugging and protocol testing.
   237 	 * The primal notifications are eap_state_variable_e::eap_state_authentication_finished_successfully
   185 	 * The primal notifications are eap_state_variable_e::eap_state_authentication_finished_successfully
   238 	 * and eap_state_variable_e::eap_state_authentication_terminated_unsuccessfully.
   186 	 * and eap_state_variable_e::eap_state_authentication_terminated_unsuccessfully.
   239 	 * These two notifications are sent from EAP-protocol layer (eap_protocol_layer_e::eap_protocol_layer_eap).
   187 	 * These two notifications are sent from EAP-protocol layer (eap_protocol_layer_e::eap_protocol_layer_eap).