mtpfws/mtpfw/src/cmtpparserrouter.cpp
changeset 49 c20dd21d1eb4
parent 20 6e82ae192c3a
equal deleted inserted replaced
41:2c19c7cf5550 49:c20dd21d1eb4
    24 #include "cmtpparserrouter.h"
    24 #include "cmtpparserrouter.h"
    25 #include "cmtpsession.h"
    25 #include "cmtpsession.h"
    26 #include "cmtpstoragemgr.h"
    26 #include "cmtpstoragemgr.h"
    27 #include "tmtptypeobjecthandle.h"
    27 #include "tmtptypeobjecthandle.h"
    28 #include "cmtpservicemgr.h"
    28 #include "cmtpservicemgr.h"
    29 
    29 #include "mtpdebug.h"
    30 // Class constants.
    30 #include "OstTraceDefinitions.h"
    31 __FLOG_STMT(_LIT8(KComponent,"ParserRouter");)
    31 #ifdef OST_TRACE_COMPILER_IN_USE
       
    32 #include "cmtpparserrouterTraces.h"
       
    33 #endif
       
    34 
       
    35 
    32 
    36 
    33 /**
    37 /**
    34 Provides the byte size of the specified array.
    38 Provides the byte size of the specified array.
    35 */
    39 */
    36 #define _ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
    40 #define _ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
   142 /**
   146 /**
   143 Destructor
   147 Destructor
   144 */
   148 */
   145 CMTPParserRouter::~CMTPParserRouter()
   149 CMTPParserRouter::~CMTPParserRouter()
   146     {
   150     {
   147     __FLOG(_L8("~CMTPParserRouter, Entry"));
   151     OstTraceFunctionEntry0( CMTPPARSERROUTER_CMTPPARSERROUTER_DES_ENTRY );
   148     iMaps.ResetAndDestroy();
   152     iMaps.ResetAndDestroy();
   149     iSingletons.Close();
   153     iSingletons.Close();
   150     __FLOG(_L8("~CMTPParserRouter, Exit"));
   154     OstTraceFunctionExit0( CMTPPARSERROUTER_CMTPPARSERROUTER_DES_EXIT );
   151     __FLOG_CLOSE;
       
   152     }
   155     }
   153 
   156 
   154 /**
   157 /**
   155 Configures the parser/router. This processing primarily involves retrieving 
   158 Configures the parser/router. This processing primarily involves retrieving 
   156 each data provider's set of supported category codes and using them to build
   159 each data provider's set of supported category codes and using them to build
   157 up the operation parameter lookup routing sub-type tables.
   160 up the operation parameter lookup routing sub-type tables.
   158 @leave One of the system wide error codes, if a processing failure occurs.
   161 @leave One of the system wide error codes, if a processing failure occurs.
   159 */
   162 */
   160 EXPORT_C void CMTPParserRouter::ConfigureL()
   163 EXPORT_C void CMTPParserRouter::ConfigureL()
   161     {
   164     {
   162     __FLOG(_L8("ConfigureL, Entry"));    
   165     OstTraceFunctionEntry0( CMTPPARSERROUTER_CONFIGUREL_ENTRY );
   163     const TUint KMapIds[] = 
   166     const TUint KMapIds[] = 
   164         {
   167         {
   165         ESubTypeDevicePropCode,
   168         ESubTypeDevicePropCode,
   166         ESubTypeObjectPropCode,
   169         ESubTypeObjectPropCode,
   167         ESubTypeOperationCode,
   170         ESubTypeOperationCode,
   213         CleanupStack::PopAndDestroy(&p3Codes);
   216         CleanupStack::PopAndDestroy(&p3Codes);
   214         CleanupStack::PopAndDestroy(&p2Codes);
   217         CleanupStack::PopAndDestroy(&p2Codes);
   215         CleanupStack::PopAndDestroy(&p1Codes);
   218         CleanupStack::PopAndDestroy(&p1Codes);
   216         }
   219         }
   217         
   220         
   218     __FLOG_STMT(FLOGMapsL());
   221 #ifdef OST_TRACE_COMPILER_IN_USE
   219     __FLOG(_L8("ConfigureL, Exit"));
   222     OSTMapsL();
       
   223 #endif
       
   224     
       
   225     OstTraceFunctionExit0( CMTPPARSERROUTER_CONFIGUREL_EXIT );
   220     }
   226     }
   221     
   227     
   222 /**
   228 /**
   223 Indicates if the specified MTP operation code is supported by any of the set 
   229 Indicates if the specified MTP operation code is supported by any of the set 
   224 of loaded data providers.
   230 of loaded data providers.
   225 @param aOperation The MTP operation code.
   231 @param aOperation The MTP operation code.
   226 @leave One of the system wide error codes, if a processing failure occurs.
   232 @leave One of the system wide error codes, if a processing failure occurs.
   227 */    
   233 */    
   228 EXPORT_C TBool CMTPParserRouter::OperationSupportedL(TUint16 aOperation) const
   234 EXPORT_C TBool CMTPParserRouter::OperationSupportedL(TUint16 aOperation) const
   229     {
   235     {
   230     __FLOG(_L8("OperationSupported, Entry"));
   236     OstTraceFunctionEntry0( CMTPPARSERROUTER_OPERATIONSUPPORTEDL_ENTRY );
   231     RArray<TUint> from;
   237     RArray<TUint> from;
   232     RArray<TUint> to;
   238     RArray<TUint> to;
   233     CleanupClosePushL(from);
   239     CleanupClosePushL(from);
   234     CleanupClosePushL(to);
   240     CleanupClosePushL(to);
   235     
   241     
   237     iMaps[Index(ESubTypeOperationCode)]->GetToL(from, to);
   243     iMaps[Index(ESubTypeOperationCode)]->GetToL(from, to);
   238     TBool ret(to.Count() > 0);
   244     TBool ret(to.Count() > 0);
   239 
   245 
   240     CleanupStack::PopAndDestroy(&to);
   246     CleanupStack::PopAndDestroy(&to);
   241     CleanupStack::PopAndDestroy(&from);
   247     CleanupStack::PopAndDestroy(&from);
   242     __FLOG(_L8("OperationSupported, Exit"));
   248     OstTraceFunctionExit0( CMTPPARSERROUTER_OPERATIONSUPPORTEDL_EXIT );
   243     return (ret);
   249     return (ret);
   244     }
   250     }
   245 
   251 
   246 /**
   252 /**
   247 Parses the operation dataset supplied in the specified routing parameters 
   253 Parses the operation dataset supplied in the specified routing parameters 
   264 operation. 
   270 operation. 
   265 @leave One of the system wide error codes if a processing failure occurs,
   271 @leave One of the system wide error codes if a processing failure occurs,
   266 */
   272 */
   267 EXPORT_C void CMTPParserRouter::ParseOperationRequestL(TRoutingParameters& aParams) const
   273 EXPORT_C void CMTPParserRouter::ParseOperationRequestL(TRoutingParameters& aParams) const
   268     {
   274     {
   269     __FLOG(_L8("ParseOperationRequestL, Entry"));
   275     OstTraceFunctionEntry0( CMTPPARSERROUTER_PARSEOPERATIONREQUESTL_ENTRY );
   270     const TUint16 KOpCode(aParams.Request().Uint16(TMTPTypeRequest::ERequestOperationCode));
   276     const TUint16 KOpCode(aParams.Request().Uint16(TMTPTypeRequest::ERequestOperationCode));
   271     __FLOG_VA((_L8("Operation Code = 0x%04X"), KOpCode));
   277     OstTrace1(TRACE_NORMAL, CMTPPARSERROUTER_PARSEOPERATIONREQUESTL, "Operation Code = 0x%04X", KOpCode);
   272     switch (KOpCode)
   278     switch (KOpCode)
   273         {
   279         {
   274     case EMTPOpCodeGetStorageInfo:
   280     case EMTPOpCodeGetStorageInfo:
   275         ParseOperationRequestParameterL(TMTPTypeRequest::ERequestParameter1, TRoutingParameters::EParamStorageId, aParams);
   281         ParseOperationRequestParameterL(TMTPTypeRequest::ERequestParameter1, TRoutingParameters::EParamStorageId, aParams);
   276         break;
   282         break;
   377     case EMTPOpCodeSkip:
   383     case EMTPOpCodeSkip:
   378     case EMTPOpCodeGetServiceIDs:
   384     case EMTPOpCodeGetServiceIDs:
   379         default:
   385         default:
   380         break;
   386         break;
   381         }
   387         }
   382     __FLOG(_L8("ParseOperationRequestL, Exit"));
   388     OstTraceFunctionExit0( CMTPPARSERROUTER_PARSEOPERATIONREQUESTL_EXIT );
   383     }
   389     }
   384 
   390 
   385 /**
   391 /**
   386 Routes an MTP operation using the specified routing parameters. By default 
   392 Routes an MTP operation using the specified routing parameters. By default 
   387 only operation parameter routing is performed.
   393 only operation parameter routing is performed.
   390 operation should be dispatched.
   396 operation should be dispatched.
   391 @leave One of the system wide error codes if a processing failure occurs,
   397 @leave One of the system wide error codes if a processing failure occurs,
   392 */
   398 */
   393 EXPORT_C void CMTPParserRouter::RouteOperationRequestL(const TRoutingParameters& aParams, RArray<TUint>& aTargets) const
   399 EXPORT_C void CMTPParserRouter::RouteOperationRequestL(const TRoutingParameters& aParams, RArray<TUint>& aTargets) const
   394     {
   400     {
   395     __FLOG(_L8("RouteOperationRequestL, Entry"));
   401     OstTraceFunctionEntry0( CMTPPARSERROUTER_ROUTEOPERATIONREQUESTL_ENTRY );
   396     aTargets.Reset();
   402     aTargets.Reset();
   397     
   403     
   398     // By default ETypeOperationParameter routing is always enabled.
   404     // By default ETypeOperationParameter routing is always enabled.
   399     if (!(aParams.Param(TRoutingParameters::EFlagRoutingTypes) & ETypeOperationParameter))
   405     if (!(aParams.Param(TRoutingParameters::EFlagRoutingTypes) & ETypeOperationParameter))
   400         {
   406         {
   456             }
   462             }
   457         }    
   463         }    
   458     CleanupStack::PopAndDestroy(&params);
   464     CleanupStack::PopAndDestroy(&params);
   459     CleanupStack::PopAndDestroy(&validation);
   465     CleanupStack::PopAndDestroy(&validation);
   460     CleanupStack::PopAndDestroy(&routing);
   466     CleanupStack::PopAndDestroy(&routing);
   461     __FLOG(_L8("RouteOperationRequestL, Exit"));
   467     OstTraceFunctionExit0( CMTPPARSERROUTER_ROUTEOPERATIONREQUESTL_EXIT );
   462     }
   468     }
   463 
   469 
   464 /**
   470 /**
   465 Indicates if a routing request with the specified MTP operation code is 
   471 Indicates if a routing request with the specified MTP operation code is 
   466 registered on the specified session.
   472 registered on the specified session.
   472 registered on the session, otherwise EFalse.
   478 registered on the session, otherwise EFalse.
   473 @leave One of the system wide error codes, if a processing failure occurs.
   479 @leave One of the system wide error codes, if a processing failure occurs.
   474 */
   480 */
   475 EXPORT_C TBool CMTPParserRouter::RouteRequestRegisteredL(const TMTPTypeRequest& aRequest, MMTPConnection& aConnection) const
   481 EXPORT_C TBool CMTPParserRouter::RouteRequestRegisteredL(const TMTPTypeRequest& aRequest, MMTPConnection& aConnection) const
   476     {
   482     {
   477     __FLOG(_L8("RouteRequestRegistered, Entry"));
   483     OstTraceFunctionEntry0( CMTPPARSERROUTER_ROUTEREQUESTREGISTEREDL_ENTRY );
   478     TBool ret(EFalse);
   484     TBool ret(EFalse);
   479     const TUint32 KSessionId(aRequest.Uint32(TMTPTypeRequest::ERequestSessionID));
   485     const TUint32 KSessionId(aRequest.Uint32(TMTPTypeRequest::ERequestSessionID));
   480     if ((KSessionId != KMTPSessionAll) && (aConnection.SessionWithMTPIdExists(KSessionId)))
   486     if ((KSessionId != KMTPSessionAll) && (aConnection.SessionWithMTPIdExists(KSessionId)))
   481         {
   487         {
   482         CMTPSession& session(static_cast<CMTPSession&>(aConnection.SessionWithMTPIdL(KSessionId)));
   488         CMTPSession& session(static_cast<CMTPSession&>(aConnection.SessionWithMTPIdL(KSessionId)));
   483         ret = session.RouteRequestRegistered(aRequest.Uint16(TMTPTypeRequest::ERequestOperationCode));
   489         ret = session.RouteRequestRegistered(aRequest.Uint16(TMTPTypeRequest::ERequestOperationCode));
   484         }
   490         }
   485     __FLOG(_L8("RouteRequestRegistered, Exit"));
   491     OstTraceFunctionExit0( CMTPPARSERROUTER_ROUTEREQUESTREGISTEREDL_EXIT );
   486     return ret;
   492     return ret;
   487     }
   493     }
   488    
   494    
   489 /**
   495 /**
   490 Routes and dispatches the specified MTP event dataset. The only valid event 
   496 Routes and dispatches the specified MTP event dataset. The only valid event 
   496 @param aConnection The MTP connection on which the event was received.
   502 @param aConnection The MTP connection on which the event was received.
   497 @leave One of the system wide error codes, if a processing failure occurs.
   503 @leave One of the system wide error codes, if a processing failure occurs.
   498 */
   504 */
   499 void CMTPParserRouter::ProcessEventL(const TMTPTypeEvent& aEvent, CMTPConnection& aConnection) const
   505 void CMTPParserRouter::ProcessEventL(const TMTPTypeEvent& aEvent, CMTPConnection& aConnection) const
   500     {
   506     {
   501     __FLOG(_L8("ProcessEventL, Entry"));
   507     OstTraceFunctionEntry0( CMTPPARSERROUTER_PROCESSEVENTL_ENTRY );
   502     if ((aEvent.Uint16(TMTPTypeEvent::EEventCode) == EMTPEventCodeCancelTransaction) &&
   508     if ((aEvent.Uint16(TMTPTypeEvent::EEventCode) == EMTPEventCodeCancelTransaction) &&
   503         (aConnection.SessionWithMTPIdExists(aEvent.Uint32(TMTPTypeEvent::EEventSessionID))))
   509         (aConnection.SessionWithMTPIdExists(aEvent.Uint32(TMTPTypeEvent::EEventSessionID))))
   504         {
   510         {
   505         CMTPSession& session(static_cast<CMTPSession&>(aConnection.SessionWithMTPIdL(aEvent.Uint32(TMTPTypeEvent::EEventSessionID))));
   511         CMTPSession& session(static_cast<CMTPSession&>(aConnection.SessionWithMTPIdL(aEvent.Uint32(TMTPTypeEvent::EEventSessionID))));
   506         if (session.TransactionPhase() != EIdlePhase)
   512         if (session.TransactionPhase() != EIdlePhase)
   507             {    
   513             {    
   508             iSingletons.DpController().DataProviderL(RoutingTargetL(session.ActiveRequestL(), aConnection)).ExecuteEventL(aEvent, aConnection);
   514             iSingletons.DpController().DataProviderL(RoutingTargetL(session.ActiveRequestL(), aConnection)).ExecuteEventL(aEvent, aConnection);
   509             }
   515             }
   510         }
   516         }
   511     __FLOG(_L8("ProcessEventL, Exit"));
   517     OstTraceFunctionExit0( CMTPPARSERROUTER_PROCESSEVENTL_EXIT );
   512     }
   518     }
   513    
   519    
   514 /**
   520 /**
   515 Routes and dispatches the specified MTP operation (request) dataset.
   521 Routes and dispatches the specified MTP operation (request) dataset.
   516 @param aRequest The MTP operation (request) dataset.
   522 @param aRequest The MTP operation (request) dataset.
   517 @param aConnection The MTP connection on which the event was received.
   523 @param aConnection The MTP connection on which the event was received.
   518 @leave One of the system wide error codes, if a processing failure occurs.
   524 @leave One of the system wide error codes, if a processing failure occurs.
   519 */
   525 */
   520 void CMTPParserRouter::ProcessRequestL(const TMTPTypeRequest& aRequest, CMTPConnection& aConnection) const
   526 void CMTPParserRouter::ProcessRequestL(const TMTPTypeRequest& aRequest, CMTPConnection& aConnection) const
   521     {
   527     {
   522     __FLOG(_L8("ProcessRequestL, Entry")); 
   528     OstTraceFunctionEntry0( CMTPPARSERROUTER_PROCESSREQUESTL_ENTRY );
   523     iSingletons.DpController().DataProviderL(RoutingTargetL(aRequest, aConnection)).ExecuteRequestL(aRequest, aConnection);
   529     iSingletons.DpController().DataProviderL(RoutingTargetL(aRequest, aConnection)).ExecuteRequestL(aRequest, aConnection);
   524     __FLOG(_L8("ProcessRequestL, Exit"));
   530     OstTraceFunctionExit0( CMTPPARSERROUTER_PROCESSREQUESTL_EXIT );
   525     }
   531     }
   526 
   532 
   527 /**
   533 /**
   528 Registers the calling data provider to receive one or more occurrences of 
   534 Registers the calling data provider to receive one or more occurrences of 
   529 the specified request dataset that are received on the specified connection.
   535 the specified request dataset that are received on the specified connection.
   534 @leave One of the system wide error codes, if a processing failure occurs.
   540 @leave One of the system wide error codes, if a processing failure occurs.
   535 @see MMTPDataProviderFramework::RouteRequestRegisterL
   541 @see MMTPDataProviderFramework::RouteRequestRegisterL
   536 */
   542 */
   537 void CMTPParserRouter::RouteRequestRegisterL(const TMTPTypeRequest& aRequest, MMTPConnection& aConnection, TInt aId)
   543 void CMTPParserRouter::RouteRequestRegisterL(const TMTPTypeRequest& aRequest, MMTPConnection& aConnection, TInt aId)
   538     {
   544     {
   539     __FLOG(_L8("RouteRequestRegisterL, Entry"));
   545     OstTraceFunctionEntry0( CMTPPARSERROUTER_ROUTEREQUESTREGISTERL_ENTRY );
   540     const TUint32 KSessionId(aRequest.Uint32(TMTPTypeRequest::ERequestSessionID));
   546     const TUint32 KSessionId(aRequest.Uint32(TMTPTypeRequest::ERequestSessionID));
   541     if (KSessionId == KMTPSessionAll)
   547     if (KSessionId == KMTPSessionAll)
   542         {
   548         {
   543         // Register the request on all sessions.
   549         // Register the request on all sessions.
   544         const TUint KNumSessions(aConnection.SessionCount());
   550         const TUint KNumSessions(aConnection.SessionCount());
   562     else
   568     else
   563         {
   569         {
   564         CMTPSession& session(static_cast<CMTPSession&>(aConnection.SessionWithMTPIdL(KSessionId)));
   570         CMTPSession& session(static_cast<CMTPSession&>(aConnection.SessionWithMTPIdL(KSessionId)));
   565         session.RouteRequestRegisterL(aRequest, aId);
   571         session.RouteRequestRegisterL(aRequest, aId);
   566         }
   572         }
   567     __FLOG(_L8("RouteRequestRegisterL, Exit"));
   573     OstTraceFunctionExit0( CMTPPARSERROUTER_ROUTEREQUESTREGISTERL_EXIT );
   568     }
   574     }
   569 
   575 
   570 /**
   576 /**
   571 Cancels a pending RouteRequestRegisterL registration.
   577 Cancels a pending RouteRequestRegisterL registration.
   572 @param aRequest The registered operation request dataset.
   578 @param aRequest The registered operation request dataset.
   576 occurs.
   582 occurs.
   577 @see MMTPDataProviderFramework::RouteRequestUnregisterL
   583 @see MMTPDataProviderFramework::RouteRequestUnregisterL
   578 */
   584 */
   579 void CMTPParserRouter::RouteRequestUnregisterL(const TMTPTypeRequest& aRequest, MMTPConnection& aConnection)
   585 void CMTPParserRouter::RouteRequestUnregisterL(const TMTPTypeRequest& aRequest, MMTPConnection& aConnection)
   580     {
   586     {
   581     __FLOG(_L8("RouteRequestUnregisterL, Entry"));
   587     OstTraceFunctionEntry0( CMTPPARSERROUTER_ROUTEREQUESTUNREGISTERL_ENTRY );
   582     CMTPSession& session(static_cast<CMTPSession&>(aConnection.SessionWithMTPIdL(aRequest.Uint32(TMTPTypeRequest::ERequestSessionID))));
   588     CMTPSession& session(static_cast<CMTPSession&>(aConnection.SessionWithMTPIdL(aRequest.Uint32(TMTPTypeRequest::ERequestSessionID))));
   583     session.RouteRequestUnregister(aRequest);
   589     session.RouteRequestUnregister(aRequest);
   584     __FLOG(_L8("RouteRequestUnregisterL, Exit"));
   590     OstTraceFunctionExit0( CMTPPARSERROUTER_ROUTEREQUESTUNREGISTERL_EXIT );
   585     }
   591     }
   586 
   592 
   587 /**
   593 /**
   588 Constructor.
   594 Constructor.
   589 @param aFrom The map source parameter.
   595 @param aFrom The map source parameter.
   632         }
   638         }
   633     else
   639     else
   634         {
   640         {
   635         iToBranches.ResetAndDestroy();
   641         iToBranches.ResetAndDestroy();
   636         }
   642         }
   637     __FLOG_CLOSE;
       
   638     }
   643     }
   639     
   644     
   640 /**
   645 /**
   641 Provides the map source parameter.
   646 Provides the map source parameter.
   642 @return The map source parameter.
   647 @return The map source parameter.
   675     {
   680     {
   676     const TUint KFrom(Param(aFrom));
   681     const TUint KFrom(Param(aFrom));
   677     if (Params(iSubType) == ESubTypeParams1)
   682     if (Params(iSubType) == ESubTypeParams1)
   678         {
   683         {
   679         // Node.
   684         // Node.
   680         __FLOG_STMT(FLOGMapEntryL(aFrom, aTo));
   685 #ifdef OST_TRACE_COMPILER_IN_USE
       
   686         OSTMapEntryL(aFrom, aTo);
       
   687 #endif
   681         const TUint KSubType(CMTPParserRouter::SubType(Index(iSubType), Flags(iSubType), (ParamsCount(iSubType) - 1)));
   688         const TUint KSubType(CMTPParserRouter::SubType(Index(iSubType), Flags(iSubType), (ParamsCount(iSubType) - 1)));
   682         const TMap KNode(KFrom, aTo, KSubType);
   689         const TMap KNode(KFrom, aTo, KSubType);
   683         NodeInsertL(KNode);
   690         NodeInsertL(KNode);
   684         }
   691         }
   685     else
   692     else
   702 @leave One of the system wide error codes, if a general processing error 
   709 @leave One of the system wide error codes, if a general processing error 
   703 occurs.
   710 occurs.
   704 */
   711 */
   705 void CMTPParserRouter::CMap::GetToL(const RArray<TUint>& aFrom, RArray<TUint>& aTo) const
   712 void CMTPParserRouter::CMap::GetToL(const RArray<TUint>& aFrom, RArray<TUint>& aTo) const
   706     {
   713     {
   707     __FLOG(_L8("CMap::GetToL - entry"));
   714     OstTraceFunctionEntry0( CMAP_GETTOL_ENTRY );
   708     const TUint KFrom(Param(aFrom));
   715     const TUint KFrom(Param(aFrom));
   709     if (KFrom == KMTPNotSpecified32)
   716     if (KFrom == KMTPNotSpecified32)
   710         {
   717         {
   711         // Null (zero) parameter acts as a wildcard.
   718         // Null (zero) parameter acts as a wildcard.
   712         SelectTargetAllL(aFrom, aTo);
   719         SelectTargetAllL(aFrom, aTo);
   718         }
   725         }
   719     else
   726     else
   720         {
   727         {
   721         // Select 0 .. 1 matching targets.
   728         // Select 0 .. 1 matching targets.
   722         SelectTargetSingleL(aFrom, aTo);
   729         SelectTargetSingleL(aFrom, aTo);
   723         }
   730         }   
   724 	__FLOG(_L8("CMap::GetToL - Exit"));        
   731     OstTraceFunctionExit0( CMAP_GETTOL_EXIT );
   725     }
   732     }
   726     
   733     
   727 /**
   734 /**
   728 Provides the map subtype code.
   735 Provides the map subtype code.
   729 @return The map subtype code.
   736 @return The map subtype code.
   731 TUint CMTPParserRouter::CMap::SubType() const
   738 TUint CMTPParserRouter::CMap::SubType() const
   732     {
   739     {
   733     return iSubType;
   740     return iSubType;
   734     }
   741     }
   735 
   742 
   736 #ifdef __FLOG_ACTIVE
   743 #ifdef OST_TRACE_COMPILER_IN_USE
   737 /**
   744 /**
   738 Logs the map table entries (source and target) which match the specified source 
   745 Logs the map table entries (source and target) which match the specified source 
   739 parameters.
   746 parameters.
   740 @param aFrom The map source parameters.
   747 @param aFrom The map source parameters.
   741 @leave One of the system wide error codes, if a general processing error 
   748 @leave One of the system wide error codes, if a general processing error 
   742 occurs.
   749 occurs.
   743 */  
   750 */  
   744 void CMTPParserRouter::CMap::FLOGMapL(RArray<TUint>& aFrom) const
   751 void CMTPParserRouter::CMap::OSTMapL(RArray<TUint>& aFrom) const
   745     {
   752     {
   746     if (Params(iSubType) == ESubTypeParams1)
   753     if (Params(iSubType) == ESubTypeParams1)
   747         {
   754         {
   748         // Node.
   755         // Node.
   749         const TUint KCount(iToNodes.Count());
   756         const TUint KCount(iToNodes.Count());
   750         for (TUint i(0); (i < KCount); i++)
   757         for (TUint i(0); (i < KCount); i++)
   751             {
   758             {
   752             aFrom[ParamIdx(aFrom)] = iToNodes[i].iFrom;
   759             aFrom[ParamIdx(aFrom)] = iToNodes[i].iFrom;
   753             FLOGMapEntryL(aFrom, iToNodes[i].iTo);
   760             OSTMapEntryL(aFrom, iToNodes[i].iTo);
   754             }
   761             }
   755         }
   762         }
   756     else 
   763     else 
   757         {
   764         {
   758         // Branch.
   765         // Branch.
   759         const TUint KCount(iToBranches.Count());
   766         const TUint KCount(iToBranches.Count());
   760         for (TUint i(0); (i < KCount); i++)
   767         for (TUint i(0); (i < KCount); i++)
   761             {
   768             {
   762             const CMap& KBranch(*iToBranches[i]);
   769             const CMap& KBranch(*iToBranches[i]);
   763             aFrom[ParamIdx(aFrom)] = KBranch.iFrom;
   770             aFrom[ParamIdx(aFrom)] = KBranch.iFrom;
   764             KBranch.FLOGMapL(aFrom);
   771             KBranch.OSTMapL(aFrom);
   765             }
   772             }
   766         }
   773         }
   767     }
   774     }
   768     
   775     
   769 /**
   776 /**
   771 @param aFrom The map source parameters.
   778 @param aFrom The map source parameters.
   772 @param aTo The map target parameter.
   779 @param aTo The map target parameter.
   773 @leave One of the system wide error codes, if a general processing error 
   780 @leave One of the system wide error codes, if a general processing error 
   774 occurs.
   781 occurs.
   775 */
   782 */
   776 void CMTPParserRouter::CMap::FLOGMapEntryL(const RArray<TUint>& aFrom, TUint aTo) const
   783 void CMTPParserRouter::CMap::OSTMapEntryL(const RArray<TUint>& aFrom, TUint aTo) const
   777     {
   784     {
   778     __ASSERT_DEBUG((aFrom.Count() >= ParamsCount(iSubType)), User::Invariant());
   785     __ASSERT_DEBUG((aFrom.Count() >= ParamsCount(iSubType)), User::Invariant());
   779     RBuf log;
   786     RBuf log;
   780     log.CleanupClosePushL();
   787     log.CleanupClosePushL();
   781     const TUint KParamsCount(aFrom.Count());
   788     const TUint KParamsCount(aFrom.Count());
   789         log.AppendNumFixedWidthUC(aFrom[i], EHex, KWidthFrom);
   796         log.AppendNumFixedWidthUC(aFrom[i], EHex, KWidthFrom);
   790         log.Append(_L(" "));
   797         log.Append(_L(" "));
   791         }
   798         }
   792     log.Append(_L("-> 0x"));
   799     log.Append(_L("-> 0x"));
   793     log.AppendNumFixedWidthUC(aTo, EHex, KWidthTo);
   800     log.AppendNumFixedWidthUC(aTo, EHex, KWidthTo);
   794     __FLOG(log);
   801     OstTraceExt1(TRACE_NORMAL, CMTPPARSERROUTER_CMAP_OSTMAPENTRYL, "%S", log);
   795     CleanupStack::PopAndDestroy(&log);
   802     CleanupStack::PopAndDestroy(&log);
   796     }
   803     }
   797 #endif
   804 #endif
   798 
   805 
   799 /**
   806 /**
   826 /**
   833 /**
   827 Second-phase constructor.
   834 Second-phase constructor.
   828 */
   835 */
   829 void CMTPParserRouter::CMap::ConstructL()
   836 void CMTPParserRouter::CMap::ConstructL()
   830     {
   837     {
   831     __FLOG_OPEN(KMTPSubsystem, KComponent);
       
   832     }
   838     }
   833     
   839     
   834 /**
   840 /**
   835 Locates the map branch table index of the first map table entry matching the 
   841 Locates the map branch table index of the first map table entry matching the 
   836 specified source parameter, using a binary search algorithm.
   842 specified source parameter, using a binary search algorithm.
   908             {
   914             {
   909             Panic(EMTPPanicRoutingConflict);
   915             Panic(EMTPPanicRoutingConflict);
   910             }
   916             }
   911         else
   917         else
   912             {
   918             {
   913             User::LeaveIfError(err);
   919             LEAVEIFERROR(err,
       
   920                     OstTrace1( TRACE_ERROR, CMAP_NODEINSERTL, "Inserts the specified map node into the map node table failed, error code %d", err ));
   914             }
   921             }
   915         }
   922         }
   916     const TInt KIdx(NodeFind(aMap));
   923     const TInt KIdx(NodeFind(aMap));
   917     __ASSERT_DEBUG((KIdx != KErrNotFound), User::Invariant());
   924     __ASSERT_DEBUG((KIdx != KErrNotFound), User::Invariant());
   918     return KIdx;
   925     return KIdx;
   976 @leave One of the system wide error codes, if a general processing error 
   983 @leave One of the system wide error codes, if a general processing error 
   977 occurs.
   984 occurs.
   978 */
   985 */
   979 void CMTPParserRouter::CMap::SelectTargetMatchingL(const RArray<TUint>& aFrom, RArray<TUint>& aTo) const
   986 void CMTPParserRouter::CMap::SelectTargetMatchingL(const RArray<TUint>& aFrom, RArray<TUint>& aTo) const
   980     {
   987     {
   981     __FLOG(_L8("CMap::SelectTargetMatchingL - entry"));
   988     OstTraceFunctionEntry0( CMAP_SELECTTARGETMATCHINGL_ENTRY );
   982     const TUint KFrom(Param(aFrom));
   989     const TUint KFrom(Param(aFrom));
   983     TInt idx(KErrNotFound);
   990     TInt idx(KErrNotFound);
   984     if (Params(iSubType) == ESubTypeParams1)
   991     if (Params(iSubType) == ESubTypeParams1)
   985         {
   992         {
   986         idx = iToNodes.SpecificFindInOrder(TMap(KFrom), ((iSubType & ESubTypeFlagOrderDescending) ? NodeOrderFromDescending : NodeOrderFromAscending), EArrayFindMode_First);                
   993         idx = iToNodes.SpecificFindInOrder(TMap(KFrom), ((iSubType & ESubTypeFlagOrderDescending) ? NodeOrderFromDescending : NodeOrderFromAscending), EArrayFindMode_First);                
  1001         const TUint KCount(iToBranches.Count());
  1008         const TUint KCount(iToBranches.Count());
  1002         while ((idx < KCount) && (iToBranches[idx]->From() == KFrom))
  1009         while ((idx < KCount) && (iToBranches[idx]->From() == KFrom))
  1003             {
  1010             {
  1004             iToBranches[idx++]->GetToL(aFrom, aTo);
  1011             iToBranches[idx++]->GetToL(aFrom, aTo);
  1005             }
  1012             }
  1006         }
  1013         }    
  1007 	__FLOG(_L8("CMap::SelectTargetMatchingL - exit"));        
  1014     OstTraceFunctionExit0( CMAP_SELECTTARGETMATCHINGL_EXIT );
  1008     }
  1015     }
  1009 
  1016 
  1010 /**
  1017 /**
  1011 Selects the first map target which matches the specified source parameters.
  1018 Selects the first map target which matches the specified source parameters.
  1012 @param aFrom The map source parameter set.
  1019 @param aFrom The map source parameter set.
  1205 /**
  1212 /**
  1206 Second-phase constructor.
  1213 Second-phase constructor.
  1207 */
  1214 */
  1208 void CMTPParserRouter::ConstructL()
  1215 void CMTPParserRouter::ConstructL()
  1209     {
  1216     {
  1210     __FLOG_OPEN(KMTPSubsystem, KComponent);
  1217     OstTraceFunctionEntry0( CMTPPARSERROUTER_CONSTRUCTL_ENTRY );
  1211     __FLOG(_L8("ConstructL, Entry"));
       
  1212     iSingletons.OpenL();
  1218     iSingletons.OpenL();
  1213     __FLOG(_L8("ConstructL, Exit"));
  1219     OstTraceFunctionExit0( CMTPPARSERROUTER_CONSTRUCTL_EXIT );
  1214     }
  1220     }
  1215     
  1221     
  1216 /**
  1222 /**
  1217 Provides the set of @see TMTPSupportCategory codes which comprise each of the 
  1223 Provides the set of @see TMTPSupportCategory codes which comprise each of the 
  1218 lookup parameters for the specified routing sub-type (routing map).
  1224 lookup parameters for the specified routing sub-type (routing map).
  1299 occurs.
  1305 occurs.
  1300 
  1306 
  1301 */    
  1307 */    
  1302 void CMTPParserRouter::SelectTargetL(TUint aTarget, RArray<TUint>& aTargets)
  1308 void CMTPParserRouter::SelectTargetL(TUint aTarget, RArray<TUint>& aTargets)
  1303     {
  1309     {
  1304     __FLOG_STATIC(KMTPSubsystem, KComponent, _L8("SelectTargetL, Entry"));
  1310     OstTraceFunctionEntry0( CMTPPARSERROUTER_SELECTTARGETL_ENTRY );
  1305     TInt idx(aTargets.Find(aTarget));
  1311     TInt idx(aTargets.Find(aTarget));
  1306     if (idx != KErrNotFound)
  1312     if (idx != KErrNotFound)
  1307         {
  1313         {
  1308         aTargets.Remove(idx);
  1314         aTargets.Remove(idx);
  1309         }
  1315         }
  1310     aTargets.AppendL(aTarget);
  1316     aTargets.AppendL(aTarget);
  1311     __FLOG_STATIC(KMTPSubsystem, KComponent, _L8("SelectTargetL, Exit"));
  1317     OstTraceFunctionExit0( CMTPPARSERROUTER_SELECTTARGETL_EXIT );
  1312     }
  1318     }
  1313 
  1319 
  1314 /**
  1320 /**
  1315 Configures (loads) the specified one lookup parameter routing sub-type map. The
  1321 Configures (loads) the specified one lookup parameter routing sub-type map. The
  1316 map is constructed by interrogating each data provider in turn and building a 
  1322 map is constructed by interrogating each data provider in turn and building a 
  1331     
  1337     
  1332     const TUint KCount(iSingletons.DpController().Count());
  1338     const TUint KCount(iSingletons.DpController().Count());
  1333     for (TUint d(0); (d < KCount); d++)
  1339     for (TUint d(0); (d < KCount); d++)
  1334         {
  1340         {
  1335         CMTPDataProvider& dp(iSingletons.DpController().DataProviderByIndexL(d));
  1341         CMTPDataProvider& dp(iSingletons.DpController().DataProviderByIndexL(d));
  1336         __FLOG(_L8(""));
  1342         OstTrace0(TRACE_NORMAL, CMTPPARSERROUTER_CONFIGURE1PARAMETERMAPL,"");
  1337         __FLOG_VA((_L8("Creating DP %02d Table 0x%08X Entries"), dp.DataProviderId(), aSubType));
  1343         OstTraceExt2(TRACE_NORMAL, DUP1_CMTPPARSERROUTER_CONFIGURE1PARAMETERMAPL, 
  1338         __FLOG(_L8("---------------------------------------")); 
  1344                 "Creating DP %d Table 0x%X Entries", dp.DataProviderId(), aSubType);
       
  1345         OstTrace0(TRACE_NORMAL, DUP2_CMTPPARSERROUTER_CONFIGURE1PARAMETERMAPL,"----------------");
  1339         
  1346         
  1340         RArray<TUint> p1s;
  1347         RArray<TUint> p1s;
  1341         CleanupClosePushL(p1s);
  1348         CleanupClosePushL(p1s);
  1342         GetConfigParametersL(dp, aP1Codes, p1s);
  1349         GetConfigParametersL(dp, aP1Codes, p1s);
  1343         const TUint KCountP1s(p1s.Count());
  1350         const TUint KCountP1s(p1s.Count());
  1346             const TUint KP1(p1s[p1]);
  1353             const TUint KP1(p1s[p1]);
  1347             from[EParam1] = KP1;
  1354             from[EParam1] = KP1;
  1348             map.InsertL(from, dp.DataProviderId());
  1355             map.InsertL(from, dp.DataProviderId());
  1349             }
  1356             }
  1350         CleanupStack::PopAndDestroy(&p1s);
  1357         CleanupStack::PopAndDestroy(&p1s);
  1351         __FLOG(_L8(""));
  1358         OstTrace0(TRACE_NORMAL, DUP3_CMTPPARSERROUTER_CONFIGURE1PARAMETERMAPL,"");
  1352         }
  1359         }
  1353     CleanupStack::PopAndDestroy(&from);
  1360     CleanupStack::PopAndDestroy(&from);
  1354     }
  1361     }
  1355 
  1362 
  1356 /**
  1363 /**
  1375     
  1382     
  1376     const TUint KCountDps(iSingletons.DpController().Count());
  1383     const TUint KCountDps(iSingletons.DpController().Count());
  1377     for (TUint d(0); (d < KCountDps); d++)
  1384     for (TUint d(0); (d < KCountDps); d++)
  1378         {
  1385         {
  1379         CMTPDataProvider& dp(iSingletons.DpController().DataProviderByIndexL(d));
  1386         CMTPDataProvider& dp(iSingletons.DpController().DataProviderByIndexL(d));
  1380         __FLOG(_L8(""));
  1387         OstTrace0(TRACE_NORMAL, CMTPPARSERROUTER_CONFIGURE2PARAMETERMAPL,"");
  1381         __FLOG_VA((_L8("Creating DP %02d Table 0x%08X Entries"), dp.DataProviderId(), aSubType));
  1388         OstTraceExt2(TRACE_NORMAL, DUP1_CMTPPARSERROUTER_CONFIGURE2PARAMETERMAPL, 
  1382         __FLOG(_L8("---------------------------------------"));
  1389                 "Creating DP %d Table 0x%X Entries", dp.DataProviderId(), aSubType);
       
  1390         OstTrace0(TRACE_NORMAL, DUP2_CMTPPARSERROUTER_CONFIGURE2PARAMETERMAPL,"----------------");        
  1383         
  1391         
  1384         RArray<TUint> p1s;
  1392         RArray<TUint> p1s;
  1385         CleanupClosePushL(p1s);
  1393         CleanupClosePushL(p1s);
  1386         GetConfigParametersL(dp, aP1Codes, p1s);
  1394         GetConfigParametersL(dp, aP1Codes, p1s);
  1387         const TUint KCountP1s(p1s.Count());
  1395         const TUint KCountP1s(p1s.Count());
  1409                     }
  1417                     }
  1410                 CleanupStack::PopAndDestroy(&p2s);
  1418                 CleanupStack::PopAndDestroy(&p2s);
  1411                 }
  1419                 }
  1412             }
  1420             }
  1413         CleanupStack::PopAndDestroy(&p1s);
  1421         CleanupStack::PopAndDestroy(&p1s);
  1414         __FLOG(_L8(""));
  1422         OstTrace0(TRACE_NORMAL, DUP3_CMTPPARSERROUTER_CONFIGURE2PARAMETERMAPL,"");
  1415         } 
  1423         } 
  1416     CleanupStack::PopAndDestroy(&from);
  1424     CleanupStack::PopAndDestroy(&from);
  1417     }
  1425     }
  1418 
  1426 
  1419 /**
  1427 /**
  1440     
  1448     
  1441     const TUint KCount(iSingletons.DpController().Count());
  1449     const TUint KCount(iSingletons.DpController().Count());
  1442     for (TUint d(0); (d < KCount); d++)
  1450     for (TUint d(0); (d < KCount); d++)
  1443         {
  1451         {
  1444         CMTPDataProvider& dp(iSingletons.DpController().DataProviderByIndexL(d));
  1452         CMTPDataProvider& dp(iSingletons.DpController().DataProviderByIndexL(d));
  1445         __FLOG(_L8(""));
  1453         OstTrace0(TRACE_NORMAL, CMTPPARSERROUTER_CONFIGURE3PARAMETERMAPL,"");
  1446         __FLOG_VA((_L8("Creating DP %02d Table 0x%08X Entries"), dp.DataProviderId(), aSubType));
  1454         OstTraceExt2(TRACE_NORMAL, DUP1_CMTPPARSERROUTER_CONFIGURE3PARAMETERMAPL, 
  1447         __FLOG(_L8("---------------------------------------"));
  1455                 "Creating DP %d Table 0x%X Entries", dp.DataProviderId(), aSubType);
       
  1456         OstTrace0(TRACE_NORMAL, DUP2_CMTPPARSERROUTER_CONFIGURE3PARAMETERMAPL,"----------------");         
  1448         
  1457         
  1449         RArray<TUint> p1s;
  1458         RArray<TUint> p1s;
  1450         CleanupClosePushL(p1s);
  1459         CleanupClosePushL(p1s);
  1451         GetConfigParametersL(dp, aP1Codes, p1s);
  1460         GetConfigParametersL(dp, aP1Codes, p1s);
  1452         const TUint KCountP1s(p1s.Count());
  1461         const TUint KCountP1s(p1s.Count());
  1491                 CleanupStack::PopAndDestroy(&p2s);
  1500                 CleanupStack::PopAndDestroy(&p2s);
  1492                 }
  1501                 }
  1493             CleanupStack::PopAndDestroy(&p3s);
  1502             CleanupStack::PopAndDestroy(&p3s);
  1494             }
  1503             }
  1495         CleanupStack::PopAndDestroy(&p1s);
  1504         CleanupStack::PopAndDestroy(&p1s);
  1496         __FLOG(_L8(""));
  1505         OstTrace0(TRACE_NORMAL, DUP3_CMTPPARSERROUTER_CONFIGURE3PARAMETERMAPL,"");
  1497         }
  1506         }
  1498     CleanupStack::PopAndDestroy(&from);
  1507     CleanupStack::PopAndDestroy(&from);
  1499     }
  1508     }
  1500 
  1509 
  1501 /**
  1510 /**
  1518         const TUint KCountParams(KParams.Count());
  1527         const TUint KCountParams(KParams.Count());
  1519         for (TUint p(0); (p < KCountParams); p++)
  1528         for (TUint p(0); (p < KCountParams); p++)
  1520             {
  1529             {
  1521             if(( EServiceIDs == aCodes[c] )&&( iSingletons.ServiceMgr().IsSupportedService( KParams[p] )) )
  1530             if(( EServiceIDs == aCodes[c] )&&( iSingletons.ServiceMgr().IsSupportedService( KParams[p] )) )
  1522                 {
  1531                 {
  1523                 __FLOG_1(_L8("GetConfigParametersL, abstract service id = %d"), KParams[p]);
  1532                 OstTrace1( TRACE_NORMAL, CMTPPARSERROUTER_GETCONFIGPARAMETERSL, 
       
  1533                         "GetConfigParametersL, abstract service id = %d",KParams[p] );             
  1524                 continue;
  1534                 continue;
  1525                 }
  1535                 }
  1526             TInt err(aParams.InsertInOrder(KParams[p]));
  1536             TInt err(aParams.InsertInOrder(KParams[p]));
  1527             if ((err != KErrNone) && (err != KErrAlreadyExists))
  1537             if ((err != KErrNone) && (err != KErrAlreadyExists))
  1528                 {
  1538                 {
       
  1539                 OstTrace1( TRACE_ERROR, DUP1_CMTPPARSERROUTER_GETCONFIGPARAMETERSL, "insert into aParams error! error code %d", err );
  1529                 User::Leave(err);
  1540                 User::Leave(err);
  1530                 }
  1541                 }
  1531             }
  1542             }
  1532         }
  1543         }
  1533     }
  1544     }
  1541 @leave One of the system wide error codes, if a general processing error 
  1552 @leave One of the system wide error codes, if a general processing error 
  1542 occurs.
  1553 occurs.
  1543 */
  1554 */
  1544 void CMTPParserRouter::GetRoutingSubTypesL(RArray<TRoutingParameters>& aParams, RArray<TUint>& aRoutingSubTypes, RArray<TUint>& aValidationSubTypes) const
  1555 void CMTPParserRouter::GetRoutingSubTypesL(RArray<TRoutingParameters>& aParams, RArray<TUint>& aRoutingSubTypes, RArray<TUint>& aValidationSubTypes) const
  1545     {
  1556     {
  1546     __FLOG(_L8("GetRoutingSubTypesL, Entry"));
  1557     OstTraceFunctionEntry0( CMTPPARSERROUTER_GETROUTINGSUBTYPESL_ENTRY );  
  1547     __ASSERT_DEBUG((aParams.Count() > 0), User::Invariant());
  1558     __ASSERT_DEBUG((aParams.Count() > 0), User::Invariant());
  1548     aRoutingSubTypes.Reset();
  1559     aRoutingSubTypes.Reset();
  1549     aValidationSubTypes.Reset();
  1560     aValidationSubTypes.Reset();
  1550     
  1561     
  1551     TRoutingParameters& params1(aParams[0]);
  1562     TRoutingParameters& params1(aParams[0]);
  1741                 params1.SetParam(TRoutingParameters::EFlagRoutingTypes, (KRoutingTypes | ETypeFlagSingleTarget));
  1752                 params1.SetParam(TRoutingParameters::EFlagRoutingTypes, (KRoutingTypes | ETypeFlagSingleTarget));
  1742                 }
  1753                 }
  1743             break;
  1754             break;
  1744             }
  1755             }
  1745         }
  1756         }
  1746     __FLOG(_L8("GetRoutingSubTypesL, Exit"));
  1757     OstTraceFunctionExit0( CMTPPARSERROUTER_GETROUTINGSUBTYPESL_EXIT );
  1747     }
  1758     }
  1748 
  1759 
  1749 /**
  1760 /**
  1750 Provides the set of operation parameter routing and validation sub-types to be 
  1761 Provides the set of operation parameter routing and validation sub-types to be 
  1751 executed against each of the specified MTP DeleteObject operation routing 
  1762 executed against each of the specified MTP DeleteObject operation routing 
  1756 @leave One of the system wide error codes, if a general processing error 
  1767 @leave One of the system wide error codes, if a general processing error 
  1757 occurs.
  1768 occurs.
  1758 */
  1769 */
  1759 void CMTPParserRouter::GetRoutingSubTypesDeleteRequestL(RArray<TRoutingParameters>& aParams, RArray<TUint>& aRoutingSubTypes, RArray<TUint>& aValidationSubTypes) const
  1770 void CMTPParserRouter::GetRoutingSubTypesDeleteRequestL(RArray<TRoutingParameters>& aParams, RArray<TUint>& aRoutingSubTypes, RArray<TUint>& aValidationSubTypes) const
  1760     {
  1771     {
  1761     __FLOG(_L8("GetRoutingSubTypesDeleteRequestL, Entry"));
  1772     OstTraceFunctionEntry0( CMTPPARSERROUTER_GETROUTINGSUBTYPESDELETEREQUESTL_ENTRY );
  1762     TRoutingParameters& params1(aParams[0]);
  1773     TRoutingParameters& params1(aParams[0]);
  1763     __ASSERT_DEBUG((params1.Request().Uint16(TMTPTypeRequest::ERequestOperationCode) == EMTPOpCodeDeleteObject), User::Invariant());
  1774     __ASSERT_DEBUG((params1.Request().Uint16(TMTPTypeRequest::ERequestOperationCode) == EMTPOpCodeDeleteObject), User::Invariant());
  1764     
  1775     
  1765     const TUint KObjectHandle(params1.Param(TRoutingParameters::EParamObjectHandle));
  1776     const TUint KObjectHandle(params1.Param(TRoutingParameters::EParamObjectHandle));
  1766     const TUint KObjectFormatCode(params1.Param(TRoutingParameters::EParamFormatCode));
  1777     const TUint KObjectFormatCode(params1.Param(TRoutingParameters::EParamFormatCode));
  1791             {
  1802             {
  1792             SelectSubTypeRoutingL(ESubTypeStorageTypeOperationCode, aRoutingSubTypes, aValidationSubTypes, aParams);
  1803             SelectSubTypeRoutingL(ESubTypeStorageTypeOperationCode, aRoutingSubTypes, aValidationSubTypes, aParams);
  1793             }
  1804             }
  1794         SelectSubTypeRoutingL(ESubTypeOwnerObject, aRoutingSubTypes, aValidationSubTypes, aParams);
  1805         SelectSubTypeRoutingL(ESubTypeOwnerObject, aRoutingSubTypes, aValidationSubTypes, aParams);
  1795         }
  1806         }
  1796     __FLOG(_L8("GetRoutingSubTypesDeleteRequestL, Exit"));
  1807     OstTraceFunctionExit0( CMTPPARSERROUTER_GETROUTINGSUBTYPESDELETEREQUESTL_EXIT );
  1797     }
  1808     }
  1798 
  1809 
  1799 /**
  1810 /**
  1800 Provides the set of operation parameter routing and validation sub-types to be 
  1811 Provides the set of operation parameter routing and validation sub-types to be 
  1801 executed against each of the specified MTP CopyObject and MoveObject operation routing 
  1812 executed against each of the specified MTP CopyObject and MoveObject operation routing 
  1806 @leave One of the system wide error codes, if a general processing error 
  1817 @leave One of the system wide error codes, if a general processing error 
  1807 occurs.
  1818 occurs.
  1808 */
  1819 */
  1809 void CMTPParserRouter::GetRoutingSubTypesCopyMoveRequestL(RArray<TRoutingParameters>& aParams, RArray<TUint>& aRoutingSubTypes, RArray<TUint>& aValidationSubTypes) const
  1820 void CMTPParserRouter::GetRoutingSubTypesCopyMoveRequestL(RArray<TRoutingParameters>& aParams, RArray<TUint>& aRoutingSubTypes, RArray<TUint>& aValidationSubTypes) const
  1810 	{
  1821 	{
  1811 	__FLOG(_L8("GetRoutingSubTypesCopyMoveRequestL, Entry"));
  1822 	OstTraceFunctionEntry0( CMTPPARSERROUTER_GETROUTINGSUBTYPESCOPYMOVEREQUESTL_ENTRY );
  1812 	const TUint KObjectFormatCode(aParams[0].Param(TRoutingParameters::EParamFormatCode));
  1823 	const TUint KObjectFormatCode(aParams[0].Param(TRoutingParameters::EParamFormatCode));
  1813 	if (KObjectFormatCode == EMTPFormatCodeAssociation)
  1824 	if (KObjectFormatCode == EMTPFormatCodeAssociation)
  1814         {
  1825         {
  1815         SelectSubTypeRoutingL(ESubTypeStorageTypeOperationCode, aRoutingSubTypes, aValidationSubTypes, aParams);
  1826         SelectSubTypeRoutingL(ESubTypeStorageTypeOperationCode, aRoutingSubTypes, aValidationSubTypes, aParams);
  1816         }
  1827         }
  1817     else
  1828     else
  1818     	{
  1829     	{
  1819     	SelectSubTypeRoutingL(ESubTypeOwnerObject, aRoutingSubTypes, aValidationSubTypes, aParams);    
  1830     	SelectSubTypeRoutingL(ESubTypeOwnerObject, aRoutingSubTypes, aValidationSubTypes, aParams);    
  1820     	}
  1831     	}
  1821 	__FLOG(_L8("GetRoutingSubTypesCopyMoveRequestL, Exit"));    
  1832 	OstTraceFunctionExit0( CMTPPARSERROUTER_GETROUTINGSUBTYPESCOPYMOVEREQUESTL_EXIT );
  1822 	}
  1833 	}
  1823 /**
  1834 /**
  1824 Provides the set of operation parameter routing and validation sub-types to be 
  1835 Provides the set of operation parameter routing and validation sub-types to be 
  1825 executed against each of the specified MTP GetObjectPropList operation routing 
  1836 executed against each of the specified MTP GetObjectPropList operation routing 
  1826 parameter data.
  1837 parameter data.
  1830 @leave One of the system wide error codes, if a general processing error 
  1841 @leave One of the system wide error codes, if a general processing error 
  1831 occurs.
  1842 occurs.
  1832 */
  1843 */
  1833 void CMTPParserRouter::GetRoutingSubTypesGetObjectPropListRequestL(RArray<TRoutingParameters>& aParams, RArray<TUint>& aRoutingSubTypes, RArray<TUint>& aValidationSubTypes) const
  1844 void CMTPParserRouter::GetRoutingSubTypesGetObjectPropListRequestL(RArray<TRoutingParameters>& aParams, RArray<TUint>& aRoutingSubTypes, RArray<TUint>& aValidationSubTypes) const
  1834     {
  1845     {
  1835     __FLOG(_L8("GetRoutingSubTypesGetObjectPropListRequestL, Entry"));
  1846     OstTraceFunctionEntry0( CMTPPARSERROUTER_GETROUTINGSUBTYPESGETOBJECTPROPLISTREQUESTL_ENTRY );
  1836     TRoutingParameters& params1(aParams[0]);
  1847     TRoutingParameters& params1(aParams[0]);
  1837     __ASSERT_DEBUG((params1.Request().Uint16(TMTPTypeRequest::ERequestOperationCode) == EMTPOpCodeGetObjectPropList), User::Invariant());
  1848     __ASSERT_DEBUG((params1.Request().Uint16(TMTPTypeRequest::ERequestOperationCode) == EMTPOpCodeGetObjectPropList), User::Invariant());
  1838     if (params1.Param(TRoutingParameters::EFlagRoutingTypes) & ETypeOperationParameter)
  1849     if (params1.Param(TRoutingParameters::EFlagRoutingTypes) & ETypeOperationParameter)
  1839         {
  1850         {
  1840         const TUint KObjectHandle(params1.Param(TRoutingParameters::EParamObjectHandle));
  1851         const TUint KObjectHandle(params1.Param(TRoutingParameters::EParamObjectHandle));
  1873             {
  1884             {
  1874             SelectSubTypeRoutingL(ESubTypeOperationCode, aRoutingSubTypes, aValidationSubTypes, aParams);
  1885             SelectSubTypeRoutingL(ESubTypeOperationCode, aRoutingSubTypes, aValidationSubTypes, aParams);
  1875             }
  1886             }
  1876         
  1887         
  1877         }
  1888         }
  1878     __FLOG(_L8("GetRoutingSubTypesGetObjectPropListRequestL, Exit"));
  1889     OstTraceFunctionExit0( CMTPPARSERROUTER_GETROUTINGSUBTYPESGETOBJECTPROPLISTREQUESTL_EXIT );
  1879     }
  1890     }
  1880 
  1891 
  1881 /**
  1892 /**
  1882 Provides the set of operation parameter routing and validation sub-types to be 
  1893 Provides the set of operation parameter routing and validation sub-types to be 
  1883 executed against each of the specified MTP SendObjectPropList operation routing 
  1894 executed against each of the specified MTP SendObjectPropList operation routing 
  1888 @leave One of the system wide error codes, if a general processing error 
  1899 @leave One of the system wide error codes, if a general processing error 
  1889 occurs.
  1900 occurs.
  1890 */
  1901 */
  1891 void CMTPParserRouter::GetRoutingSubTypesSendObjectPropListRequestL(RArray<TRoutingParameters>& aParams, RArray<TUint>& aRoutingSubTypes, RArray<TUint>& aValidationSubTypes) const
  1902 void CMTPParserRouter::GetRoutingSubTypesSendObjectPropListRequestL(RArray<TRoutingParameters>& aParams, RArray<TUint>& aRoutingSubTypes, RArray<TUint>& aValidationSubTypes) const
  1892     {
  1903     {
  1893     __FLOG(_L8("GetRoutingSubTypesSendObjectPropListRequestL, Entry"));
  1904     OstTraceFunctionEntry0( CMTPPARSERROUTER_GETROUTINGSUBTYPESSENDOBJECTPROPLISTREQUESTL_ENTRY );
  1894     TRoutingParameters& params1(aParams[0]);
  1905     TRoutingParameters& params1(aParams[0]);
  1895     __ASSERT_DEBUG((params1.Request().Uint16(TMTPTypeRequest::ERequestOperationCode) == EMTPOpCodeSendObjectPropList), User::Invariant());
  1906     __ASSERT_DEBUG((params1.Request().Uint16(TMTPTypeRequest::ERequestOperationCode) == EMTPOpCodeSendObjectPropList), User::Invariant());
  1896     const TUint KRoutingTypes(params1.Param(TRoutingParameters::EFlagRoutingTypes));
  1907     const TUint KRoutingTypes(params1.Param(TRoutingParameters::EFlagRoutingTypes));
  1897     if ((KRoutingTypes & ETypeFramework) &&
  1908     if ((KRoutingTypes & ETypeFramework) &&
  1898         (params1.Param(TRoutingParameters::EParamFormatCode) == EMTPFormatCodeAssociation))
  1909         (params1.Param(TRoutingParameters::EParamFormatCode) == EMTPFormatCodeAssociation))
  1901         }
  1912         }
  1902     else if (KRoutingTypes & ETypeOperationParameter)
  1913     else if (KRoutingTypes & ETypeOperationParameter)
  1903         {
  1914         {
  1904         SelectSubTypeRoutingL(ESubTypeFormatCodeFormatSubcodeStorageType, aRoutingSubTypes, aValidationSubTypes, aParams);
  1915         SelectSubTypeRoutingL(ESubTypeFormatCodeFormatSubcodeStorageType, aRoutingSubTypes, aValidationSubTypes, aParams);
  1905         }
  1916         }
  1906     __FLOG(_L8("GetRoutingSubTypesSendObjectPropListRequestL, Exit"));
  1917     OstTraceFunctionExit0( CMTPPARSERROUTER_GETROUTINGSUBTYPESSENDOBJECTPROPLISTREQUESTL_EXIT );
  1907     }
  1918     }
  1908 
  1919 
  1909 void CMTPParserRouter::GetRoutingSubTypesDeleteObjectPropListL(RArray<TRoutingParameters>& aParams, RArray<TUint>& aRoutingSubTypes, RArray<TUint>& aValidationSubTypes) const
  1920 void CMTPParserRouter::GetRoutingSubTypesDeleteObjectPropListL(RArray<TRoutingParameters>& aParams, RArray<TUint>& aRoutingSubTypes, RArray<TUint>& aValidationSubTypes) const
  1910     {
  1921     {
  1911     __FLOG(_L8("GetRoutingSubTypesDeleteObjectPropListL, Entry"));
  1922     OstTraceFunctionEntry0( CMTPPARSERROUTER_GETROUTINGSUBTYPESDELETEOBJECTPROPLISTL_ENTRY );
  1912     TRoutingParameters& params1(aParams[0]);
  1923     TRoutingParameters& params1(aParams[0]);
  1913     
  1924     
  1914     __ASSERT_DEBUG((params1.Request().Uint16(TMTPTypeRequest::ERequestOperationCode) == EMTPOpCodeDeleteObjectPropList), User::Invariant());
  1925     __ASSERT_DEBUG((params1.Request().Uint16(TMTPTypeRequest::ERequestOperationCode) == EMTPOpCodeDeleteObjectPropList), User::Invariant());
  1915     
  1926     
  1916     const TUint KObjectHandle(params1.Param(TRoutingParameters::EParamObjectHandle));
  1927     const TUint KObjectHandle(params1.Param(TRoutingParameters::EParamObjectHandle));
  1921     else 
  1932     else 
  1922         {
  1933         {
  1923         SelectSubTypeRoutingL(ESubTypeOwnerObject, aRoutingSubTypes, aValidationSubTypes, aParams);
  1934         SelectSubTypeRoutingL(ESubTypeOwnerObject, aRoutingSubTypes, aValidationSubTypes, aParams);
  1924         }
  1935         }
  1925 
  1936 
  1926     __FLOG(_L8("GetRoutingSubTypesDeleteObjectPropListL, Exit"));
  1937     OstTraceFunctionExit0( CMTPPARSERROUTER_GETROUTINGSUBTYPESDELETEOBJECTPROPLISTL_EXIT );
  1927     }
  1938     }
  1928 
  1939 
  1929 void CMTPParserRouter::GetRoutingSubTypesGetFormatCapabilitiesL(RArray<TRoutingParameters>& aParams, RArray<TUint>& aRoutingSubTypes, RArray<TUint>& aValidationSubTypes) const
  1940 void CMTPParserRouter::GetRoutingSubTypesGetFormatCapabilitiesL(RArray<TRoutingParameters>& aParams, RArray<TUint>& aRoutingSubTypes, RArray<TUint>& aValidationSubTypes) const
  1930     {
  1941     {
  1931     __FLOG(_L8("GetRoutingSubTypesGetFormatCapabilities, Entry"));
  1942     OstTraceFunctionEntry0( CMTPPARSERROUTER_GETROUTINGSUBTYPESGETFORMATCAPABILITIESL_ENTRY );
  1932     TRoutingParameters& params1(aParams[0]);
  1943     TRoutingParameters& params1(aParams[0]);
  1933     
  1944     
  1934     __ASSERT_DEBUG((params1.Request().Uint16(TMTPTypeRequest::ERequestOperationCode) == EMTPOpCodeGetFormatCapabilities), User::Invariant());
  1945     __ASSERT_DEBUG((params1.Request().Uint16(TMTPTypeRequest::ERequestOperationCode) == EMTPOpCodeGetFormatCapabilities), User::Invariant());
  1935     
  1946     
  1936     if( params1.Param(TRoutingParameters::EParamFormatCode) == KMTPFormatsAll)
  1947     if( params1.Param(TRoutingParameters::EParamFormatCode) == KMTPFormatsAll)
  1940     else if ( params1.Param(TRoutingParameters::EFlagRoutingTypes) & ETypeOperationParameter)
  1951     else if ( params1.Param(TRoutingParameters::EFlagRoutingTypes) & ETypeOperationParameter)
  1941         {
  1952         {
  1942         SelectSubTypeRoutingL(ESubTypeFormatCodeOperationCode, aRoutingSubTypes, aValidationSubTypes, aParams);
  1953         SelectSubTypeRoutingL(ESubTypeFormatCodeOperationCode, aRoutingSubTypes, aValidationSubTypes, aParams);
  1943         }
  1954         }
  1944     
  1955     
  1945     __FLOG(_L8("GetRoutingSubTypesGetFormatCapabilities, Exit"));
  1956     OstTraceFunctionExit0( CMTPPARSERROUTER_GETROUTINGSUBTYPESGETFORMATCAPABILITIESL_EXIT );
  1946     }
  1957     }
  1947 
  1958 
  1948 /**
  1959 /**
  1949 Parses the specified MTP operation request dataset to extract the specified 
  1960 Parses the specified MTP operation request dataset to extract the specified 
  1950 parameter value together with any applicable meta-data. The parameter value 
  1961 parameter value together with any applicable meta-data. The parameter value 
  1956 @leave One of the system wide error codes, if a general processing error 
  1967 @leave One of the system wide error codes, if a general processing error 
  1957 occurs.
  1968 occurs.
  1958 */    
  1969 */    
  1959 void CMTPParserRouter::ParseOperationRequestParameterL(TMTPTypeRequest::TElements aParam, TRoutingParameters::TParameterType aType, TRoutingParameters& aParams) const
  1970 void CMTPParserRouter::ParseOperationRequestParameterL(TMTPTypeRequest::TElements aParam, TRoutingParameters::TParameterType aType, TRoutingParameters& aParams) const
  1960     {
  1971     {
  1961     __FLOG(_L8("ParseOperationRequestParameterL, Entry"));
  1972     OstTraceFunctionEntry0( CMTPPARSERROUTER_PARSEOPERATIONREQUESTPARAMETERL_ENTRY );
  1962     const TUint32 KParam(aParams.Request().Uint32(aParam));    
  1973     const TUint32 KParam(aParams.Request().Uint32(aParam));
  1963     __FLOG_VA((_L8("Parameter %d = 0x%08X"), (aParam - TMTPTypeRequest::ERequestParameter1 + 1), KParam));
  1974     OstTraceExt2(TRACE_NORMAL, CMTPPARSERROUTER_PARSEOPERATIONREQUESTPARAMETERL,
       
  1975             "Parameter %d = 0x%X", (aParam - TMTPTypeRequest::ERequestParameter1 + 1), (int)KParam);
  1964     
  1976     
  1965     // Parse out the parameter value if a non-null value is present.
  1977     // Parse out the parameter value if a non-null value is present.
  1966     if (KParam != KMTPNotSpecified32)
  1978     if (KParam != KMTPNotSpecified32)
  1967         {
  1979         {
  1968         aParams.SetParam(aType, KParam);
  1980         aParams.SetParam(aType, KParam);
  2013         break;
  2025         break;
  2014         
  2026         
  2015     default:
  2027     default:
  2016         break;
  2028         break;
  2017         }    
  2029         }    
  2018     __FLOG(_L8("ParseOperationRequestParameterL, Exit"));
  2030     OstTraceFunctionExit0( CMTPPARSERROUTER_PARSEOPERATIONREQUESTPARAMETERL_EXIT );
  2019     }
  2031     }
  2020 
  2032 
  2021 /**
  2033 /**
  2022 Resolves set of zero or more routing targets using the specified lookup 
  2034 Resolves set of zero or more routing targets using the specified lookup 
  2023 parameter based routing sub-type.
  2035 parameter based routing sub-type.
  2027 @leave One of the system wide error codes, if a general processing error 
  2039 @leave One of the system wide error codes, if a general processing error 
  2028 occurs.
  2040 occurs.
  2029 */
  2041 */
  2030 void CMTPParserRouter::RouteOperationRequestNParametersL(TUint aRoutingSubType, const TRoutingParameters& aParams, RArray<TUint>& aTargets) const
  2042 void CMTPParserRouter::RouteOperationRequestNParametersL(TUint aRoutingSubType, const TRoutingParameters& aParams, RArray<TUint>& aTargets) const
  2031     {
  2043     {
  2032     __FLOG(_L8("RouteOperationRequestNParametersL, Entry"));
  2044     OstTraceFunctionEntry0( CMTPPARSERROUTER_ROUTEOPERATIONREQUESTNPARAMETERSL_ENTRY );
  2033     __FLOG_VA((_L8("Routing Sub-type = 0x%08X"), aRoutingSubType));
  2045     OstTrace1(TRACE_NORMAL, CMTPPARSERROUTER_ROUTEOPERATIONREQUESTNPARAMETERSL, 
       
  2046             "Routing Sub-type = 0x%X", aRoutingSubType);
  2034     
  2047     
  2035     // Build the set of map source parameter values.
  2048     // Build the set of map source parameter values.
  2036     RArray<TUint> from;
  2049     RArray<TUint> from;
  2037     CleanupClosePushL(from);
  2050     CleanupClosePushL(from);
  2038     switch (aRoutingSubType)
  2051     switch (aRoutingSubType)
  2085         }
  2098         }
  2086     
  2099     
  2087     // Resolve the map target parameter set.
  2100     // Resolve the map target parameter set.
  2088     iMaps[Index(aRoutingSubType)]->GetToL(from, aTargets);
  2101     iMaps[Index(aRoutingSubType)]->GetToL(from, aTargets);
  2089     CleanupStack::PopAndDestroy(&from);
  2102     CleanupStack::PopAndDestroy(&from);
  2090     __FLOG(_L8("RouteOperationRequestNParametersL, Exit"));
  2103     OstTraceFunctionExit0( CMTPPARSERROUTER_ROUTEOPERATIONREQUESTNPARAMETERSL_EXIT );
  2091     }
  2104     }
  2092 
  2105 
  2093 /**
  2106 /**
  2094 Resolves set of zero or more routing targets using the specified parameterless 
  2107 Resolves set of zero or more routing targets using the specified parameterless 
  2095 routing sub-type.
  2108 routing sub-type.
  2099 @leave One of the system wide error codes, if a general processing error 
  2112 @leave One of the system wide error codes, if a general processing error 
  2100 occurs.
  2113 occurs.
  2101 */
  2114 */
  2102 void CMTPParserRouter::RouteOperationRequest0ParametersL(TUint aRoutingSubType, const TRoutingParameters& aParams, RArray<TUint>& aTargets) const
  2115 void CMTPParserRouter::RouteOperationRequest0ParametersL(TUint aRoutingSubType, const TRoutingParameters& aParams, RArray<TUint>& aTargets) const
  2103     {
  2116     {
  2104     __FLOG(_L8("RouteOperationRequest0ParametersL, Entry"));
  2117     OstTraceFunctionEntry0( CMTPPARSERROUTER_ROUTEOPERATIONREQUEST0PARAMETERSL_ENTRY );
  2105     __FLOG_VA((_L8("Routing Sub-type = 0x%08X"), aRoutingSubType));
  2118     OstTrace1(TRACE_NORMAL, CMTPPARSERROUTER_ROUTEOPERATIONREQUEST0PARAMETERSL, 
       
  2119             "Routing Sub-type = 0x%X", aRoutingSubType);    
  2106     TInt id(KErrNotFound);
  2120     TInt id(KErrNotFound);
  2107     switch (aRoutingSubType)
  2121     switch (aRoutingSubType)
  2108         {
  2122         {
  2109     case ESubTypeDpDevice:
  2123     case ESubTypeDpDevice:
  2110         id = iSingletons.DpController().DeviceDpId();
  2124         id = iSingletons.DpController().DeviceDpId();
  2154         
  2168         
  2155     if (id != KErrNotFound && iSingletons.DpController().IsDataProviderLoaded(id))
  2169     if (id != KErrNotFound && iSingletons.DpController().IsDataProviderLoaded(id))
  2156         {
  2170         {
  2157         SelectTargetL(id, aTargets);
  2171         SelectTargetL(id, aTargets);
  2158         }
  2172         }
  2159     __FLOG(_L8("RouteOperationRequest0ParametersL, Exit"));
  2173     OstTraceFunctionExit0( CMTPPARSERROUTER_ROUTEOPERATIONREQUEST0PARAMETERSL_EXIT );
  2160     }
  2174     }
  2161 
  2175 
  2162 /**
  2176 /**
  2163 Provides a single suitable routing target for the specified request. A target 
  2177 Provides a single suitable routing target for the specified request. A target 
  2164 is selected such that:
  2178 is selected such that:
  2175 @leave One of the system wide error codes, if a general processing error 
  2189 @leave One of the system wide error codes, if a general processing error 
  2176 occurs.
  2190 occurs.
  2177 */
  2191 */
  2178 TUint CMTPParserRouter::RoutingTargetL(const TMTPTypeRequest& aRequest, CMTPConnection& aConnection) const
  2192 TUint CMTPParserRouter::RoutingTargetL(const TMTPTypeRequest& aRequest, CMTPConnection& aConnection) const
  2179     {
  2193     {
  2180     __FLOG(_L8("RoutingTargetL, Entry"));    
  2194     OstTraceFunctionEntry0( CMTPPARSERROUTER_ROUTINGTARGETL_ENTRY );
  2181     // Parse the operation request dataset.
  2195     // Parse the operation request dataset.
  2182     TRoutingParameters params(aRequest, static_cast<MMTPConnection&>(aConnection));
  2196     TRoutingParameters params(aRequest, static_cast<MMTPConnection&>(aConnection));
  2183     ParseOperationRequestL(params);
  2197     ParseOperationRequestL(params);
  2184     ValidateOperationRequestParametersL(params);
  2198     ValidateOperationRequestParametersL(params);
  2185     
  2199     
  2198     else
  2212     else
  2199         {
  2213         {
  2200         target = targets[0];
  2214         target = targets[0];
  2201         }
  2215         }
  2202     CleanupStack::PopAndDestroy(&targets);
  2216     CleanupStack::PopAndDestroy(&targets);
  2203     __FLOG(_L8("RoutingTargetL, Exit"));
  2217     OstTraceFunctionExit0( CMTPPARSERROUTER_ROUTINGTARGETL_EXIT );
  2204     return target;
  2218     return target;
  2205     }
  2219     }
  2206     
  2220     
  2207 /**
  2221 /**
  2208 Selects the specified routing sub-type together with any applicable validation 
  2222 Selects the specified routing sub-type together with any applicable validation 
  2215 @leave One of the system wide error codes, if a general processing error 
  2229 @leave One of the system wide error codes, if a general processing error 
  2216 occurs.
  2230 occurs.
  2217 */
  2231 */
  2218 void CMTPParserRouter::SelectSubTypeRoutingL(TRoutingSubType aSubType, RArray<TUint>& aRoutingSubTypes, RArray<TUint>& aValidationSubTypes, RArray<TRoutingParameters>& aParams) const
  2232 void CMTPParserRouter::SelectSubTypeRoutingL(TRoutingSubType aSubType, RArray<TUint>& aRoutingSubTypes, RArray<TUint>& aValidationSubTypes, RArray<TRoutingParameters>& aParams) const
  2219     {
  2233     {
  2220     __FLOG(_L8("SelectSubTypeRoutingL, Entry"));
  2234     OstTraceFunctionEntry0( CMTPPARSERROUTER_SELECTSUBTYPEROUTINGL_ENTRY );
  2221     __ASSERT_DEBUG((aRoutingSubTypes.Find(aSubType) == KErrNotFound), User::Invariant());
  2235     __ASSERT_DEBUG((aRoutingSubTypes.Find(aSubType) == KErrNotFound), User::Invariant());
  2222     aRoutingSubTypes.AppendL(aSubType);    
  2236     aRoutingSubTypes.AppendL(aSubType);    
  2223     switch (aSubType)
  2237     switch (aSubType)
  2224         {
  2238         {
  2225     case ESubTypeDevicePropCode:
  2239     case ESubTypeDevicePropCode:
  2243         
  2257         
  2244     case ESubTypeRequestRegistration:
  2258     case ESubTypeRequestRegistration:
  2245     default:
  2259     default:
  2246         break;
  2260         break;
  2247         }
  2261         }
  2248     __FLOG(_L8("SelectSubTypeRoutingL, Exit"));
  2262     OstTraceFunctionExit0( CMTPPARSERROUTER_SELECTSUBTYPEROUTINGL_EXIT );
  2249     }
  2263     }
  2250     
  2264     
  2251 /**
  2265 /**
  2252 Selects the specified validation sub-type.
  2266 Selects the specified validation sub-type.
  2253 @param aSubType The selected validation sub-type.
  2267 @param aSubType The selected validation sub-type.
  2256 @leave One of the system wide error codes, if a general processing error 
  2270 @leave One of the system wide error codes, if a general processing error 
  2257 occurs.
  2271 occurs.
  2258 */
  2272 */
  2259 void CMTPParserRouter::SelectSubTypeValidationL(TRoutingSubType aSubType, RArray<TUint>& aValidationSubTypes) const
  2273 void CMTPParserRouter::SelectSubTypeValidationL(TRoutingSubType aSubType, RArray<TUint>& aValidationSubTypes) const
  2260     {
  2274     {
  2261     __FLOG(_L8("SelectSubTypeValidationL, Entry"));
  2275     OstTraceFunctionEntry0( CMTPPARSERROUTER_SELECTSUBTYPEVALIDATIONL_ENTRY );
  2262     TInt err(aValidationSubTypes.InsertInOrder(aSubType));
  2276     TInt err(aValidationSubTypes.InsertInOrder(aSubType));
  2263     if ((err != KErrNone) &&
  2277     if ((err != KErrNone) &&
  2264         (err != KErrAlreadyExists))
  2278         (err != KErrAlreadyExists))
  2265         {
  2279         {
       
  2280         OstTrace1( TRACE_ERROR, CMTPPARSERROUTER_SELECTSUBTYPEVALIDATIONL, "insert into validation sub-type array failed! error code %d", err);
  2266         User::Leave(err);
  2281         User::Leave(err);
  2267         }
  2282         }
  2268     __FLOG(_L8("SelectSubTypeValidationL, Exit"));
  2283     OstTraceFunctionExit0( CMTPPARSERROUTER_SELECTSUBTYPEVALIDATIONL_EXIT );
  2269     }
  2284     }
  2270 
  2285 
  2271 /**
  2286 /**
  2272 Validates the specified set of routing targets.
  2287 Validates the specified set of routing targets.
  2273 @param aParams The operation routing parameter data.
  2288 @param aParams The operation routing parameter data.
  2275 @param aTargets The set of data provider targets to be validated. Invalid 
  2290 @param aTargets The set of data provider targets to be validated. Invalid 
  2276 targets are removed from this set.
  2291 targets are removed from this set.
  2277 */    
  2292 */    
  2278 void CMTPParserRouter::ValidateTargetsL(const TRoutingParameters& aParams, const RArray<TUint>& aValidationSubTypes, RArray<TUint>& aTargets) const
  2293 void CMTPParserRouter::ValidateTargetsL(const TRoutingParameters& aParams, const RArray<TUint>& aValidationSubTypes, RArray<TUint>& aTargets) const
  2279     {
  2294     {
  2280     __FLOG(_L8("ValidateTargetsL, Entry"));
  2295     OstTraceFunctionEntry0( CMTPPARSERROUTER_VALIDATETARGETSL_ENTRY );
  2281     const TUint KValidationsCount(aValidationSubTypes.Count());
  2296     const TUint KValidationsCount(aValidationSubTypes.Count());
  2282     for (TUint v(0); (v < KValidationsCount); v++)
  2297     for (TUint v(0); (v < KValidationsCount); v++)
  2283         {
  2298         {
  2284         RArray<TUint> valid;
  2299         RArray<TUint> valid;
  2285         CleanupClosePushL(valid);
  2300         CleanupClosePushL(valid);
  2293                 aTargets.Remove(target);
  2308                 aTargets.Remove(target);
  2294                 }
  2309                 }
  2295             }
  2310             }
  2296         CleanupStack::PopAndDestroy(&valid);
  2311         CleanupStack::PopAndDestroy(&valid);
  2297         }
  2312         }
  2298     __FLOG(_L8("ValidateTargetsL, Exit"));
  2313     OstTraceFunctionExit0( CMTPPARSERROUTER_VALIDATETARGETSL_EXIT );
  2299     }
  2314     }
  2300     
  2315     
  2301 void CMTPParserRouter::ValidateOperationRequestParametersL(TRoutingParameters& aParams) const
  2316 void CMTPParserRouter::ValidateOperationRequestParametersL(TRoutingParameters& aParams) const
  2302 	{
  2317 	{
  2303     __FLOG(_L8("ValidateOperationRequestParametersL, Entry"));
  2318     OstTraceFunctionEntry0( CMTPPARSERROUTER_VALIDATEOPERATIONREQUESTPARAMETERSL_ENTRY );
  2304     if(aParams.Param(TRoutingParameters::EFlagInvalid))
  2319     if(aParams.Param(TRoutingParameters::EFlagInvalid))
  2305     	{
  2320     	{
  2306 		__FLOG(_L8("ValidateOperationRequestParametersL, Invalid is true,Exit"));
  2321 		OstTraceFunctionExit0( CMTPPARSERROUTER_VALIDATEOPERATIONREQUESTPARAMETERSL_EXIT );
  2307 		return;
  2322 		return;
  2308     	}
  2323     	}
  2309     		
  2324     		
  2310     const TUint16 KOpCode(aParams.Request().Uint16(TMTPTypeRequest::ERequestOperationCode));
  2325     const TUint16 KOpCode(aParams.Request().Uint16(TMTPTypeRequest::ERequestOperationCode));
  2311 	__FLOG_VA((_L8("Operation Code = 0x%04X"), KOpCode));
  2326 	OstTrace1(TRACE_NORMAL, CMTPPARSERROUTER_VALIDATEOPERATIONREQUESTPARAMETERSL,
       
  2327 	        "Operation Code = 0x%X", KOpCode);
  2312 	switch (KOpCode)
  2328 	switch (KOpCode)
  2313 	   {
  2329 	   {
  2314 		case EMTPOpCodeSetObjectPropValue:
  2330 		case EMTPOpCodeSetObjectPropValue:
  2315 		case EMTPOpCodeSetObjectProtection:
  2331 		case EMTPOpCodeSetObjectProtection:
  2316 		case EMTPOpCodeDeleteObject:
  2332 		case EMTPOpCodeDeleteObject:
  2380 	    	}
  2396 	    	}
  2381 	    	break;
  2397 	    	break;
  2382 		default:
  2398 		default:
  2383 			break;
  2399 			break;
  2384 	   }
  2400 	   }
  2385     __FLOG(_L8("ValidateOperationRequestParametersL, Exit"));
  2401 	OstTraceFunctionExit0( DUP1_CMTPPARSERROUTER_VALIDATEOPERATIONREQUESTPARAMETERSL_EXIT );
  2386 	}
  2402 	}
  2387 
  2403 
  2388 /**
  2404 /**
  2389 Provides the routing sub-type modifier flags of the specified routing sub-type.
  2405 Provides the routing sub-type modifier flags of the specified routing sub-type.
  2390 @param aSubType The routing sub-type identifier.
  2406 @param aSubType The routing sub-type identifier.
  2436 TUint CMTPParserRouter::SubType(TUint aIndex, TUint aFlags, TUint aParamsCount)
  2452 TUint CMTPParserRouter::SubType(TUint aIndex, TUint aFlags, TUint aParamsCount)
  2437     {
  2453     {
  2438     return ((aParamsCount << 24) | aFlags | aIndex);
  2454     return ((aParamsCount << 24) | aFlags | aIndex);
  2439     }
  2455     }
  2440   
  2456   
  2441 #ifdef __FLOG_ACTIVE
  2457 #ifdef OST_TRACE_COMPILER_IN_USE
  2442 /**
  2458 /**
  2443 Logs the map table entries of all map tables.
  2459 Logs the map table entries of all map tables.
  2444 @leave One of the system wide error codes, if a general processing error 
  2460 @leave One of the system wide error codes, if a general processing error 
  2445 occurs.
  2461 occurs.
  2446 */  
  2462 */  
  2447 void CMTPParserRouter::FLOGMapsL() const
  2463 void CMTPParserRouter::OSTMapsL() const
  2448     {
  2464     {
  2449     __FLOG(_L8("FLOGMapsL, Entry"));
  2465     OstTraceFunctionEntry0( CMTPPARSERROUTER_OSTMAPSL_ENTRY );
  2450     const TUint KCount(iMaps.Count());
  2466     const TUint KCount(iMaps.Count());
  2451     for (TUint i(0); (i < KCount); i++)
  2467     for (TUint i(0); (i < KCount); i++)
  2452         {
  2468         {
  2453         const CMap& KMap (*iMaps[i]);
  2469         const CMap& KMap (*iMaps[i]);
  2454         __FLOG(_L8(""));
  2470         OstTrace0(TRACE_NORMAL, CMTPPARSERROUTER_OSTMAPSL,"");
  2455         __FLOG_VA((_L8("Table 0x%08X"), KMap.SubType()));
  2471         OstTrace1(TRACE_NORMAL, DUP1_CMTPPARSERROUTER_OSTMAPSL,"Table 0x%08X", KMap.SubType());
  2456         __FLOG(_L8("----------------"));
  2472         OstTrace0(TRACE_NORMAL, DUP2_CMTPPARSERROUTER_OSTMAPSL,"----------------");
  2457         RArray<TUint> from;
  2473         RArray<TUint> from;
  2458         CleanupClosePushL(from);
  2474         CleanupClosePushL(from);
  2459         KMap.InitParamsL(from);
  2475         KMap.InitParamsL(from);
  2460         KMap.FLOGMapL(from);
  2476         KMap.OSTMapL(from);
  2461         CleanupStack::PopAndDestroy(&from);
  2477         CleanupStack::PopAndDestroy(&from);
  2462         __FLOG(_L8(""));
  2478         OstTrace0(TRACE_NORMAL, DUP3_CMTPPARSERROUTER_OSTMAPSL,"");
  2463         }
  2479         }
  2464     __FLOG(_L8("FLOGMapsL, Exit"));
  2480     OstTraceFunctionExit0( CMTPPARSERROUTER_OSTMAPSL_EXIT );
  2465     }
  2481     }
  2466 #endif
  2482 #endif