adaptationlayer/tsy/nokiatsy_dll/inc/cmmcustommesshandler.h
changeset 0 63b37f68c1ce
child 5 8ccc39f9d787
equal deleted inserted replaced
-1:000000000000 0:63b37f68c1ce
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef _CMMCUSTOMMESSHANDLER_H
       
    21 #define _CMMCUSTOMMESSHANDLER_H
       
    22 
       
    23 // INCLUDES
       
    24 #include "mmmmesshandlerbase.h"
       
    25 #include "cmmphonetreceiver.h"
       
    26 #include "muiccoperationbase.h"
       
    27 #include "cmmuiccmesshandler.h"
       
    28 
       
    29 // for internal testing
       
    30 #include "nokiatsy_internal_variation.h"
       
    31 
       
    32 #include <ctsy/rmmcustomapi.h>
       
    33 
       
    34 // CONSTANTS
       
    35 
       
    36 // Length of Sim info isi msg buffer
       
    37 const TUint8 KSimInfoBufferSize = 20;
       
    38 
       
    39 // Time related constants
       
    40 const TUint16 KSecsInHour = 3600;
       
    41 const TUint8 KMinsInHour = 60;
       
    42 
       
    43 // Length if Gss Cs isi msg buffer
       
    44 const TUint8 KGssCsBufferSize = 6;
       
    45 
       
    46 // Call property buffer size
       
    47 const TUint8 KCallPropBuffSize = 4;
       
    48 
       
    49 // Value for information which value is not needed.
       
    50 const TUint8 KZero = 0x00;
       
    51 // Default length for product profile reading request
       
    52 const TUint8 KDefaultPPlength = 0x01;
       
    53 
       
    54 // Max length of network proveder name
       
    55 const TUint8 KNwProviderNameLength = 0x19;
       
    56 // Constants for remote address length
       
    57 const TUint8 KRemoteAddressBcdSize = 18;
       
    58 const TUint8 KRemoteAddressAsciiSize = 34;
       
    59 const TUint8 KRemoteAddressConversionSize = 36;
       
    60 
       
    61 // SS Request Complete Notifivation SS Status
       
    62 const TUint8 KCustomApiSsGsmActive = 0x01;
       
    63 const TUint8 KCustomApiSsGsmRegistered = 0x02;
       
    64 const TUint8 KCustomApiSsGsmProvisioned = 0x04;
       
    65 const TUint8 KCustomApiSsGsmQuiescent = 0x08;
       
    66 
       
    67 const TUint8 KinfoPpTwoDigitDial = 0x0F;
       
    68 
       
    69 //value for information which value is two
       
    70 const TUint8 KTwo = 0x02;
       
    71 
       
    72 //value for information which value is three
       
    73 const TUint8 KThree = 0x03;
       
    74 
       
    75 //value for information which value is four
       
    76 const TUint8 KFour = 0x04;
       
    77 
       
    78 //value for information which value is six
       
    79 const TUint8 KSix = 0x06;
       
    80 
       
    81 const TUint8 KCustomPadding = 0x00; //Padding byte
       
    82 
       
    83 // Call Life Timer Constants
       
    84 const TUint8 KCallLifeTimerDataAmount = 0x04;
       
    85 const TInt KCallLifeTimerNotSet = -1;
       
    86 const TUint8 KPmmGroupNokiaTsySize = 100;
       
    87 
       
    88 // Maximum number of re-trials when requesting data from PMM.
       
    89 const TUint8 KMaxPMMReadRequests = 0x03;
       
    90 
       
    91 // These constants are needed for Viag Home Zone
       
    92 const TUint8 KLengthOfSMSCNumber = 15;
       
    93 const TUint8 KLengthOfSCPNumber = 15;
       
    94 const TUint8 KLengthOfHzCzTag = 13;
       
    95 const TUint8 KHomeZoneActiveBit = 0x01;
       
    96 const TUint8 KCityZoneActiveBit = 0x02;
       
    97 
       
    98 const TUint8 KSimNumberOfCbMsgIds = 15;
       
    99 const TUint KUnusedCbMsgId = 0xffff;
       
   100 
       
   101 // MACROS
       
   102     //None
       
   103 
       
   104 // DATA TYPES
       
   105     //None
       
   106 
       
   107 // EXTERNAL DATA STRUCTURES
       
   108     //None
       
   109 
       
   110 // FUNCTION PROTOTYPES
       
   111     //None
       
   112 
       
   113 // FORWARD DECLARATIONS
       
   114 class CMmSecurityMessHandler;
       
   115 class CMmNetMessHandler;
       
   116 class CMmPhoNetSender;
       
   117 class TIsiReceiveC;
       
   118 class CMmMessageRouter;
       
   119 class CMmUiccMessHandler;
       
   120 
       
   121 // CLASS DECLARATION
       
   122 
       
   123 /**
       
   124 *  CMmCustomMessHandler is used to create and send GSM specific
       
   125 *  custom ISI messages to PhoNet via PhoNetSender.
       
   126 */
       
   127 class CMmCustomMessHandler :
       
   128     public CBase,
       
   129     public MMmMessHandlerBase,
       
   130     public MMmMessageReceiver,
       
   131     public MUiccOperationBase
       
   132     {
       
   133 
       
   134     public:
       
   135 
       
   136     // Used for saving the ciphering information.
       
   137     struct TCiphListEntry
       
   138         {
       
   139         TBool iCiphStatus;
       
   140         TUint8 iTraId;
       
   141         };
       
   142 
       
   143     // Used for saving the enhanced cell information.
       
   144     class TECIDInfo
       
   145         {
       
   146         public: // data
       
   147         RMmCustomAPI::TMmCellInfo iCellInfo; // Cell Information
       
   148         TUint iMCC; // Mobile Country Code
       
   149         TUint iMNC; // Mobile Network Code
       
   150         TUint iCID; // Location area code
       
   151         TUint iLAC; // Cell identity
       
   152         };
       
   153 
       
   154     // This enumeration is needed because different Product Profile
       
   155     // requests can be made using the same INFO_PP_READ_REQ/RESP
       
   156     // messages. Used as a transaction ID.
       
   157     enum TProductProfileRequestType
       
   158         {
       
   159         EGetAlsPPSupport = 0,
       
   160         ECheckTwoDigitDialSupport
       
   161         };
       
   162 
       
   163     // This enumeration is needed because a SIM_READ_CI_RESP can come
       
   164     // as a response to a GetCipheringInfo-request, or triggered by
       
   165     // a NET_CIPHERING_IND indication which makes the same request.
       
   166     // Used as a transaction ID.
       
   167     enum TCipheringInfoRequestType
       
   168         {
       
   169         EGetCipheringInfo = 0,
       
   170         ENotifyCipheringInfo
       
   171         };
       
   172 
       
   173     // The SIM operations are grouped into the following types.
       
   174     // Used as ISA transaction IDs.
       
   175     enum TSIMOperationType
       
   176         {
       
   177         ESIMOperationTypeReadSimTopics = 0,
       
   178         ESIMOperationTypeDeleteSimTopic
       
   179         };
       
   180 
       
   181     enum TUiccSapIfStatus
       
   182         {
       
   183         EUiccSapIfStatus1 = 1,
       
   184         EUiccSapIfStatus2,
       
   185         EUiccSapIfStatus3
       
   186         };
       
   187 
       
   188     public: // Constructors and destructor
       
   189 
       
   190         /**
       
   191         * Creates a new GSM specific MessageHandler object instance.
       
   192         * @param aPhoNetSender: a pointer to a Phonet Sender object
       
   193         * @param aPhoNetReceiver:
       
   194         * @param aNetMessHandler: a pointer to the Net message handler
       
   195         * @param aSecurityMessHandler: a pointer to the security mess handler
       
   196         * @param aMessageRouter: a pointer to the message router
       
   197         * @return void
       
   198         */
       
   199         static CMmCustomMessHandler* NewL(
       
   200             CMmPhoNetSender* aPhoNetSender,
       
   201             CMmPhoNetReceiver* aPhoNetReceiver,
       
   202             CMmNetMessHandler* aNetMessHandler,
       
   203             CMmSecurityMessHandler* aSecurityMessHandler,
       
   204             CMmMessageRouter* aMessageRouter,
       
   205             CMmUiccMessHandler* aUiccMessHandler);
       
   206 
       
   207         /**
       
   208         * Destructor.
       
   209         * @return void
       
   210         */
       
   211         ~CMmCustomMessHandler();
       
   212 
       
   213    public: // New Functions
       
   214 
       
   215         /**
       
   216         * Creates CallReleaseReq ISI message and sends it to Phonet.
       
   217         * @param TUint8 aTransactionId: unique transaction id
       
   218         * @param TUint8 aCallId: Call ID of this call (NOS Call ID)
       
   219         * @param TUint8 aCause: cause of releasing
       
   220         * @return TInt: success/failure value
       
   221         */
       
   222         TInt CallReleaseReq(
       
   223             TUint8 aTransactionId,
       
   224             TUint8 aCallId,
       
   225             TUint8 aCause );
       
   226 
       
   227         /**
       
   228         * Breaks received CallReleaseResp ISI message.
       
   229         * @param const TIsiReceiveC& aIsiMsg: The received ISI message
       
   230         * @return void : None
       
   231         */
       
   232         void CallReleaseResp( const TIsiReceiveC& aIsiMsg );
       
   233 
       
   234         /**
       
   235         * MO alert indication, used for Remote Alerting Tone in Custom TSY
       
   236         * @param const TIsiReceiveC& aIsiMsg: The received ISI message
       
   237         * @return TInt: void : None
       
   238         */
       
   239         void CallMoAlertInd( const TIsiReceiveC& aIsiMsg );
       
   240 
       
   241         /**
       
   242         * Creates a NET_CS_WAKEUP_REQ ISI message and sends it to Phonet
       
   243         * @param TUint8 aTransId: transaction Id
       
   244         * @return TInt: success/failure value
       
   245         */
       
   246         TInt NetCsWakeupReq( TUint8 aTransId );
       
   247 
       
   248         /**
       
   249         * Breaks received NET_CS_WAKEUP_RESP ISI message
       
   250         * @param None
       
   251         * @return void : None
       
   252         */
       
   253         void NetCsWakeupResp();
       
   254 
       
   255         /**
       
   256         * Breaks received NET_CIPHERING_IND ISI message
       
   257         * @param TIsiReceiveC& aIsiMsg: The received ISI message
       
   258         * @return void : None
       
   259         */
       
   260         void NetCipheringInd( const TIsiReceiveC& aIsiMsg );
       
   261 
       
   262         /**
       
   263         * Breaks received NET_MODEM_REG_STATUS_IND ISI message
       
   264         * @param TIsiReceiveC& aIsiMsg: The received ISI message
       
   265         * @return void : None
       
   266         */
       
   267         void NetModemRegStatusInd( const TIsiReceiveC& aIsiMsg );
       
   268 
       
   269 
       
   270         /**
       
   271         * Read dynamic flags 2
       
   272         * @return void
       
   273         */
       
   274         TInt UiccReadDynamic2FlagsReq();
       
   275 
       
   276         /**
       
   277         * Read dynamic flags 2 response
       
   278         * @param aStatus Status
       
   279         * @param aFileData File data
       
   280         * @return void
       
   281         */
       
   282         void UiccReadDynamic2FlagsResp(
       
   283             TInt aStatus,
       
   284             const TDesC8& aFileData );
       
   285 
       
   286         /**
       
   287         * Write dynamic flags 2
       
   288         * @param aInfo Flags 2 data
       
   289         * @return void
       
   290         */
       
   291         TInt UiccWriteDynamic2FlagsReq( TUint8 aInfo );
       
   292 
       
   293         /**
       
   294         * Write dynamic flags 2 response
       
   295         * @param aInfo Flags 2 data
       
   296         * @return void
       
   297         */
       
   298         void UiccWriteDynamic2FlagsResp( TInt aStatus );
       
   299 
       
   300         /**
       
   301         * Breaks received CALL_TERMINATE_IND ISI messages
       
   302         * @param const TIsiReceiveC& aIsiMsg: The received ISI message
       
   303         * @return void : None
       
   304         */
       
   305         void CallTerminateInd( const TIsiReceiveC& aIsiMsg );
       
   306 
       
   307         /**
       
   308         * Breaks received CALL_RELEASE_IND ISI messages
       
   309         * @param const TIsiReceiveC& aIsiMsg: The received ISI message
       
   310         * @return void : None
       
   311         */
       
   312         void CallReleaseInd( const TIsiReceiveC& aIsiMsg );
       
   313 
       
   314         /**
       
   315         * Creates a INFO_PP_READ_REQ ISI messages and sends it to phone
       
   316         * @param TProductProfileRequestType aReqType: request type (used
       
   317         *        as transaction id)
       
   318         * @return void : KErrNone / Error value from phonet
       
   319         */
       
   320         TInt InfoPpReadReq( TProductProfileRequestType aReqType );
       
   321 
       
   322         /**
       
   323         * Breaks a INFO_PP_READ_RESP message
       
   324         * @param CIsiMsg* aIsiMsg: The received ISI message
       
   325         * @return void : None
       
   326         */
       
   327         void InfoPpReadResp( const TIsiReceiveC& aIsiMessage );
       
   328 
       
   329         /**
       
   330         * Creates a CALL_GSM_BLACKLIST_CLEAR_REQ ISI message and sends it to
       
   331         * Phonet
       
   332         * @param TUint8 aTransId: transaction Id
       
   333         * @return TInt : KErrNone or error code
       
   334         */
       
   335         TInt CallGsmBlackListClearReq( TUint8 aTransId );
       
   336 
       
   337         /**
       
   338         * Breaks received CALL_GSM_BLACKLIST_CLEAR_RESP ISI message
       
   339         * @return void : None
       
   340         */
       
   341         void CallGsmBlackListClearResp();
       
   342 
       
   343         /**
       
   344         * Breaks received SS_SERVICE_COMPLETED_IND ISI message
       
   345         * @param const TIsiReceiveC& aIsiMessage: The received ISI message
       
   346         * @return void : None
       
   347         */
       
   348         void SsServiceCompletedInd ( const TIsiReceiveC& aIsiMessage );
       
   349 
       
   350         /**
       
   351         * Creates a CALL_EMERGENCY_NBR_CHECK_REQ ISI messages and sends it to
       
   352         * phonet
       
   353         * @param TUint8 aTransId: Transaction Id
       
   354         * @param TMobileTelNumber&: telnumber
       
   355         * @param TCheckMode aCheckMode; check mode
       
   356         * @return TInt : KErrNone / Error value from phonet
       
   357         */
       
   358         TInt CallEmergencyNbrCheckReq( TUint8 aTransId,
       
   359             RMmCustomAPI::TMobileTelNumber& aNumber,
       
   360             RMmCustomAPI::TCheckMode aCheckMode );
       
   361 
       
   362         /**
       
   363         * Breaks a CALL_EMERGENCY_NBR_CHECK_RESP message
       
   364         * @param const TIsiReceiveC& aIsiMsg: The received ISI message
       
   365         * @return void : None
       
   366         */
       
   367         void CallEmergencyNbrCheckResp( const TIsiReceiveC& aIsiMsg );
       
   368 
       
   369         /**
       
   370         * Creates a SS_GSM_USSD_SEND_REQ ISI messages and sends it to IsaApi
       
   371         * @param TUint8 aTransId: Transaction Id
       
   372         * @return TInt : KErrNone / Error value from IsaApi
       
   373         */
       
   374         TInt SsGsmUssdSendReq( TUint8 aTransId );
       
   375 
       
   376         /**
       
   377         * Forwards a execution of SS_CANCEL_USSD_SEND_RESP message
       
   378         * @param const TIsiReceiveC& aIsiMessage: The received ISI message
       
   379         * @return void : None
       
   380         */
       
   381         void SsGsmUssdSendResp( const TIsiReceiveC& aIsiMessage );
       
   382 
       
   383         /**
       
   384         * Construct a NET_MODEM_REG_STATUS_GET_REQ ISI message and send
       
   385         * it through phonet.
       
   386         * @param TUint8 aTransId: Transaction Id
       
   387         * @return TInt: KErrNone / Error value from phonet
       
   388         */
       
   389         TInt NetModemRegStatusGetReq( TUint8 aTransId );
       
   390 
       
   391         /**
       
   392         * Construct a NET_SET_REQ message and send it through phonet.
       
   393         * @param TUint8 aTransId: Transaction Id
       
   394         * @return TInt: KErrNone / Error value from phonet
       
   395         */
       
   396         TInt NetSetReq( TUint8 aTransId );
       
   397         /**
       
   398         * Handles SsRequestComplete response ISI message
       
   399         * @return void : None
       
   400         */
       
   401         void SsRequestComplete();
       
   402 
       
   403         /**
       
   404         * Read field from SIM/USIM
       
   405         * @param aSimFileInfo File info
       
   406         * @return Error code
       
   407         */
       
   408         TInt UiccReadFieldReq( RMmCustomAPI::TSimFileInfo& aSimFileInfo );
       
   409 
       
   410         /**
       
   411         * Response to read field request
       
   412         * @param aStatus Status
       
   413         * @param aFileData File data
       
   414         * @return void
       
   415         */
       
   416         void UiccReadFieldResp( TInt aStatus, const TDesC8& aFileData );
       
   417 
       
   418         /**
       
   419         * Read ciphering indicator status from SIM/USIM
       
   420         * @param aTrId Transaction ID
       
   421         * @return Error code
       
   422         */
       
   423         TInt UiccReadCiReq( TInt aTrId );
       
   424 
       
   425         /**
       
   426         * Response to read CI request
       
   427         * @param aStatus Status
       
   428         * @param aTrId Transaction ID
       
   429         * @param aFileData File data
       
   430         * @return void
       
   431         */
       
   432         void UiccReadCiResp(
       
   433             TInt aStatus,
       
   434             TInt aTrId,
       
   435             const TDesC8& aFileData );
       
   436 
       
   437         /**
       
   438         * Read operator name from SIM/USIM
       
   439         * @return Error code
       
   440         */
       
   441         TInt UiccOperatorReq();
       
   442 
       
   443         /**
       
   444         * Response to read operator name request
       
   445         * @param aStatus Status
       
   446         * @param aFileData File data
       
   447         * @return none
       
   448         */
       
   449         void UiccOperatorResp( TInt aStatus, const TDesC8& aFileData );
       
   450 
       
   451         /**
       
   452         * Disconnects UICC server from smartcard and
       
   453         * activates UICC SAP APDU interface
       
   454         * @return Error code
       
   455         */
       
   456         TInt UiccSimPowerOffReq();
       
   457 
       
   458         /**
       
   459         * Handles responses to SIM power off
       
   460         * @param aStatus Status
       
   461         * @return none
       
   462         */
       
   463         void UiccSimPowerOffResp( TInt aStatus );
       
   464 
       
   465         /**
       
   466         * Requests SIM warm reset
       
   467         * @return Error code
       
   468         */
       
   469         TInt UiccSimWarmResetReq();
       
   470 
       
   471         /**
       
   472         * Response to SIM warm reset
       
   473         * @param aStatus Status
       
   474         * @return none
       
   475         */
       
   476         void UiccSimWarmResetResp( TInt aStatus );
       
   477 
       
   478         /**
       
   479         * Requests Get ATR
       
   480         * @return Error code
       
   481         */
       
   482         TInt UiccSimGetAtrReq();
       
   483 
       
   484         /**
       
   485         * Handles responses to SIM Get ATR
       
   486         * @param aStatus Status
       
   487         * @param aFileData File data
       
   488         * @return none
       
   489         */
       
   490         void UiccSimGetAtrResp( TInt aStatus, const TDesC8& aFileData );
       
   491 
       
   492         /**
       
   493         * Connects UICC server to smartcard and
       
   494         * deactivates UICC SAP APDU interface
       
   495         * @return Error code
       
   496         */
       
   497         TInt UiccSimPowerOnReq();
       
   498 
       
   499         /**
       
   500         * Handles responses to SIM power off
       
   501         * @param aStatus Status
       
   502         * @return none
       
   503         */
       
   504         void UiccSimPowerOnResp( TInt aStatus );
       
   505 
       
   506         /**
       
   507         * Sends APDU to UICC
       
   508         * @param aApduParameters APDU parameters
       
   509         * @param aTraId transaction id
       
   510         * @return Error code
       
   511         */
       
   512         TInt UiccSendAPDUReq(
       
   513             const RMmCustomAPI::TApduParameters& aApduParameters,
       
   514             TInt aTraId );
       
   515 
       
   516         /**
       
   517         * Handles responses to UICC_APDU_RESP
       
   518         * @param aStatus Status
       
   519         * @param aFileData File data
       
   520         * @param aTraId transaction id 
       
   521         * @return none
       
   522         */
       
   523         void UiccSendAPDUResp(
       
   524             TInt aStatus,
       
   525             const TDesC8& aFileData,
       
   526             TInt aTraId );
       
   527 
       
   528         /**
       
   529         * Sends UICC_CARD_REQ
       
   530         * @return Error code
       
   531         */
       
   532         TInt UiccCardReaderStatusReq();
       
   533 
       
   534         /**
       
   535         * Handles responses for Card Reader Status req
       
   536         * @param aStatus Status
       
   537         * @param aFileData File data
       
   538         * @return none
       
   539         */
       
   540         void UiccCardReaderStatusResp( TInt aStatus, const TDesC8& aFileData );
       
   541 
       
   542         /**
       
   543         * Handles UICC_CARD_IND
       
   544         * @param aIsiMessage Received ISI message
       
   545         * @return void
       
   546         */
       
   547         void UiccCardInd( const TIsiReceiveC& aIsiMessage );
       
   548 
       
   549         /**
       
   550         * Read CB message IDs from UICC
       
   551         * @param aTraId Transaction identification
       
   552         * @return Error code
       
   553         */
       
   554         TInt UiccReadCbMsgIdsReq( TUiccTrId aTrId );
       
   555 
       
   556         /**
       
   557         * Response to read CB message IDs from UICC
       
   558         * @param aStatus Status
       
   559         * @param aTraId Transaction ID
       
   560         * @param aFileData File data
       
   561         * @return void
       
   562         */
       
   563         void UiccReadCbMsgIdsResp(
       
   564             TInt aStatus,
       
   565             TInt aTraId,
       
   566             const TDesC8& aFileData );
       
   567 
       
   568         /**
       
   569         * Response to delete CB message ID request
       
   570         * @param aStatus Status
       
   571         * @return void
       
   572         */
       
   573         void UiccDeleteCbMsgIdResp( TInt aStatus );
       
   574 
       
   575         /**
       
   576         * Read home zone parameters from UICC
       
   577         * @return Error code
       
   578         */
       
   579         TInt UiccReadViagHomeZoneParametersReq();
       
   580 
       
   581         /**
       
   582         * Response read home zone parameters request
       
   583         * @param aStatus Status
       
   584         * @param aFileData File data
       
   585         * @return void
       
   586         */
       
   587         void UiccReadViagHomeZoneParametersResp(
       
   588             TInt aStatus,
       
   589             const TDesC8& aFileData );
       
   590 
       
   591         /**
       
   592         * Read home zone cache from UICC
       
   593         * @params aRecordId Record identifier
       
   594         * @return Error code
       
   595         */
       
   596         TInt UiccReadViagHomeZoneCacheReq(
       
   597             const RMmCustomAPI::TViagCacheRecordId& aRecordId );
       
   598 
       
   599        /**
       
   600         * Response to read home zone cache request
       
   601         * @param aStatus Status
       
   602         * @param aFileData File data
       
   603         * @return void
       
   604         */
       
   605         void UiccReadViagHomeZoneCacheResp(
       
   606             TInt aStatus,
       
   607             const TDesC8& aFileData );
       
   608 
       
   609         /**
       
   610          * Request to write home zone settings
       
   611          * @param aUhziuiSettings UHZIUI settings
       
   612          * @return void
       
   613          */
       
   614         TInt UiccWriteViagHomeZoneUhziueSettingsReq(
       
   615             const RMmCustomAPI::TViagUHZIUESettings& aUhziuiSettings );
       
   616 
       
   617         /**
       
   618          * Response to write home zone settings
       
   619          * @param aStatus Status
       
   620          * @return void
       
   621          */
       
   622         void UiccWriteViagHomeZoneUhziueSettingsResp( TInt aStatus );
       
   623 
       
   624         /**
       
   625         * Write Viag Home Zone cache from UICC
       
   626         * @params aRecordId Record identifier
       
   627         * @params aViagRecordContent Record content
       
   628         * @return error code
       
   629         */
       
   630         TInt UiccWriteViagHomeZoneCacheReq(
       
   631             const RMmCustomAPI::TViagCacheRecordId& aRecordId,
       
   632             const RMmCustomAPI::TViagCacheRecordContent& aViagRecordContent );
       
   633 
       
   634        /**
       
   635         * Response Write Viag Home Zone cache request
       
   636         * @param aStatus Status
       
   637         * @return void
       
   638         */
       
   639         void UiccWriteViagHomeZoneCacheResp( TInt aStatus );
       
   640 
       
   641    public: // Functions from base classes
       
   642 
       
   643         /**
       
   644         * ISI message for CustomMessageHandler received
       
   645         * @param const TIsiReceiveC& aIsiMessage: reference to received ISI message
       
   646         */
       
   647         void ReceiveMessageL( const TIsiReceiveC& aIsiMessage );
       
   648 
       
   649         /**
       
   650         * Handles errors comes from PhoNetReceiver RunError
       
   651         * @param TIsiReceiveC& aIsiMessage: reference to received ISI message
       
   652         * @param TInt aError: Error code
       
   653         */
       
   654         void HandleError( const TIsiReceiveC& aIsiMessage, TInt aError );
       
   655 
       
   656         /**
       
   657         * From MMmMessHandlerBase. This method is the single entry point for
       
   658         * requests coming from the Symbian OS layer to this message handler
       
   659         * @since ?Series60_version
       
   660         * @param aIpc IPC number of the request
       
   661         * @return TInt KErrNone or error code
       
   662         */
       
   663         TInt ExtFuncL( TInt aIpc, const CMmDataPackage* aDataPackage );
       
   664 
       
   665         /**
       
   666         * Handle UICC response messages
       
   667         * @param aTraId Transaction ID
       
   668         * @param aFileData Descriptor for file data
       
   669         * @return KErrNone or error code
       
   670         */
       
   671         TInt ProcessUiccMsg(
       
   672             TInt aTraId,
       
   673             TInt aStatus,
       
   674             const TDesC8& aFileData );
       
   675 
       
   676     protected: // New functions
       
   677         //None
       
   678 
       
   679     protected: // Functions from base classes
       
   680         //None
       
   681 
       
   682     private:
       
   683 
       
   684         /**
       
   685         * C++ default constructor.
       
   686         * @return void
       
   687         */
       
   688         CMmCustomMessHandler();
       
   689 
       
   690         /**
       
   691         * Initialises object attributes.
       
   692         * By default Symbian 2nd phase constructor is private.
       
   693         * @return void
       
   694         */
       
   695         void ConstructL();
       
   696 
       
   697         /**
       
   698         * Breaks a CALL_GSM_NOTIFICATION_IND ISI-message.
       
   699         * @param const TIsiReceiveC& aIsiMsg: Received ISI message
       
   700         * @return None
       
   701         */
       
   702         void CallGsmNotificationInd( const TIsiReceiveC& aIsiMsg );
       
   703 
       
   704         /**
       
   705         * Handles Forwarding data from a CALL_GSM_NOTIFICATION_IND
       
   706         * @param TUint16 aSsCode,
       
   707         * @param const TIsiReceiveC& aIsiMsg,
       
   708         * @param RMmCustomAPI::TSsTypeAndMode& aSsTypeAndMode
       
   709         * @return None
       
   710         */
       
   711         void HandleForwarding(
       
   712             TUint16 aSsCode,
       
   713             const TIsiReceiveC& aIsiMsg,
       
   714             RMmCustomAPI::TSsTypeAndMode& aSsTypeAndMode ) const;
       
   715 
       
   716         /**
       
   717         * Handles Barring data from a CALL_GSM_NOTIFICATION_IND
       
   718         * @param TUint16 aSsCode,
       
   719         * @param const TIsiReceiveC& aIsiMsg,
       
   720         * @param RMmCustomAPI::TSsTypeAndMode& aSsTypeAndMode
       
   721         * @return None
       
   722         */
       
   723         void HandleBarring(
       
   724             TUint16 aSsCode,
       
   725             const TIsiReceiveC& aIsiMsg,
       
   726             RMmCustomAPI::TSsTypeAndMode& aSsTypeAndMode ) const;
       
   727 
       
   728         /**
       
   729         * Match function for making finds in the Ciphering list
       
   730         * @param TCiphListEntry& aArg1: first argument for match
       
   731         * @param TCiphListEntry& aArg2: secnd argument for the match
       
   732         * @return TBool: if both arguments match
       
   733         */
       
   734         static TBool Match(
       
   735             const TCiphListEntry& aArg1,
       
   736             const TCiphListEntry& aArg2 );
       
   737 
       
   738         /**
       
   739         * Breaks received NET_MODEM_REG_STATUS_GET_RESP ISI message
       
   740         * @param TIsiReceiveC& aIsiMsg: The received ISI message
       
   741         * @return void : None
       
   742         */
       
   743         void NetModemRegStatusGetResp( const TIsiReceiveC& aIsiMsg );
       
   744 
       
   745         /**
       
   746         * Breaks received NET_SET_RESP ISI message
       
   747         * @param TIsiReceiveC& aIsiMsg: The received ISI message
       
   748         * @return void : None
       
   749         */
       
   750         void NetSetResp( const TIsiReceiveC& aIsiMsg );
       
   751 
       
   752         /**
       
   753         * Breaks received SS_SERVICE_FAILED_RESP ISI message
       
   754         * @param const TIsiReceiveC& aIsiMessage: The received ISI message
       
   755         * @return void : None
       
   756         */
       
   757         void SsServiceFailedResp( const TIsiReceiveC& aIsiMessage );
       
   758 
       
   759         /**
       
   760         * Construct a NET_RAT_REQ message and send it through phonet.
       
   761         * @param TUint8 aTransId: Transaction Id
       
   762         * @param TBool aCurrentRats: Use Current RAT setting
       
   763         * @return TInt: KErrNone / Error value from phonet
       
   764         */
       
   765         TInt NetRatReq( TUint8 aTransId, TBool aCurrentRats );
       
   766 
       
   767         /**
       
   768         * Breaks received NET_RAT_RESP ISI message
       
   769         * @param TIsiReceiveC& aIsiMsg: The received ISI message
       
   770         * @return void : None
       
   771         */
       
   772         void NetRatResp( const TIsiReceiveC& aIsiMsg );
       
   773 
       
   774         /**
       
   775         * Construct a GSS_CS_SERVICE_REQ message and send it through phonet.
       
   776         * @param TUint8 aTransId: Transaction Id
       
   777         * @param RMmCustomAPI::TNetworkModeCaps: System network mode to set.
       
   778         * @return TInt: KErrNone / Error value from phonet
       
   779         */
       
   780         TInt GssCsServiceReq(
       
   781             TUint8 aTransId,
       
   782             RMmCustomAPI::TNetworkModeCaps aNetworkModeCaps );
       
   783 
       
   784         /**
       
   785         * Breaks received GSS_CS_SERVICE_RESP ISI message
       
   786         * @param const TIsiReceiveC& aIsiMessage: The received ISI message
       
   787         * @return void : None
       
   788         */
       
   789         void GssCsServiceResp( const TIsiReceiveC& aIsiMessage );
       
   790 
       
   791         /**
       
   792         * Breaks received GSS_CS_SERVICE_FAIL_RESP ISI message
       
   793         * @param const TIsiReceiveC& aIsiMessage: The received ISI message
       
   794         * @return void : None
       
   795         */
       
   796         void GssCsServiceFailResp( const TIsiReceiveC& aIsiMessage );
       
   797 
       
   798         /**
       
   799         * MtcRat Query
       
   800         * @param TUInt8 aTransId: Transaction Id
       
   801         * @return TInt : result
       
   802         */
       
   803 #ifdef INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING
       
   804         // Removed for Bridge camp!
       
   805         TInt MtcRatQueryReq( TUint8 aTransId );
       
   806 #endif /* INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING */
       
   807 
       
   808         /**
       
   809         * MtcRat Query Response
       
   810         * @param TIsiReceiveC& aIsiMessage: ISI message
       
   811         * @return void : None
       
   812         */
       
   813 #ifdef INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING
       
   814         // Removed for Bridge camp!
       
   815         void MtcRatQueryResp( const TIsiReceiveC& aIsiMessage );
       
   816 #endif /* INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING */
       
   817 
       
   818         /**
       
   819         * Handles the ReadViagHomeZoneParamsResp response message.
       
   820         * @param const TIsiReceiveC& aIsiMessage: a pointer to incoming message
       
   821         * @return void
       
   822         */
       
   823         void ReadViagHomeZoneParamsRespL( const TIsiReceiveC& aIsiMessage );
       
   824 
       
   825         /**
       
   826         * Handles the ReadViagHomeZoneCacheResp response message.
       
   827         * @param const TIsiReceiveC& aIsiMessage: a pointer to incoming message
       
   828         * @return void
       
   829         */
       
   830         void ReadViagHomeZoneCacheResp( const TIsiReceiveC& aIsiMessage );
       
   831 
       
   832         /**
       
   833         * Handles the WriteViagHomeZoneCacheResp response message.
       
   834         * @param const TIsiReceiveC& aIsiMessage: a pointer to incoming message
       
   835         * @return void
       
   836         */
       
   837         void WriteViagHomeZoneCacheResp( const TIsiReceiveC& aIsiMessage );
       
   838 
       
   839         /**
       
   840         * Construct and send to phonet GSS_HSXPA_USER_SETTING_WRITE_REQ
       
   841         * ISI message.
       
   842         * @param TUint8 aTraId: a transaction identification
       
   843         * @param THSxPAStatus status:
       
   844         * @return TInt: error code
       
   845         */
       
   846         TInt WriteHSxPAStatusReq(
       
   847             TUint8 aTraId,
       
   848             RMmCustomAPI::THSxPAStatus status );
       
   849 
       
   850         /**
       
   851         * Breaks GSS_HSXPA_USER_SETTING_WRITE_RESP ISI message
       
   852         * @param const TIsiReceiveC& aIsiMessage: the incoming message
       
   853         * @return void
       
   854         */
       
   855         void WriteHSxPAStatusResp( const TIsiReceiveC& aIsiMessage );
       
   856 
       
   857         /**
       
   858         * Construct and send to phonet GSS_HSXPA_USER_SETTING_READ_REQ
       
   859         * ISI message.
       
   860         * @param TUint8 aTraId: a transaction identification
       
   861         * @return TInt: error code
       
   862         */
       
   863         TInt ReadHSxPAStatusReq( TUint8 aTraId );
       
   864 
       
   865         /**
       
   866         * Breaks GSS_HSXPA_USER_SETTING_READ_RESP ISI message
       
   867         * @param const TIsiReceiveC& aIsiMessage: the incoming message
       
   868         * @return void
       
   869         */
       
   870         void ReadHSxPAStatusResp( const TIsiReceiveC& aIsiMessage );
       
   871 
       
   872         /**
       
   873         * Breaks received GSS_HSXPA_SETTING_IND ISI messages
       
   874         * @param const TIsiReceiveC& aIsiMsg: The received ISI message
       
   875         * @return void : None
       
   876         */
       
   877         void HSxPASettingInd( const TIsiReceiveC& aIsiMsg );
       
   878 
       
   879         /**
       
   880         * Construct a NET_NEIGHBOUR_CELLS_REQ message and send it through phonet.
       
   881         * @param TUint8 aTraId: a transaction identification
       
   882         * @return TInt: error code
       
   883         */
       
   884         TInt NetNeighbourCellsReq( const TUint8 aTraId );
       
   885 
       
   886         /**
       
   887         * Breaks received NET_NEIGHBOUR_CELLS_RESP ISI messages.
       
   888         * @param const TIsiReceiveC& aIsiMsg: The received ISI message
       
   889         * @return void: None
       
   890         */
       
   891         void NetNeighbourCellsResp( const TIsiReceiveC& aIsiMessage );
       
   892 
       
   893         /**
       
   894         * Breaks received NET_REG_STATUS_IND or NET_REG_STATUS_IND
       
   895         * message and checks if enhanced cell information is chaged
       
   896         * ( => needs to be requested/updated).
       
   897         * @param const TIsiReceiveC& aIsiMessage: The received ISI message
       
   898         * @return void: None
       
   899         */
       
   900         void CheckECIDInfo( const TIsiReceiveC& aIsiMessage );
       
   901 
       
   902 // Not suppoted for S60 ver 3.2
       
   903 #if ( NCP_COMMON_S60_VERSION_SUPPORT != S60_VERSION_32 )
       
   904 
       
   905         /**
       
   906         * Construct a GSS_CS_SERVICE_REQ message including selected
       
   907         * band mode and send it through phonet.
       
   908         * @param TUint8 aTransId: Transaction Id
       
   909         * @param RMmCustomAPI::TNetworkModeCaps: System network mode to set.
       
   910         * @param RMmCustomAPI::TBandSelection: Selected band mode.
       
   911         * @return TInt: KErrNone / Error value from phonet
       
   912         */
       
   913         TInt GssCsServiceSetBandReq(
       
   914             TUint8 aTransId,
       
   915             RMmCustomAPI::TNetworkModeCaps aNetworkModeCaps,
       
   916             RMmCustomAPI::TBandSelection aBandSelection );
       
   917 
       
   918         /**
       
   919         * Construct a GSS_CS_SERVICE_REQ message to get selected
       
   920         * band mode.
       
   921         * @param TUint8 aTransId: Transaction Id
       
   922         * @return TInt: KErrNone / Error value from phonet
       
   923         */
       
   924         TInt GssCsServiceGetBandReq( TUint8 aTransId );
       
   925 
       
   926         /**
       
   927         * Breaks received GSS_SELECTED_BANDS_READ operation.
       
   928         * @param const TIsiReceiveC& aIsiMessage: The received ISI message
       
   929         * @return void: None
       
   930         */
       
   931         void CompleteGetBandSelection( const TIsiReceiveC& aIsiMessage );
       
   932 
       
   933 #endif // NCP_COMMON_S60_VERSION_SUPPORT
       
   934 
       
   935         /**
       
   936         * Construcst PERM_PM_RECORD_READ_REQ message sends it through
       
   937         * phonet.
       
   938         * @param TUint8 aTransId: Transaction id.
       
   939         * @return TInt: KErrNone / Error value from phonet.
       
   940         */
       
   941         TInt ReadLifeTimerFromPermanentMemory( const TUint8 aTransId );
       
   942 
       
   943         /**
       
   944         * Breaks a PERM_PM_RECORD_READ_RESP ISI-message.
       
   945         * @param const TIsiReceiveC& aIsiMessage: Received isi message.
       
   946         * @return void: none
       
   947         */
       
   948         void LifeTimerFromPermanentMemoryReadResponse(
       
   949                  const TIsiReceiveC& aIsiMessage );
       
   950 
       
   951         /**
       
   952         * Construcst PERM_PM_RECORD_WRITE_REQ message sends it through
       
   953         * phonet.
       
   954         * @param TUint8 aTransId: Transaction id.
       
   955         * @return TInt: KErrNone / Error value from phonet / KErrNotReady if PMM
       
   956         * has not been able to be read.
       
   957         */
       
   958         TInt WriteLifeTimerToPermanentMemory(
       
   959                  const TUint8 aTransId,
       
   960                  TTimeIntervalSeconds aTime );
       
   961 
       
   962         /**
       
   963         * Breaks a PERM_PM_RECORD_WRITE_RESP ISI-message.
       
   964         * @param const TIsiReceiveC& aIsiMessage: Received isi message.
       
   965         * @return void: none
       
   966         */
       
   967         void LifeTimerToPermanentMemoryWriteResponse(
       
   968                  const TIsiReceiveC& aIsiMessage );
       
   969 
       
   970         /**
       
   971         * Reads total call life timer value and returns it in complete.
       
   972         * If
       
   973         * @param none
       
   974         * @return TInt: KErrNone / KErrNotReady if PMM has not been able to be
       
   975         * read.
       
   976         */
       
   977         TInt  GetTotalLifeTimerValue();
       
   978         
       
   979         /**
       
   980         * Constructs and sends AUTHENTICATE APDU to the UICC
       
   981         * @param aDataPackage: data containing authentication parameters
       
   982         * @return TInt: KErrNone / Error value from phonet
       
   983         */
       
   984         TInt CMmCustomMessHandler::UiccSendAuthenticateApdu( 
       
   985             const CMmDataPackage& aDataPackage );
       
   986 
       
   987 
       
   988         /**
       
   989         * Constructs RUN GSM ALGORITHM APDU. Used when authentication
       
   990         * is done for ICC card
       
   991         * @param aParams: parameter where the apdu is constructed
       
   992         * @param aRand: RAND value inserted to the APDU
       
   993         * @param aTraId: tr id used in UICC request
       
   994         * @return void: none
       
   995         */
       
   996         void UiccCreateRunGsmAlgorithmApdu(
       
   997             TUiccSendApdu& aParams, 
       
   998             const TDesC8& aRand,
       
   999             TUiccTrId aTraId );
       
  1000 
       
  1001         /**
       
  1002         * Handles response APDU for RUN GSM ALGORITHM APDU
       
  1003         * @param aTraId: transaction id of received message
       
  1004         * @param aStatus: status of the response
       
  1005         * @param aFileData: response apdu
       
  1006         * @return void: none
       
  1007         */
       
  1008         void UiccRunGsmAlgorithmApduResp(
       
  1009             TInt aTraId,
       
  1010             TInt aStatus,
       
  1011             const TDesC8& aFileData );
       
  1012 
       
  1013         /**
       
  1014         * Constructs GSM context AUTHENTICATE APDU
       
  1015         * @param params: parameter where the apdu is constructed
       
  1016         * @param aDataPackage: data containing authentication parameters
       
  1017         * @return void: none
       
  1018         */
       
  1019         void UiccCreateGsmSecurityContextApdu( 
       
  1020             TUiccSendApdu& params, 
       
  1021             const CMmDataPackage& aDataPackage );
       
  1022 
       
  1023         /**
       
  1024         * Handles response APDU for GSM security context AUTHENTICATE APDU
       
  1025         * @param aTraId: transaction id of received message
       
  1026         * @param aStatus: status of the response
       
  1027         * @param aFileData: response apdu
       
  1028         * @return void: none
       
  1029         */
       
  1030         void UiccGsmSecurityContextApduResp(
       
  1031             TInt aTraId,
       
  1032             TInt aStatus,
       
  1033             const TDesC8& aFileData );
       
  1034 
       
  1035         /**
       
  1036         * Constructs 3G security context AUTHENTICATE APDU
       
  1037         * @param aParams: parameter where the apdu is constructed
       
  1038         * @param aRand: RAND value inserted to the APDU
       
  1039         * @param aAuth: AUTH value inserted to the APDU
       
  1040         * @param aTraId: tr id used in UICC request
       
  1041         * @return void: none
       
  1042         */
       
  1043         void UiccCreate3GSecurityContextApdu( 
       
  1044             TUiccSendApdu& aParams, 
       
  1045             const TDesC8& aRand, 
       
  1046             const TDesC8& aAuth,
       
  1047             TUiccTrId aTraId );
       
  1048 
       
  1049         /**
       
  1050         * Handles response APDU for 3G security context AUTHENTICATE APDU
       
  1051         * @param aTraId: transaction id of received message
       
  1052         * @param aStatus: status of the response
       
  1053         * @param aFileData: response apdu
       
  1054         * @return void: none
       
  1055         */
       
  1056         void Uicc3GSecurityContextApduResp(
       
  1057             TInt aTraId,
       
  1058             TInt aStatus,
       
  1059             const TDesC8& aFileData );
       
  1060 
       
  1061         /**
       
  1062         * Constructs GBA security context AUTHENTICATE APDU (bootstrapping mode)
       
  1063         * @param aParams: parameter where the apdu is constructed
       
  1064         * @param aDataPackage: data containing authentication parameters
       
  1065         * @return void: none
       
  1066         */
       
  1067         void UiccCreateGBABootstrappingApdu(
       
  1068             TUiccSendApdu& aParams, 
       
  1069             const CMmDataPackage& aDataPackage );
       
  1070 
       
  1071         /**
       
  1072         * Handles response APDU for GBA security context AUTHENTICATE 
       
  1073         * APDU (bootstrapping mode)
       
  1074         * @param aTraId: transaction id of received message
       
  1075         * @param aStatus: status of the response
       
  1076         * @param aFileData: response apdu
       
  1077         * @return void: none
       
  1078         */
       
  1079         void UiccGBABootstrappingApduResp(
       
  1080             TInt aTraId,
       
  1081             TInt aStatus,
       
  1082             const TDesC8& aFileData );
       
  1083 
       
  1084         /**
       
  1085         * Starts GBA bootstrap operation by reading elementary file EFgba. After reading 
       
  1086         * is done, B-Tid and keylifetime is updated to EFgba
       
  1087         * @param aDataPackage: data containing parameters going to be written
       
  1088         *                      to the EFgba
       
  1089         * @return void: none
       
  1090         */
       
  1091         void UiccGBABootstrapUpdate(
       
  1092             const CMmDataPackage& aDataPackage );
       
  1093 
       
  1094         /**
       
  1095         * Handles response for EFgba read operation
       
  1096         * @param aStatus: status of the response
       
  1097         * @param aFileData: file data
       
  1098         * @return void: none
       
  1099         */
       
  1100         void UiccGBABootstrapReadResp(
       
  1101             TInt aStatus,
       
  1102             const TDesC8& aFileData );
       
  1103 
       
  1104         /**
       
  1105         * Handles response for EFgba write operation
       
  1106         * @param aStatus: status of the response
       
  1107         * @return void: none
       
  1108         */
       
  1109         void UiccGBABootstrapUpdateResp( TInt aStatus );
       
  1110 
       
  1111         /**
       
  1112         * Constructs GBA security context AUTHENTICATE APDU 
       
  1113         * (NAF derivation mode)
       
  1114         * @param aParams: parameter where the apdu is constructed
       
  1115         * @param aDataPackage: data containing authentication parameters
       
  1116         * @return void: none
       
  1117         */
       
  1118         void UiccCreateGBABootstrapNafDerivationApdu(
       
  1119             TUiccSendApdu& aParams, 
       
  1120             const CMmDataPackage& aDataPackage );
       
  1121 
       
  1122         /**
       
  1123         * Handles response APDU for GBA security context AUTHENTICATE 
       
  1124         * APDU (NAF derivation mode)
       
  1125         * @param aTraId: transaction id of received message
       
  1126         * @param aStatus: status of the response
       
  1127         * @param aFileData: response apdu
       
  1128         * @return void: none
       
  1129         */
       
  1130         void UiccGBANafDerivationApduResp(
       
  1131             TInt aTraId,
       
  1132             TInt aStatus,
       
  1133             const TDesC8& aFileData );
       
  1134 
       
  1135         /**
       
  1136         * Constructs MBMS security context AUTHENTICATE APDU 
       
  1137         * (MSK Update Mode)
       
  1138         * @param params: parameter where the apdu is constructed
       
  1139         * @param aDataPackage: data containing authentication parameters
       
  1140         * @return void: none
       
  1141         */
       
  1142         void UiccCreateMbmsMskUpdateApdu(
       
  1143             TUiccSendApdu& params, 
       
  1144             const CMmDataPackage& aDataPackage );
       
  1145 
       
  1146         /**
       
  1147         * Handles response APDU for MBMS security context AUTHENTICATE 
       
  1148         * APDU (MSK Update Mode)
       
  1149         * @param aTraId: transaction id of received message
       
  1150         * @param aStatus: status of the response
       
  1151         * @param aFileData: response apdu
       
  1152         * @return void: none
       
  1153         */
       
  1154         void UiccMbmsMskUpdateApduResp(
       
  1155             TInt aStatus,
       
  1156             const TDesC8& aFileData );
       
  1157 
       
  1158         /**
       
  1159         * Constructs MBMS security context AUTHENTICATE APDU 
       
  1160         * (MTK Generation Mode)
       
  1161         * @param params: parameter where the apdu is constructed
       
  1162         * @param aDataPackage: data containing authentication parameters
       
  1163         * @return void: none
       
  1164         */
       
  1165         void UiccCreateMbmsMtkGenerationApdu(
       
  1166             TUiccSendApdu& params, 
       
  1167             const CMmDataPackage& aDataPackage );
       
  1168 
       
  1169         /**
       
  1170         * Handles response APDU for MBMS security context AUTHENTICATE 
       
  1171         * APDU (MTK Generation Mode)
       
  1172         * @param aStatus: status of the response
       
  1173         * @param aFileData: response apdu
       
  1174         * @return void: none
       
  1175         */
       
  1176         void UiccMbmsMtkGenerationApduResp(
       
  1177             TInt aStatus,
       
  1178             const TDesC8& aFileData );
       
  1179 
       
  1180         /**
       
  1181         * Constructs MBMS security context AUTHENTICATE APDU 
       
  1182         * (MSK Deletion Mode)
       
  1183         * @param params: parameter where the apdu is constructed
       
  1184         * @param aDataPackage: data containing authentication parameters
       
  1185         * @return void: none
       
  1186         */
       
  1187         void UiccCreateMbmsMskDeletionApdu(
       
  1188             TUiccSendApdu& params, 
       
  1189             const CMmDataPackage& aDataPackage );
       
  1190 
       
  1191         /**
       
  1192         * Handles response APDU for MBMS security context AUTHENTICATE 
       
  1193         * APDU (MSK Deletion Mode)
       
  1194         * @param aStatus: status of the response
       
  1195         * @param aFileData: response apdu
       
  1196         * @return void: none
       
  1197         */
       
  1198         void UiccMbmsMskDeletionApduResp(
       
  1199             TInt aStatus,
       
  1200             const TDesC8& aFileData );
       
  1201 
       
  1202         /**
       
  1203         * Constructs APDU to get first block of authenticate response data
       
  1204         * in case of odd ins code
       
  1205         * @return void: none
       
  1206         */
       
  1207         void CMmCustomMessHandler::UiccCreateFirstBlockOfAuthRespApdu( TUiccTrId aTrId );
       
  1208 
       
  1209         /**
       
  1210         * Maps sw1 and sw2 from response authenticate apdu to result 
       
  1211         * @param sw1: status of the response
       
  1212         * @param sw2: response apdu
       
  1213         * @return TUint8: command result
       
  1214         */
       
  1215         TUint8 MapSw1Sw2ToAuthenticateResult( TUint8 sw1, TUint8 sw2 );
       
  1216 
       
  1217         /**
       
  1218         * Validates received apdu
       
  1219         * @param aTraId: Identifies the apdu
       
  1220         * @param aApdu: APDU to be verified
       
  1221         * @return TUint8: KApduOk if verified successfully, 
       
  1222         *                 otherwise KApduNok
       
  1223         */
       
  1224         TUint8 ValidateReceivedAuthenticateApdu( 
       
  1225             TInt aTraId, 
       
  1226             const TDesC8& aApdu );
       
  1227 
       
  1228         /**
       
  1229         * Validates received gsm security context apdu for authenticate
       
  1230         * @param aApdu: APDU to be verified
       
  1231         * @return TUint8: KApduOk if verified successfully, 
       
  1232         *                 otherwise KApduNok
       
  1233         */
       
  1234         TUint8 ValidateGsmSecurityContextApduResp( const TDesC8& aApdu );
       
  1235 
       
  1236         /**
       
  1237         * Validates received 3G security context apdu for authenticate
       
  1238         * @param aApdu: APDU to be verified
       
  1239         * @return TUint8: KApduOk if verified successfully, 
       
  1240         *                 otherwise KApduNok
       
  1241         */
       
  1242         TUint8 Validate3GSecurityContextApduResp( const TDesC8& aApdu );
       
  1243 
       
  1244         /**
       
  1245         * Validates received GBA security context apdu (GBA bootstrapping mode)
       
  1246         * for authenticate
       
  1247         * @param aApdu: APDU to be verified
       
  1248         * @return TUint8: KApduOk if verified successfully, 
       
  1249         *                 otherwise KApduNok
       
  1250         */
       
  1251         TUint8 ValidateGBABootstrappingApduResp( const TDesC8& aApdu );
       
  1252 
       
  1253         /**
       
  1254         * Validates received GBA security context apdu (GBA NAF derivation mode)
       
  1255         * for authenticate
       
  1256         * @param aApdu: APDU to be verified
       
  1257         * @return TUint8: KApduOk if verified successfully, 
       
  1258         *                 otherwise KApduNok
       
  1259         */
       
  1260         TUint8 ValidateGBANafDerivationApduResp( const TDesC8& aApdu );
       
  1261 
       
  1262         /**
       
  1263         * Validates received RUN GSM ALGORITHM apdu for authenticate
       
  1264         * @param aApdu: APDU to be verified
       
  1265         * @return TUint8: KApduOk if verified successfully, 
       
  1266         *                 otherwise KApduNok
       
  1267         */
       
  1268         TUint8 ValidateRunGsmAlgorithmApduResp( const TDesC8& aApdu );
       
  1269 
       
  1270         /**
       
  1271         * Handles MBMS operation data from received MSK Update
       
  1272         * authenticate APDU
       
  1273         * @param aMskUpdate: parameters from MBMS operation data are
       
  1274         *                    inserted to aMskUpdate
       
  1275         * @param aMbmsData: MBMS data got from MSK Update authenticate
       
  1276         *                   APDU
       
  1277         * @return void: none
       
  1278         */
       
  1279         void UiccMskUpdateHandleMbmsOperationData(
       
  1280             RMmCustomAPI::TSimAuthenticationMgvMskUpdate& aMskUpdate,
       
  1281             TDesC8& aMbmsData );
       
  1282 
       
  1283         /**
       
  1284         * Handles OMA BCAST operation data from received authenticate
       
  1285         * APDU
       
  1286         * @param aMskUpdate: parameters from MBMS operation data are
       
  1287         *                    inserted to aMskUpdate
       
  1288         * @param aMbmsData: APDU data
       
  1289         * @return void: none
       
  1290         */
       
  1291         void UiccMskUpdateHandleOMABcastOperationData( 
       
  1292             RMmCustomAPI::TSimAuthenticationMgvMskUpdate& aMskUpdate,
       
  1293             TDesC8& aMbmsData );
       
  1294 
       
  1295         /**
       
  1296         * Handles MBMS operation data from received MTK Generation
       
  1297         * authenticate APDU
       
  1298         * @param aMskUpdate: parameters from MBMS operation data are
       
  1299         *                    inserted to aMskUpdate
       
  1300         * @param aMbmsData: APDU data
       
  1301         * @return void: none
       
  1302         */
       
  1303         void UiccMtkGenHandleMbmsOperationData( 
       
  1304             RMmCustomAPI::TSimAuthenticationMgvMtkGeneration& aMtkGen,
       
  1305             TDesC8& aMbmsData );
       
  1306 
       
  1307         /**
       
  1308         * Handles OMA BCAST operation data from received MTK Generation
       
  1309         * authenticate APDU
       
  1310         * @param aMtkGen: parameters from MBMS operation data are
       
  1311         *                    inserted to aMtkGen
       
  1312         * @param aMbmsData: APDU data
       
  1313         * @return void: none
       
  1314         */
       
  1315         void UiccMtkGenHandleOMABcastOperationData( 
       
  1316             RMmCustomAPI::TSimAuthenticationMgvMtkGeneration& aMtkGen,
       
  1317             TDesC8& aMbmsData );
       
  1318 
       
  1319         /**
       
  1320         * Finds tlv objects from BER TLV object
       
  1321         * @param aTlvTag: tag of teh tlv object to be search
       
  1322         * @param aBerTlv: BER TLV object where to search
       
  1323         * @param aTlvObject: tlv object data is copied to this 
       
  1324         *                    parameter, if it's found
       
  1325         * @return TBool: ETrue if tlv object found, otherwise EFalse
       
  1326         */
       
  1327         TBool FindTlvObject(
       
  1328             TUint8 aTlvTag,
       
  1329             const TDesC8& aBerTlv,
       
  1330             TDes8& aTlvObject );
       
  1331 
       
  1332         /**
       
  1333         * calculates the UMTS Ciphering Key (CK) from the GSM
       
  1334         * Ciphering Key (Kc). This is done by using the c4 algorithm defined in
       
  1335         * 3GPP TS 33.102 v3.8.0 (Release 1999).
       
  1336         * @param aCk: Result is inserted to this parameter
       
  1337         * @param aKc:     Kc which is used in calculation
       
  1338         * @return void: none
       
  1339         */
       
  1340         void DeriveCkFromKc( 
       
  1341             TDes8& aCk,
       
  1342             const TDesC8& aKc );
       
  1343 
       
  1344         /** derives the UMTS Integrity Key (IK) from the GSM
       
  1345         * Ciphering Key (Kc). This is done by using the c5 algorithm defined in
       
  1346         * 3GPP TS 33.102 v3.8.0 (release 1999).
       
  1347         * @param aEapAka: Result is inserted to this parameter
       
  1348         * @param aKc:     Kc which is used in calculation
       
  1349         * @return void: none
       
  1350         */
       
  1351         void DeriveIkFromKc(
       
  1352             TDes8& aIk,
       
  1353             const TDesC8& aKc );
       
  1354 
       
  1355         /** Handles the IMS authentication
       
  1356         * @param aDataPackage: data containing authentication parameters
       
  1357         * @return TInt: KErrNone / Error value from phonet
       
  1358         */
       
  1359         TInt UiccHandleImsAuthentication( const CMmDataPackage& aDataPackage );
       
  1360 
       
  1361         /**
       
  1362         * Handles response for ISim application activation
       
  1363         * @param aStatus: status of the response
       
  1364         * @return void: none
       
  1365         */
       
  1366         void UiccHandleIsimActivationResp( TInt aStatus );
       
  1367 
       
  1368     protected: // Data
       
  1369 
       
  1370         // Pointer to the PhonetSender
       
  1371         CMmPhoNetSender* iPhoNetSender;
       
  1372 
       
  1373     private: // Data
       
  1374 
       
  1375         // Pointer to the Message router
       
  1376         CMmMessageRouter* iMessageRouter;
       
  1377 
       
  1378         // Pointer to the Net message handler
       
  1379         CMmNetMessHandler* iNetMessHandler;
       
  1380 
       
  1381         // Pointer to the Security message handler
       
  1382         CMmSecurityMessHandler* iSecurityMessHandler;
       
  1383 
       
  1384         // Release cause value sent
       
  1385         TUint8 iReleaseCauseValueSent;
       
  1386 
       
  1387         // List of Ciphering values, for buffering purpose
       
  1388         RArray<TCiphListEntry> *iListOfCiphValues;
       
  1389 
       
  1390         // Is indication a refresh indication
       
  1391         TBool iIsRefresh;
       
  1392 
       
  1393         // Emergency number checking mode
       
  1394         RMmCustomAPI::TCheckMode iUsedEmergencyNbrCheckMode;
       
  1395 
       
  1396         // Lenght of the emergency number to be checked
       
  1397         TInt iEmergencyNumberLength;
       
  1398 
       
  1399         // Buffer to hold RAND_PARAMS subblock data
       
  1400         TBuf8<20> iRandBuf;
       
  1401 
       
  1402         // Buffer to hold AUTN_PARAMS subblock data
       
  1403         TBuf8<20> iAutnBuf;
       
  1404 
       
  1405         // Buffer to hold B-Tid data
       
  1406         TBuf8<256> iBTidBuf;
       
  1407 
       
  1408         // Buffer to hold keylifetime data
       
  1409         TBuf8<256> iKeyLifetimeBuf;
       
  1410 
       
  1411         // Buffer to hold SIM_SB_AM_GBA_NAF_ID_ID subblock data
       
  1412         TBuf8<254> iNafIdBuf;
       
  1413 
       
  1414         // Buffer to hold SIM_SB_IMS_PRIVATE_USER_ID subblock data
       
  1415         TBuf8<254> iImpiBuf;
       
  1416 
       
  1417         // Buffer for Mikey data.
       
  1418         RMmCustomAPI::TMikey iMikey;
       
  1419 
       
  1420         // Buffer for key domain id data
       
  1421         RMmCustomAPI::TKeyDomainId iKeyDomainId;
       
  1422 
       
  1423         // Buffer for key group id data
       
  1424         RMmCustomAPI::TKeyGroupId iKeyGroupIdPart;
       
  1425 
       
  1426         // Viag Home Zone Parameters
       
  1427         RMmCustomAPI::TViagParams iViagParams;
       
  1428 
       
  1429         // Cb msg ids max count
       
  1430         TInt iCbMsgIdsMaxCount;
       
  1431 
       
  1432         // Saves the SIM CB topic number for deletion
       
  1433         TUint iSimCBTopicToBeDeleted;
       
  1434 
       
  1435         // Is the SIM topic is being deleted (ETrue ) or not (EFalse)
       
  1436         TBool iTopicInSimMemoryDelete;
       
  1437 
       
  1438         // Enhanced Cell Information
       
  1439         TECIDInfo iECIDInfo;
       
  1440 
       
  1441         // Is ECIDInfo requested
       
  1442         TBool iECIDInfoRequested;
       
  1443 
       
  1444         // Call Life Timer;
       
  1445         TInt iCallLifeTimer;
       
  1446 
       
  1447         // Conter for record retries from PMM during read.
       
  1448         TUint8 iPMMReadRetryCounter;
       
  1449 
       
  1450         // Pointer to UICC message handler
       
  1451         CMmUiccMessHandler* iMmUiccMessHandler;
       
  1452 
       
  1453         //keeps track...
       
  1454         TUint8 iSapApduIfState;
       
  1455 
       
  1456         // is Isim application already activated
       
  1457         TBool iIsimApplActivated;
       
  1458 
       
  1459     public: // Friend classes
       
  1460         //None
       
  1461     protected: // Friend classes
       
  1462         //None
       
  1463     private: // Friend classes
       
  1464         //None
       
  1465     };
       
  1466 
       
  1467 #endif // _CMMCUSTOMMESSHANDLER_H
       
  1468 
       
  1469 // End of File