eapol/eapol_framework/wapi_symbian/include/wapi_am_wlan_authentication_symbian.h
changeset 17 8840d3e38314
equal deleted inserted replaced
2:1c7bc153c08e 17:8840d3e38314
       
     1 /*
       
     2 * ============================================================================
       
     3 *  Name        : ./accesssec/eapol/eapol_framework/wapi_symbian/include/wapi_am_wlan_authentication_symbian.h
       
     4 *  Part of     : WAPI / WAPI       *** Info from the SWAD
       
     5 *  Description : WAPI authentication
       
     6 *  Version     : %version: 13.1.1 % << Don't touch! Updated by Synergy at check-out.
       
     7 *
       
     8 *  Copyright © 2001-2009 Nokia.  All rights reserved.
       
     9 *  This material, including documentation and any related computer
       
    10 *  programs, is protected by copyright controlled by Nokia.  All
       
    11 *  rights are reserved.  Copying, including reproducing, storing,
       
    12 *  adapting or translating, any or all of this material requires the
       
    13 *  prior written consent of Nokia.  This material also contains
       
    14 *  confidential information which may not be disclosed to others
       
    15 *  without the prior written consent of Nokia.
       
    16 * ============================================================================
       
    17 * Template version: 4.2
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 #if !defined(_WAPI_AM_WLAN_AUTHENTICATION_SYMBIAN_H_)
       
    23 #define _WAPI_AM_WLAN_AUTHENTICATION_SYMBIAN_H_
       
    24 
       
    25 #include "eap_am_export.h"
       
    26 #include "wapi_am_wlan_authentication.h"
       
    27 #include "eapol_wlan_database_reference.h"
       
    28 #include "eap_am_network_id.h"
       
    29 #include "eap_array_algorithms.h"
       
    30 
       
    31 #include <e32base.h>
       
    32 #include <e32std.h>
       
    33 #include <d32dbms.h>
       
    34 
       
    35 #include <wdbifwlansettings.h>
       
    36 
       
    37 #include <EapType.h>
       
    38 
       
    39 
       
    40 // Full path is not needed. The database wapi.dat will be saved in the 
       
    41 // data cage path for DBMS. So it will be in "\private\100012a5\wapi.dat" in C: drive.
       
    42 // The maximum length of database name is 0x40 (KDbMaxName) , which is defined in d32dbms.h.
       
    43 
       
    44 _LIT(KWapiDatabaseName, "c:wapi.dat");
       
    45 
       
    46 
       
    47 class CEapType;
       
    48 class abs_wapi_am_wlan_authentication_c;
       
    49 class abs_eap_am_tools_c;
       
    50 class eap_file_config_c;
       
    51 
       
    52 /// This class declares the adaptation module of wapi_am_wlan_authentication_c.
       
    53 /// See comments of the functions from wapi_am_wlan_authentication_c.
       
    54 class EAP_EXPORT wapi_am_wlan_authentication_symbian_c
       
    55 : public CActive
       
    56 , public wapi_am_wlan_authentication_c
       
    57 {
       
    58 private:
       
    59 	//--------------------------------------------------
       
    60 
       
    61 	abs_wapi_am_wlan_authentication_c * m_am_partner;
       
    62 
       
    63 	abs_eap_am_tools_c * m_am_tools;
       
    64 
       
    65 	/// This is object to handle file configuration.
       
    66 	eap_file_config_c * m_fileconfig;
       
    67 
       
    68 	/// SSID of current network.
       
    69 	eap_variable_data_c m_SSID;
       
    70 
       
    71 	/// This pointer is abstract interface to reference of WLAN database of the current connection.
       
    72 	const abs_eapol_wlan_database_reference_if_c * m_wlan_database_reference;
       
    73 
       
    74 
       
    75 	/// Network identity of current connection.
       
    76 	eap_am_network_id_c m_receive_network_id;
       
    77 
       
    78 	/// WLAN security mode as defined in Symbian platform.
       
    79 	EWlanSecurityMode m_security_mode;
       
    80 
       
    81 	/// WLAN authentication type.
       
    82 	eapol_key_authentication_type_e m_selected_eapol_key_authentication_type;
       
    83 
       
    84 	/// This object is client (true).
       
    85 	bool m_is_client;
       
    86 
       
    87 	/// This object is valid (true).
       
    88 	bool m_is_valid;
       
    89 
       
    90 	/// WPA(2)-PSK
       
    91 	eap_variable_data_c m_wapi_preshared_key;
       
    92 
       
    93 	/// HAHS of WPA(2)-PSK 
       
    94 	eap_variable_data_c m_wapi_psk;
       
    95 	
       
    96 	// Iap Index, NULL if not initialized
       
    97 	TUint iIapIndex;
       
    98 	//--------------------------------------------------
       
    99 
       
   100 	/// Function reads one configuration value from database.
       
   101 	void ReadConfigureL(
       
   102 		eap_config_string fieldx,
       
   103 		const eap_configuration_field_c * const field,
       
   104 		const u32_t /*field_length*/,
       
   105 		eap_variable_data_c * const data);
       
   106 
       
   107 	/// Control function of this active-object.
       
   108 	void RunL();
       
   109 
       
   110 	/// Cancel function for active-object.
       
   111 	void DoCancel();
       
   112 
       
   113 	/// THis function reads the references to active Internet Access Point (IAP).
       
   114 	eap_status_e read_database_reference_values(
       
   115 		TIndexType * const type,
       
   116 		TUint * const index);
       
   117 
       
   118 
       
   119     // This function Gets Psk from commdbif
       
   120 	eap_status_e GetWlanConfigurationL(eap_variable_data_c * const wapi_psk );
       
   121 	
       
   122 	/// This function sends error notification to partner object.
       
   123 	void send_error_notification(const eap_status_e error);
       
   124 
       
   125 	//--------------------------------------------------
       
   126 public:
       
   127 	//--------------------------------------------------
       
   128 
       
   129 	// 
       
   130 	EAP_FUNC_IMPORT virtual ~wapi_am_wlan_authentication_symbian_c();
       
   131 
       
   132 	// 
       
   133 	EAP_FUNC_IMPORT wapi_am_wlan_authentication_symbian_c(
       
   134 		abs_eap_am_tools_c * const tools,
       
   135 		const bool is_client_when_true,
       
   136 		const abs_eapol_wlan_database_reference_if_c * const wlan_database_reference);
       
   137 
       
   138 
       
   139 	/// See comments of the functions from wapi_am_wlan_authentication_c.
       
   140 
       
   141 	EAP_FUNC_IMPORT bool get_is_valid();
       
   142 
       
   143 	EAP_FUNC_IMPORT eap_status_e configure();
       
   144 
       
   145 	EAP_FUNC_IMPORT eap_status_e shutdown();
       
   146 
       
   147 	EAP_FUNC_IMPORT eap_status_e set_am_partner(
       
   148 		abs_wapi_am_wlan_authentication_c * am_partner
       
   149 		);
       
   150 
       
   151 	EAP_FUNC_IMPORT eap_status_e reset_wapi_configuration();
       
   152 
       
   153 	EAP_FUNC_IMPORT eap_status_e set_wlan_parameters(
       
   154 		const eap_variable_data_c * const SSID,
       
   155 		const bool WPA_override_enabled,
       
   156 		const eap_variable_data_c * const wapi_preshared_key,
       
   157 		const eapol_key_authentication_type_e selected_eapol_key_authentication_type);
       
   158 
       
   159 	EAP_FUNC_IMPORT eap_status_e association(
       
   160 		const eap_am_network_id_c * const receive_network_id);
       
   161 
       
   162 	EAP_FUNC_IMPORT eap_status_e disassociation(
       
   163 		const eap_am_network_id_c * const receive_network_id ///< source includes remote address, destination includes local address.
       
   164 		);
       
   165 
       
   166 	EAP_FUNC_IMPORT eap_status_e get_wlan_configuration(
       
   167 		eap_variable_data_c * const wapi_psk);
       
   168 
       
   169 	/**
       
   170 	 * This function indicates finish of the authentication to adatation module.
       
   171 	 * @param when_true_successfull tells whether authentication was successfull (true) or not (false).
       
   172 	 * @param authentication_type tells the used WLAN authentication type.
       
   173 	 */
       
   174 	EAP_FUNC_EXPORT eap_status_e authentication_finished(
       
   175 		const bool when_true_successfull,
       
   176 		const eapol_key_authentication_type_e authentication_type);
       
   177 
       
   178 	EAP_FUNC_IMPORT eap_status_e read_configure(
       
   179 		const eap_configuration_field_c * const field,
       
   180 		eap_variable_data_c * const data);
       
   181 
       
   182 	EAP_FUNC_IMPORT eap_status_e write_configure(
       
   183 		const eap_configuration_field_c * const field,
       
   184 		eap_variable_data_c * const data);
       
   185 
       
   186 	EAP_FUNC_IMPORT eap_status_e set_timer(
       
   187 		abs_eap_base_timer_c * const initializer, 
       
   188 		const u32_t id, 
       
   189 		void * const data,
       
   190 		const u32_t p_time_ms);
       
   191 
       
   192 	EAP_FUNC_IMPORT eap_status_e cancel_timer(
       
   193 		abs_eap_base_timer_c * const initializer, 
       
   194 		const u32_t id);
       
   195 
       
   196 	EAP_FUNC_IMPORT eap_status_e cancel_all_timers();
       
   197 
       
   198 	EAP_FUNC_IMPORT void state_notification(
       
   199 		const abs_eap_state_notification_c * const state);
       
   200 
       
   201 	//--------------------------------------------------
       
   202 }; // class wapi_am_wlan_authentication_symbian_c
       
   203 
       
   204 #endif //#if !defined(_WAPI_AM_WLAN_AUTHENTICATION_SYMBIAN_H_)
       
   205 
       
   206 //--------------------------------------------------
       
   207 
       
   208 
       
   209 
       
   210 // End.