eapol/eapol_framework/eapol_symbian/am/include/EapAkaInterface.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 #ifndef _EAPAKAINTERFACE_H_
       
    20 #define _EAPAKAINTERFACE_H_
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include "eap_tools.h"
       
    25 #include "eap_am_type_aka_symbian.h"
       
    26 
       
    27 #include <etelmm.h>
       
    28 #include <rmmcustomapi.h>
       
    29 
       
    30 // CLASS DECLARATION
       
    31 /**
       
    32 * Class (active object) that handles the communications with the 3G SIM.
       
    33 */
       
    34 class CEapAkaInterface 
       
    35 : public CActive
       
    36 {
       
    37 public:
       
    38 
       
    39 	// For differentiating the query type.
       
    40 	enum TQueryType
       
    41 	{
       
    42 		EQueryNone,
       
    43 		EQueryIMSI,
       
    44 		EQueryRES
       
    45 	};
       
    46 	/**
       
    47 	* Initialisation function.
       
    48 	* @param aTools Tools class pointer.
       
    49 	* @param aParent Pointer to the parent class.
       
    50 	*/
       
    51 	static CEapAkaInterface* NewL(
       
    52 		abs_eap_am_tools_c* const aTools, 
       
    53 		eap_am_type_aka_symbian_c* const aParent);	
       
    54 
       
    55 	/**
       
    56 	* Destructor
       
    57 	*/ 
       
    58 	virtual ~CEapAkaInterface();
       
    59 
       
    60 	/**
       
    61 	* This function queries the IMSI from 3G SIM. After the request has been completed
       
    62 	* complete_SIM_imsi is called in the parent.
       
    63 	*/
       
    64 	void QueryIMSIL();
       
    65 
       
    66 	/**
       
    67 	* This function queries RES, CK, IK and AUTS from 3G SIM. After the request has been completed
       
    68 	* complete_AKA_RES_L is called in the parent.
       
    69 	* @param aRand Random value
       
    70 	* @param aAUTN Authentication Token
       
    71 	*/
       
    72 	void QueryRESL( eap_variable_data_c * const aRand, eap_variable_data_c * const aAUTN );
       
    73 
       
    74 protected:
       
    75 
       
    76 	CEapAkaInterface(abs_eap_am_tools_c* const aTools, eap_am_type_aka_symbian_c* const aParent);
       
    77 
       
    78 	void ConstructL();
       
    79 	
       
    80 	void RunL();
       
    81 	
       
    82 	void DoCancel();
       
    83 	
       
    84 private:
       
    85 	
       
    86 	// Creates the MMETel connection and loads the phone module.
       
    87 	TInt CreateMMETelConnectionL();
       
    88 	void DisconnectMMETel();	
       
    89 
       
    90 private:
       
    91 
       
    92 	eap_am_type_aka_symbian_c * const iParent;
       
    93 	
       
    94 	abs_eap_am_tools_c * const m_am_tools;
       
    95 		
       
    96 	// ETel connection.
       
    97     RTelServer iServer;
       
    98     RMobilePhone iPhone;
       
    99     
       
   100     //For custom API.
       
   101     RMmCustomAPI iCustomAPI;  
       
   102     
       
   103     // Stores the last queried Subscriber Id ( IMSI ).
       
   104     RMobilePhone::TMobilePhoneSubscriberId iSubscriberId; 
       
   105     
       
   106     // Stores the SIM authentication details.
       
   107 	RMmCustomAPI::TSimAuthenticationEapAka iEAPAka;
       
   108 	
       
   109 	// For the packaged authentication data.
       
   110 	RMmCustomAPI::TAkaDataPckg *iAuthenticationData;
       
   111 	
       
   112 	// Stores the query identifier. Used to check if IMSI query or KC & SRES query.
       
   113 	TQueryType iQueryId;
       
   114 	
       
   115     // Tells if MMETEL is connected already or not.
       
   116     TBool iMMETELConnectionStatus;
       
   117 	
       
   118 }; 
       
   119 
       
   120 #endif // _EAPAKAINTERFACE_H_
       
   121 
       
   122 // End of file