eapol/eapol_framework/eapol_symbian/am/include/eapol_am_core_symbian_simulator.h
changeset 49 43351a4f2da3
parent 26 9abfd4f00d37
equal deleted inserted replaced
47:712b4ffd76bb 49:43351a4f2da3
    26 	#include <es_mbuf.h>
    26 	#include <es_mbuf.h>
    27 #endif
    27 #endif
    28 
    28 
    29 #include "eap_tools.h"
    29 #include "eap_tools.h"
    30 #include "eap_am_export.h"
    30 #include "eap_am_export.h"
       
    31 // Start: added by script change_export_macros.sh.
       
    32 #if defined(EAP_NO_EXPORT_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H)
       
    33 	#define EAP_CLASS_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H EAP_NONSHARABLE 
       
    34 	#define EAP_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H 
       
    35 	#define EAP_C_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H 
       
    36 	#define EAP_FUNC_EXPORT_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H 
       
    37 	#define EAP_C_FUNC_EXPORT_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H 
       
    38 #elif defined(EAP_EXPORT_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H)
       
    39 	#define EAP_CLASS_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H EAP_EXPORT 
       
    40 	#define EAP_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H EAP_FUNC_EXPORT 
       
    41 	#define EAP_C_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H EAP_C_FUNC_EXPORT 
       
    42 	#define EAP_FUNC_EXPORT_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H EAP_FUNC_EXPORT 
       
    43 	#define EAP_C_FUNC_EXPORT_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H EAP_C_FUNC_EXPORT 
       
    44 #else
       
    45 	#define EAP_CLASS_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H EAP_IMPORT 
       
    46 	#define EAP_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H EAP_FUNC_IMPORT 
       
    47 	#define EAP_C_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H EAP_C_FUNC_IMPORT 
       
    48 	#define EAP_FUNC_EXPORT_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H 
       
    49 	#define EAP_C_FUNC_EXPORT_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H 
       
    50 #endif
       
    51 // End: added by script change_export_macros.sh.
    31 #include "abs_eapol_am_core_symbian_simulator.h"
    52 #include "abs_eapol_am_core_symbian_simulator.h"
    32 #include "abs_ethernet_core.h"
    53 #include "abs_ethernet_core.h"
    33 #include "ethernet_core.h"
    54 #include "ethernet_core.h"
    34 #include "eap_base_type.h"
    55 #include "eap_base_type.h"
    35 #include "eap_variable_data.h"
    56 #include "eap_variable_data.h"
    36 #include "eap_core_map.h"
    57 #include "eap_core_map.h"
    37 
    58 
    38 class CEapType;
    59 class CEapType;
    39 
    60 
    40 // 
    61 // 
    41 class EAP_EXPORT eapol_am_core_symbian_c
    62 class EAP_CLASS_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H eapol_am_core_symbian_c
    42 : public abs_ethernet_core_c
    63 : public abs_ethernet_core_c
    43 {
    64 {
    44 private:
    65 private:
    45 	//--------------------------------------------------
    66 	//--------------------------------------------------
    46 
    67 
    65 	bool m_shutdown_was_called;
    86 	bool m_shutdown_was_called;
    66 
    87 
    67 	RPointerArray<CEapType> m_plugin_if_array;
    88 	RPointerArray<CEapType> m_plugin_if_array;
    68 	RArray<eap_type_value_e> m_eap_type_array;
    89 	RArray<eap_type_value_e> m_eap_type_array;
    69 
    90 
    70 	EAP_FUNC_IMPORT eap_status_e random_error(
    91 	EAP_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H eap_status_e random_error(
    71 		eap_buf_chain_wr_c * const sent_packet);
    92 		eap_buf_chain_wr_c * const sent_packet);
    72 
    93 
    73 	//--------------------------------------------------
    94 	//--------------------------------------------------
    74 protected:
    95 protected:
    75 	//--------------------------------------------------
    96 	//--------------------------------------------------
    77 	//--------------------------------------------------
    98 	//--------------------------------------------------
    78 public:
    99 public:
    79 	//--------------------------------------------------
   100 	//--------------------------------------------------
    80 
   101 
    81 	// 
   102 	// 
    82 	EAP_FUNC_IMPORT virtual ~eapol_am_core_symbian_c();
   103 	EAP_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H virtual ~eapol_am_core_symbian_c();
    83 
   104 
    84 	// 
   105 	// 
    85 	EAP_FUNC_IMPORT eapol_am_core_symbian_c(
   106 	EAP_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H eapol_am_core_symbian_c(
    86 		abs_eap_am_tools_c * const m_am_tools,
   107 		abs_eap_am_tools_c * const m_am_tools,
    87 		abs_eapol_am_core_symbian_c * const partner,
   108 		abs_eapol_am_core_symbian_c * const partner,
    88 		const bool is_client_when_true);
   109 		const bool is_client_when_true);
    89 
   110 
    90 	//
   111 	//
    91 	EAP_FUNC_IMPORT eap_base_type_c * load_type(const eap_type_value_e type);
   112 	EAP_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H eap_base_type_c * load_type(const eap_type_value_e type);
    92 
   113 
    93 #if defined(USE_EAPOL_LLC_INTERFACE)
   114 #if defined(USE_EAPOL_LLC_INTERFACE)
    94 	//
   115 	//
    95 	EAP_FUNC_IMPORT eap_status_e packet_process(
   116 	EAP_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H eap_status_e packet_process(
    96 		RMBufChain& aPdu);
   117 		RMBufChain& aPdu);
    97 #endif //#if defined(USE_EAPOL_LLC_INTERFACE)
   118 #endif //#if defined(USE_EAPOL_LLC_INTERFACE)
    98 
   119 
    99 	//
   120 	//
   100 	EAP_FUNC_IMPORT eap_status_e packet_process(
   121 	EAP_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H eap_status_e packet_process(
   101 		const eap_am_network_id_c * const receive_network_id,
   122 		const eap_am_network_id_c * const receive_network_id,
   102 		eapol_ethernet_header_wr_c * const eth_header,
   123 		eapol_ethernet_header_wr_c * const eth_header,
   103 		const u32_t packet_length); 
   124 		const u32_t packet_length); 
   104 
   125 
   105 	//
   126 	//
   106 	EAP_FUNC_IMPORT eap_status_e packet_send(
   127 	EAP_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H eap_status_e packet_send(
   107 		const eap_am_network_id_c * const send_network_id,
   128 		const eap_am_network_id_c * const send_network_id,
   108 		eap_buf_chain_wr_c * const sent_packet,
   129 		eap_buf_chain_wr_c * const sent_packet,
   109 		const u32_t header_offset,
   130 		const u32_t header_offset,
   110 		const u32_t data_length,
   131 		const u32_t data_length,
   111 		const u32_t buffer_length); 
   132 		const u32_t buffer_length); 
   116 	{
   137 	{
   117 		return m_own_address.set_copy_of_buffer(address, length);
   138 		return m_own_address.set_copy_of_buffer(address, length);
   118 	}
   139 	}
   119 
   140 
   120 	//
   141 	//
   121 	EAP_FUNC_IMPORT u32_t get_header_offset(
   142 	EAP_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H u32_t get_header_offset(
   122 		u32_t * const MTU,
   143 		u32_t * const MTU,
   123 		u32_t * const trailer_length);
   144 		u32_t * const trailer_length);
   124 
   145 
   125 	//
   146 	//
   126 	EAP_FUNC_IMPORT eap_status_e eap_acknowledge(const eap_am_network_id_c * const receive_network_id); 
   147 	EAP_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H eap_status_e eap_acknowledge(const eap_am_network_id_c * const receive_network_id); 
   127 
   148 
   128 	//
   149 	//
   129 	EAP_FUNC_IMPORT eap_status_e load_module(
   150 	EAP_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H eap_status_e load_module(
   130 		const eap_type_value_e type,
   151 		const eap_type_value_e type,
   131 		const eap_type_value_e /* tunneling_type */,
   152 		const eap_type_value_e /* tunneling_type */,
   132 		abs_eap_base_type_c * const partner,
   153 		abs_eap_base_type_c * const partner,
   133 		eap_base_type_c ** const eap_type,
   154 		eap_base_type_c ** const eap_type,
   134 		const bool is_client_when_true,
   155 		const bool is_client_when_true,
   135 		const eap_am_network_id_c * const receive_network_id);
   156 		const eap_am_network_id_c * const receive_network_id);
   136 
   157 
   137 	//
   158 	//
   138 	EAP_FUNC_IMPORT eap_status_e unload_module(const eap_type_value_e type); 
   159 	EAP_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H eap_status_e unload_module(const eap_type_value_e type); 
   139 
   160 
   140 	/**
   161 	/**
   141 	 * This function starts the EAP-authentication.
   162 	 * This function starts the EAP-authentication.
   142 	 * The first parameter includes the network addresses of the protocol
   163 	 * The first parameter includes the network addresses of the protocol
   143 	 * over the EAP-packets are transmitted.
   164 	 * over the EAP-packets are transmitted.
   147 	 * Value eapol_ethernet_type_e::eapol_ethernet_type_pae starts normal EA-authentication.
   168 	 * Value eapol_ethernet_type_e::eapol_ethernet_type_pae starts normal EA-authentication.
   148 	 * Value eapol_ethernet_type_e::eapol_ethernet_type_preauthentication starts 802.11i preauthentication.
   169 	 * Value eapol_ethernet_type_e::eapol_ethernet_type_preauthentication starts 802.11i preauthentication.
   149 	 * The second parameter is_client_when_true tells whether this stack
   170 	 * The second parameter is_client_when_true tells whether this stack
   150 	 * is client (true) or server (false).
   171 	 * is client (true) or server (false).
   151 	 */ 
   172 	 */ 
   152 	EAP_FUNC_IMPORT eap_status_e start_authentication(
   173 	EAP_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H eap_status_e start_authentication(
   153 		const eap_am_network_id_c * const receive_network_id,
   174 		const eap_am_network_id_c * const receive_network_id,
   154 		const bool is_client_when_true);
   175 		const bool is_client_when_true);
   155 
   176 
   156 	EAP_FUNC_IMPORT eap_status_e send_logoff(const eap_am_network_id_c * const receive_network_id);
   177 	EAP_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H eap_status_e send_logoff(const eap_am_network_id_c * const receive_network_id);
   157 
   178 
   158 	EAP_FUNC_IMPORT_EMPTY void set_is_valid()
   179 	EAP_FUNC_IMPORT_EMPTY void set_is_valid()
   159 	{
   180 	{
   160 		m_is_valid = true;
   181 		m_is_valid = true;
   161 	}
   182 	}
   183 	bool get_is_client()
   204 	bool get_is_client()
   184 	{
   205 	{
   185 		return m_is_client;
   206 		return m_is_client;
   186 	}
   207 	}
   187 
   208 
   188 	EAP_FUNC_IMPORT eap_status_e configure();
   209 	EAP_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H eap_status_e configure();
   189 
   210 
   190 	EAP_FUNC_IMPORT eap_status_e shutdown();
   211 	EAP_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H eap_status_e shutdown();
   191 
   212 
   192 	/**
   213 	/**
   193 	 * Note this function is just an example. Parameters will change later.
   214 	 * Note this function is just an example. Parameters will change later.
   194 	 * The packet_data_crypto_keys() function gives the generated keys to lower level.
   215 	 * The packet_data_crypto_keys() function gives the generated keys to lower level.
   195 	 * After EAP-authentication has generated the keys it calls this function
   216 	 * After EAP-authentication has generated the keys it calls this function
   196 	 * to offer the keys to lower level.
   217 	 * to offer the keys to lower level.
   197 	 * @see abs_eap_base_type_c::packet_data_crypto_keys().
   218 	 * @see abs_eap_base_type_c::packet_data_crypto_keys().
   198 	 */
   219 	 */
   199 	EAP_FUNC_IMPORT eap_status_e packet_data_crypto_keys(
   220 	EAP_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H eap_status_e packet_data_crypto_keys(
   200 		const eap_am_network_id_c * const send_network_id,
   221 		const eap_am_network_id_c * const send_network_id,
   201 		const eap_master_session_key_c * const master_session_key);
   222 		const eap_master_session_key_c * const master_session_key);
   202 
   223 
   203 	EAP_FUNC_IMPORT eap_status_e read_configure(
   224 	EAP_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H eap_status_e read_configure(
   204 		const eap_configuration_field_c * const field,
   225 		const eap_configuration_field_c * const field,
   205 		eap_variable_data_c * const data);
   226 		eap_variable_data_c * const data);
   206 
   227 
   207 	EAP_FUNC_IMPORT eap_status_e write_configure(
   228 	EAP_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H eap_status_e write_configure(
   208 		const eap_configuration_field_c * const field,
   229 		const eap_configuration_field_c * const field,
   209 		eap_variable_data_c * const data);
   230 		eap_variable_data_c * const data);
   210 
   231 
   211 	// See abs_eap_base_type_c::state_notification().
   232 	// See abs_eap_base_type_c::state_notification().
   212 	void state_notification(
   233 	void state_notification(
   214 	{
   235 	{
   215 		m_partner->state_notification(state);
   236 		m_partner->state_notification(state);
   216 	}
   237 	}
   217 
   238 
   218 	//
   239 	//
   219 	EAP_FUNC_IMPORT eap_status_e set_timer(
   240 	EAP_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H eap_status_e set_timer(
   220 		abs_eap_base_timer_c * const p_initializer, 
   241 		abs_eap_base_timer_c * const p_initializer, 
   221 		const u32_t p_id, 
   242 		const u32_t p_id, 
   222 		void * const p_data,
   243 		void * const p_data,
   223 		const u32_t p_time_ms);
   244 		const u32_t p_time_ms);
   224 
   245 
   225 	EAP_FUNC_IMPORT eap_status_e cancel_timer(
   246 	EAP_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H eap_status_e cancel_timer(
   226 		abs_eap_base_timer_c * const p_initializer, 
   247 		abs_eap_base_timer_c * const p_initializer, 
   227 		const u32_t p_id);
   248 		const u32_t p_id);
   228 
   249 
   229 	//
   250 	//
   230 	EAP_FUNC_IMPORT eap_status_e cancel_all_timers();
   251 	EAP_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H eap_status_e cancel_all_timers();
   231 
   252 
   232 	//
   253 	//
   233 	EAP_FUNC_IMPORT eap_status_e check_is_valid_eap_type(const eap_type_value_e eap_type);
   254 	EAP_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H eap_status_e check_is_valid_eap_type(const eap_type_value_e eap_type);
   234 
   255 
   235 	//
   256 	//
   236 	EAP_FUNC_IMPORT eap_status_e get_eap_type_list(
   257 	EAP_FUNC_VISIBILITY_EAPOL_AM_CORE_SYMBIAN_SIMULATOR_H eap_status_e get_eap_type_list(
   237 		eap_array_c<eap_type_value_e> * const eap_type_list);
   258 		eap_array_c<eap_type_value_e> * const eap_type_list);
   238 
   259 
   239 	eap_status_e packet_data_session_key(
   260 	eap_status_e packet_data_session_key(
   240 		const eap_am_network_id_c * const send_network_id,
   261 		const eap_am_network_id_c * const send_network_id,
   241 		const eapol_session_key_c * const key);
   262 		const eapol_session_key_c * const key);