accesssec_plat/eap_type_api/inc/EapType.h
changeset 0 c8830336c852
child 2 1c7bc153c08e
equal deleted inserted replaced
-1:000000000000 0:c8830336c852
       
     1 /*
       
     2 * Copyright (c) 2001-2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  EAP and WLAN authentication protocols.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef _EAPTYPE_H_
       
    21 #define _EAPTYPE_H_
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <ecom/ecom.h> 
       
    26 
       
    27 #include <EapSettings.h>
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class abs_eap_am_tools_c;
       
    31 class eap_base_type_c;
       
    32 class abs_eap_base_type_c;
       
    33 class CEapTypeInfo;
       
    34 class eap_am_network_id_c;
       
    35 
       
    36 #ifndef RD_WLAN_3_1_BACKPORTING
       
    37 class abs_eap_configuration_if_c;
       
    38 #endif
       
    39 
       
    40 // LOCAL DATA
       
    41 // The UID for EAP plugin interface. ECom uses this.
       
    42 const TUid KEapTypeInterfaceUid = {0x101f8e4a};
       
    43 
       
    44 /// Possible services.
       
    45 enum TIndexType
       
    46 {
       
    47 	EDialoutISP,
       
    48 	EDialinISP,
       
    49 	EOutgoingGPRS,
       
    50 	ELan,
       
    51 	EVpn
       
    52 };
       
    53 
       
    54 struct SIapInfo {
       
    55 	TIndexType indexType;
       
    56 	TInt index;
       
    57 }; 
       
    58 
       
    59 // CLASS DECLARATION
       
    60 
       
    61 /**
       
    62 * The base interface class for EAP plug-in access.
       
    63 * Includes methods to create either the configuration interface or the EAP protocol interface.
       
    64 */
       
    65 class CEapType : public CBase  
       
    66 {
       
    67 public:
       
    68 
       
    69 	/**
       
    70 	* Factory function that loads the EAP type implementation DLL (plug-in).
       
    71 	* Uses ECom architecture to load the correct EAP type DLL. Calls the initialization
       
    72 	* function of the EAP type
       
    73 	* @param aCue EAP type id that specifies which plugin is loaded.
       
    74 	* @param aIndexType Indicates the bearer used for this connection.
       
    75 	* @param aIndex Index for the connection. aIndexType and aIndex uniquely specify the connection.
       
    76 	* @return Pointer to the implementation.
       
    77 	*/
       
    78 	inline static CEapType* NewL(const TDesC8& aCue, TIndexType aIndexType, TInt aIndex);	
       
    79 	
       
    80 	/**
       
    81 	* Unloads the implementation DLL.
       
    82 	*/
       
    83 	inline virtual ~CEapType();
       
    84 
       
    85 #ifndef RD_WLAN_3_1_BACKPORTING
       
    86 
       
    87 	/**
       
    88 	* Creates EAP protocol interface implementation. Instances an object that
       
    89 	* has been derived from eap_base_type_c that handles the communication 
       
    90 	* with EAP stack. 
       
    91 	* @param aTools Pointer to tools class.
       
    92 	* @param aPartner Used for callbacks to the stack.
       
    93 	* @param is_client_when_true Specifies whether the EAP type acts as a client or server.
       
    94 	* @param receive_network_id Network addresses
       
    95 	* @param eap_config_if Pointer used for call back to creater of stack (eapol_am_wlan_authentication_symbian_c class).
       
    96 	* @return Pointer to the implementation.
       
    97 	*/		
       
    98 	virtual eap_base_type_c* GetStackInterfaceL(abs_eap_am_tools_c* const aTools, 
       
    99 											   abs_eap_base_type_c* const aPartner,
       
   100 											   const bool is_client_when_true,
       
   101 											   const eap_am_network_id_c * const receive_network_id,
       
   102 											   abs_eap_configuration_if_c * const configuration_if) = 0;
       
   103 
       
   104 #else
       
   105 
       
   106 	/**
       
   107 	* Creates EAP protocol interface implementation. Instances an object that
       
   108 	* has been derived from eap_base_type_c that handles the communication 
       
   109 	* with EAP stack. 
       
   110 	* @param aTools Pointer to tools class.
       
   111 	* @param aPartner Used for callbacks to the stack.
       
   112 	* @param is_client_when_true Specifies whether the EAP type acts as a client or server.
       
   113 	* @param receive_network_id Network addresses
       
   114 	* @return Pointer to the implementation.
       
   115 	*/		
       
   116 
       
   117 	virtual eap_base_type_c* GetStackInterfaceL(abs_eap_am_tools_c* const aTools, 
       
   118 											   abs_eap_base_type_c* const aPartner,
       
   119 											   const bool is_client_when_true,
       
   120 											   const eap_am_network_id_c * const receive_network_id) = 0;
       
   121 	
       
   122 #endif // #ifndef RD_WLAN_3_1_BACKPORTING
       
   123 
       
   124 	/**
       
   125 	* Invokes the configuration UI. Displays a dialog for configuring the EAP type settings.
       
   126 	*/
       
   127 	virtual TInt InvokeUiL() = 0;
       
   128 	
       
   129 	/**
       
   130 	* Gets information about EAP type. 
       
   131 	* @return Pointer to a class that contains the EAP type information. Also pushed to cleanup stack.
       
   132 	*/
       
   133 	virtual CEapTypeInfo* GetInfoLC() = 0;
       
   134 	
       
   135 	/**
       
   136 	* Deletes EAP type configuration
       
   137 	*/	
       
   138 	virtual void DeleteConfigurationL() = 0;
       
   139 
       
   140 	/**
       
   141 	* Returns the version of the interface that the EAP type implements.
       
   142 	* The client-side of the interface must always check the version with this function 
       
   143 	* and not call the functions that are not implemented. New functions must be
       
   144 	* added to the end of the interface so that the order of the old functions
       
   145 	* does not change.
       
   146 	* @return Integer indicating the version.
       
   147 	*/
       
   148 	virtual TUint GetInterfaceVersion() = 0;
       
   149 
       
   150 	/**
       
   151 	* Parses the opaque_data field in CImplementationInformation and returns true if
       
   152 	* string NOT_OUTSIDE_PEAP is found.
       
   153 	* @param aImplInfo Implementation info returned by ListImplementations call
       
   154 	* @return Boolean
       
   155 	*/
       
   156 	inline static TBool IsDisallowedOutsidePEAP(const CImplementationInformation& aImplInfo);
       
   157 
       
   158 	/**
       
   159 	* Parses the opaque_data field in CImplementationInformation and returns true if
       
   160 	* string NOT_INSIDE_PEAP is found.
       
   161 	* @param aImplInfo Implementation info returned by ListImplementations call
       
   162 	* @return Boolean
       
   163 	*/	
       
   164 	inline static TBool IsDisallowedInsidePEAP(const CImplementationInformation& aImplInfo);
       
   165 
       
   166 	/**
       
   167 	* Parses the opaque_data field in CImplementationInformation and returns true if
       
   168 	* string NOT_INSIDE_TTLS is found.
       
   169 	* @param aImplInfo Implementation info returned by ListImplementations call
       
   170 	* @return Boolean
       
   171 	*/	
       
   172 	inline static TBool IsDisallowedInsideTTLS(const CImplementationInformation& aImplInfo);
       
   173 
       
   174 	/**
       
   175 	* Sets the tunneling type. This is used to indicate that this type is run inside another 
       
   176 	* EAP type. 
       
   177 	* @param aTunnelingType Type number for the tunneling type
       
   178 	*/	
       
   179 	virtual void SetTunnelingType(const TInt aTunnelingType) = 0;
       
   180 	
       
   181 	/**
       
   182 	* Changes the index of the saved parameters.
       
   183 	* @param aIndexType Indicates the bearer used for this connection.
       
   184 	* @param aIndex Index for the connection. aIndexType and aIndex uniquely specify the connection.
       
   185 	*/
       
   186 	virtual void SetIndexL(
       
   187 		const TIndexType aIndexType, 
       
   188 		const TInt aIndex) = 0;
       
   189 
       
   190 	/**
       
   191 	* Sets the EAP types configuration
       
   192 	* @param aSettings Structure containing the settings
       
   193 	*/
       
   194 	virtual void SetConfigurationL(const EAPSettings& aSettings) = 0;
       
   195 
       
   196 	/**
       
   197 	* Gets the EAP types configuration
       
   198 	* @param aSettings Structure containing the settings
       
   199 	*/
       
   200 	virtual void GetConfigurationL(EAPSettings& aSettings) = 0;
       
   201 	
       
   202 	/**
       
   203 	* Copies the EAP types configuration
       
   204 	* @param aDestinationIndexType index type of the destination, ELan for WLAN.
       
   205 	* @param aDestinationIndex ID to where copy the settings.
       
   206 	*/
       
   207 	virtual void CopySettingsL(
       
   208 		const TIndexType aDestinationIndexType, 
       
   209 		const TInt aDestinationIndex) = 0;
       
   210 
       
   211 
       
   212 private:
       
   213 
       
   214 	/// ECom uses this key to keep track of DLL usage.
       
   215 	TUid iDtor_ID_Key;
       
   216 };
       
   217 
       
   218 #include "EapType.inl"
       
   219 
       
   220 #endif // _EAPTYPE_H_
       
   221 
       
   222 // End of file