accesssec_plat/eap_type_api/inc/EapTypePlugin.h
changeset 49 43351a4f2da3
parent 47 712b4ffd76bb
equal deleted inserted replaced
47:712b4ffd76bb 49:43351a4f2da3
     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 * %version: 8 %
       
    20 */
       
    21 
       
    22 #ifndef _EAP_TYPE_PLUGIN_H_
       
    23 #define _EAP_TYPE_PLUGIN_H_
       
    24 
       
    25 // INCLUDES
       
    26 #include <e32base.h>
       
    27 #include <ecom/ecom.h> 
       
    28 
       
    29 #include <EapSettings.h>
       
    30 #include <EapTypeDefinitions.h>
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 class abs_eap_am_tools_c;
       
    34 class eap_base_type_c;
       
    35 class abs_eap_base_type_c;
       
    36 class CEapTypeInfo;
       
    37 class eap_am_network_id_c;
       
    38 
       
    39 #ifndef RD_WLAN_3_1_BACKPORTING
       
    40 class abs_eap_configuration_if_c;
       
    41 #endif
       
    42 
       
    43 
       
    44 // CLASS DECLARATION
       
    45 
       
    46 /**
       
    47 * The interface class for direct EAP plug-in access.
       
    48 * Includes methods to create either the configuration interface or the EAP protocol interface.
       
    49 */
       
    50 class CEapTypePlugin
       
    51 : public CBase
       
    52 {
       
    53 public:
       
    54 
       
    55 	/**
       
    56 	* Factory function that loads the EAP type implementation DLL (plug-in).
       
    57 	* Uses ECom architecture to load the correct EAP type DLL. Calls the initialization
       
    58 	* function of the EAP type
       
    59 	* @param aCue EAP type id that specifies which plugin is loaded.
       
    60 	* @param aIndexType Indicates the bearer used for this connection.
       
    61 	* @param aIndex Index for the connection. aIndexType and aIndex uniquely specify the connection.
       
    62 	* @return Pointer to the implementation.
       
    63 	*/
       
    64 	inline static CEapTypePlugin* NewL(const TDesC8& aCue, TIndexType aIndexType, TInt aIndex);	
       
    65 
       
    66 	/**
       
    67 	* Unloads the implementation DLL.
       
    68 	*/
       
    69 	inline virtual ~CEapTypePlugin();
       
    70 
       
    71 	/**
       
    72 	* Creates EAP protocol interface implementation. Instances an object that
       
    73 	* has been derived from eap_base_type_c that handles the communication 
       
    74 	* with EAP stack. 
       
    75 	* @param aTools Pointer to tools class.
       
    76 	* @param aPartner Used for callbacks to the stack.
       
    77 	* @param is_client_when_true Specifies whether the EAP type acts as a client or server.
       
    78 	* @param receive_network_id Network addresses
       
    79 	* @param eap_config_if Pointer used for call back to creater of stack (eapol_am_wlan_authentication_symbian_c class).
       
    80 	* @return Pointer to the implementation.
       
    81 	*/		
       
    82 	virtual eap_base_type_c* GetStackInterfaceL(abs_eap_am_tools_c* const aTools, 
       
    83 											   abs_eap_base_type_c* const aPartner,
       
    84 											   const bool is_client_when_true,
       
    85 											   const eap_am_network_id_c * const receive_network_id,
       
    86 											   abs_eap_configuration_if_c * const configuration_if) = 0;
       
    87 
       
    88 #if 0
       
    89 #ifndef RD_WLAN_3_1_BACKPORTING
       
    90 
       
    91 #else
       
    92 
       
    93 	/**
       
    94 	* Creates EAP protocol interface implementation. Instances an object that
       
    95 	* has been derived from eap_base_type_c that handles the communication 
       
    96 	* with EAP stack. 
       
    97 	* @param aTools Pointer to tools class.
       
    98 	* @param aPartner Used for callbacks to the stack.
       
    99 	* @param is_client_when_true Specifies whether the EAP type acts as a client or server.
       
   100 	* @param receive_network_id Network addresses
       
   101 	* @return Pointer to the implementation.
       
   102 	*/		
       
   103 
       
   104 	virtual eap_base_type_c* GetStackInterfaceL(abs_eap_am_tools_c* const aTools, 
       
   105 											   abs_eap_base_type_c* const aPartner,
       
   106 											   const bool is_client_when_true,
       
   107 											   const eap_am_network_id_c * const receive_network_id) = 0;
       
   108 	
       
   109 #endif // #ifndef RD_WLAN_3_1_BACKPORTING
       
   110 #endif
       
   111 
       
   112 
       
   113 	
       
   114 	/**
       
   115 	* Gets information about EAP type. 
       
   116 	* @return Pointer to a class that contains the EAP type information. Also pushed to cleanup stack.
       
   117 	*/
       
   118 	virtual CEapTypeInfo* GetInfoL() = 0;
       
   119 	
       
   120 	/**
       
   121 	* Deletes EAP type configuration
       
   122 	*/	
       
   123 	virtual void DeleteConfigurationL() = 0;
       
   124 
       
   125 	/**
       
   126 	* Returns the version of the interface that the EAP type implements.
       
   127 	* The client-side of the interface must always check the version with this function 
       
   128 	* and not call the functions that are not implemented. New functions must be
       
   129 	* added to the end of the interface so that the order of the old functions
       
   130 	* does not change.
       
   131 	* @return Integer indicating the version.
       
   132 	*/
       
   133 	virtual TUint GetInterfaceVersion() = 0;
       
   134 
       
   135 	/**
       
   136 	* Parses the opaque_data field in CImplementationInformation and returns true if
       
   137 	* string NOT_OUTSIDE_PEAP is found.
       
   138 	* @param aImplInfo Implementation info returned by ListImplementations call
       
   139 	* @return Boolean
       
   140 	*/
       
   141 	inline static TBool IsDisallowedOutsidePEAP(const CImplementationInformation& aImplInfo);
       
   142 
       
   143 	/**
       
   144 	* Parses the opaque_data field in CImplementationInformation and returns true if
       
   145 	* string NOT_INSIDE_PEAP is found.
       
   146 	* @param aImplInfo Implementation info returned by ListImplementations call
       
   147 	* @return Boolean
       
   148 	*/	
       
   149 	inline static TBool IsDisallowedInsidePEAP(const CImplementationInformation& aImplInfo);
       
   150 
       
   151 	/**
       
   152 	* Parses the opaque_data field in CImplementationInformation and returns true if
       
   153 	* string NOT_INSIDE_TTLS is found.
       
   154 	* @param aImplInfo Implementation info returned by ListImplementations call
       
   155 	* @return Boolean
       
   156 	*/	
       
   157 	inline static TBool IsDisallowedInsideTTLS(const CImplementationInformation& aImplInfo);
       
   158 
       
   159 	/**
       
   160 	* Sets the tunneling type. This is used to indicate that this type is run inside another 
       
   161 	* EAP type. 
       
   162 	* @param aTunnelingType Type number for the tunneling type
       
   163 	*/	
       
   164 	virtual void SetTunnelingType(const TEapExpandedType aTunnelingType) = 0;
       
   165 	
       
   166 	/**
       
   167 	* Changes the index of the saved parameters.
       
   168 	* @param aIndexType Indicates the bearer used for this connection.
       
   169 	* @param aIndex Index for the connection. aIndexType and aIndex uniquely specify the connection.
       
   170 	*/
       
   171 	virtual void SetIndexL(
       
   172 		const TIndexType aIndexType, 
       
   173 		const TInt aIndex) = 0;
       
   174 
       
   175 	/**
       
   176 	* Sets the EAP types configuration
       
   177 	* @param aSettings Structure containing the settings
       
   178 	*/
       
   179 	virtual void SetConfigurationL(const EAPSettings& aSettings) = 0;
       
   180 
       
   181 	/**
       
   182 	* Gets the EAP types configuration
       
   183 	* @param aSettings Structure containing the settings
       
   184 	*/
       
   185 	virtual void GetConfigurationL(EAPSettings& aSettings) = 0;
       
   186 	
       
   187 	/**
       
   188 	* Copies the EAP types configuration
       
   189 	* @param aDestinationIndexType index type of the destination, ELan for WLAN.
       
   190 	* @param aDestinationIndex ID to where copy the settings.
       
   191 	*/
       
   192 	virtual void CopySettingsL(
       
   193 		const TIndexType aDestinationIndexType, 
       
   194 		const TInt aDestinationIndex) = 0;
       
   195 
       
   196 
       
   197 private:
       
   198 
       
   199 	/// ECom uses this key to keep track of DLL usage.
       
   200 	TUid iDtor_ID_Key;
       
   201 };
       
   202 
       
   203 #include "EapTypePlugin.inl"
       
   204 
       
   205 #endif // _EAP_TYPE_PLUGIN_H_
       
   206 
       
   207 // End of file