eapol/eapol_framework/eapol_common/type/mschapv2/include/eap_type_mschapv2.h
changeset 52 c23bdf5a328a
parent 39 fe6b6762fccd
equal deleted inserted replaced
51:e863583e6720 52:c23bdf5a328a
    28 
    28 
    29 #include "eap_am_network_id.h"
    29 #include "eap_am_network_id.h"
    30 #include "abs_eap_am_type_mschapv2.h"
    30 #include "abs_eap_am_type_mschapv2.h"
    31 #include "eap_am_type_mschapv2.h"
    31 #include "eap_am_type_mschapv2.h"
    32 #include "eap_type_mschapv2_header.h"
    32 #include "eap_type_mschapv2_header.h"
       
    33 #include "eap_am_export.h"
       
    34 // Start: added by script change_export_macros.sh.
       
    35 #if defined(EAP_NO_EXPORT_EAP_TYPE_MSCHAPV2_H)
       
    36 	#define EAP_CLASS_VISIBILITY_EAP_TYPE_MSCHAPV2_H EAP_NONSHARABLE 
       
    37 	#define EAP_FUNC_VISIBILITY_EAP_TYPE_MSCHAPV2_H 
       
    38 	#define EAP_C_FUNC_VISIBILITY_EAP_TYPE_MSCHAPV2_H 
       
    39 	#define EAP_FUNC_EXPORT_EAP_TYPE_MSCHAPV2_H 
       
    40 	#define EAP_C_FUNC_EXPORT_EAP_TYPE_MSCHAPV2_H 
       
    41 #elif defined(EAP_EXPORT_EAP_TYPE_MSCHAPV2_H)
       
    42 	#define EAP_CLASS_VISIBILITY_EAP_TYPE_MSCHAPV2_H EAP_EXPORT 
       
    43 	#define EAP_FUNC_VISIBILITY_EAP_TYPE_MSCHAPV2_H EAP_FUNC_EXPORT 
       
    44 	#define EAP_C_FUNC_VISIBILITY_EAP_TYPE_MSCHAPV2_H EAP_C_FUNC_EXPORT 
       
    45 	#define EAP_FUNC_EXPORT_EAP_TYPE_MSCHAPV2_H EAP_FUNC_EXPORT 
       
    46 	#define EAP_C_FUNC_EXPORT_EAP_TYPE_MSCHAPV2_H EAP_C_FUNC_EXPORT 
       
    47 #else
       
    48 	#define EAP_CLASS_VISIBILITY_EAP_TYPE_MSCHAPV2_H EAP_IMPORT 
       
    49 	#define EAP_FUNC_VISIBILITY_EAP_TYPE_MSCHAPV2_H EAP_FUNC_IMPORT 
       
    50 	#define EAP_C_FUNC_VISIBILITY_EAP_TYPE_MSCHAPV2_H EAP_C_FUNC_IMPORT 
       
    51 	#define EAP_FUNC_EXPORT_EAP_TYPE_MSCHAPV2_H 
       
    52 	#define EAP_C_FUNC_EXPORT_EAP_TYPE_MSCHAPV2_H 
       
    53 #endif
       
    54 // End: added by script change_export_macros.sh.
       
    55 
    33 
    56 
    34 
    57 
    35 /// This class is implementation of MS-CHAP-v2 EAP-type.
    58 /// This class is implementation of MS-CHAP-v2 EAP-type.
    36 class EAP_EXPORT eap_type_mschapv2_c
    59 class EAP_CLASS_VISIBILITY_EAP_TYPE_MSCHAPV2_H eap_type_mschapv2_c
    37 	: public abs_eap_am_type_mschapv2_c 
    60 	: public abs_eap_am_type_mschapv2_c 
    38 	, public eap_base_type_c
    61 	, public eap_base_type_c
    39 {
    62 {
    40 
    63 
    41 private:
    64 private:
   139 
   162 
   140 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   163 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   141 
   164 
   142 	void send_error_notification(const eap_status_e error);
   165 	void send_error_notification(const eap_status_e error);
   143 
   166 
   144 	EAP_FUNC_IMPORT eap_status_e finish_successful_authentication();
   167 	EAP_FUNC_VISIBILITY_EAP_TYPE_MSCHAPV2_H eap_status_e finish_successful_authentication();
   145 
   168 
   146 	eap_status_e finish_unsuccessful_authentication(
   169 	eap_status_e finish_unsuccessful_authentication(
   147 		const bool authentication_cancelled);
   170 		const bool authentication_cancelled);
   148 
   171 
   149 	EAP_FUNC_IMPORT eap_status_e complete_eap_identity_query();
   172 	EAP_FUNC_VISIBILITY_EAP_TYPE_MSCHAPV2_H eap_status_e complete_eap_identity_query();
   150 
   173 
   151 	EAP_FUNC_IMPORT eap_status_e complete_failure_retry_response();
   174 	EAP_FUNC_VISIBILITY_EAP_TYPE_MSCHAPV2_H eap_status_e complete_failure_retry_response();
   152 
   175 
   153 	EAP_FUNC_IMPORT eap_status_e complete_change_password_query();
   176 	EAP_FUNC_VISIBILITY_EAP_TYPE_MSCHAPV2_H eap_status_e complete_change_password_query();
   154 
   177 
   155 	eap_status_e client_packet_process(
   178 	eap_status_e client_packet_process(
   156 		eap_header_wr_c * const eap, ///< This is pointer to EAP header and data.
   179 		eap_header_wr_c * const eap, ///< This is pointer to EAP header and data.
   157 		const u32_t eap_packet_length ///< This is length of received EAP packet.
   180 		const u32_t eap_packet_length ///< This is length of received EAP packet.
   158 		);
   181 		);
   354 public:
   377 public:
   355 
   378 
   356 	/**
   379 	/**
   357 	 * Destructor cancels all timers and deletes member attributes.
   380 	 * Destructor cancels all timers and deletes member attributes.
   358 	 */
   381 	 */
   359 	EAP_FUNC_IMPORT virtual ~eap_type_mschapv2_c();
   382 	EAP_FUNC_VISIBILITY_EAP_TYPE_MSCHAPV2_H virtual ~eap_type_mschapv2_c();
   360 
   383 
   361 	/**
   384 	/**
   362 	 * Constructor initializes all member attributes.
   385 	 * Constructor initializes all member attributes.
   363 	 */
   386 	 */
   364 	EAP_FUNC_IMPORT eap_type_mschapv2_c(
   387 	EAP_FUNC_VISIBILITY_EAP_TYPE_MSCHAPV2_H eap_type_mschapv2_c(
   365 		abs_eap_am_tools_c * const tools,
   388 		abs_eap_am_tools_c * const tools,
   366 		abs_eap_base_type_c * const partner,
   389 		abs_eap_base_type_c * const partner,
   367 		eap_am_type_mschapv2_c * const am_type_mschapv2,
   390 		eap_am_type_mschapv2_c * const am_type_mschapv2,
   368 		const bool free_am_type_mschapv2,
   391 		const bool free_am_type_mschapv2,
   369 		const bool is_client_when_true,
   392 		const bool is_client_when_true,
   371 
   394 
   372 	/**
   395 	/**
   373 	 * The partner class calls this function when EAP/MS-CHAP-v2 packet is received.
   396 	 * The partner class calls this function when EAP/MS-CHAP-v2 packet is received.
   374 	 * see also eap_base_type_c::packet_process().
   397 	 * see also eap_base_type_c::packet_process().
   375 	 */
   398 	 */
   376 	EAP_FUNC_IMPORT eap_status_e packet_process(
   399 	EAP_FUNC_VISIBILITY_EAP_TYPE_MSCHAPV2_H eap_status_e packet_process(
   377 		const eap_am_network_id_c * const receive_network_id, ///< This is the network identity of the received EAP packet.
   400 		const eap_am_network_id_c * const receive_network_id, ///< This is the network identity of the received EAP packet.
   378 		eap_header_wr_c * const eap, ///< This is pointer to EAP header and data.
   401 		eap_header_wr_c * const eap, ///< This is pointer to EAP header and data.
   379 		const u32_t eap_packet_length ///< This is length of received EAP packet.
   402 		const u32_t eap_packet_length ///< This is length of received EAP packet.
   380 		);
   403 		);
   381 
   404 
   382 	// This is commented in eap_base_type_c::get_is_valid().
   405 	// This is commented in eap_base_type_c::get_is_valid().
   383 	EAP_FUNC_IMPORT bool get_is_valid();
   406 	EAP_FUNC_VISIBILITY_EAP_TYPE_MSCHAPV2_H bool get_is_valid();
   384 	
   407 	
   385 	EAP_FUNC_IMPORT void set_is_valid();
   408 	EAP_FUNC_VISIBILITY_EAP_TYPE_MSCHAPV2_H void set_is_valid();
   386 
   409 
   387 	/**
   410 	/**
   388 	 * This function resets the reused eap_type_mschapv2_c object.
   411 	 * This function resets the reused eap_type_mschapv2_c object.
   389 	 */
   412 	 */
   390 	EAP_FUNC_IMPORT eap_status_e reset();
   413 	EAP_FUNC_VISIBILITY_EAP_TYPE_MSCHAPV2_H eap_status_e reset();
   391 
   414 
   392 	EAP_FUNC_IMPORT eap_status_e shutdown();
   415 	EAP_FUNC_VISIBILITY_EAP_TYPE_MSCHAPV2_H eap_status_e shutdown();
   393 
   416 
   394 	EAP_FUNC_IMPORT eap_status_e set_initial_eap_identifier(
   417 	EAP_FUNC_VISIBILITY_EAP_TYPE_MSCHAPV2_H eap_status_e set_initial_eap_identifier(
   395 		const eap_am_network_id_c * const receive_network_id,
   418 		const eap_am_network_id_c * const receive_network_id,
   396 		const u8_t initial_identifier);
   419 		const u8_t initial_identifier);
   397 
   420 
   398 	// This is commented in eap_base_type_c::eap_acknowledge().
   421 	// This is commented in eap_base_type_c::eap_acknowledge().
   399 	EAP_FUNC_IMPORT eap_status_e eap_acknowledge(
   422 	EAP_FUNC_VISIBILITY_EAP_TYPE_MSCHAPV2_H eap_status_e eap_acknowledge(
   400 		const eap_am_network_id_c * const receive_network_id);
   423 		const eap_am_network_id_c * const receive_network_id);
   401 
   424 
   402 	EAP_FUNC_IMPORT eap_status_e configure();
   425 	EAP_FUNC_VISIBILITY_EAP_TYPE_MSCHAPV2_H eap_status_e configure();
   403 
   426 
   404 	// This is commented in eap_base_type_c::query_eap_identity().
   427 	// This is commented in eap_base_type_c::query_eap_identity().
   405 	EAP_FUNC_IMPORT eap_status_e query_eap_identity(
   428 	EAP_FUNC_VISIBILITY_EAP_TYPE_MSCHAPV2_H eap_status_e query_eap_identity(
   406 		const bool must_be_synchronous,
   429 		const bool must_be_synchronous,
   407 		eap_variable_data_c * const identity,
   430 		eap_variable_data_c * const identity,
   408 		const eap_am_network_id_c * const receive_network_id,
   431 		const eap_am_network_id_c * const receive_network_id,
   409 		const u8_t eap_identifier);
   432 		const u8_t eap_identifier);
   410 
   433