telephonyserverplugins/simtsy/inc/CSimUsimR6.h
changeset 0 3553901f7fa8
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // This file contains the definitions of the Simulator TSY USIM Release6 class.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalAll
       
    21 */
       
    22 
       
    23 #ifndef CSIMUSIMR6_H_
       
    24 #define CSIMUSIMR6_H_
       
    25 #include <etelmm.h>
       
    26 #include <et_phone.h>
       
    27 #include "csimtimer.h"
       
    28 #include "CSimPubSubChange.h"
       
    29 
       
    30 class CSimPhone;
       
    31 class CTestConfigSection;
       
    32 
       
    33 /**
       
    34  * Implements the RMobilePhone based functions that constitute the 3GPP Release6
       
    35  * functionality provided by the SIM TSY.
       
    36  */
       
    37 class CSimUsimR6 : public CBase, MTimerCallBack
       
    38 	{
       
    39 public:
       
    40 	static CSimUsimR6* NewL(CSimPhone* aPhone);
       
    41 	CSimUsimR6(CSimPhone* aPhone);
       
    42 	~CSimUsimR6();
       
    43 	
       
    44 	/** Videomail related APIS */
       
    45 	TInt GetMailboxNumbers(TTsyReqHandle aReqHandle, TDes8* aMailBox);
       
    46 	TInt GetMailboxNumbersCancel(TTsyReqHandle aReqHandle);
       
    47 	
       
    48 	TInt NotifyMailboxNumbersChange(TTsyReqHandle aReqHandle, TDes8* aMailBox);
       
    49 	TInt NotifyMailboxNumbersChangeCancel(TTsyReqHandle aReqHandle);
       
    50 	
       
    51 	TInt GetIccMessageWaitingIndicators(TTsyReqHandle aReqHandle, TDes8* aMsgIndicators);
       
    52 	TInt GetIccMessageWaitingIndicatorsCancel(TTsyReqHandle aReqHandle);
       
    53 	
       
    54 	TInt SetIccMessageWaitingIndicators(TTsyReqHandle aReqHandle,TDes8* aMsgIndicators);
       
    55 	TInt SetIccMessageWaitingIndicatorsCancel(TTsyReqHandle aReqHandle);
       
    56 	
       
    57 	TInt NotifyIccMessageWaitingIndicatorsChange(TTsyReqHandle aReqHandle, TDes8* aMsgIndicators);
       
    58 	TInt NotifyIccMessageWaitingIndicatorsChangeCancel(TTsyReqHandle aReqHandle);
       
    59 	
       
    60 	TInt NotifyMessageWaiting(TTsyReqHandle aReqStatus, TInt* aCount);
       
    61 	TInt NotifyMessageWaitingCancel(TTsyReqHandle aReqHandle);
       
    62 	
       
    63 	/** Preferred Networks */	
       
    64 
       
    65 	TInt GetPreferredNetworksPhase1(const TTsyReqHandle aTsyReqHandle, RMobilePhone::TClientId* aClient, TInt* aBufSize);
       
    66 	TInt ProcessGetPreferredNetworksPhase1L(const TTsyReqHandle aTsyReqHandle, RMobilePhone::TClientId* aClient, TInt* aBufSize);
       
    67 	TInt GetPreferredNetworksPhase2(const TTsyReqHandle aTsyReqHandle, RMobilePhone::TClientId* aClient, TDes8* aBuf);
       
    68 	TInt GetPreferredNetworksCancel(const TTsyReqHandle aTsyReqHandle);
       
    69 
       
    70 	TInt ProcessStorePreferredNetworksListL(TTsyReqHandle aTsyReqHandle, TDes8* aBuffer);
       
    71 	TInt StorePreferredNetworksList(const TTsyReqHandle aTsyReqHandle, TDes8* aBuffer);
       
    72 
       
    73 	TInt NotifyStorePreferredNetworksListChange(const TTsyReqHandle aTsyReqHandle);
       
    74 	TInt NotifyStorePreferredNetworksListChangeCancel(const TTsyReqHandle aTsyReqHandle);
       
    75 
       
    76 	/** WLAN related APIS */
       
    77 	TInt NotifyWlanDataChange(const TTsyReqHandle aTsyReqHandle, TDes8* aData);
       
    78 	TInt NotifyWlanDataChangeCancel(TTsyReqHandle aTsyReqHandle);
       
    79 
       
    80 	TInt NotifyPreferredWlanSIDListChange(TTsyReqHandle aTsyReqHandle);
       
    81 	TInt NotifyPreferredWlanSIDListChangeCancel(TTsyReqHandle aTsyReqHandle);
       
    82 	
       
    83 	TInt GetWlanData(const TTsyReqHandle aTsyReqHandle,TDes8* aData);
       
    84 	TInt SetWlanData(const TTsyReqHandle aTsyReqHandle,TDes8* aData);
       
    85 
       
    86 	TInt GetPreferredWlanSIDsPhase1(const TTsyReqHandle aTsyReqHandle, RMobilePhone::TClientId* aClient, TInt* aBufSize);
       
    87 	TInt ProcessGetPreferredWlanSIDsPhase1L(const TTsyReqHandle aTsyReqHandle, RMobilePhone::TClientId* aClient, TInt* aBufSize);
       
    88 	TInt GetPreferredWlanSIDsPhase2(const TTsyReqHandle aTsyReqHandle, RMobilePhone::TClientId* aClient, TDes8* aBuf);
       
    89 	TInt GetPreferredWlanSIDsCancel(const TTsyReqHandle aTsyReqHandle);
       
    90 	
       
    91 	TInt StorePreferredWlanSIDList(const TTsyReqHandle aTsyReqHandle,TDes8* aBuffer);	
       
    92 	TInt ProcessStorePreferredWlanSIDListL(TTsyReqHandle aTsyReqHandle,TDes8* aBuffer);
       
    93 		
       
    94 	/** GBA and MBMS related APIS */
       
    95 	
       
    96 	TInt SetGbaBootstrapParams(const TTsyReqHandle aTsyReqHandle,TDes8* aPckg1, const RMobilePhone::TAID* aAID);
       
    97 	TInt SetGbaBootstrapParamsCancel(const TTsyReqHandle aTsyReqHandle);
       
    98 		
       
    99 	TInt NotifyAuthenticateDataChange(const TTsyReqHandle aReqstatus,TDes8* aAuthPckg);
       
   100 	TInt NotifyAuthenticateDataChangeCancel(const TTsyReqHandle aTsyReqHandle);
       
   101 	
       
   102 	TInt GetAuthenticationParams(const TTsyReqHandle aTsyReqHandle,TDes8* aPckg1, TDes8* aPckg2);
       
   103 	TInt GetAuthenticationParamsCancel(const TTsyReqHandle aTsyReqHandle);
       
   104 	
       
   105 	TInt GetAuthenticationListPhase1(const TTsyReqHandle aTsyReqHandle, CRetrieveMobilePhoneAuthenticationIds::TAuthRequestData* aRequest,TInt* aBufSize);
       
   106 	TInt ProcessGetGbaPhase1L(const TTsyReqHandle aTsyReqHandle,RMobilePhone::TClientId* aClientId,TInt* aBufSize);
       
   107 	TInt ProcessGetMbmsPhase1L(const TTsyReqHandle aTsyReqHandle,RMobilePhone::TClientId* aClientId,TInt* aBufSize);
       
   108 	TInt GetAuthenticationListPhase2(const TTsyReqHandle aTsyReqHandle, RMobilePhone::TClientId*,TDes8* aBuffer);
       
   109 	TInt GetAuthenticationListCancel(const TTsyReqHandle aTsyReqHandle);
       
   110 	
       
   111 	const CTestConfigSection* CfgFile();
       
   112 
       
   113 private:
       
   114 	void ConstructL();
       
   115 	void TimerCallBack(TInt aId);
       
   116 	void TimerCallBackNotifyMailboxNumChg();
       
   117 	void TimerCallBackMessageWaitingStat();
       
   118 	void TimerCallBackIccMessageWaitingStat();
       
   119 	TInt RandTime(); // Function to generate random Time to simulate asynchronous request handling.
       
   120 	
       
   121 private:
       
   122 	TInt iGetIccMsgIdCurrentIndex,iSetIccMsgIdCurrentIndex,iNotifyPreferredNetworksChangeIndex;
       
   123 	TInt iCurrentIndex,iNotifyWlanDataChangeIndex,iNotifyPreferredWlanSIDListChangeIndex,iIndex;
       
   124 	
       
   125 	
       
   126 	CSimPhone* iPhone;			// < Pointer to the parent phone class.
       
   127 	CSimTimer* iTimer;			//< Pointer to the Timer object for callback
       
   128 	CSimTimer* iWlanTimer;  	//< Pointer to the TimerObject for Wlan
       
   129 	CSimTimer* iNotifyAuthTimer;//< Pointer to the TimerObject for NotifyAuthenticationTimer.
       
   130 	
       
   131 	TInt iMailBoxIndex;  				// < Current index for the MailBox entries
       
   132 	TInt iListIndex; 					// < Current index from the iGBAInfo array or iMBMSInfo array
       
   133 	TInt iVideoMailIndex; 				// < Current index from the iVideoMailInfo array	
       
   134 	TInt iCurrentNotifyMailboxIndex; 	//< Current index for the NotifyMailBox
       
   135 	TInt iCurrentIccMessageWaitingIndex;//< Current index for the ICC MessageWaiting.
       
   136 	TInt iCurrentMessageWaitingIndex; 	//< Current index for the MessageWaitingIndex.
       
   137 			
       
   138 	CArrayFixFlat<RMobilePhone::TMobilePhoneMessageWaitingV8>* iMessageWaiting;	//< Array containing the Message Waiting Indicators
       
   139 	CArrayFixFlat<RMobilePhone::TMobilePhoneVoicemailIdsV8>* iVoiceMailIds;     //< Array containing MialBox Numbers	
       
   140 	CArrayFixFlat<RMobilePhone::TUsimWlanDataV8>* iWlanData;					//< Array containing Wlan Data.
       
   141 	CArrayFixFlat<RMobilePhone::TWlanSIDV8>* iWlanSid;							//< Array containing Wlan Sids
       
   142 	CArrayFixFlat<RMobilePhone::TMobilePreferredNetworkEntryV3>* iPreferredNetworks; //< Array containing Preferred  Networks' list
       
   143 	CArrayPtrFlat<CListReadAllAttempt>* iGetWlanSIDsData;					
       
   144 	CArrayPtrFlat<CListReadAllAttempt>* iGetPreferredNetworks;
       
   145 	
       
   146 	TBool iMailBoxNumberChangePending;			// < Current Mail Box number request outstanding for V3 parameter class
       
   147 	TTsyReqHandle iMailBoxNumberChangeNotificationReqHandle;	// < Mail Box number outstanding request handle  for V3 parameter class
       
   148 	RMobilePhone::TMobilePhoneVoicemailIdsV3* iMailBoxNumberChange;	// < Mail Box number notification data pointer  for V3 parameter class
       
   149 	
       
   150 	TBool iMailBoxNumberChangePendingV8;			// < Current Mail Box number request outstanding for V8 parameter class
       
   151 	TTsyReqHandle iMailBoxNumberChangeNotificationReqHandleV8;	// < Mail Box number outstanding request handle  for V8 parameter class
       
   152 	RMobilePhone::TMobilePhoneVoicemailIdsV8* iMailBoxNumberChangeV8;	// < Mail Box number notification data pointer  for V8 parameter class
       
   153 	
       
   154 	TBool iMessageWaitingPending;			// < Message waiting  notification request outstanding for the class
       
   155 	TTsyReqHandle iMessageWaitingNotificationReqHandle;	// < Message waiting outstanding request handle  for the class
       
   156 	TInt* iMsgWaitingCount;	// < Message waiting  notification data pointer  for the class
       
   157 	
       
   158 	
       
   159 	TBool iIccMessageWaitingPending;			// < Icc Message waiting  notification request outstanding for V1 parameter class
       
   160 	TTsyReqHandle iIccMessageWaitingNotificationReqHandle;	// < Icc Message waiting  outstanding request handle  for V1 parameter class
       
   161 	RMobilePhone::TMobilePhoneMessageWaitingV1* iIccMsgWaiting;	// < Icc Message waiting  notification data pointer  for V1 parameter class
       
   162 
       
   163 	TBool iIccMessageWaitingPendingV8;			// < Icc Message waiting  notification request outstanding for V8 parameter class
       
   164 	TTsyReqHandle iIccMessageWaitingNotificationReqHandleV8;	// < Icc Message waiting  outstanding request handle  for V8 parameter class
       
   165 	RMobilePhone::TMobilePhoneMessageWaitingV1* iIccMsgWaitingV8;	// < Icc Message waiting  notification data pointer  for V8 parameter class
       
   166 
       
   167 	TBool iNotifyWlanDataChangePending;			// < WLAN Data change information for V8 parameter class
       
   168 	TTsyReqHandle iNotifyWlanDataChangeReqHandle;	// < WLAN Data change information request handle  for V8 parameter class
       
   169 	RMobilePhone::TUsimWlanDataV8* iNotifyWlanDataChange; // <  WLAN Data change information
       
   170 	
       
   171 	TBool iStorePreferredWlanSIDListPending;			// < WLAN SID List information for V8 parameter class
       
   172 	TTsyReqHandle iStorePreferredWlanSIDListeReqHandle;	// < WLAN SID Listinformation request handle  for V8 parameter class
       
   173 	
       
   174 	TBool iNotifyPreferredWlanSIDListChangePending;			// < WLAN SID Listinformation for V8 parameter class
       
   175 	TTsyReqHandle iNotifyPreferredWlanSIDListReqHandle;	// < WLAN SID List information request handle  for V8 parameter class	
       
   176 	
       
   177 	TBool iNotifyPreferredNetworksChangePending;		// < NotifyPreferredNetwork change information
       
   178 	TTsyReqHandle iNotifyPreferredNetworksReqHandle;   // < Request Handle for NotifyPreferredNetworks.
       
   179 	
       
   180 	struct TGBAAuthInfo
       
   181 		{
       
   182 		/** holds value of network challenge AUTN */
       
   183 		TBuf8<RMobilePhone::KAutnLength> iAUTN;
       
   184 		/** holds value of network challenge RAND */
       
   185 		TBuf8<RMobilePhone::KRandLength> iRAND;
       
   186 		/**
       
   187 		 holds Application's ID, on which the authentication is to be
       
   188 		 carried out.  Note, there is no checking for this AID's
       
   189 		 existence, config file must simply match client's request data.
       
   190 		 */
       
   191 		TBuf8<RMobilePhone::KAIDSize> iAID;
       
   192 		/** holds result RES of AUTHENTICATE command when it's successfull */
       
   193 		TBuf8<RMobilePhone::KResLength> iRES;
       
   194 		/** holds value of Authentication Token when  AUTHENTICATE fails */
       
   195 		TBuf8<RMobilePhone::KAutsLength> iAUTS;
       
   196 		/** holds value of session key NAFID */
       
   197 		TBuf8<RMobilePhone::KNafIdLength> iNAFID;
       
   198 		/** holds value of session key IMPI */
       
   199 		TBuf8<RMobilePhone::KImpiLength> iIMPI;
       
   200 		/** holds value of Ks_ext_Naf key */
       
   201 		TBuf8<RMobilePhone::KKsExtNafLength> iKsExtNaf;
       
   202 		/** holds the Btid information */
       
   203 		TBuf8<RMobilePhone::KBtidLength> iBtid;
       
   204 		/** holds the keylifetime information */
       
   205 		TBuf8<RMobilePhone::KKeyLifetimeLength> iKeyLifeTime;
       
   206 		/** holds whether the other application is busy or not */
       
   207 		TBool iOtherAppBusy;
       
   208 		/** holds whether the current application is active or not */
       
   209 		TBool iAppActive;
       
   210 		/** holds the error code that the AUTHENTICATE request should pass/fail with */
       
   211 		TInt iAuthErr;
       
   212 		};
       
   213 
       
   214 	struct TMBMSInfo
       
   215 		{
       
   216 		/** holds the input Mikey from the Network */
       
   217 		TBuf8<RMobilePhone::KMikeyLength> iInputMikey ;  
       
   218 		/** holds the output Mikey containing the verification message */
       
   219 		TBuf8<RMobilePhone::KMikeyLength> iOutputMikey;  
       
   220 		/**holds the output parameter MBMS traffic key */
       
   221 		TBuf8<RMobilePhone::KMtkLength> iMtk;  
       
   222 		/** holds the output parameter random or pseudo random string used to 
       
   223 		 * protect against some offline pre computation attacks on the 
       
   224 		 * underlying security protocol. */
       
   225 		TBuf8<RMobilePhone::KSaltLength> iSaltkey; 
       
   226 		/** MSK is identified by its Key Domain ID and MSK ID 
       
   227 		 * holds the Keydomain ID*/		
       
   228 		TBuf8<RMobilePhone::KKeyDomainIdLength> iKeyDmn;  
       
   229 		/** holds the Key group part */
       
   230 		TBuf8<RMobilePhone::KKeyGroupLength> iMskIdGrp;  
       
   231 		/** holds the MUK ID TLV contains MUK IDr and MUK IDi */
       
   232 		TBuf8<RMobilePhone::KMukIdTlvLength> iMukIdTlv; 
       
   233 		/** holds the IDi part of MBMS User Key */
       
   234 		TBuf8<RMobilePhone::KMukIdiLength>  iMukIdi;  
       
   235 		/** holds the IDr part of MBMS User Key */
       
   236 		TBuf8<RMobilePhone::KMukIdrLength>  iMukIdr; 
       
   237 		/** holds the timestamp for MIKEY reply protection in MSK delivery. */
       
   238 		TBuf8<RMobilePhone::KTimeStampCounterLength> iMukTimestamp; 
       
   239 		/**
       
   240 		 holds Application's ID, on which the authentication is to be
       
   241 		 carried out.  Note, there is no checking for this AID's
       
   242 		 existence, config file must simply match client's request data.
       
   243 		 */
       
   244 		TBuf8<RMobilePhone::KAIDSize> iAID;
       
   245 		/** holds value of Ks_Int_Naf key 
       
   246 		 * The length used for External NAF is being used here also*/
       
   247 		TBuf8<RMobilePhone::KKsExtNafLength> iKsIntNaf;
       
   248 		/** holds whether the current application is active or not */
       
   249 		TBool iAppActive;
       
   250 		/** holds the error code that the AUTHENTICATE request should pass/fail with */
       
   251 		TInt iAuthErr;
       
   252 		};
       
   253 		
       
   254 	enum TTypeOfAuth
       
   255 		{
       
   256 		/** Indicates GBA Authentication in progress*/
       
   257 		EGba =1,
       
   258 		/** Indicates MBMS Authentication in progress*/
       
   259 		EMbms
       
   260 		};
       
   261 		
       
   262 	TInt iNotifyAuthDataIndex; // Current index of the array
       
   263 	CArrayFixFlat<TGBAAuthInfo>* iGBAAuthInfoList; // < Array containing all the GBA config information needed
       
   264 	CArrayFixFlat<TMBMSInfo>* iMBMSInfoList; // < Array containing all the MBMS config information needed
       
   265 	
       
   266 	TNotifyData iSetGBABootstrapParams; //  data struct to be used for SetGBABootstrapParams API.
       
   267 	TNotifyData iNotifyAuthDataChange; // data struct to be used for NotifyAuthenticateChange API.
       
   268 	TNotifyData iGetAuthParams; // data struct to be used for GetAuthenticationParams API.
       
   269 	
       
   270 	CArrayPtrFlat<CListReadAllAttempt>*  iAuthListInfo; // array to hold the GBA information
       
   271 	CMobilePhoneGbaNafIdList* iGbaNafList; //pointer to specialised list class for GBA
       
   272 	CArrayPtrFlat<CListReadAllAttempt>* iMbmsListInfo; // array to hold the MBMS information
       
   273 	CMobilePhoneMbmsMskIdList* iMbmsMskList; //pointer to specialised list class for MBMS
       
   274 
       
   275 	TTypeOfAuth	iAuthType; // type of authentication in 2 phase retrieval
       
   276 	};
       
   277 	
       
   278 #endif /**CSIMUSIMR6_H_*/