eapol/eapol_framework/eapol_common/am/include/eap_am_memory_store.h
changeset 52 c23bdf5a328a
parent 33 938269283a16
equal deleted inserted replaced
51:e863583e6720 52:c23bdf5a328a
    26 
    26 
    27 #include "abs_eap_base_type.h"
    27 #include "abs_eap_base_type.h"
    28 #include "eap_am_memory_store_data.h"
    28 #include "eap_am_memory_store_data.h"
    29 #include "eap_core_map.h"
    29 #include "eap_core_map.h"
    30 #include "eap_tlv_message_data.h"
    30 #include "eap_tlv_message_data.h"
       
    31 #include "eap_am_export.h"
       
    32 // Start: added by script change_export_macros.sh.
       
    33 #if defined(EAP_NO_EXPORT_EAP_AM_MEMORY_STORE_H)
       
    34 	#define EAP_CLASS_VISIBILITY_EAP_AM_MEMORY_STORE_H EAP_NONSHARABLE 
       
    35 	#define EAP_FUNC_VISIBILITY_EAP_AM_MEMORY_STORE_H 
       
    36 	#define EAP_C_FUNC_VISIBILITY_EAP_AM_MEMORY_STORE_H 
       
    37 	#define EAP_FUNC_EXPORT_EAP_AM_MEMORY_STORE_H 
       
    38 	#define EAP_C_FUNC_EXPORT_EAP_AM_MEMORY_STORE_H 
       
    39 #elif defined(EAP_EXPORT_EAP_AM_MEMORY_STORE_H)
       
    40 	#define EAP_CLASS_VISIBILITY_EAP_AM_MEMORY_STORE_H EAP_EXPORT 
       
    41 	#define EAP_FUNC_VISIBILITY_EAP_AM_MEMORY_STORE_H EAP_FUNC_EXPORT 
       
    42 	#define EAP_C_FUNC_VISIBILITY_EAP_AM_MEMORY_STORE_H EAP_C_FUNC_EXPORT 
       
    43 	#define EAP_FUNC_EXPORT_EAP_AM_MEMORY_STORE_H EAP_FUNC_EXPORT 
       
    44 	#define EAP_C_FUNC_EXPORT_EAP_AM_MEMORY_STORE_H EAP_C_FUNC_EXPORT 
       
    45 #else
       
    46 	#define EAP_CLASS_VISIBILITY_EAP_AM_MEMORY_STORE_H EAP_IMPORT 
       
    47 	#define EAP_FUNC_VISIBILITY_EAP_AM_MEMORY_STORE_H EAP_FUNC_IMPORT 
       
    48 	#define EAP_C_FUNC_VISIBILITY_EAP_AM_MEMORY_STORE_H EAP_C_FUNC_IMPORT 
       
    49 	#define EAP_FUNC_EXPORT_EAP_AM_MEMORY_STORE_H 
       
    50 	#define EAP_C_FUNC_EXPORT_EAP_AM_MEMORY_STORE_H 
       
    51 #endif
       
    52 // End: added by script change_export_macros.sh.
       
    53 
    31 
    54 
    32 
    55 
    33 /// This class is base class for data stored to memory store.
    56 /// This class is base class for data stored to memory store.
    34 /**
    57 /**
    35  * This class allows EAP objects store data to memory
    58  * This class allows EAP objects store data to memory
    54 
    77 
    55 	/// This indicates whether this object was generated successfully.
    78 	/// This indicates whether this object was generated successfully.
    56 	bool m_is_valid;
    79 	bool m_is_valid;
    57 
    80 
    58 	// This is documented in abs_eap_stack_interface_c::set_is_valid().
    81 	// This is documented in abs_eap_stack_interface_c::set_is_valid().
    59 	EAP_FUNC_IMPORT void set_is_valid();
    82 	EAP_FUNC_VISIBILITY_EAP_AM_MEMORY_STORE_H void set_is_valid();
    60 
    83 
    61 public:
    84 public:
    62 
    85 
    63 	EAP_FUNC_IMPORT virtual ~eap_am_memory_store_c();
    86 	EAP_FUNC_VISIBILITY_EAP_AM_MEMORY_STORE_H virtual ~eap_am_memory_store_c();
    64 
    87 
    65 	EAP_FUNC_IMPORT eap_am_memory_store_c(
    88 	EAP_FUNC_VISIBILITY_EAP_AM_MEMORY_STORE_H eap_am_memory_store_c(
    66 		abs_eap_am_tools_c * const tools);
    89 		abs_eap_am_tools_c * const tools);
    67 
    90 
    68 	EAP_FUNC_IMPORT eap_status_e shutdown();
    91 	EAP_FUNC_VISIBILITY_EAP_AM_MEMORY_STORE_H eap_status_e shutdown();
    69 
    92 
    70 	// This is documented in abs_eap_stack_interface_c::get_is_valid().
    93 	// This is documented in abs_eap_stack_interface_c::get_is_valid().
    71 	EAP_FUNC_IMPORT bool get_is_valid();
    94 	EAP_FUNC_VISIBILITY_EAP_AM_MEMORY_STORE_H bool get_is_valid();
    72 
    95 
    73 	/// Memory store is visible only during the eap_am_tools_c object is alive.
    96 	/// Memory store is visible only during the eap_am_tools_c object is alive.
    74 	/// This function add flat data to memory store.
    97 	/// This function add flat data to memory store.
    75 	/// You must format your data to eap_tlv_message_data_c object.
    98 	/// You must format your data to eap_tlv_message_data_c object.
    76 	/// Data is identified by key parameter.
    99 	/// Data is identified by key parameter.
    80 	/// Memory store is globally used by all EAP Core objects.
   103 	/// Memory store is globally used by all EAP Core objects.
    81 	/// Key must be good that other users do not use others data.
   104 	/// Key must be good that other users do not use others data.
    82 	/// Add the real data type as a string to the key and other identifiers
   105 	/// Add the real data type as a string to the key and other identifiers
    83 	/// that separate data between the other users that store same data type
   106 	/// that separate data between the other users that store same data type
    84 	/// to the memory store.
   107 	/// to the memory store.
    85 	EAP_FUNC_IMPORT virtual eap_status_e add_data(
   108 	EAP_FUNC_VISIBILITY_EAP_AM_MEMORY_STORE_H virtual eap_status_e add_data(
    86 		const eap_variable_data_c * const key,
   109 		const eap_variable_data_c * const key,
    87 		const eap_tlv_message_data_c * const data,
   110 		const eap_tlv_message_data_c * const data,
    88 		const u32_t timeout);
   111 		const u32_t timeout);
    89 
   112 
    90 	/// Memory store is visible only during the eap_am_tools_c object is alive.
   113 	/// Memory store is visible only during the eap_am_tools_c object is alive.
    95 	/// Memory store is globally used by all EAP Core objects.
   118 	/// Memory store is globally used by all EAP Core objects.
    96 	/// Key must be good that other users do not use others data.
   119 	/// Key must be good that other users do not use others data.
    97 	/// Add the real data type as a string to the key and other identifiers
   120 	/// Add the real data type as a string to the key and other identifiers
    98 	/// that separate data between the other users that store same data type
   121 	/// that separate data between the other users that store same data type
    99 	/// to the memory store.
   122 	/// to the memory store.
   100 	EAP_FUNC_IMPORT virtual eap_status_e get_data(
   123 	EAP_FUNC_VISIBILITY_EAP_AM_MEMORY_STORE_H virtual eap_status_e get_data(
   101 		const eap_variable_data_c * const key,
   124 		const eap_variable_data_c * const key,
   102 		eap_tlv_message_data_c * const data);
   125 		eap_tlv_message_data_c * const data);
   103 
   126 
   104 	/// Memory store is visible only during the eap_am_tools_c object is alive.
   127 	/// Memory store is visible only during the eap_am_tools_c object is alive.
   105 	/// This function removes data from memory store.
   128 	/// This function removes data from memory store.
   108 	/// Memory store is globally used by all EAP Core objects.
   131 	/// Memory store is globally used by all EAP Core objects.
   109 	/// Key must be good that other users do not use others data.
   132 	/// Key must be good that other users do not use others data.
   110 	/// Add the real data type as a string to the key and other identifiers
   133 	/// Add the real data type as a string to the key and other identifiers
   111 	/// that separate data between the other users that store same data type
   134 	/// that separate data between the other users that store same data type
   112 	/// to the memory store.
   135 	/// to the memory store.
   113 	EAP_FUNC_IMPORT eap_status_e remove_data(
   136 	EAP_FUNC_VISIBILITY_EAP_AM_MEMORY_STORE_H eap_status_e remove_data(
   114 		const eap_variable_data_c * const key);
   137 		const eap_variable_data_c * const key);
   115 
   138 
   116 
   139 
   117 	/**
   140 	/**
   118 	 * Function timer_expired() is called after the timer is elapsed.
   141 	 * Function timer_expired() is called after the timer is elapsed.
   119 	 * @param id and data are set by caller of abs_eap_am_tools::set_timer() function.
   142 	 * @param id and data are set by caller of abs_eap_am_tools::set_timer() function.
   120 	 * @param id could be used to separate different timer events.
   143 	 * @param id could be used to separate different timer events.
   121 	 * @param data could be pointer to any data that is needed in timer processing.
   144 	 * @param data could be pointer to any data that is needed in timer processing.
   122 	 */
   145 	 */
   123 	EAP_FUNC_IMPORT eap_status_e timer_expired(
   146 	EAP_FUNC_VISIBILITY_EAP_AM_MEMORY_STORE_H eap_status_e timer_expired(
   124 		const u32_t id, void *data);
   147 		const u32_t id, void *data);
   125 
   148 
   126 	/**
   149 	/**
   127 	 * This function is called when timer event is deleted.
   150 	 * This function is called when timer event is deleted.
   128 	 * Initialiser of the data must delete the data.
   151 	 * Initialiser of the data must delete the data.
   129 	 * Only the initializer knows the real type of data.
   152 	 * Only the initializer knows the real type of data.
   130 	 * @param id could be used to separate different timer events.
   153 	 * @param id could be used to separate different timer events.
   131 	 * @param data could be pointer to any data that is needed in timer processing.
   154 	 * @param data could be pointer to any data that is needed in timer processing.
   132 	 */
   155 	 */
   133 	EAP_FUNC_IMPORT eap_status_e timer_delete_data(
   156 	EAP_FUNC_VISIBILITY_EAP_AM_MEMORY_STORE_H eap_status_e timer_delete_data(
   134 		const u32_t id, void *data);
   157 		const u32_t id, void *data);
   135 };
   158 };
   136 
   159 
   137 //#endif //#if !defined(NO_EAP_AM_MEMORY_STORE)
   160 //#endif //#if !defined(NO_EAP_AM_MEMORY_STORE)
   138 
   161