eapol/eapol_framework/eapol_common/type/simple_config/eap/include/eap_type_simple_config_header.h
changeset 49 43351a4f2da3
parent 26 9abfd4f00d37
equal deleted inserted replaced
47:712b4ffd76bb 49:43351a4f2da3
    25 #if defined(USE_EAP_SIMPLE_CONFIG)
    25 #if defined(USE_EAP_SIMPLE_CONFIG)
    26 
    26 
    27 #include "eap_tools.h"
    27 #include "eap_tools.h"
    28 #include "eap_header.h"
    28 #include "eap_header.h"
    29 #include "simple_config_types.h"
    29 #include "simple_config_types.h"
       
    30 #include "eap_am_export.h"
       
    31 // Start: added by script change_export_macros.sh.
       
    32 #if defined(EAP_NO_EXPORT_EAP_TYPE_SIMPLE_CONFIG_HEADER_H)
       
    33 	#define EAP_CLASS_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H EAP_NONSHARABLE 
       
    34 	#define EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H 
       
    35 	#define EAP_C_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H 
       
    36 	#define EAP_FUNC_EXPORT_EAP_TYPE_SIMPLE_CONFIG_HEADER_H 
       
    37 	#define EAP_C_FUNC_EXPORT_EAP_TYPE_SIMPLE_CONFIG_HEADER_H 
       
    38 #elif defined(EAP_EXPORT_EAP_TYPE_SIMPLE_CONFIG_HEADER_H)
       
    39 	#define EAP_CLASS_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H EAP_EXPORT 
       
    40 	#define EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H EAP_FUNC_EXPORT 
       
    41 	#define EAP_C_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H EAP_C_FUNC_EXPORT 
       
    42 	#define EAP_FUNC_EXPORT_EAP_TYPE_SIMPLE_CONFIG_HEADER_H EAP_FUNC_EXPORT 
       
    43 	#define EAP_C_FUNC_EXPORT_EAP_TYPE_SIMPLE_CONFIG_HEADER_H EAP_C_FUNC_EXPORT 
       
    44 #else
       
    45 	#define EAP_CLASS_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H EAP_IMPORT 
       
    46 	#define EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H EAP_FUNC_IMPORT 
       
    47 	#define EAP_C_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H EAP_C_FUNC_IMPORT 
       
    48 	#define EAP_FUNC_EXPORT_EAP_TYPE_SIMPLE_CONFIG_HEADER_H 
       
    49 	#define EAP_C_FUNC_EXPORT_EAP_TYPE_SIMPLE_CONFIG_HEADER_H 
       
    50 #endif
       
    51 // End: added by script change_export_macros.sh.
       
    52 
    30 
    53 
    31 /** @file */
    54 /** @file */
    32 
    55 
    33 const u8_t SIMPLE_CONFIG_NAI_AT_BYTE = '@';
    56 const u8_t SIMPLE_CONFIG_NAI_AT_BYTE = '@';
    34 
    57 
    56  *  |  Message Data...
    79  *  |  Message Data...
    57  *  +-+-+-+-+-+-+-+-+-+
    80  *  +-+-+-+-+-+-+-+-+-+
    58  * @endcode
    81  * @endcode
    59  *
    82  *
    60  */
    83  */
    61 class EAP_EXPORT eap_simple_config_header_c
    84 class EAP_CLASS_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H eap_simple_config_header_c
    62 : public eap_header_base_c
    85 : public eap_header_base_c
    63 {
    86 {
    64 private:
    87 private:
    65 	//--------------------------------------------------
    88 	//--------------------------------------------------
    66 
    89 
   109 		op_code_WSC_Done  = 0x05,
   132 		op_code_WSC_Done  = 0x05,
   110 		op_code_FRAG_ACK  = 0x06,
   133 		op_code_FRAG_ACK  = 0x06,
   111 	};
   134 	};
   112 
   135 
   113 
   136 
   114 	EAP_FUNC_IMPORT virtual ~eap_simple_config_header_c();
   137 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H virtual ~eap_simple_config_header_c();
   115 
   138 
   116 	// 
   139 	// 
   117 	EAP_FUNC_IMPORT eap_simple_config_header_c(
   140 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H eap_simple_config_header_c(
   118 		abs_eap_am_tools_c * const tools,
   141 		abs_eap_am_tools_c * const tools,
   119 		u8_t * const header_begin,
   142 		u8_t * const header_begin,
   120 		const u32_t header_buffer_length);
   143 		const u32_t header_buffer_length);
   121 
   144 
   122 	EAP_FUNC_IMPORT eap_code_value_e get_eap_code() const;
   145 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H eap_code_value_e get_eap_code() const;
   123 
   146 
   124 	EAP_FUNC_IMPORT u8_t get_eap_identifier() const;
   147 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H u8_t get_eap_identifier() const;
   125 
   148 
   126 	EAP_FUNC_IMPORT u16_t get_eap_length() const;
   149 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H u16_t get_eap_length() const;
   127 
   150 
   128 	EAP_FUNC_IMPORT eap_type_value_e get_eap_type() const;
   151 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H eap_type_value_e get_eap_type() const;
   129 
   152 
   130 	EAP_FUNC_IMPORT u16_t get_data_length() const;
   153 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H u16_t get_data_length() const;
   131 
   154 
   132 	EAP_FUNC_IMPORT u32_t get_simple_config_min_header_length() const;
   155 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H u32_t get_simple_config_min_header_length() const;
   133 
   156 
   134 	EAP_FUNC_IMPORT static u32_t get_simple_config_max_header_length();
   157 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H static u32_t get_simple_config_max_header_length();
   135 
   158 
   136 	EAP_FUNC_IMPORT u32_t get_header_length() const;
   159 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H u32_t get_header_length() const;
   137 
   160 
   138 	EAP_FUNC_IMPORT u32_t get_start_offset_of_data() const;
   161 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H u32_t get_start_offset_of_data() const;
   139 
   162 
   140 	EAP_FUNC_IMPORT u8_t * get_data_offset(
   163 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H u8_t * get_data_offset(
   141 		abs_eap_am_tools_c * const m_am_tools,
   164 		abs_eap_am_tools_c * const m_am_tools,
   142 		const u32_t offset,
   165 		const u32_t offset,
   143 		const u32_t contignuous_bytes) const;
   166 		const u32_t contignuous_bytes) const;
   144 
   167 
   145 
   168 
   146 	EAP_FUNC_IMPORT u8_t * get_data(
   169 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H u8_t * get_data(
   147 		abs_eap_am_tools_c * const m_am_tools,
   170 		abs_eap_am_tools_c * const m_am_tools,
   148 		const u32_t contignuous_bytes) const;
   171 		const u32_t contignuous_bytes) const;
   149 
   172 
   150 
   173 
   151 	EAP_FUNC_IMPORT u32_t get_sc_op_code_offset() const;
   174 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H u32_t get_sc_op_code_offset() const;
   152 
   175 
   153 	EAP_FUNC_IMPORT u32_t get_sc_flags_offset() const;
   176 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H u32_t get_sc_flags_offset() const;
   154 
   177 
   155 	EAP_FUNC_IMPORT u32_t get_sc_length_offset() const;
   178 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H u32_t get_sc_length_offset() const;
   156 
   179 
   157 
   180 
   158 	EAP_FUNC_IMPORT op_code_e get_sc_op_code() const;
   181 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H op_code_e get_sc_op_code() const;
   159 
   182 
   160 
   183 
   161 	EAP_FUNC_IMPORT u8_t * get_simple_config_flags() const;
   184 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H u8_t * get_simple_config_flags() const;
   162 
   185 
   163 	EAP_FUNC_IMPORT bool get_simple_config_flag_bit(
   186 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H bool get_simple_config_flag_bit(
   164 		const u32_t mask) const;
   187 		const u32_t mask) const;
   165 
   188 
   166 	EAP_FUNC_IMPORT u8_t get_simple_config_flag_value(
   189 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H u8_t get_simple_config_flag_value(
   167 		const u32_t mask,
   190 		const u32_t mask,
   168 		const u32_t shift) const;
   191 		const u32_t shift) const;
   169 
   192 
   170 	EAP_FUNC_IMPORT bool get_flag_simple_config_length_included() const;
   193 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H bool get_flag_simple_config_length_included() const;
   171 
   194 
   172 	EAP_FUNC_IMPORT bool get_flag_more_fragments() const;
   195 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H bool get_flag_more_fragments() const;
   173 	
   196 	
   174 	EAP_FUNC_IMPORT u8_t get_flag_reserved() const;
   197 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H u8_t get_flag_reserved() const;
   175 
   198 
   176 	EAP_FUNC_IMPORT eap_status_e get_simple_config_message_length(
   199 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H eap_status_e get_simple_config_message_length(
   177 		u32_t * const simple_config_length) const;
   200 		u32_t * const simple_config_length) const;
   178 
   201 
   179 
   202 
   180 	EAP_FUNC_IMPORT eap_status_e check_header(
   203 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H eap_status_e check_header(
   181 		abs_eap_am_tools_c * const tools,
   204 		abs_eap_am_tools_c * const tools,
   182 		const bool is_client_when_true) const;
   205 		const bool is_client_when_true) const;
   183 
   206 
   184 	EAP_FUNC_IMPORT eap_const_string get_code_string() const;
   207 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H eap_const_string get_code_string() const;
   185 
   208 
   186 	EAP_FUNC_IMPORT eap_const_string get_eap_type_string() const;
   209 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H eap_const_string get_eap_type_string() const;
   187 
   210 
   188 	EAP_FUNC_IMPORT eap_const_string get_sc_op_code_string() const;
   211 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H eap_const_string get_sc_op_code_string() const;
   189 
   212 
   190 
   213 
   191 	EAP_FUNC_IMPORT void set_eap_code(const eap_code_value_e p_code);
   214 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H void set_eap_code(const eap_code_value_e p_code);
   192 
   215 
   193 	EAP_FUNC_IMPORT void set_eap_identifier(const u8_t p_identifier);
   216 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H void set_eap_identifier(const u8_t p_identifier);
   194 
   217 
   195 	EAP_FUNC_IMPORT void set_eap_length(
   218 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H void set_eap_length(
   196 		const u16_t p_length,
   219 		const u16_t p_length,
   197 		const bool expanded_type_when_true);
   220 		const bool expanded_type_when_true);
   198 
   221 
   199 	EAP_FUNC_IMPORT void set_eap_type(
   222 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H void set_eap_type(
   200 		const eap_type_value_e p_type,
   223 		const eap_type_value_e p_type,
   201 		const bool expanded_type_when_true);
   224 		const bool expanded_type_when_true);
   202 
   225 
   203 
   226 
   204 	EAP_FUNC_IMPORT void set_sc_op_code(const op_code_e op_code);
   227 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H void set_sc_op_code(const op_code_e op_code);
   205 
   228 
   206 
   229 
   207 	EAP_FUNC_IMPORT void set_simple_config_flag_value(
   230 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H void set_simple_config_flag_value(
   208 		const u8_t value,
   231 		const u8_t value,
   209 		const u32_t mask,
   232 		const u32_t mask,
   210 		const u32_t shift) const;
   233 		const u32_t shift) const;
   211 
   234 
   212 	EAP_FUNC_IMPORT void set_simple_config_flag_bit(const bool flag, u32_t mask) const;
   235 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H void set_simple_config_flag_bit(const bool flag, u32_t mask) const;
   213 
   236 
   214 	EAP_FUNC_IMPORT void set_flag_reserved(const u8_t reserved);
   237 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H void set_flag_reserved(const u8_t reserved);
   215 
   238 
   216 	EAP_FUNC_IMPORT void set_flag_simple_config_length_included(const bool simple_config_length_included);
   239 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H void set_flag_simple_config_length_included(const bool simple_config_length_included);
   217 
   240 
   218 	EAP_FUNC_IMPORT void set_flag_more_fragments(const bool more_fragments);
   241 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H void set_flag_more_fragments(const bool more_fragments);
   219 
   242 
   220 
   243 
   221 	EAP_FUNC_IMPORT void set_data_length(
   244 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H void set_data_length(
   222 		const u32_t p_data_length,
   245 		const u32_t p_data_length,
   223 		const bool expanded_type_when_true);
   246 		const bool expanded_type_when_true);
   224 
   247 
   225 	EAP_FUNC_IMPORT void set_simple_config_message_length(const u32_t simple_config_length);
   248 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H void set_simple_config_message_length(const u32_t simple_config_length);
   226 
   249 
   227 
   250 
   228 	EAP_FUNC_IMPORT void reset_header(
   251 	EAP_FUNC_VISIBILITY_EAP_TYPE_SIMPLE_CONFIG_HEADER_H void reset_header(
   229 		abs_eap_am_tools_c * const m_am_tools,
   252 		abs_eap_am_tools_c * const m_am_tools,
   230 		const u32_t buffer_length,
   253 		const u32_t buffer_length,
   231 		const bool expanded_type_when_true);
   254 		const bool expanded_type_when_true);
   232 
   255 
   233 	// 
   256 	//