datacommsserver/esockserver/ssock/ss_nodemessages.cpp
changeset 0 dfb7c4ff071f
child 14 4ccf8e394726
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18 */
       
    19 
       
    20 #define SYMBIAN_NETWORKING_UPS
       
    21 #include "ss_nodemessages.h"
       
    22 
       
    23 
       
    24 #include <comms-infras/ss_log.h>
       
    25 #include <ss_fact.h>
       
    26 #include <comms-infras/ss_mcprnodemessages.h>
       
    27 #include "ss_flowrequest.h"
       
    28 #include <comms-infras/ss_corepractivities.h>
       
    29 #include "ss_transporthook.h"
       
    30 #include <elements/metatype.h>
       
    31 #include <elements/sm_core.h>
       
    32 #include <ss_glob.h>
       
    33 #include <comms-infras/ss_nodeinterfaces.h>
       
    34 #include <comms-infras/ss_thread.h>
       
    35 #include <comms-infras/ss_commsdataobject.h>
       
    36 #include <elements/interfacetable.h>
       
    37 #include <es_panic.h>
       
    38 #include <es_sock.h>
       
    39 #include <comms-infras/ss_connprov.h>
       
    40 #include <comms-infras/ss_subconnprov.h>
       
    41 #include <comms-infras/ss_subconnflow.h>
       
    42 #include <comms-infras/ss_protflow.h>
       
    43 
       
    44 #include <elements/cftransportmsg.h>
       
    45 #include <elements/nm_messages_child.h>
       
    46 #include <addressupdate.h>
       
    47 
       
    48 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    49 #include <es_panic_internal.h>
       
    50 #endif
       
    51 
       
    52 #include "ss_nodemessages_dataclient.h"
       
    53 #include <comms-infras/ss_nodemessages_internal.h>
       
    54 
       
    55 #ifdef SYMBIAN_NETWORKING_UPS
       
    56 #include <comms-infras/ss_upsaccesspointconfigext.h>
       
    57 #endif
       
    58 
       
    59 #ifdef _DEBUG
       
    60 // Panic category for "absolutely impossible!" vanilla ASSERT()-type panics from this module
       
    61 // (if it could happen through user error then you should give it an explicit, documented, category + code)
       
    62 _LIT(KSpecAssert_ESockSSocksndmsg, "ESockSSocksndmsg");
       
    63 #endif
       
    64 
       
    65 
       
    66 using namespace ESock;
       
    67 using namespace Elements;
       
    68 using namespace Meta;
       
    69 using namespace Messages;
       
    70 
       
    71 // Ugly hack: mingw does not evaulate macros early enough to pass as template arguments so we hard code the
       
    72 // value for the x86gcc platform.  A compile time assertion ensures that the value stays correct.
       
    73 #ifdef __X86GCC__
       
    74 	#define KOffsetTSigUidFactoryQuery_iQuery	24
       
    75 #else
       
    76 	#define KOffsetTSigUidFactoryQuery_iQuery	( _FOFF(TSigPlayerRoleUidFactoryQuery, iQuery) )
       
    77 #endif
       
    78 
       
    79 __ASSERT_COMPILE( KOffsetTSigUidFactoryQuery_iQuery == _FOFF(TSigPlayerRoleUidFactoryQuery, iQuery) );
       
    80 
       
    81 using namespace Factories;
       
    82 
       
    83 //We can safely reuse this UID for singature's TIDs (but they mean different things)
       
    84 const TInt KESockInternalMessagesImplementationUid = TCFMessage::ERealmId;
       
    85 
       
    86 enum EMessageTypeId //message signatures only (NOT messages) messages are declared under class TCFMessage
       
    87 	{
       
    88 	//  spare                       =1,
       
    89     //	spare						=2,
       
    90 	ESignatureSigAddrUpdate			=3,
       
    91 	ESignatureConnectionInfo		=4,
       
    92 	ESignatureProvisionConfig		=5,
       
    93 	ESignatureSelectionPrefs		=6,
       
    94 	ESignatureSelectComplete		=7,
       
    95 	ESignaturePlaneNotification		=8,
       
    96 
       
    97 	ESignatureSubConnNotification	=9,
       
    98 	ESignatureSubConnOpenedEvent	=10,
       
    99 	ESignatureSubConnClosedEvent	=11,
       
   100 	ESignatureStateChange			=12,
       
   101 
       
   102 	ESignatureUidFactoryQuery		=13,
       
   103 	ESignatureBundleRMessage2		=14,
       
   104 	ESignatureBundle				=15,
       
   105 	ESignatureAvailabilitySubscriptionOptions = 16,
       
   106 	ESignatureAvailabilityStatus    = 17,
       
   107 	ESignatureNodeIdClientTypeNumber = 18,
       
   108 
       
   109 //	spare							=37,
       
   110 //	spare							=38,
       
   111 //	spare							=39,
       
   112 
       
   113 	//ESignatureNumberSubConnParams	=44,
       
   114 
       
   115 	ESignatureFlowParams				=45,
       
   116 	ESignatureConnPrefList 				= 46,
       
   117 	ESignatureUpsParameters 			= 47,	
       
   118 	ESignatureFamilyBundle			=48,
       
   119 	ESignatureNumberFamilyBundle	=49,
       
   120 	ESignatureUpsStatusChange 		=50,
       
   121 	ESignatureMetaExtContainer      =51,
       
   122 	ESignatureConnectionInfoPtr     =52,
       
   123 
       
   124 	EFlowRequestBase				=1000,
       
   125 	EImplicitFlowRequest			=1001,
       
   126 	EConnFlowRequest				=1002,
       
   127 	ESubConnFlowRequest				=1003,
       
   128 	EReBindLayerRequest				=1004,
       
   129 	EDataClientJoiningRequest       =1005,
       
   130 	EGetOrSetParameters				=1006,
       
   131 	EAlwaysFindFactoryQuery			=1007,
       
   132 	EMetaConnectionFactoryQuery		=1008,
       
   133 	EDefaultConnectionFactoryQuery	=1009,	
       
   134 	EDefaultSCPRFactoryQuery		=1010,
       
   135 	EDefaultFlowFactoryQuery		=1011,
       
   136 	EDefaultProtocolIntfFactoryQuery =1012,	
       
   137 	};
       
   138 
       
   139 //no need to serialise return value
       
   140 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TSigSubConNotification, KESockInternalMessagesImplementationUid, ESignatureSubConnNotification )
       
   141 	REGISTER_ATTRIBUTE( TSigSubConNotification, iRefCountOwnedSubConNotification, TMeta<CRefCountOwnedSubConNotification*> )
       
   142 END_ATTRIBUTE_TABLE_BASE( TSignatureBase, ESignatureBase )
       
   143 
       
   144 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TSigPlaneNotification, KESockInternalMessagesImplementationUid, ESignaturePlaneNotification )
       
   145 	REGISTER_ATTRIBUTE( TSigPlaneNotification, iRefCountOwnedNotification, TMeta<CRefCountOwnedNotification*> )
       
   146 END_ATTRIBUTE_TABLE_BASE( TSignatureBase, ESignatureBase )
       
   147 
       
   148 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TSigSubConnOpenedEvent, KESockInternalMessagesImplementationUid, ESignatureSubConnOpenedEvent )
       
   149 	REGISTER_ATTRIBUTE( TSigSubConnOpenedEvent, iSubConnectionOpenedEvent, TMeta<TSubConnectionOpenedEvent> )
       
   150 END_ATTRIBUTE_TABLE_BASE( TSignatureBase, ESignatureBase )
       
   151 
       
   152 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TSigSubConnClosedEvent, KESockInternalMessagesImplementationUid, ESignatureSubConnClosedEvent )
       
   153 	REGISTER_ATTRIBUTE( TSigSubConnClosedEvent, iSubConnectionClosedEvent, TMeta<TSubConnectionClosedEvent> )
       
   154 END_ATTRIBUTE_TABLE_BASE( TSignatureBase, ESignatureBase )
       
   155 
       
   156 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TSigPlayerRoleUidFactoryQuery, KESockInternalMessagesImplementationUid, ESignatureUidFactoryQuery )
       
   157 	REGISTER_ATTRIBUTE(TSigPlayerRoleUidFactoryQuery, iQuery, TMetaHandler )
       
   158 END_ATTRIBUTE_TABLE()
       
   159 
       
   160 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TSigAddrUpdate, KESockInternalMessagesImplementationUid, ESignatureSigAddrUpdate )
       
   161 	REGISTER_ATTRIBUTE( TSigAddrUpdate, iAddrUpdate, TMeta<TAddrUpdate> )
       
   162 END_ATTRIBUTE_TABLE_BASE( TSignatureBase, ESignatureBase )
       
   163 
       
   164 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TSigConnectionInfo, KESockInternalMessagesImplementationUid, ESignatureConnectionInfo )
       
   165 	REGISTER_ATTRIBUTE( TSigConnectionInfo, iConnectionInfo, TMeta<TConnectionInfo> )
       
   166 END_ATTRIBUTE_TABLE_BASE( TSignatureBase, ESignatureBase )
       
   167 
       
   168 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TSigSelectionPrefs, KESockInternalMessagesImplementationUid, ESignatureSelectionPrefs )
       
   169 	REGISTER_ATTRIBUTE( TSigSelectionPrefs, iSelectionPrefs, TMetaObject<TSelectionPrefs> )
       
   170 END_ATTRIBUTE_TABLE_BASE( TSignatureBase, ESignatureBase )
       
   171 
       
   172 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TSigConnPrefList, KESockInternalMessagesImplementationUid, ESignatureConnPrefList)
       
   173 	REGISTER_ATTRIBUTE( TSigConnPrefList, iConnPrefList, TMeta<RConnPrefList> )
       
   174 END_ATTRIBUTE_TABLE_BASE( Messages::TSignatureBase, ESignatureVoid )
       
   175 
       
   176 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TSigSelectComplete, KESockInternalMessagesImplementationUid, ESignatureSelectComplete )
       
   177 	REGISTER_ATTRIBUTE( TSigSelectComplete, iNodeId, TMeta<TNodeId> )
       
   178 	REGISTER_ATTRIBUTE( TSigSelectComplete, iProviderInfo, TMeta<TProviderInfo> )
       
   179 END_ATTRIBUTE_TABLE_BASE( TSignatureBase, ESignatureBase )
       
   180 
       
   181 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TSigBundleRMessage2, KESockInternalMessagesImplementationUid, ESignatureBundleRMessage2 )
       
   182 	REGISTER_ATTRIBUTE( TSigBundleRMessage2, iBundle, TMeta<TAny*> )
       
   183 	REGISTER_ATTRIBUTE( TSigBundleRMessage2, iMessage, TMeta<RMessage2*> )
       
   184 END_ATTRIBUTE_TABLE_BASE( TSignatureBase, ESignatureBase )
       
   185 
       
   186 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TSigBundle, KESockInternalMessagesImplementationUid, ESignatureBundle )
       
   187 	REGISTER_ATTRIBUTE( TSigBundle, iBundle, TMeta<TAny*> )
       
   188 END_ATTRIBUTE_TABLE_BASE( TSignatureBase, ESignatureBase )
       
   189 
       
   190 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TSigFlowParams, KESockInternalMessagesImplementationUid, ESignatureFlowParams )
       
   191 	REGISTER_ATTRIBUTE( TSigFlowParams, iFlowParams, TMeta<TFlowParams> )
       
   192 END_ATTRIBUTE_TABLE_BASE( Messages::TSignatureBase, ESignatureBase )
       
   193 
       
   194 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TSigAvailabilitySubscriptionOptions, KESockInternalMessagesImplementationUid, ESignatureAvailabilitySubscriptionOptions )
       
   195 	REGISTER_ATTRIBUTE( TSigAvailabilitySubscriptionOptions, iAvailabilitySubscriptionOptions, TMeta<TAvailabilitySubscriptionOptions> )
       
   196 END_ATTRIBUTE_TABLE_BASE( TSignatureBase, ESignatureBase )
       
   197 
       
   198 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TSigAvailabilityStatus, KESockInternalMessagesImplementationUid, ESignatureAvailabilityStatus )
       
   199 	REGISTER_ATTRIBUTE( TSigAvailabilityStatus, iAvailabilityStatus, TMeta<TAvailabilityStatus> )
       
   200 END_ATTRIBUTE_TABLE_BASE( TSignatureBase, ESignatureBase )
       
   201 
       
   202 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TSigNodeIdClientTypeNumber, KESockInternalMessagesImplementationUid, ESignatureNodeIdClientTypeNumber )
       
   203 	REGISTER_ATTRIBUTE( TSigNodeIdClientTypeNumber, iNodeId, TMeta<TNodeId> )
       
   204 	REGISTER_ATTRIBUTE( TSigNodeIdClientTypeNumber, iClientType, TMeta<TClientType> )
       
   205 	REGISTER_ATTRIBUTE( TSigNodeIdClientTypeNumber, iValue, TMeta<TUint> )
       
   206 END_ATTRIBUTE_TABLE_BASE( TSignatureBase, ESignatureBase )
       
   207 
       
   208 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TSigFamilyBundle, KESockInternalMessagesImplementationUid, ESignatureFamilyBundle )
       
   209 	REGISTER_ATTRIBUTE( TSigFamilyBundle, iFamilyBundle, TMeta<RCFParameterFamilyBundleC> )
       
   210 END_ATTRIBUTE_TABLE_BASE( TSignatureBase, ESignatureBase )
       
   211 
       
   212 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TSigNumberFamilyBundle, KESockInternalMessagesImplementationUid, ESignatureNumberFamilyBundle )
       
   213 	REGISTER_ATTRIBUTE( TSigNumberFamilyBundle, iValue, TMetaNumber )
       
   214 	REGISTER_ATTRIBUTE( TSigNumberFamilyBundle, iFamilyBundle, TMeta<RCFParameterFamilyBundleC> )
       
   215 END_ATTRIBUTE_TABLE_BASE( TSignatureBase, ESignatureVoid )
       
   216 
       
   217 START_ATTRIBUTE_TABLE( TCFFlowRequestBase, KESockInternalMessagesImplementationUid, EFlowRequestBase )
       
   218 	REGISTER_ATTRIBUTE( TCFFlowRequestBase, iSubSessionUniqueId, TMetaNumber )
       
   219  	REGISTER_ATTRIBUTE( TCFFlowRequestBase, iFlowParams, TMeta<TFlowParams> )	
       
   220 END_ATTRIBUTE_TABLE_BASE( TSignalBase, ESignalBase )
       
   221 
       
   222 START_ATTRIBUTE_TABLE( TCFImplicitFlowRequest, KESockInternalMessagesImplementationUid, EImplicitFlowRequest )
       
   223 END_ATTRIBUTE_TABLE_BASE( TCFFlowRequestBase, EFlowRequestBase )
       
   224 
       
   225 START_ATTRIBUTE_TABLE( TCFConnFlowRequest, KESockInternalMessagesImplementationUid, EConnFlowRequest )
       
   226 	REGISTER_ATTRIBUTE( TCFConnFlowRequest, iSession, TMeta<TAny*> )
       
   227 	REGISTER_ATTRIBUTE( TCFConnFlowRequest, iHandle, TMetaNumber )
       
   228 END_ATTRIBUTE_TABLE_BASE( TCFFlowRequestBase, EFlowRequestBase )
       
   229 
       
   230 START_ATTRIBUTE_TABLE( TCFSubConnFlowRequest, KESockInternalMessagesImplementationUid, ESubConnFlowRequest )
       
   231 	REGISTER_ATTRIBUTE( TCFSubConnFlowRequest, iSession, TMeta<TAny*> )
       
   232 	REGISTER_ATTRIBUTE( TCFSubConnFlowRequest, iHandle, TMetaNumber )
       
   233 END_ATTRIBUTE_TABLE_BASE( TCFFlowRequestBase, EFlowRequestBase )
       
   234 
       
   235 START_ATTRIBUTE_TABLE( PRActivities::CRejoinDataClientActivity::TCFDataClientJoiningRequest, KESockInternalMessagesImplementationUid, EDataClientJoiningRequest )
       
   236 	REGISTER_ATTRIBUTE( PRActivities::CRejoinDataClientActivity::TCFDataClientJoiningRequest, iDataClient, TMeta<TNodeId> )
       
   237 	REGISTER_ATTRIBUTE( PRActivities::CRejoinDataClientActivity::TCFDataClientJoiningRequest, iDataClientType, TMeta<TClientType> )
       
   238 END_ATTRIBUTE_TABLE_BASE( TNodeSignal, ENodeSignal )
       
   239 
       
   240 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TSigStateChange, KESockInternalMessagesImplementationUid, ESignatureStateChange )
       
   241 	REGISTER_ATTRIBUTE( TSigStateChange, iStateChange, TMeta<TStateChange> )
       
   242 END_ATTRIBUTE_TABLE_BASE( TSignatureBase, ESignatureBase )
       
   243 
       
   244 #ifdef SYMBIAN_NETWORKING_UPS
       
   245 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TSigUpsParameters, KESockInternalMessagesImplementationUid, ESignatureUpsParameters )
       
   246 	REGISTER_ATTRIBUTE( TSigUpsParameters, iParams, TMeta<TPolicyCheckRequestParams> )
       
   247 END_ATTRIBUTE_TABLE_BASE( TSignatureBase, ESignatureVoid )
       
   248 
       
   249 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TSigUpsStatusChangeParameters, KESockInternalMessagesImplementationUid, ESignatureUpsStatusChange )
       
   250 	REGISTER_ATTRIBUTE( TSigUpsStatusChangeParameters, iParams, TMeta<TUPSStatusChangeParams> )
       
   251 END_ATTRIBUTE_TABLE_BASE( TSignatureBase, ESignatureVoid )
       
   252 
       
   253 EXPORT_START_ATTRIBUTE_TABLE_AND_FN(CUPSAccessPointConfigExt, CUPSAccessPointConfigExt::EUPSAccessPointConfigUid, CUPSAccessPointConfigExt::ETypeId)
       
   254 // No attributes defined, as no serialisation takes place.
       
   255 END_ATTRIBUTE_TABLE()
       
   256 #endif //SYMBIAN_NETWORKING_UPS
       
   257 
       
   258 EXPORT_START_ATTRIBUTE_TABLE_AND_FN(TAlwaysFindFactoryQuery, KESockInternalMessagesImplementationUid, EAlwaysFindFactoryQuery)	
       
   259 END_ATTRIBUTE_TABLE()
       
   260 
       
   261 EXPORT_START_ATTRIBUTE_TABLE_AND_FN(TMetaConnectionFactoryQuery, KESockInternalMessagesImplementationUid, EMetaConnectionFactoryQuery)	
       
   262 	REGISTER_ATTRIBUTE(TMetaConnectionFactoryQuery, iProviderInfo, TMeta<TProviderInfo>)
       
   263 	REGISTER_ATTRIBUTE(TMetaConnectionFactoryQuery, iTierImplUid, TMeta<TUint>)  
       
   264 END_ATTRIBUTE_TABLE()
       
   265 
       
   266 EXPORT_START_ATTRIBUTE_TABLE_AND_FN(TDefaultConnectionFactoryQuery, KESockInternalMessagesImplementationUid, EDefaultConnectionFactoryQuery)	
       
   267 	REGISTER_ATTRIBUTE(TDefaultConnectionFactoryQuery, iMCprId, TMeta<TNodeId>)	
       
   268 END_ATTRIBUTE_TABLE()
       
   269 
       
   270 EXPORT_START_ATTRIBUTE_TABLE_AND_FN(TDefaultSCPRFactoryQuery, KESockInternalMessagesImplementationUid, EDefaultSCPRFactoryQuery)	
       
   271 	REGISTER_ATTRIBUTE(TDefaultSCPRFactoryQuery, iControlProvider, TMeta<TNodeId>)
       
   272 	REGISTER_ATTRIBUTE(TDefaultSCPRFactoryQuery, iSCPRType, TMeta<TSubConnOpen::TSubConnType>)
       
   273 END_ATTRIBUTE_TABLE()
       
   274 
       
   275 EXPORT_START_ATTRIBUTE_TABLE_AND_FN(TDefaultFlowFactoryQuery, KESockInternalMessagesImplementationUid, EDefaultFlowFactoryQuery)	
       
   276 	REGISTER_ATTRIBUTE(TDefaultFlowFactoryQuery, iCprId, TMeta<TNodeId>)
       
   277 	REGISTER_ATTRIBUTE(TDefaultFlowFactoryQuery, iSCprId, TMeta<TNodeId>)
       
   278 	REGISTER_ATTRIBUTE(TDefaultFlowFactoryQuery, iMessageId, TMeta<TNodeSignal::TMessageId>)
       
   279 	REGISTER_ATTRIBUTE(TDefaultFlowFactoryQuery, iProtocolType, TMeta<TSubConnOpen::TSubConnType>)
       
   280 END_ATTRIBUTE_TABLE()
       
   281 
       
   282 EXPORT_START_ATTRIBUTE_TABLE_AND_FN(TDefaultProtocolIntfFactoryQuery, KESockInternalMessagesImplementationUid, EDefaultProtocolIntfFactoryQuery)	
       
   283 	REGISTER_ATTRIBUTE(TDefaultProtocolIntfFactoryQuery, iCprId, TMeta<TNodeId>)
       
   284 END_ATTRIBUTE_TABLE()
       
   285 
       
   286 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TSigMetaExtContainer, KESockInternalMessagesImplementationUid, ESignatureMetaExtContainer )
       
   287 	{ _FOFF( TSigMetaExtContainer, iConfig ), ESock::TMetaExtensionContainerMetaType::NewL },
       
   288 END_ATTRIBUTE_TABLE_BASE( TSignatureBase, ESignatureBase )
       
   289 
       
   290 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TSigConnectionInfoPtr, KESockInternalMessagesImplementationUid, ESignatureConnectionInfoPtr )
       
   291     REGISTER_ATTRIBUTE( TSigConnectionInfoPtr, iPtr, TMeta<CConnectionInfo*> )
       
   292 END_ATTRIBUTE_TABLE_BASE( Messages::TSignatureBase, ESignatureBase )
       
   293 
       
   294 
       
   295 DEFINE_MVIP_CTR(TSigStateChange);
       
   296 DEFINE_MVIP_CTR(TSigSelectionPrefs);
       
   297 DEFINE_MVIP_CTR(TSigConnPrefList);
       
   298 DEFINE_MVIP_CTR(TSigFlowParams);
       
   299 DEFINE_MVIP_CTR(TSigSubConNotification);
       
   300 DEFINE_MVIP_CTR(TSigPlaneNotification);
       
   301 DEFINE_MVIP_CTR(TSigSubConnOpenedEvent);
       
   302 DEFINE_MVIP_CTR(TSigSubConnClosedEvent);
       
   303 DEFINE_MVIP_CTR(TSigAddrUpdate);
       
   304 DEFINE_MVIP_CTR(TSigConnectionInfo);
       
   305 DEFINE_MVIP_CTR(TSigBundleRMessage2)
       
   306 DEFINE_MVIP_CTR(TSigBundle)
       
   307 DEFINE_MVIP_CTR(TSigSelectComplete)
       
   308 DEFINE_MVIP_CTR(TSigPlayerRoleUidFactoryQuery)
       
   309 DEFINE_MVIP_CTR(TSigAvailabilitySubscriptionOptions)
       
   310 DEFINE_MVIP_CTR(TSigAvailabilityStatus)
       
   311 DEFINE_MVIP_CTR(TSigNodeIdClientTypeNumber)
       
   312 DEFINE_MVIP_CTR(TSigMetaExtContainer)
       
   313 DEFINE_MVIP_CTR(TSigConnectionInfoPtr)
       
   314 
       
   315 #ifdef SYMBIAN_NETWORKING_UPS
       
   316 DEFINE_MVIP_CTR(TSigUpsParameters)
       
   317 DEFINE_MVIP_CTR(TSigUpsStatusChangeParameters)
       
   318 #endif
       
   319 
       
   320 DEFINE_MVIP_CTR(TSigFamilyBundle)
       
   321 DEFINE_MVIP_CTR(TSigNumberFamilyBundle)
       
   322 DEFINE_MVIP_CTR(TCFImplicitFlowRequest)
       
   323 DEFINE_MVIP_CTR(TCFConnFlowRequest)
       
   324 DEFINE_MVIP_CTR(TCFSubConnFlowRequest)
       
   325 
       
   326 DEFINE_MVIP_CTR(PRActivities::CRejoinDataClientActivity::TCFDataClientJoiningRequest)
       
   327 DEFINE_MVIP_CTR(TAlwaysFindFactoryQuery)
       
   328 DEFINE_MVIP_CTR(TMetaConnectionFactoryQuery)
       
   329 DEFINE_MVIP_CTR(TDefaultConnectionFactoryQuery)
       
   330 DEFINE_MVIP_CTR(TDefaultSCPRFactoryQuery)
       
   331 DEFINE_MVIP_CTR(TDefaultFlowFactoryQuery)
       
   332 DEFINE_MVIP_CTR(TDefaultProtocolIntfFactoryQuery)
       
   333 
       
   334 
       
   335 const TImplementationProxy SignatureImplementationTable[] =
       
   336 	{
       
   337 	//NOTE: Entries must be sorted for the binary search to work efficiently!
       
   338 	MVIP_CTR_ENTRY(ESignatureSigAddrUpdate,TSigAddrUpdate),				//14
       
   339 	MVIP_CTR_ENTRY(ESignatureConnectionInfo,TSigConnectionInfo),		//15
       
   340 	MVIP_CTR_ENTRY(ESignatureSelectionPrefs,TSigSelectionPrefs),		//18
       
   341 	MVIP_CTR_ENTRY(ESignatureSelectComplete,TSigSelectComplete),		//19
       
   342 	MVIP_CTR_ENTRY(ESignaturePlaneNotification,TSigPlaneNotification),	//20
       
   343 	MVIP_CTR_ENTRY(ESignatureSubConnNotification,TSigSubConNotification),	//21
       
   344 	MVIP_CTR_ENTRY(ESignatureSubConnOpenedEvent,TSigSubConnOpenedEvent), //22
       
   345 	MVIP_CTR_ENTRY(ESignatureSubConnClosedEvent,TSigSubConnClosedEvent), //23
       
   346 	MVIP_CTR_ENTRY(ESignatureStateChange,TSigStateChange),					//12
       
   347 	MVIP_CTR_ENTRY(ESignatureUidFactoryQuery,TSigPlayerRoleUidFactoryQuery),	//33
       
   348 	MVIP_CTR_ENTRY(ESignatureBundleRMessage2,TSigBundleRMessage2),		//40
       
   349 	MVIP_CTR_ENTRY(ESignatureBundle,TSigBundle),						//41
       
   350 	MVIP_CTR_ENTRY(ESignatureAvailabilitySubscriptionOptions,TSigAvailabilitySubscriptionOptions), //42
       
   351 	MVIP_CTR_ENTRY(ESignatureAvailabilityStatus,TSigAvailabilityStatus),//43
       
   352 	MVIP_CTR_ENTRY(ESignatureNodeIdClientTypeNumber, TSigNodeIdClientTypeNumber), //44
       
   353 	MVIP_CTR_ENTRY(ESignatureFlowParams,TSigFlowParams),	//45
       
   354 	MVIP_CTR_ENTRY(ESignatureConnPrefList,TSigConnPrefList),//46
       
   355 #ifdef SYMBIAN_NETWORKING_UPS
       
   356 	MVIP_CTR_ENTRY(ESignatureUpsParameters,TSigUpsParameters),//47
       
   357 #endif 	
       
   358 	MVIP_CTR_ENTRY(ESignatureFamilyBundle,TSigFamilyBundle),				//48
       
   359 	MVIP_CTR_ENTRY(ESignatureNumberFamilyBundle,TSigNumberFamilyBundle),	//49
       
   360 #ifdef SYMBIAN_NETWORKING_UPS
       
   361 	MVIP_CTR_ENTRY(ESignatureUpsStatusChange,TSigUpsStatusChangeParameters),//50
       
   362 #endif
       
   363 	MVIP_CTR_ENTRY(ESignatureMetaExtContainer,TSigMetaExtContainer),   //51
       
   364 	MVIP_CTR_ENTRY(ESignatureConnectionInfoPtr,TSigConnectionInfoPtr),   //52
       
   365 	MVIP_CTR_ENTRY(EImplicitFlowRequest,TCFImplicitFlowRequest),	    //1001
       
   366 	MVIP_CTR_ENTRY(EConnFlowRequest,TCFConnFlowRequest),			    //1002
       
   367 	MVIP_CTR_ENTRY(ESubConnFlowRequest,TCFSubConnFlowRequest),	        //1003
       
   368 	MVIP_CTR_ENTRY(EDataClientJoiningRequest,PRActivities::CRejoinDataClientActivity::TCFDataClientJoiningRequest),//1005
       
   369 	MVIP_CTR_ENTRY(EGetOrSetParameters,TGetOrSetParameters),				//1006
       
   370 	MVIP_CTR_ENTRY(EAlwaysFindFactoryQuery, TAlwaysFindFactoryQuery),	//1007
       
   371 	MVIP_CTR_ENTRY(EMetaConnectionFactoryQuery, TMetaConnectionFactoryQuery), //1008
       
   372 	MVIP_CTR_ENTRY(EDefaultConnectionFactoryQuery, TDefaultConnectionFactoryQuery), //1008	
       
   373 	MVIP_CTR_ENTRY(EDefaultSCPRFactoryQuery, TDefaultSCPRFactoryQuery), //1008	
       
   374 	MVIP_CTR_ENTRY(EDefaultFlowFactoryQuery, TDefaultFlowFactoryQuery),
       
   375 	MVIP_CTR_ENTRY(EDefaultProtocolIntfFactoryQuery, TDefaultProtocolIntfFactoryQuery),	
       
   376 	};
       
   377 
       
   378 
       
   379 void TCFMessage::RegisterL()
       
   380 	{
       
   381 	TlsGlobals::Get().RegisterInterfaceL(TUid::Uid(KESockInternalMessagesImplementationUid), sizeof(SignatureImplementationTable) / sizeof(SignatureImplementationTable[0]), SignatureImplementationTable);
       
   382 	}
       
   383 
       
   384 void TCFMessage::DeRegister()
       
   385 	{
       
   386 	TlsGlobals::Get().DeregisterInterface(TUid::Uid(KESockInternalMessagesImplementationUid));
       
   387 	}
       
   388 
       
   389 #if 0
       
   390 #ifdef ESOCK_EXTLOG_ACTIVE
       
   391 
       
   392 // for logging bundle
       
   393 #include <comms-infras/es_parameterbundle.h>
       
   394 
       
   395 TInt TNodeSignalBase::PrintableSignature(TDes8& aResult) const
       
   396 /**
       
   397 Generate printable output of signature parameters in the specified buffer
       
   398 
       
   399 @param aResult buffer to receive printable output.
       
   400 @return number of parameters output
       
   401 */
       
   402 	{
       
   403 	_LIT8(KArgNumber, "%d");
       
   404 	_LIT8(KArgNumberNumber, "%d,%d");
       
   405 	_LIT8(KArgThreeNumbers, "%d,%d,%d");
       
   406 	_LIT8(KArgHexAndTwoDecimalNumbers, "%08x,%d,%d");
       
   407 #ifdef SYMBIAN_NETWORKING_UPS
       
   408 	_LIT8(KArgHexNumber, "%08x");
       
   409 #endif //SYMBIAN_NETWORKING_UPS
       
   410 
       
   411 	STypeId id = GetTypeId();
       
   412 	if (id.iUid.iUid == KESockInternalMessagesImplementationUid)
       
   413 		{
       
   414 		switch (id.iType)
       
   415 			{
       
   416 		case ESignatureNumber:
       
   417 			aResult.AppendFormat(KArgNumber(), static_cast<const TSigNumber*>(this)->iValue);
       
   418 			return 1;
       
   419 		case ESignatureStateChange:
       
   420 			{
       
   421 			const TStateChange& state = static_cast<const TSigStateChange*>(this)->iStateChange;
       
   422 			aResult.AppendFormat(KArgNumberNumber(), state.iStage, state.iError);
       
   423 			return 2;
       
   424 			}
       
   425 		case ESignatureNumberNumber:
       
   426 			{
       
   427 			const TSigNumberNumber* sig = static_cast<const TSigNumberNumber*>(this);
       
   428 			aResult.AppendFormat(KArgNumberNumber(), sig->iValue1, sig->iValue2);
       
   429 			return 2;
       
   430 			}
       
   431 		case ESignatureErrResponse:
       
   432 			{
       
   433 			const TErrResponse& resp = static_cast<const TSigErrResponse*>(this)->iErrResponse;
       
   434 			aResult.AppendFormat(KArgThreeNumbers(), resp.iAction, resp.iError, resp.iMessageId.MessageId());
       
   435 			return 3;
       
   436 			}
       
   437 		case ESignatureErrContext:
       
   438 			{
       
   439 			const TErrContext& ctx = static_cast<const TSigErrContext*>(this)->iErrContext;
       
   440 			aResult.AppendFormat(KArgHexAndTwoDecimalNumbers(), ctx.iOriginator.Printable(), ctx.iMessageId.MessageId(), ctx.iActivityId);
       
   441 			return 3;
       
   442 			}
       
   443 		case ESignatureMessageIdNumber:
       
   444 			{
       
   445 			const TSigMessageIdNumber* sig = static_cast<const TSigMessageIdNumber*>(this);
       
   446 #ifdef SYMBIAN_NETWORKING_UPS
       
   447 			_LIT8(KArgStringNumber, "%s,%d");
       
   448 			// TPrintableMessage is just for printing out a MessageId in human readable form.
       
   449 			class TPrintableMessage : public TCFSignatureBase
       
   450 				{
       
   451 			public:
       
   452 				TPrintableMessage(const TCFNodeSignalBase::TMessageId& aMessageId)
       
   453 				: TCFSignatureBase(aMessageId, *TCommsId::KNullCommsId, ECFActivityNull)
       
   454 					{
       
   455 					}
       
   456 				} msg(sig->iMsgId);
       
   457 			aResult.AppendFormat(KArgStringNumber(), msg.Printable(), sig->iValue);
       
   458 #else
       
   459 			aResult.AppendFormat(KArgNumberNumber(), sig->iMsgId.MessageId(), sig->iValue);
       
   460 #endif
       
   461 			return 2;
       
   462 			}
       
   463 #ifdef SYMBIAN_NETWORKING_UPS
       
   464 		case ESignatureCommsBinderNumber:
       
   465 			{
       
   466 			const TSigCommsBinderNumber* sig = static_cast<const TSigCommsBinderNumber*>(this);
       
   467 			aResult.AppendFormat(KArgHexNumber(), sig->iCommsBinder.iCommsId.Printable());
       
   468 			return 1;
       
   469 			}
       
   470 
       
   471 		case ESignatureCommsBinder:
       
   472 			{
       
   473 			const TSigCommsBinder* sig = static_cast<const TSigCommsBinder*>(this);
       
   474 			aResult.AppendFormat(KArgHexNumber(), sig->iCommsBinder.iCommsId.Printable());
       
   475 			return 1;
       
   476 			}
       
   477 		case ESignatureSelectComplete:
       
   478 			{
       
   479 			const TSigSelectComplete* sig = static_cast<const TSigSelectComplete*>(this);
       
   480 			aResult.AppendFormat(KArgHexNumber(), sig->iCommsId.Printable());
       
   481 			return 1;
       
   482 			}
       
   483 		case ESignatureCommsId:
       
   484 			{
       
   485 			const TSigCommsId* sig = static_cast<const TSigCommsId*>(this);
       
   486 			aResult.AppendFormat(KArgHexNumber(), sig->iCommsId.Printable());
       
   487 			return 1;
       
   488 			}
       
   489 #endif
       
   490 
       
   491 		case ESignatureBundle:
       
   492 			{
       
   493 			const TSigBundle* bun = static_cast<const TSigBundle*>(this);
       
   494 			aResult.AppendFormat(_L8("Bundle (PSCs:%d)"), bun->iBundle->Ptr()->CountParamSetContainers());
       
   495 			return 1;
       
   496 			}
       
   497 		case ESignatureFlowParams:
       
   498 			{
       
   499 			const TSigFlowParams* flowParams = static_cast<const TSigFlowParams*>(this);
       
   500 			aResult.AppendFormat(
       
   501 				_L8("Flow params: addrFamily:%d, protocol:%d, socketType:%d, flowRequest:%d"),
       
   502 				flowParams->iFlowParams.iAddrFamily,
       
   503 				flowParams->iFlowParams.iProtocol,
       
   504 				flowParams->iFlowParams.iSocketType,
       
   505 				flowParams->iFlowParams.iFlowRequestType);
       
   506 			return 4;
       
   507 			}
       
   508 		default:
       
   509 			break;
       
   510 			}
       
   511 		}
       
   512 	return 0;
       
   513 	}
       
   514 
       
   515 #endif
       
   516 #endif
       
   517 
       
   518 
       
   519 
       
   520 //-======================================================
       
   521 // TMessageSigMetaExtContainer
       
   522 //-======================================================
       
   523 
       
   524 EXPORT_C void TSigMetaExtContainer::DispatchL(const TRuntimeCtxId& aSender, const TRuntimeCtxId& aRecipient)
       
   525     {
       
   526     Messages::TSignatureBase::DispatchL(aSender, aRecipient);
       
   527     iConfig.Close();
       
   528     }
       
   529 
       
   530 EXPORT_C void TSigMetaExtContainer::Error(const TRuntimeCtxId& aSender, const TRuntimeCtxId& aRecipient, TInt aError)
       
   531     {
       
   532     iConfig.Close();
       
   533     Messages::TSignatureBase::Error(aSender, aRecipient, aError);
       
   534     }
       
   535 
       
   536 //-======================================================
       
   537 //
       
   538 //
       
   539 // CRefCountOwnerBase methods
       
   540 //
       
   541 //
       
   542 //-======================================================
       
   543 EXPORT_C CRefCountOwnerBase::CRefCountOwnerBase(const TAny* aPtr)
       
   544 : iPtr(const_cast<TAny*>(aPtr)),
       
   545   iRefCount(0)
       
   546     {
       
   547 	LOG_NODE_CREATE(KCFNodeTag, CRefCountOwnerBase)
       
   548     }
       
   549 
       
   550 EXPORT_C CRefCountOwnerBase::~CRefCountOwnerBase()
       
   551     {
       
   552 	LOG_NODE_DESTROY(KCFNodeTag, CRefCountOwnerBase)
       
   553     }
       
   554 
       
   555 EXPORT_C void CRefCountOwnerBase::Close()
       
   556 /*
       
   557 To be called by the message receiver when it's finished
       
   558 inspecting the pointer.
       
   559 */
       
   560     {
       
   561     // LockedDec() returns the value prior to decrement
       
   562     if (User::LockedDec(iRefCount) == 1)
       
   563         {
       
   564         // If this CRefCountOwnerBase was created in a higher priority thread than
       
   565         // the release of the final reference is running in, the TCFDataClient::TStop
       
   566         // can dispatch and delete this object almost immediately.
       
   567 
       
   568         // DO NOT put any processing after this PostTo()
       
   569         RClientInterface::OpenPostMessageClose(Id(), Id(),
       
   570         	TCFDataClient::TStop(0).CRef());
       
   571         }
       
   572     }
       
   573 
       
   574 EXPORT_C void CRefCountOwnerBase::Open()
       
   575 /*
       
   576 To be called by the message sender each time the same
       
   577 pointer is sent away.
       
   578 */
       
   579     {
       
   580 #ifdef _DEBUG
       
   581     if (!User::LockedInc(iRefCount) && iRefOpened)
       
   582     	{
       
   583     	// This panic means that the objects ref count has been decremented to zero
       
   584     	// and an async deletion has been initiated. You are now trying to Open() a
       
   585     	// new ref on this soon to be dead object. Dangling pointers maybe??
       
   586     	User::Panic(KESockFaultPanic, EDeadObjectReused);
       
   587     	}
       
   588     iRefOpened = ETrue;
       
   589 #else
       
   590     User::LockedInc(iRefCount);
       
   591 #endif
       
   592     }
       
   593 
       
   594 EXPORT_C void CRefCountOwnerBase::ReceivedL(const TRuntimeCtxId& /*aSender*/, const TNodeId& /*aRecipient*/, TSignatureBase& aMessage)
       
   595    	{
       
   596 	(void)aMessage;
       
   597    	__ASSERT_DEBUG(aMessage.IsMessage<TCFDataClient::TStop>(), User::Panic(KSpecAssert_ESockSSocksndmsg, 1));
       
   598 //   	delete iPtr;
       
   599 	DeletePtr();
       
   600    	iPtr = NULL;
       
   601    	delete this;
       
   602    	}
       
   603 
       
   604 EXPORT_C Meta::SMetaData* TVCFromSockManAttributeCreationPolicy::New(TPtrC8& aSrc, TPtr8& aDst)
       
   605 	{
       
   606 	CMetaDataVirtualCtorInPlace* vctr = SockManGlobals::Get()->SelfWorker()->TransportGlobals().VirtualCtor();
       
   607 	if (vctr ==NULL)
       
   608 		{
       
   609 		return NULL;
       
   610 		}
       
   611 	__ASSERT_DEBUG(aSrc.Length() >= sizeof(STypeId), User::Panic(KSpecAssert_ESockSSocksndmsg, 2)); //At least the type id must be present			
       
   612 	return vctr->New ( aSrc, aDst );
       
   613 	}
       
   614 
       
   615 
       
   616 
       
   617 EXPORT_C MFactoryQuery::TMatchResult TAlwaysFindFactoryQuery::Match(Factories::TFactoryObjectInfo& /* aObjectInfo */)
       
   618 	{
       
   619 	return MFactoryQuery::EMatch; //Return the first and only.			
       
   620 	}
       
   621 
       
   622 EXPORT_C TAlwaysFindFactoryQuery ::TAlwaysFindFactoryQuery ()
       
   623 	{
       
   624 		
       
   625 	}
       
   626 
       
   627 EXPORT_C TMetaConnectionFactoryQuery::TMetaConnectionFactoryQuery()
       
   628 	{
       
   629 		
       
   630 	}
       
   631 
       
   632 EXPORT_C TMetaConnectionFactoryQuery::TMetaConnectionFactoryQuery(const TProviderInfo& aProviderInfo,const TUid aTierImplUid)
       
   633 : iProviderInfo(aProviderInfo),iTierImplUid(aTierImplUid)
       
   634 	{
       
   635 		
       
   636 	}
       
   637 	
       
   638 EXPORT_C MFactoryQuery::TMatchResult TMetaConnectionFactoryQuery::Match(Factories::TFactoryObjectInfo& aFactoryObjectInfo)
       
   639 	{
       
   640 	CMetaConnectionProviderBase* prov = static_cast<CMetaConnectionProviderBase*>(aFactoryObjectInfo.iInfo.iFactoryObject);
       
   641 	return prov->ProviderInfo() == iProviderInfo? MFactoryQuery::EMatch : MFactoryQuery::EContinue;		
       
   642 	}
       
   643 
       
   644 EXPORT_C TDefaultConnectionFactoryQuery::TDefaultConnectionFactoryQuery(const Messages::TNodeId& aMCprId)
       
   645 : iMCprId(aMCprId)
       
   646 	{
       
   647 		
       
   648 	}
       
   649 
       
   650 EXPORT_C MFactoryQuery::TMatchResult TDefaultConnectionFactoryQuery::Match(Factories::TFactoryObjectInfo& aFactoryObjectInfo)
       
   651 	{
       
   652 	CConnectionProviderBase* prov = static_cast<CConnectionProviderBase*>(aFactoryObjectInfo.iInfo.iFactoryObject);
       
   653 
       
   654 	if (prov->ControlProvider())
       
   655 		{
       
   656 		// Each MCPR instance can only have one data client.  The comparison here uses the NodeId of the MCPR
       
   657 		// to implement this check.
       
   658 		//ASSERT(prov->ControlProvider());
       
   659 		return prov->ControlProvider()->RecipientId() == iMCprId ? MFactoryQuery::EMatch : MFactoryQuery::EContinue;
       
   660 		}
       
   661 	else
       
   662 		{
       
   663 		// This is to support the half-way house bluetooth code
       
   664 		// There is a dummy Cpr owning lower scpr's that are not
       
   665 		// created by the framework in the usual way.
       
   666 		// This dummy Cpr is also not created in the usual way
       
   667 		// and hence will not have a ControlProvider()
       
   668 		return MFactoryQuery::EContinue;
       
   669 		}		
       
   670 	}
       
   671 
       
   672 EXPORT_C TDefaultConnectionFactoryQuery::TDefaultConnectionFactoryQuery()
       
   673 : iMCprId(TNodeId::NullId())
       
   674 	{
       
   675 		
       
   676 	}
       
   677 
       
   678 EXPORT_C TDefaultSCPRFactoryQuery::TDefaultSCPRFactoryQuery()
       
   679 : iControlProvider(TNodeId::NullId()),
       
   680 iSCPRType((TSubConnOpen::TSubConnType)0)
       
   681 	{
       
   682 		
       
   683 	}
       
   684 
       
   685 //used to look up sub-connection from control side
       
   686 EXPORT_C TDefaultSCPRFactoryQuery::TDefaultSCPRFactoryQuery(const Messages::TNodeId& aControlProvider, TSubConnOpen::TSubConnType aSCPRType)
       
   687 : iControlProvider(aControlProvider),
       
   688 iSCPRType(aSCPRType)
       
   689 	{
       
   690 		
       
   691 	}
       
   692 
       
   693 EXPORT_C MFactoryQuery::TMatchResult TDefaultSCPRFactoryQuery::Match(Factories::TFactoryObjectInfo& aFactoryObjectInfo)
       
   694 	{
       
   695 	if (iSCPRType == TSubConnOpen::ECreateNew)
       
   696     	{
       
   697     	return MFactoryQuery::ECancel;
       
   698     	}
       
   699 	CSubConnectionProviderBase* sc = static_cast<CSubConnectionProviderBase*>(aFactoryObjectInfo.iInfo.iFactoryObject);
       
   700 	MFactoryQuery::TMatchResult match = aFactoryObjectInfo.iInfo.iFlag == iSCPRType ? MFactoryQuery::EMatch : MFactoryQuery::EContinue;
       
   701 	__ASSERT_DEBUG(sc->ControlProvider(), User::Panic(KSpecAssert_ESockSSocksndmsg, 3));
       
   702 
       
   703 	if (match == MFactoryQuery::EMatch)
       
   704 	   	{
       
   705     	match = iControlProvider == sc->ControlProvider()->RecipientId() ? MFactoryQuery::EMatch : MFactoryQuery::EContinue;
       
   706     	}
       
   707 	return match;			
       
   708 	}
       
   709 
       
   710 EXPORT_C TDefaultFlowFactoryQuery::TDefaultFlowFactoryQuery()
       
   711 : iCprId(TNodeId::NullId()),
       
   712 iSCprId(TNodeId::NullId())
       
   713 	{
       
   714 		
       
   715 	}
       
   716 
       
   717 EXPORT_C TDefaultFlowFactoryQuery::TDefaultFlowFactoryQuery(const Messages::TNodeId& aSCprId)
       
   718 : iCprId(TNodeId::NullId()),
       
   719 iSCprId(aSCprId)
       
   720 	{
       
   721 		
       
   722 	}
       
   723 
       
   724 EXPORT_C TDefaultFlowFactoryQuery::TDefaultFlowFactoryQuery(const Messages::TNodeId& aCprId, const Messages::TNodeId& aSCprId, Messages::TNodeSignal::TMessageId aMessageId, TInt aProtocolType)
       
   725 : iCprId(aCprId),
       
   726 iSCprId(aSCprId),
       
   727 iMessageId(aMessageId),
       
   728 iProtocolType(aProtocolType)
       
   729 	{
       
   730 		
       
   731 	}
       
   732 
       
   733 EXPORT_C TDefaultFlowFactoryQuery::TDefaultFlowFactoryQuery(const Messages::TNodeId& aCprId, const Messages::TNodeId& aSCprId)
       
   734 : iCprId(aCprId),
       
   735 iSCprId(aSCprId)
       
   736 	{
       
   737 		
       
   738 	}
       
   739 
       
   740 EXPORT_C MFactoryQuery::TMatchResult TDefaultFlowFactoryQuery::Match(Factories::TFactoryObjectInfo& aFactoryObjectInfo)
       
   741 	{
       
   742 	CSubConnectionFlowBase* flow = static_cast<CSubConnectionFlowBase*>(aFactoryObjectInfo.iInfo.iFactoryObject);
       
   743 	if (flow->HasControlPlane() && flow->ControlProvider() == iSCprId)
       
   744 		{
       
   745 		return MFactoryQuery::EMatch;
       
   746 		}
       
   747 	return MFactoryQuery::EContinue;		
       
   748 	}
       
   749 
       
   750 EXPORT_C TDefaultProtocolIntfFactoryQuery::TDefaultProtocolIntfFactoryQuery()
       
   751 : iCprId(TNodeId::NullId())
       
   752 	{
       
   753 		
       
   754 	}
       
   755 
       
   756 EXPORT_C TDefaultProtocolIntfFactoryQuery::TDefaultProtocolIntfFactoryQuery(const Messages::TNodeId& aCprId)
       
   757 : iCprId(aCprId)
       
   758 	{
       
   759 		
       
   760 	}
       
   761 
       
   762 EXPORT_C MFactoryQuery::TMatchResult TDefaultProtocolIntfFactoryQuery::Match(Factories::TFactoryObjectInfo& aFactoryObjectInfo)
       
   763 	{
       
   764 	CProtocolIntfBase* protIntf = static_cast<CProtocolIntfBase*>(aFactoryObjectInfo.iInfo.iFactoryObject);
       
   765 	return (protIntf->ControlProviderId() == iCprId ? MFactoryQuery::EMatch : MFactoryQuery::EContinue);		
       
   766 	}
       
   767