eapol/eapol_framework/eapol_common/type/tls_peap/tls/include/tls_extension.h
changeset 52 c23bdf5a328a
parent 33 938269283a16
equal deleted inserted replaced
51:e863583e6720 52:c23bdf5a328a
    14 * Description:  EAP and WLAN authentication protocols.
    14 * Description:  EAP and WLAN authentication protocols.
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 /*
    18 /*
    19 * %version: %
    19 * %version: 9.1.3 %
    20 */
    20 */
    21 
    21 
    22 #if !defined(_TLS_EXTENSION_H_)
    22 #if !defined(_TLS_EXTENSION_H_)
    23 #define _TLS_EXTENSION_H_
    23 #define _TLS_EXTENSION_H_
    24 
    24 
    28 #include "eap_array.h"
    28 #include "eap_array.h"
    29 #include "eap_variable_data.h"
    29 #include "eap_variable_data.h"
    30 #if defined(USE_FAST_EAP_TYPE)
    30 #if defined(USE_FAST_EAP_TYPE)
    31 #include "eap_fast_tlv_header.h"
    31 #include "eap_fast_tlv_header.h"
    32 #endif //#if defined(USE_FAST_EAP_TYPE)
    32 #endif //#if defined(USE_FAST_EAP_TYPE)
       
    33 
       
    34 #include "eap_am_export.h"
       
    35 // Start: added by script change_export_macros.sh.
       
    36 #if defined(EAP_NO_EXPORT_TLS_EXTENSION_H)
       
    37 	#define EAP_CLASS_VISIBILITY_TLS_EXTENSION_H EAP_NONSHARABLE 
       
    38 	#define EAP_FUNC_VISIBILITY_TLS_EXTENSION_H 
       
    39 	#define EAP_C_FUNC_VISIBILITY_TLS_EXTENSION_H 
       
    40 	#define EAP_FUNC_EXPORT_TLS_EXTENSION_H 
       
    41 	#define EAP_C_FUNC_EXPORT_TLS_EXTENSION_H 
       
    42 #elif defined(EAP_EXPORT_TLS_EXTENSION_H)
       
    43 	#define EAP_CLASS_VISIBILITY_TLS_EXTENSION_H EAP_EXPORT 
       
    44 	#define EAP_FUNC_VISIBILITY_TLS_EXTENSION_H EAP_FUNC_EXPORT 
       
    45 	#define EAP_C_FUNC_VISIBILITY_TLS_EXTENSION_H EAP_C_FUNC_EXPORT 
       
    46 	#define EAP_FUNC_EXPORT_TLS_EXTENSION_H EAP_FUNC_EXPORT 
       
    47 	#define EAP_C_FUNC_EXPORT_TLS_EXTENSION_H EAP_C_FUNC_EXPORT 
       
    48 #else
       
    49 	#define EAP_CLASS_VISIBILITY_TLS_EXTENSION_H EAP_IMPORT 
       
    50 	#define EAP_FUNC_VISIBILITY_TLS_EXTENSION_H EAP_FUNC_IMPORT 
       
    51 	#define EAP_C_FUNC_VISIBILITY_TLS_EXTENSION_H EAP_C_FUNC_IMPORT 
       
    52 	#define EAP_FUNC_EXPORT_TLS_EXTENSION_H 
       
    53 	#define EAP_C_FUNC_EXPORT_TLS_EXTENSION_H 
       
    54 #endif
       
    55 // End: added by script change_export_macros.sh.
    33 
    56 
    34 /** @file */
    57 /** @file */
    35 
    58 
    36 /**
    59 /**
    37  * This is enumeration of TLS competion actions.
    60  * This is enumeration of TLS competion actions.
    50 
    73 
    51 //----------------------------------------------------------------------------
    74 //----------------------------------------------------------------------------
    52 
    75 
    53 
    76 
    54 /// This class defines one TLS completion action.
    77 /// This class defines one TLS completion action.
    55 class EAP_EXPORT tls_extension_c
    78 class EAP_CLASS_VISIBILITY_TLS_EXTENSION_H tls_extension_c
    56 : public eap_variable_data_c
    79 : public eap_variable_data_c
    57 {
    80 {
    58 private:
    81 private:
    59 	//--------------------------------------------------
    82 	//--------------------------------------------------
    60 
    83 
    77 
   100 
    78 	/**
   101 	/**
    79 	 * The set_is_valid() function sets the state of the object valid.
   102 	 * The set_is_valid() function sets the state of the object valid.
    80 	 * The creator of this object calls this function after it is initialized. 
   103 	 * The creator of this object calls this function after it is initialized. 
    81 	 */
   104 	 */
    82 	EAP_FUNC_IMPORT void set_is_valid();
   105 	EAP_FUNC_VISIBILITY_TLS_EXTENSION_H void set_is_valid();
    83 
   106 
    84 	//--------------------------------------------------
   107 	//--------------------------------------------------
    85 protected:
   108 protected:
    86 	//--------------------------------------------------
   109 	//--------------------------------------------------
    87 
   110 
    90 	//--------------------------------------------------
   113 	//--------------------------------------------------
    91 
   114 
    92 	/**
   115 	/**
    93 	 * Destructor does nothing special.
   116 	 * Destructor does nothing special.
    94 	 */
   117 	 */
    95 	EAP_FUNC_IMPORT virtual ~tls_extension_c();
   118 	EAP_FUNC_VISIBILITY_TLS_EXTENSION_H virtual ~tls_extension_c();
    96 
   119 
    97 	/**
   120 	/**
    98 	 * Constructor initializes object.
   121 	 * Constructor initializes object.
    99 	 */
   122 	 */
   100 	EAP_FUNC_IMPORT tls_extension_c(
   123 	EAP_FUNC_VISIBILITY_TLS_EXTENSION_H tls_extension_c(
   101 		abs_eap_am_tools_c * const tools);
   124 		abs_eap_am_tools_c * const tools);
   102 
   125 
   103 	/**
   126 	/**
   104 	 * Function copies the object.
   127 	 * Function copies the object.
   105 	 */
   128 	 */
   108 	/**
   131 	/**
   109 	 * Object must indicate it's validity.
   132 	 * Object must indicate it's validity.
   110 	 * If object initialization fails this function must return false.
   133 	 * If object initialization fails this function must return false.
   111 	 * @return This function returns the validity of this object.
   134 	 * @return This function returns the validity of this object.
   112 	 */
   135 	 */
   113 	EAP_FUNC_IMPORT bool get_is_valid();
   136 	EAP_FUNC_VISIBILITY_TLS_EXTENSION_H bool get_is_valid();
   114 
   137 
   115 	/**
   138 	/**
   116 	 * This function sets the extension lifitime hint.
   139 	 * This function sets the extension lifitime hint.
   117 	 */
   140 	 */
   118 	EAP_FUNC_IMPORT void set_lifetime_hint(const u32_t lifetime_hint);
   141 	EAP_FUNC_VISIBILITY_TLS_EXTENSION_H void set_lifetime_hint(const u32_t lifetime_hint);
   119 
   142 
   120 	/**
   143 	/**
   121 	 * This function gets the extension lifetime hint.
   144 	 * This function gets the extension lifetime hint.
   122 	 */
   145 	 */
   123 	EAP_FUNC_IMPORT u32_t get_lifetime_hint() const;
   146 	EAP_FUNC_VISIBILITY_TLS_EXTENSION_H u32_t get_lifetime_hint() const;
   124 
   147 
   125 	/**
   148 	/**
   126 	 * This function sets the extension type.
   149 	 * This function sets the extension type.
   127 	 */
   150 	 */
   128 	EAP_FUNC_IMPORT void set_type(const tls_extension_type_e type);
   151 	EAP_FUNC_VISIBILITY_TLS_EXTENSION_H void set_type(const tls_extension_type_e type);
   129 
   152 
   130 	/**
   153 	/**
   131 	 * This function gets the extension type.
   154 	 * This function gets the extension type.
   132 	 */
   155 	 */
   133 	EAP_FUNC_IMPORT tls_extension_type_e get_type() const;
   156 	EAP_FUNC_VISIBILITY_TLS_EXTENSION_H tls_extension_type_e get_type() const;
   134 
   157 
   135 #if defined(USE_FAST_EAP_TYPE)
   158 #if defined(USE_FAST_EAP_TYPE)
   136 
   159 
   137 	/// This function stores the PAC-Type for fast access.
   160 	/// This function stores the PAC-Type for fast access.
   138 	EAP_FUNC_IMPORT void set_pac_type(const eap_fast_pac_type_e pac_type);
   161 	EAP_FUNC_VISIBILITY_TLS_EXTENSION_H void set_pac_type(const eap_fast_pac_type_e pac_type);
   139 
   162 
   140 	/// This function returns the PAC-Type for fast access.
   163 	/// This function returns the PAC-Type for fast access.
   141 	EAP_FUNC_IMPORT eap_fast_pac_type_e get_pac_type() const;
   164 	EAP_FUNC_VISIBILITY_TLS_EXTENSION_H eap_fast_pac_type_e get_pac_type() const;
   142 
   165 
   143 #endif //#if defined(USE_FAST_EAP_TYPE)
   166 #endif //#if defined(USE_FAST_EAP_TYPE)
   144 
   167 
   145 	/**
   168 	/**
   146 	 * This function gets the debug string of the extension type.
   169 	 * This function gets the debug string of the extension type.
   147 	 */
   170 	 */
   148 	EAP_FUNC_IMPORT static eap_const_string  get_type_string(tls_extension_type_e type);
   171 	EAP_FUNC_VISIBILITY_TLS_EXTENSION_H static eap_const_string  get_type_string(tls_extension_type_e type);
   149 
   172 
   150 	/**
   173 	/**
   151 	 * This function gets the extension from the array of extensions.
   174 	 * This function gets the extension from the array of extensions.
   152 	 */
   175 	 */
   153 	EAP_FUNC_IMPORT static const tls_extension_c * get_tls_extension(
   176 	EAP_FUNC_VISIBILITY_TLS_EXTENSION_H static const tls_extension_c * get_tls_extension(
   154 		const tls_extension_type_e tls_extension_type,
   177 		const tls_extension_type_e tls_extension_type,
   155 		EAP_TEMPLATE_CONST eap_array_c<tls_extension_c> * const tls_extensions,
   178 		EAP_TEMPLATE_CONST eap_array_c<tls_extension_c> * const tls_extensions,
   156 		abs_eap_am_tools_c * const am_tools);
   179 		abs_eap_am_tools_c * const am_tools);
   157 
   180 
   158 #if defined(USE_FAST_EAP_TYPE)
   181 #if defined(USE_FAST_EAP_TYPE)
   159 	/**
   182 	/**
   160 	 * This function gets the extension from the array of extensions.
   183 	 * This function gets the extension from the array of extensions.
   161 	 */
   184 	 */
   162 	EAP_FUNC_IMPORT static const tls_extension_c * get_tls_extension(
   185 	EAP_FUNC_VISIBILITY_TLS_EXTENSION_H static const tls_extension_c * get_tls_extension(
   163 		const tls_extension_type_e tls_extension_type,
   186 		const tls_extension_type_e tls_extension_type,
   164 		const eap_fast_pac_type_e pac_type,
   187 		const eap_fast_pac_type_e pac_type,
   165 		EAP_TEMPLATE_CONST eap_array_c<tls_extension_c> * const tls_extensions,
   188 		EAP_TEMPLATE_CONST eap_array_c<tls_extension_c> * const tls_extensions,
   166 		abs_eap_am_tools_c * const am_tools);
   189 		abs_eap_am_tools_c * const am_tools);
   167 #endif //#if defined(USE_FAST_EAP_TYPE)
   190 #endif //#if defined(USE_FAST_EAP_TYPE)