eapol/eapol_framework/eapol_common/am/include/eap_sim_triplets.h
changeset 49 43351a4f2da3
parent 26 9abfd4f00d37
equal deleted inserted replaced
47:712b4ffd76bb 49:43351a4f2da3
    23 #define _EAP_SIM_TRIPLETS_H_
    23 #define _EAP_SIM_TRIPLETS_H_
    24 
    24 
    25 //#include "eap_am_memory.h"
    25 //#include "eap_am_memory.h"
    26 #include "eap_tools.h"
    26 #include "eap_tools.h"
    27 #include "eap_am_export.h"
    27 #include "eap_am_export.h"
       
    28 // Start: added by script change_export_macros.sh.
       
    29 #if defined(EAP_NO_EXPORT_EAP_SIM_TRIPLETS_H)
       
    30 	#define EAP_CLASS_VISIBILITY_EAP_SIM_TRIPLETS_H EAP_NONSHARABLE 
       
    31 	#define EAP_FUNC_VISIBILITY_EAP_SIM_TRIPLETS_H 
       
    32 	#define EAP_C_FUNC_VISIBILITY_EAP_SIM_TRIPLETS_H 
       
    33 	#define EAP_FUNC_EXPORT_EAP_SIM_TRIPLETS_H 
       
    34 	#define EAP_C_FUNC_EXPORT_EAP_SIM_TRIPLETS_H 
       
    35 #elif defined(EAP_EXPORT_EAP_SIM_TRIPLETS_H)
       
    36 	#define EAP_CLASS_VISIBILITY_EAP_SIM_TRIPLETS_H EAP_EXPORT 
       
    37 	#define EAP_FUNC_VISIBILITY_EAP_SIM_TRIPLETS_H EAP_FUNC_EXPORT 
       
    38 	#define EAP_C_FUNC_VISIBILITY_EAP_SIM_TRIPLETS_H EAP_C_FUNC_EXPORT 
       
    39 	#define EAP_FUNC_EXPORT_EAP_SIM_TRIPLETS_H EAP_FUNC_EXPORT 
       
    40 	#define EAP_C_FUNC_EXPORT_EAP_SIM_TRIPLETS_H EAP_C_FUNC_EXPORT 
       
    41 #else
       
    42 	#define EAP_CLASS_VISIBILITY_EAP_SIM_TRIPLETS_H EAP_IMPORT 
       
    43 	#define EAP_FUNC_VISIBILITY_EAP_SIM_TRIPLETS_H EAP_FUNC_IMPORT 
       
    44 	#define EAP_C_FUNC_VISIBILITY_EAP_SIM_TRIPLETS_H EAP_C_FUNC_IMPORT 
       
    45 	#define EAP_FUNC_EXPORT_EAP_SIM_TRIPLETS_H 
       
    46 	#define EAP_C_FUNC_EXPORT_EAP_SIM_TRIPLETS_H 
       
    47 #endif
       
    48 // End: added by script change_export_macros.sh.
    28 #include "eap_variable_data.h"
    49 #include "eap_variable_data.h"
    29 
    50 
    30 
    51 
    31 //-----------------------------------------------
    52 //-----------------------------------------------
    32 
    53 
    33 const u32_t SIM_RAND_LENGTH = 16u;
    54 const u32_t SIM_RAND_LENGTH = 16u;
    34 const u32_t SIM_KC_LENGTH   = 8u;
    55 const u32_t SIM_KC_LENGTH   = 8u;
    35 const u32_t SIM_SRES_LENGTH = 4u;
    56 const u32_t SIM_SRES_LENGTH = 4u;
    36 
    57 
    37 
    58 
    38 class EAP_EXPORT eap_type_saesim_triplet_c
    59 class EAP_CLASS_VISIBILITY_EAP_SIM_TRIPLETS_H eap_type_saesim_triplet_c
    39 {
    60 {
    40 private:
    61 private:
    41 
    62 
    42 	eap_variable_data_c *m_kc;
    63 	eap_variable_data_c *m_kc;
    43 	eap_variable_data_c *m_rand;
    64 	eap_variable_data_c *m_rand;
    44 	eap_variable_data_c *m_sres;
    65 	eap_variable_data_c *m_sres;
    45 	bool m_is_valid;
    66 	bool m_is_valid;
    46 
    67 
    47 public:
    68 public:
    48 
    69 
    49 	EAP_FUNC_IMPORT virtual ~eap_type_saesim_triplet_c();
    70 	EAP_FUNC_VISIBILITY_EAP_SIM_TRIPLETS_H virtual ~eap_type_saesim_triplet_c();
    50 
    71 
    51 	EAP_FUNC_IMPORT eap_type_saesim_triplet_c(
    72 	EAP_FUNC_VISIBILITY_EAP_SIM_TRIPLETS_H eap_type_saesim_triplet_c(
    52 		abs_eap_am_tools_c * const tools
    73 		abs_eap_am_tools_c * const tools
    53 		);
    74 		);
    54 
    75 
    55 	EAP_FUNC_IMPORT void reset();
    76 	EAP_FUNC_VISIBILITY_EAP_SIM_TRIPLETS_H void reset();
    56 
    77 
    57 	EAP_FUNC_IMPORT eap_status_e set_triplet(
    78 	EAP_FUNC_VISIBILITY_EAP_SIM_TRIPLETS_H eap_status_e set_triplet(
    58 		eap_variable_data_c * const kc,
    79 		eap_variable_data_c * const kc,
    59 		eap_variable_data_c * const rand,
    80 		eap_variable_data_c * const rand,
    60 		eap_variable_data_c * const sres
    81 		eap_variable_data_c * const sres
    61 		);
    82 		);
    62 
    83 
    63 	EAP_FUNC_IMPORT eap_type_saesim_triplet_c * copy(
    84 	EAP_FUNC_VISIBILITY_EAP_SIM_TRIPLETS_H eap_type_saesim_triplet_c * copy(
    64 		abs_eap_am_tools_c * const tools
    85 		abs_eap_am_tools_c * const tools
    65 		);
    86 		);
    66 
    87 
    67 	EAP_FUNC_IMPORT void set_is_valid();
    88 	EAP_FUNC_VISIBILITY_EAP_SIM_TRIPLETS_H void set_is_valid();
    68 
    89 
    69 	EAP_FUNC_IMPORT bool get_is_valid();
    90 	EAP_FUNC_VISIBILITY_EAP_SIM_TRIPLETS_H bool get_is_valid();
    70 
    91 
    71 	EAP_FUNC_IMPORT eap_variable_data_c *get_kc();
    92 	EAP_FUNC_VISIBILITY_EAP_SIM_TRIPLETS_H eap_variable_data_c *get_kc();
    72 
    93 
    73 	EAP_FUNC_IMPORT eap_variable_data_c *get_rand();
    94 	EAP_FUNC_VISIBILITY_EAP_SIM_TRIPLETS_H eap_variable_data_c *get_rand();
    74 
    95 
    75 	EAP_FUNC_IMPORT eap_variable_data_c *get_sres();
    96 	EAP_FUNC_VISIBILITY_EAP_SIM_TRIPLETS_H eap_variable_data_c *get_sres();
    76 };
    97 };
    77 
    98 
    78 //-----------------------------------------------
    99 //-----------------------------------------------
    79 
   100 
    80 class EAP_EXPORT eap_type_sim_triplet_array_c
   101 class EAP_CLASS_VISIBILITY_EAP_SIM_TRIPLETS_H eap_type_sim_triplet_array_c
    81 {
   102 {
    82 private:
   103 private:
    83 
   104 
    84 	u32_t m_triplet_count;
   105 	u32_t m_triplet_count;
    85 	eap_type_saesim_triplet_c **m_array;
   106 	eap_type_saesim_triplet_c **m_array;
    86 	abs_eap_am_tools_c * m_am_tools;
   107 	abs_eap_am_tools_c * m_am_tools;
    87 
   108 
    88 public:
   109 public:
    89 
   110 
    90 	EAP_FUNC_IMPORT virtual ~eap_type_sim_triplet_array_c();
   111 	EAP_FUNC_VISIBILITY_EAP_SIM_TRIPLETS_H virtual ~eap_type_sim_triplet_array_c();
    91 
   112 
    92 	EAP_FUNC_IMPORT eap_type_sim_triplet_array_c(
   113 	EAP_FUNC_VISIBILITY_EAP_SIM_TRIPLETS_H eap_type_sim_triplet_array_c(
    93 		abs_eap_am_tools_c * const tools
   114 		abs_eap_am_tools_c * const tools
    94 		);
   115 		);
    95 
   116 
    96 	EAP_FUNC_IMPORT eap_status_e set_triplet_count(
   117 	EAP_FUNC_VISIBILITY_EAP_SIM_TRIPLETS_H eap_status_e set_triplet_count(
    97 		const u32_t triplet_count
   118 		const u32_t triplet_count
    98 		);
   119 		);
    99 
   120 
   100 	EAP_FUNC_IMPORT eap_type_saesim_triplet_c * add_triplet();
   121 	EAP_FUNC_VISIBILITY_EAP_SIM_TRIPLETS_H eap_type_saesim_triplet_c * add_triplet();
   101 
   122 
   102 	EAP_FUNC_IMPORT eap_type_saesim_triplet_c * get_triplet(abs_eap_am_tools_c * const m_am_tools, u32_t index);
   123 	EAP_FUNC_VISIBILITY_EAP_SIM_TRIPLETS_H eap_type_saesim_triplet_c * get_triplet(abs_eap_am_tools_c * const m_am_tools, u32_t index);
   103 
   124 
   104 	EAP_FUNC_IMPORT eap_status_e set_triplet(u32_t index, eap_type_saesim_triplet_c * const triplet);
   125 	EAP_FUNC_VISIBILITY_EAP_SIM_TRIPLETS_H eap_status_e set_triplet(u32_t index, eap_type_saesim_triplet_c * const triplet);
   105 
   126 
   106 	EAP_FUNC_IMPORT u32_t get_triplet_count();
   127 	EAP_FUNC_VISIBILITY_EAP_SIM_TRIPLETS_H u32_t get_triplet_count();
   107 
   128 
   108 	EAP_FUNC_IMPORT eap_type_sim_triplet_array_c * copy();
   129 	EAP_FUNC_VISIBILITY_EAP_SIM_TRIPLETS_H eap_type_sim_triplet_array_c * copy();
   109 
   130 
   110 	EAP_FUNC_IMPORT void reset();
   131 	EAP_FUNC_VISIBILITY_EAP_SIM_TRIPLETS_H void reset();
   111 
   132 
   112 };
   133 };
   113 
   134 
   114 
   135 
   115 #endif //#if !defined(_EAP_SIM_TRIPLETS_H_)
   136 #endif //#if !defined(_EAP_SIM_TRIPLETS_H_)