eapol/eapol_framework/eapol_common/type/aka/include/eap_type_aka_state.h
changeset 52 c23bdf5a328a
parent 33 938269283a16
equal deleted inserted replaced
51:e863583e6720 52:c23bdf5a328a
    22 #if !defined(_AKA_STATE_H_)
    22 #if !defined(_AKA_STATE_H_)
    23 #define _AKA_STATE_H_
    23 #define _AKA_STATE_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 // Start: added by script change_export_macros.sh.
       
    28 #if defined(EAP_NO_EXPORT_EAP_TYPE_AKA_STATE_H)
       
    29 	#define EAP_CLASS_VISIBILITY_EAP_TYPE_AKA_STATE_H EAP_NONSHARABLE 
       
    30 	#define EAP_FUNC_VISIBILITY_EAP_TYPE_AKA_STATE_H 
       
    31 	#define EAP_C_FUNC_VISIBILITY_EAP_TYPE_AKA_STATE_H 
       
    32 	#define EAP_FUNC_EXPORT_EAP_TYPE_AKA_STATE_H 
       
    33 	#define EAP_C_FUNC_EXPORT_EAP_TYPE_AKA_STATE_H 
       
    34 #elif defined(EAP_EXPORT_EAP_TYPE_AKA_STATE_H)
       
    35 	#define EAP_CLASS_VISIBILITY_EAP_TYPE_AKA_STATE_H EAP_EXPORT 
       
    36 	#define EAP_FUNC_VISIBILITY_EAP_TYPE_AKA_STATE_H EAP_FUNC_EXPORT 
       
    37 	#define EAP_C_FUNC_VISIBILITY_EAP_TYPE_AKA_STATE_H EAP_C_FUNC_EXPORT 
       
    38 	#define EAP_FUNC_EXPORT_EAP_TYPE_AKA_STATE_H EAP_FUNC_EXPORT 
       
    39 	#define EAP_C_FUNC_EXPORT_EAP_TYPE_AKA_STATE_H EAP_C_FUNC_EXPORT 
       
    40 #else
       
    41 	#define EAP_CLASS_VISIBILITY_EAP_TYPE_AKA_STATE_H EAP_IMPORT 
       
    42 	#define EAP_FUNC_VISIBILITY_EAP_TYPE_AKA_STATE_H EAP_FUNC_IMPORT 
       
    43 	#define EAP_C_FUNC_VISIBILITY_EAP_TYPE_AKA_STATE_H EAP_C_FUNC_IMPORT 
       
    44 	#define EAP_FUNC_EXPORT_EAP_TYPE_AKA_STATE_H 
       
    45 	#define EAP_C_FUNC_EXPORT_EAP_TYPE_AKA_STATE_H 
       
    46 #endif
       
    47 // End: added by script change_export_macros.sh.
    27 #include "eap_base_type.h"
    48 #include "eap_base_type.h"
    28 #include "eap_variable_data.h"
    49 #include "eap_variable_data.h"
    29 #include "eap_type_aka_header.h"
    50 #include "eap_type_aka_header.h"
    30 #include "eap_type_aka_types.h"
    51 #include "eap_type_aka_types.h"
    31 #include "eap_type_aka_payloads.h"
    52 #include "eap_type_aka_payloads.h"
    40 
    61 
    41 //-----------------------------------------------
    62 //-----------------------------------------------
    42 
    63 
    43 /// This class stores the valid AKA messages (aka_subtype_e)
    64 /// This class stores the valid AKA messages (aka_subtype_e)
    44 /// within a one state (eap_type_aka_state_variable_e).
    65 /// within a one state (eap_type_aka_state_variable_e).
    45 class EAP_EXPORT eap_type_aka_state_variable_parameters_c
    66 class EAP_CLASS_VISIBILITY_EAP_TYPE_AKA_STATE_H eap_type_aka_state_variable_parameters_c
    46 {
    67 {
    47 private:
    68 private:
    48 
    69 
    49 	/// Array includes valid AKA messages (aka_subtype_e).
    70 	/// Array includes valid AKA messages (aka_subtype_e).
    50 	aka_subtype_e m_valid_types[AKA_STATE_MAX_TYPES];
    71 	aka_subtype_e m_valid_types[AKA_STATE_MAX_TYPES];
    62 public:
    83 public:
    63 
    84 
    64 	/**
    85 	/**
    65 	 * Destructor does nothing.
    86 	 * Destructor does nothing.
    66 	 */
    87 	 */
    67 	EAP_FUNC_IMPORT virtual ~eap_type_aka_state_variable_parameters_c();
    88 	EAP_FUNC_VISIBILITY_EAP_TYPE_AKA_STATE_H virtual ~eap_type_aka_state_variable_parameters_c();
    68 
    89 
    69 	/**
    90 	/**
    70 	 * Constructor initializes attributes with default values.
    91 	 * Constructor initializes attributes with default values.
    71 	 */
    92 	 */
    72 	EAP_FUNC_IMPORT eap_type_aka_state_variable_parameters_c();
    93 	EAP_FUNC_VISIBILITY_EAP_TYPE_AKA_STATE_H eap_type_aka_state_variable_parameters_c();
    73 
    94 
    74 	/**
    95 	/**
    75 	 * This function checks the AKA message is valid in this state.
    96 	 * This function checks the AKA message is valid in this state.
    76 	 */
    97 	 */
    77 	EAP_FUNC_IMPORT bool check_valid_types(aka_subtype_e type) const;
    98 	EAP_FUNC_VISIBILITY_EAP_TYPE_AKA_STATE_H bool check_valid_types(aka_subtype_e type) const;
    78 
    99 
    79 	/**
   100 	/**
    80 	 * This function checks the initiator is valid in this state.
   101 	 * This function checks the initiator is valid in this state.
    81 	 */
   102 	 */
    82 	EAP_FUNC_IMPORT bool check_initiator(const bool is_initiator) const;
   103 	EAP_FUNC_VISIBILITY_EAP_TYPE_AKA_STATE_H bool check_initiator(const bool is_initiator) const;
    83 
   104 
    84 	/**
   105 	/**
    85 	 * This function initializes this state to allow three AKA message types.
   106 	 * This function initializes this state to allow three AKA message types.
    86 	 */
   107 	 */
    87 	EAP_FUNC_IMPORT void init_state(
   108 	EAP_FUNC_VISIBILITY_EAP_TYPE_AKA_STATE_H void init_state(
    88 		const bool must_be_initiator,
   109 		const bool must_be_initiator,
    89 		const bool must_be_responder,
   110 		const bool must_be_responder,
    90 		const aka_subtype_e type0,
   111 		const aka_subtype_e type0,
    91 		const aka_subtype_e type1,
   112 		const aka_subtype_e type1,
    92 		const aka_subtype_e type2,
   113 		const aka_subtype_e type2,