telephonyprotocols/pdplayer/src/PDPSCPR.cpp
changeset 73 70d75957b98f
parent 69 b982c3e940f3
equal deleted inserted replaced
69:b982c3e940f3 73:70d75957b98f
    18 /**
    18 /**
    19  @file
    19  @file
    20  @internalComponent
    20  @internalComponent
    21 */
    21 */
    22 
    22 
       
    23 #include "OstTraceDefinitions.h"
       
    24 #ifdef OST_TRACE_COMPILER_IN_USE
       
    25 #include "PDPSCPRTraces.h"
       
    26 #endif
    23 
    27 
    24 #include "PDPSCPRStates.h"
    28 #include "PDPSCPRStates.h"
    25 #include "PDPDeftSCPR.h"
    29 #include "PDPDeftSCPR.h"
    26 #include "PDPSCPR.h"
    30 #include "PDPSCPR.h"
    27 #include "PDPSCPRFactory.h"
    31 #include "PDPSCPRFactory.h"
   223 
   227 
   224 
   228 
   225 CPDPSubConnectionProvider::~CPDPSubConnectionProvider()
   229 CPDPSubConnectionProvider::~CPDPSubConnectionProvider()
   226     {
   230     {
   227     LOG_NODE_DESTROY(KPDPSCprSubTag, CPDPSubConnectionProvider)
   231     LOG_NODE_DESTROY(KPDPSCprSubTag, CPDPSubConnectionProvider)
       
   232     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPSUBCONNECTIONPROVIDER_DTOR_1, "Destructor");
   228     __FLOG_CLOSE;
   233     __FLOG_CLOSE;
   229     if (iPdpFsmInterface)
   234     if (iPdpFsmInterface)
   230         {
   235         {
   231         iPdpFsmInterface->Close();
   236         iPdpFsmInterface->Close();
   232         }
   237         }
   239  iPdpFsmInterface(NULL),
   244  iPdpFsmInterface(NULL),
   240  iActivityAwaitingResponse(KActivityNull),
   245  iActivityAwaitingResponse(KActivityNull),
   241  iProvisionFailure(KErrCorrupt)
   246  iProvisionFailure(KErrCorrupt)
   242     {
   247     {
   243     LOG_NODE_CREATE1(KPDPSCprSubTag, CPDPSubConnectionProvider, " [factory=%08x]", &aFactory)
   248     LOG_NODE_CREATE1(KPDPSCprSubTag, CPDPSubConnectionProvider, " [factory=%08x]", &aFactory)
       
   249     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPSUBCONNECTIONPROVIDER_CTOR_1, "Constructor");
   244     __FLOG_OPEN(KCFNodeTag, KPDPSCprSubTag);
   250     __FLOG_OPEN(KCFNodeTag, KPDPSCprSubTag);
   245     }
   251     }
   246 
   252 
   247 
   253 
   248 CPDPSubConnectionProvider::CPDPSubConnectionProvider(ESock::CSubConnectionProviderFactoryBase& aFactory,
   254 CPDPSubConnectionProvider::CPDPSubConnectionProvider(ESock::CSubConnectionProviderFactoryBase& aFactory,
   275 	MeshMachine::AMMNodeBase::PostReceived(aContext);
   281 	MeshMachine::AMMNodeBase::PostReceived(aContext);
   276 	}
   282 	}
   277 
   283 
   278 void CPDPSubConnectionProvider::ReceivedL(const TRuntimeCtxId& aSender, const TNodeId& aRecipient, TSignatureBase& aMessage)
   284 void CPDPSubConnectionProvider::ReceivedL(const TRuntimeCtxId& aSender, const TNodeId& aRecipient, TSignatureBase& aMessage)
   279     {
   285     {
       
   286     OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPSUBCONNECTIONPROVIDER_RECEIVEDL_1, "Realm Id [%u] Message Id [%u]", aMessage.MessageId().Realm(), aMessage.MessageId().MessageId());
   280 	ESOCK_DEBUG_MESSAGE_INTERCEPT(aSender, aMessage, aRecipient);
   287 	ESOCK_DEBUG_MESSAGE_INTERCEPT(aSender, aMessage, aRecipient);
   281 
   288 
   282 	PDPSCprStates::TContext ctx(*this, aMessage, aSender, aRecipient);
   289 	PDPSCprStates::TContext ctx(*this, aMessage, aSender, aRecipient);
   283     CPDPSubConnectionProvider::Received(ctx);
   290     CPDPSubConnectionProvider::Received(ctx);
   284     User::LeaveIfError(ctx.iReturn);
   291     User::LeaveIfError(ctx.iReturn);
   285 	}
   292 	}
   286 
   293 
   287 void CPDPSubConnectionProvider::Event(TInt aEvent, TInt aParam)
   294 void CPDPSubConnectionProvider::Event(TInt aEvent, TInt aParam)
   288     {
   295     {
       
   296     OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPSUBCONNECTIONPROVIDER_EVENT_1, "Event [%d], Param [%d]", aEvent, aParam);
   289     TPDPMessages::TPDPFSMMessage msg(aEvent, aParam);
   297     TPDPMessages::TPDPFSMMessage msg(aEvent, aParam);
   290 
   298 
   291 	RClientInterface::OpenPostMessageClose(TNodeCtxId(iActivityAwaitingResponse, Id()), Id(), msg);
   299 	RClientInterface::OpenPostMessageClose(TNodeCtxId(iActivityAwaitingResponse, Id()), Id(), msg);
   292     iActivityAwaitingResponse = KActivityNull;
   300     iActivityAwaitingResponse = KActivityNull;
   293     }
   301     }
   388     return MFactoryQuery::EContinue;
   396     return MFactoryQuery::EContinue;
   389 	}
   397 	}
   390 
   398 
   391 TTFTInfo CPDPSubConnectionProvider::GetTftInfoL(CSubConIPAddressInfoParamSet* aParamSet)
   399 TTFTInfo CPDPSubConnectionProvider::GetTftInfoL(CSubConIPAddressInfoParamSet* aParamSet)
   392 	{
   400 	{
       
   401     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPSUBCONNECTIONPROVIDER_GETTFTINFOL_1, "GetTftInfoL");
   393 	/** TODO: What to do if there will be second request before ggsn responce back and first one will go to the granted list
   402 	/** TODO: What to do if there will be second request before ggsn responce back and first one will go to the granted list
   394 	Assigning of id's is not correct in that case*/
   403 	Assigning of id's is not correct in that case*/
   395 
   404 
   396 	TTFTInfo tft;
   405 	TTFTInfo tft;
   397 	RPacketContext::TPacketFilterV2 pf;
   406 	RPacketContext::TPacketFilterV2 pf;
   432 	TTFTOperationCode result(0);
   441 	TTFTOperationCode result(0);
   433 	TInt count = aParamSet->GetParamNum();
   442 	TInt count = aParamSet->GetParamNum();
   434 	if(count > 0)
   443 	if(count > 0)
   435 		{
   444 		{
   436 		CSubConIPAddressInfoParamSet::TSubConIPAddressInfo paramInfo(aParamSet->GetParamInfoL(0));
   445 		CSubConIPAddressInfoParamSet::TSubConIPAddressInfo paramInfo(aParamSet->GetParamInfoL(0));
       
   446 		OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPSUBCONNECTIONPROVIDER_GETOPERATIONCODEL_1, "Param Info State [%d]", paramInfo.iState);
   437 		switch(paramInfo.iState)
   447 		switch(paramInfo.iState)
   438 			{
   448 			{
   439 			case CSubConIPAddressInfoParamSet::TSubConIPAddressInfo::EAdd:
   449 			case CSubConIPAddressInfoParamSet::TSubConIPAddressInfo::EAdd:
   440 					result = KAddFilters;
   450 					result = KAddFilters;
   441 					break;
   451 					break;
   460 	return result;
   470 	return result;
   461 	}
   471 	}
   462 
   472 
   463 TUint CPDPSubConnectionProvider::FindPacketFilterIdL(CSubConIPAddressInfoParamSet::TSubConIPAddressInfo aParamInfo)
   473 TUint CPDPSubConnectionProvider::FindPacketFilterIdL(CSubConIPAddressInfoParamSet::TSubConIPAddressInfo aParamInfo)
   464 	{
   474 	{
       
   475     OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPSUBCONNECTIONPROVIDER_FINDPACKETFILTERIDL_1, "Param Info State [%d]", aParamInfo.iState);
   465 	TUint id = 0;
   476 	TUint id = 0;
   466 
   477 
   467 	switch(aParamInfo.iState)
   478 	switch(aParamInfo.iState)
   468 		{
   479 		{
   469 		case CSubConIPAddressInfoParamSet::TSubConIPAddressInfo::EAdd :
   480 		case CSubConIPAddressInfoParamSet::TSubConIPAddressInfo::EAdd :
   495 	return id;
   506 	return id;
   496 	}
   507 	}
   497 
   508 
   498 TUint CPDPSubConnectionProvider::FindIdOfMatchingParamSetL(CSubConIPAddressInfoParamSet::TSubConIPAddressInfo aParamInfo)
   509 TUint CPDPSubConnectionProvider::FindIdOfMatchingParamSetL(CSubConIPAddressInfoParamSet::TSubConIPAddressInfo aParamInfo)
   499 	{
   510 	{
       
   511     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPSUBCONNECTIONPROVIDER_FINDIDOFMATCHINGPARAMSETL_1, "Returns Id of Matching Param Set");
   500 	// check the list of the granted params for an index
   512 	// check the list of the granted params for an index
   501 	if(GetParameterBundle().IsNull())
   513 	if(GetParameterBundle().IsNull())
   502 		{
   514 		{
   503 		return 0;
   515 		return 0;
   504 		}
   516 		}
   532 	return found ? iPacketFilterId[i] : 0;
   544 	return found ? iPacketFilterId[i] : 0;
   533 	}
   545 	}
   534 
   546 
   535 void CPDPSubConnectionProvider::NewPacketFilterAddedL(CSubConIPAddressInfoParamSet::TSubConIPAddressInfo aParamInfo, TUint aId)
   547 void CPDPSubConnectionProvider::NewPacketFilterAddedL(CSubConIPAddressInfoParamSet::TSubConIPAddressInfo aParamInfo, TUint aId)
   536 	{
   548 	{
       
   549     OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPSUBCONNECTIONPROVIDER_NEWPACKETFILTERADDEDL_1, "Adding New Packet Filter Id [%d]", aId);
   537     RParameterFamily ipAddressInfoFamily = GetParameterBundle().FindFamily(KSubConIPAddressInfoFamily);
   550     RParameterFamily ipAddressInfoFamily = GetParameterBundle().FindFamily(KSubConIPAddressInfoFamily);
   538     if ( ! ipAddressInfoFamily.IsNull())
   551     if ( ! ipAddressInfoFamily.IsNull())
   539         {
   552         {
   540         CSubConIPAddressInfoParamSet* grantedIPAddressInfo = CSubConIPAddressInfoParamSet::NewL(ipAddressInfoFamily, RParameterFamily::EGranted);
   553         CSubConIPAddressInfoParamSet* grantedIPAddressInfo = CSubConIPAddressInfoParamSet::NewL(ipAddressInfoFamily, RParameterFamily::EGranted);
   541 
   554 
   553 		}
   566 		}
   554 	}
   567 	}
   555 
   568 
   556 void CPDPSubConnectionProvider::PacketFilterRemovedL(TUint aId)
   569 void CPDPSubConnectionProvider::PacketFilterRemovedL(TUint aId)
   557 	{
   570 	{
       
   571     OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPSUBCONNECTIONPROVIDER_PACKETFILTERREMOVEDL_1, "Removing Packet Filter Id [%d]", aId);
   558     RParameterFamily ipAddressInfoFamily = GetParameterBundle().FindFamily(KSubConIPAddressInfoFamily);
   572     RParameterFamily ipAddressInfoFamily = GetParameterBundle().FindFamily(KSubConIPAddressInfoFamily);
   559 
   573 
   560     if ( ! ipAddressInfoFamily.IsNull())
   574     if ( ! ipAddressInfoFamily.IsNull())
   561         {
   575         {
   562 		// find an index from given id value
   576 		// find an index from given id value
   563 		//TUint count = iPacketFilterId.Count();
   577 		//TUint count = iPacketFilterId.Count();
   564 		TInt index = iPacketFilterId.Find(aId);
   578 		TInt index = iPacketFilterId.Find(aId);
   565 
       
   566 		//for (index = 0; (index < count) && (iPacketFilterId[index] != aId); ++index){}
   579 		//for (index = 0; (index < count) && (iPacketFilterId[index] != aId); ++index){}
   567 
   580 
   568 		if(index >= 0)
   581 		if(index >= 0)
   569 			{
   582 			{
   570 			CSubConIPAddressInfoParamSet* grantedIPAddressInfo = CSubConIPAddressInfoParamSet::NewL(ipAddressInfoFamily, RParameterFamily::EGranted);
   583 			CSubConIPAddressInfoParamSet* grantedIPAddressInfo = CSubConIPAddressInfoParamSet::NewL(ipAddressInfoFamily, RParameterFamily::EGranted);