eapol/eapol_framework/eapol_common/type/gsmsim/include/eap_type_gsmsim_payloads.h
changeset 49 43351a4f2da3
parent 26 9abfd4f00d37
equal deleted inserted replaced
47:712b4ffd76bb 49:43351a4f2da3
    22 #if !defined(_GSMSIM_RESULT_H_)
    22 #if !defined(_GSMSIM_RESULT_H_)
    23 #define _GSMSIM_RESULT_H_
    23 #define _GSMSIM_RESULT_H_
    24 
    24 
    25 #include "eap_variable_data.h"
    25 #include "eap_variable_data.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_GSMSIM_PAYLOADS_H)
       
    29 	#define EAP_CLASS_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H EAP_NONSHARABLE 
       
    30 	#define EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H 
       
    31 	#define EAP_C_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H 
       
    32 	#define EAP_FUNC_EXPORT_EAP_TYPE_GSMSIM_PAYLOADS_H 
       
    33 	#define EAP_C_FUNC_EXPORT_EAP_TYPE_GSMSIM_PAYLOADS_H 
       
    34 #elif defined(EAP_EXPORT_EAP_TYPE_GSMSIM_PAYLOADS_H)
       
    35 	#define EAP_CLASS_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H EAP_EXPORT 
       
    36 	#define EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H EAP_FUNC_EXPORT 
       
    37 	#define EAP_C_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H EAP_C_FUNC_EXPORT 
       
    38 	#define EAP_FUNC_EXPORT_EAP_TYPE_GSMSIM_PAYLOADS_H EAP_FUNC_EXPORT 
       
    39 	#define EAP_C_FUNC_EXPORT_EAP_TYPE_GSMSIM_PAYLOADS_H EAP_C_FUNC_EXPORT 
       
    40 #else
       
    41 	#define EAP_CLASS_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H EAP_IMPORT 
       
    42 	#define EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H EAP_FUNC_IMPORT 
       
    43 	#define EAP_C_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H EAP_C_FUNC_IMPORT 
       
    44 	#define EAP_FUNC_EXPORT_EAP_TYPE_GSMSIM_PAYLOADS_H 
       
    45 	#define EAP_C_FUNC_EXPORT_EAP_TYPE_GSMSIM_PAYLOADS_H 
       
    46 #endif
       
    47 // End: added by script change_export_macros.sh.
    27 #include "eap_type_gsmsim_header.h"
    48 #include "eap_type_gsmsim_header.h"
    28 
    49 
    29 
    50 
    30 
    51 
    31 class EAP_EXPORT gsmsim_fixed_data_c
    52 class EAP_CLASS_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_fixed_data_c
    32 {
    53 {
    33 private:
    54 private:
    34 	//--------------------------------------------------
    55 	//--------------------------------------------------
    35 
    56 
    36 	bool m_is_valid;
    57 	bool m_is_valid;
    44 
    65 
    45 	//--------------------------------------------------
    66 	//--------------------------------------------------
    46 public:
    67 public:
    47 	//--------------------------------------------------
    68 	//--------------------------------------------------
    48 
    69 
    49 	EAP_FUNC_IMPORT virtual ~gsmsim_fixed_data_c();
    70 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H virtual ~gsmsim_fixed_data_c();
    50 
    71 
    51 	EAP_FUNC_IMPORT gsmsim_fixed_data_c(
    72 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_fixed_data_c(
    52 		abs_eap_am_tools_c * const tools);
    73 		abs_eap_am_tools_c * const tools);
    53 
    74 
    54 	EAP_FUNC_IMPORT bool get_is_valid() const;
    75 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H bool get_is_valid() const;
    55 
    76 
    56 	EAP_FUNC_IMPORT const gsmsim_payload_AT_header_c * get_original_header();
    77 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H const gsmsim_payload_AT_header_c * get_original_header();
    57 
    78 
    58 	EAP_FUNC_IMPORT u16_t get_type(abs_eap_am_tools_c * const m_am_tools) const;
    79 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H u16_t get_type(abs_eap_am_tools_c * const m_am_tools) const;
    59 
    80 
    60 	EAP_FUNC_IMPORT u16_t get_data(abs_eap_am_tools_c * const m_am_tools) const;
    81 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H u16_t get_data(abs_eap_am_tools_c * const m_am_tools) const;
    61 
    82 
    62 	EAP_FUNC_IMPORT void set_data(
    83 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H void set_data(
    63 		const gsmsim_payload_AT_header_c * const original_header,
    84 		const gsmsim_payload_AT_header_c * const original_header,
    64 		const u16_t type, const u16_t data);
    85 		const u16_t type, const u16_t data);
    65 
    86 
    66 	//--------------------------------------------------
    87 	//--------------------------------------------------
    67 }; // class gsmsim_fixed_data_c
    88 }; // class gsmsim_fixed_data_c
    68 
    89 
    69 
    90 
    70 class EAP_EXPORT gsmsim_variable_data_c
    91 class EAP_CLASS_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_variable_data_c
    71 {
    92 {
    72 private:
    93 private:
    73 	//--------------------------------------------------
    94 	//--------------------------------------------------
    74 
    95 
    75 	abs_eap_am_tools_c * const m_am_tools;
    96 	abs_eap_am_tools_c * const m_am_tools;
    86 
   107 
    87 	//--------------------------------------------------
   108 	//--------------------------------------------------
    88 public:
   109 public:
    89 	//--------------------------------------------------
   110 	//--------------------------------------------------
    90 
   111 
    91 	EAP_FUNC_IMPORT virtual ~gsmsim_variable_data_c();
   112 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H virtual ~gsmsim_variable_data_c();
    92 
   113 
    93 	EAP_FUNC_IMPORT gsmsim_variable_data_c(abs_eap_am_tools_c * const tools);
   114 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_variable_data_c(abs_eap_am_tools_c * const tools);
    94 
   115 
    95 	EAP_FUNC_IMPORT const gsmsim_payload_AT_header_c * get_original_header() const;
   116 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H const gsmsim_payload_AT_header_c * get_original_header() const;
    96 
   117 
    97 	EAP_FUNC_IMPORT eap_status_e set_buffer(
   118 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H eap_status_e set_buffer(
    98 		const gsmsim_payload_AT_header_c * const original_header,
   119 		const gsmsim_payload_AT_header_c * const original_header,
    99 		u8_t *buffer,
   120 		u8_t *buffer,
   100 		const u32_t buffer_length,
   121 		const u32_t buffer_length,
   101 		const bool free_buffer,
   122 		const bool free_buffer,
   102 		const bool is_writable);
   123 		const bool is_writable);
   103 
   124 
   104 	EAP_FUNC_IMPORT bool get_payload_included() const;
   125 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H bool get_payload_included() const;
   105 
   126 
   106 	EAP_FUNC_IMPORT u32_t get_data_length() const;
   127 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H u32_t get_data_length() const;
   107 
   128 
   108 	EAP_FUNC_IMPORT u8_t * get_data(const u32_t data_length) const;
   129 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H u8_t * get_data(const u32_t data_length) const;
   109 
   130 
   110 	EAP_FUNC_IMPORT eap_variable_data_c * get_payload_buffer();
   131 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H eap_variable_data_c * get_payload_buffer();
   111 
   132 
   112 	EAP_FUNC_IMPORT eap_status_e reset();
   133 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H eap_status_e reset();
   113 
   134 
   114 	//--------------------------------------------------
   135 	//--------------------------------------------------
   115 }; // class gsmsim_variable_data_c
   136 }; // class gsmsim_variable_data_c
   116 
   137 
   117 
   138 
   118 //--------------------------------------------------
   139 //--------------------------------------------------
   119 
   140 
   120 
   141 
   121 // 
   142 // 
   122 class EAP_EXPORT gsmsim_payloads_c
   143 class EAP_CLASS_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_payloads_c
   123 {
   144 {
   124 private:
   145 private:
   125 	//--------------------------------------------------
   146 	//--------------------------------------------------
   126 
   147 
   127 	abs_eap_am_tools_c * const m_am_tools;
   148 	abs_eap_am_tools_c * const m_am_tools;
   187 		eap_gsmsim_payload_status_must_be,
   208 		eap_gsmsim_payload_status_must_be,
   188 		eap_gsmsim_payload_status_must_not_be
   209 		eap_gsmsim_payload_status_must_not_be
   189 	};
   210 	};
   190 
   211 
   191 
   212 
   192 	EAP_FUNC_IMPORT virtual ~gsmsim_payloads_c();
   213 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H virtual ~gsmsim_payloads_c();
   193 
   214 
   194 	EAP_FUNC_IMPORT gsmsim_payloads_c(
   215 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_payloads_c(
   195 		abs_eap_am_tools_c * const tools);
   216 		abs_eap_am_tools_c * const tools);
   196 
   217 
   197 	EAP_FUNC_IMPORT bool check_one_payload(
   218 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H bool check_one_payload(
   198 		const eap_gsmsim_payload_status_e status,
   219 		const eap_gsmsim_payload_status_e status,
   199 		const gsmsim_variable_data_c * const payload);
   220 		const gsmsim_variable_data_c * const payload);
   200 
   221 
   201 	/** This function checks the correct set of payloads are included in the message.
   222 	/** This function checks the correct set of payloads are included in the message.
   202 	 *  NOTE do not change the order of parameters.
   223 	 *  NOTE do not change the order of parameters.
   203 	 *  Add new payload type to the last of the parameter list.
   224 	 *  Add new payload type to the last of the parameter list.
   204 	 */
   225 	 */
   205 	EAP_FUNC_IMPORT bool check_payloads(
   226 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H bool check_payloads(
   206 		const eap_gsmsim_payload_status_e nonce_mt,
   227 		const eap_gsmsim_payload_status_e nonce_mt,
   207 		const eap_gsmsim_payload_status_e nonce_s,
   228 		const eap_gsmsim_payload_status_e nonce_s,
   208 		const eap_gsmsim_payload_status_e MAC,
   229 		const eap_gsmsim_payload_status_e MAC,
   209 		const eap_gsmsim_payload_status_e ENCR_DATA,
   230 		const eap_gsmsim_payload_status_e ENCR_DATA,
   210 		const eap_gsmsim_payload_status_e IDENTITY,
   231 		const eap_gsmsim_payload_status_e IDENTITY,
   223 		const eap_gsmsim_payload_status_e COUNTER_TOO_SMALL,
   244 		const eap_gsmsim_payload_status_e COUNTER_TOO_SMALL,
   224 		const eap_gsmsim_payload_status_e CLIENT_ERROR_CODE,
   245 		const eap_gsmsim_payload_status_e CLIENT_ERROR_CODE,
   225 		const eap_gsmsim_payload_status_e RESULT_IND
   246 		const eap_gsmsim_payload_status_e RESULT_IND
   226 		);
   247 		);
   227 
   248 
   228 	EAP_FUNC_IMPORT gsmsim_variable_data_c * get_NONCE_MT();
   249 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_variable_data_c * get_NONCE_MT();
   229 
   250 
   230 	EAP_FUNC_IMPORT gsmsim_variable_data_c * get_NONCE_S();
   251 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_variable_data_c * get_NONCE_S();
   231 
   252 
   232 	EAP_FUNC_IMPORT gsmsim_variable_data_c * get_MAC();
   253 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_variable_data_c * get_MAC();
   233 
   254 
   234 	EAP_FUNC_IMPORT gsmsim_variable_data_c * get_ENCR_DATA();
   255 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_variable_data_c * get_ENCR_DATA();
   235 
   256 
   236 	EAP_FUNC_IMPORT gsmsim_variable_data_c * get_IDENTITY_payload();
   257 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_variable_data_c * get_IDENTITY_payload();
   237 
   258 
   238 	EAP_FUNC_IMPORT gsmsim_variable_data_c * get_padding_payload();
   259 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_variable_data_c * get_padding_payload();
   239 
   260 
   240 	EAP_FUNC_IMPORT gsmsim_variable_data_c * get_n_RANDs();
   261 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_variable_data_c * get_n_RANDs();
   241 
   262 
   242 	EAP_FUNC_IMPORT gsmsim_variable_data_c * get_PERMANENT_ID_REQ();
   263 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_variable_data_c * get_PERMANENT_ID_REQ();
   243 
   264 
   244 	EAP_FUNC_IMPORT gsmsim_variable_data_c * get_FULLAUTH_ID_REQ();
   265 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_variable_data_c * get_FULLAUTH_ID_REQ();
   245 
   266 
   246 	EAP_FUNC_IMPORT gsmsim_variable_data_c * get_ANY_ID_REQ();
   267 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_variable_data_c * get_ANY_ID_REQ();
   247 
   268 
   248 	EAP_FUNC_IMPORT gsmsim_variable_data_c * get_IV();
   269 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_variable_data_c * get_IV();
   249 
   270 
   250 	EAP_FUNC_IMPORT gsmsim_variable_data_c * get_NEXT_PSEUDONYM();
   271 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_variable_data_c * get_NEXT_PSEUDONYM();
   251 
   272 
   252 	EAP_FUNC_IMPORT gsmsim_variable_data_c * get_NEXT_REAUTH_ID();
   273 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_variable_data_c * get_NEXT_REAUTH_ID();
   253 
   274 
   254 	EAP_FUNC_IMPORT gsmsim_variable_data_c * get_NOTIFICATION();
   275 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_variable_data_c * get_NOTIFICATION();
   255 
   276 
   256 	EAP_FUNC_IMPORT gsmsim_variable_data_c * get_RESULT_IND();
   277 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_variable_data_c * get_RESULT_IND();
   257 
   278 
   258 	EAP_FUNC_IMPORT gsmsim_variable_data_c * get_VERSION_LIST();
   279 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_variable_data_c * get_VERSION_LIST();
   259 
   280 
   260 	EAP_FUNC_IMPORT gsmsim_variable_data_c * get_SELECTED_VERSION();
   281 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_variable_data_c * get_SELECTED_VERSION();
   261 
   282 
   262 	EAP_FUNC_IMPORT gsmsim_variable_data_c * get_CLIENT_ERROR_CODE();
   283 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_variable_data_c * get_CLIENT_ERROR_CODE();
   263 
   284 
   264 	EAP_FUNC_IMPORT gsmsim_variable_data_c * get_COUNTER();
   285 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_variable_data_c * get_COUNTER();
   265 
   286 
   266 	EAP_FUNC_IMPORT gsmsim_variable_data_c * get_counter_too_small();
   287 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_variable_data_c * get_counter_too_small();
   267 
   288 
   268 
   289 
   269 	EAP_FUNC_IMPORT void set_includes_unknown_attribute(const gsmsim_payload_AT_type_e unknown_payload);
   290 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H void set_includes_unknown_attribute(const gsmsim_payload_AT_type_e unknown_payload);
   270 
   291 
   271 	EAP_FUNC_IMPORT gsmsim_payload_AT_type_e get_includes_unknown_attribute();
   292 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H gsmsim_payload_AT_type_e get_includes_unknown_attribute();
   272 
   293 
   273 
   294 
   274 	EAP_FUNC_IMPORT void set_includes_other_version_than_1(const bool includes_other_version_than_1);
   295 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H void set_includes_other_version_than_1(const bool includes_other_version_than_1);
   275 
   296 
   276 	EAP_FUNC_IMPORT bool get_includes_other_version_than_1();
   297 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H bool get_includes_other_version_than_1();
   277 
   298 
   278 
   299 
   279 	EAP_FUNC_IMPORT bool get_is_valid() const;
   300 	EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_PAYLOADS_H bool get_is_valid() const;
   280 
   301 
   281 	//--------------------------------------------------
   302 	//--------------------------------------------------
   282 }; // class gsmsim_payloads_c
   303 }; // class gsmsim_payloads_c
   283 
   304 
   284 
   305