telephonyprotocols/pdplayer/src/PDPConfig.cpp
branchRCL_3
changeset 20 07a122eea281
parent 19 630d2f34d719
equal deleted inserted replaced
19:630d2f34d719 20:07a122eea281
    18 /**
    18 /**
    19  @file
    19  @file
    20  @internalComponent
    20  @internalComponent
    21 */
    21 */
    22 
    22 
    23 
       
    24 #include "OstTraceDefinitions.h"
       
    25 #ifdef OST_TRACE_COMPILER_IN_USE
       
    26 #include "PDPConfigTraces.h"
       
    27 #endif
       
    28 
       
    29 #include <hash.h>
       
    30 #include <e32math.h>
       
    31 #include <comms-infras/ss_log.h>
    23 #include <comms-infras/ss_log.h>
    32 #include <in_sock.h>
    24 #include <in_sock.h>
    33 #include <comms-infras/metadata.h>
    25 #include <comms-infras/metadata.h>
    34 #include <comms-infras/agentmcpr.h>
    26 #include <comms-infras/agentmcpr.h>
    35 #include <comms-infras/ss_log.h>
    27 #include <comms-infras/ss_log.h>
    36 #include <comms-infras/ss_tiermanagerutils.h>
    28 #include <comms-infras/ss_tiermanagerutils.h>
    37 
    29 
    38 #include "PDPProvision.h"
    30 #include "PDPProvision.h"
    39 
    31 
    40 using namespace ESock;
    32 using namespace ESock;
       
    33 
       
    34 #if defined(__CFLOG_ACTIVE)
       
    35 #define KPDPMCprTag KESockMetaConnectionTag
       
    36 _LIT8(KPDPMCprSubTag, "pdpmcpr");
       
    37 #endif
    41 
    38 
    42 //
    39 //
    43 // Attribute table for provisioning structure passed to CFProtocol
    40 // Attribute table for provisioning structure passed to CFProtocol
    44 //
    41 //
    45 START_ATTRIBUTE_TABLE(CGPRSProvision, CGPRSProvision::EUid, CGPRSProvision::ETypeId)
    42 START_ATTRIBUTE_TABLE(CGPRSProvision, CGPRSProvision::EUid, CGPRSProvision::ETypeId)
   159 	aIapView->GetBool(KCDTIdWCDMAHeaderCompression | KCDTIdOutgoingGprsRecord, isCompression);
   156 	aIapView->GetBool(KCDTIdWCDMAHeaderCompression | KCDTIdOutgoingGprsRecord, isCompression);
   160 	if (isCompression)
   157 	if (isCompression)
   161 		{
   158 		{
   162 		aCompression |= RPacketContext::KPdpHeaderCompression;
   159 		aCompression |= RPacketContext::KPdpHeaderCompression;
   163 		}
   160 		}
   164 	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CGPRSPROVISION_RETRIEVEGPRSCOMPRESSION_1, "CGPRSProvision [this=0x%08x]::InitialiseConfigL() KCDTIdWCDMADataCompression|KCDTIdWCDMAHeaderCompression [%u]", (TUint)this, aCompression);
   161 	__CFLOG_VAR((KPDPMCprTag, KPDPMCprSubTag, _L8("CGPRSProvision [this=%08x]::InitialiseConfigL() KCDTIdWCDMADataCompression|KCDTIdWCDMAHeaderCompression [%d]"), this, aCompression));
   165 	}
   162 	}
   166 
   163 
   167 void CGPRSProvision::RetrieveGprsAnonymousAccess(RPacketContext::TAnonymousAccess& aAnonymous, ESock::CCommsDatIapView* aIapView) const
   164 void CGPRSProvision::RetrieveGprsAnonymousAccess(RPacketContext::TAnonymousAccess& aAnonymous, ESock::CCommsDatIapView* aIapView) const
   168 	{	
   165 	{	
   169 	TBool isAnonymous = EFalse;
   166 	TBool isAnonymous = EFalse;
   171 	if (isAnonymous)
   168 	if (isAnonymous)
   172 		aAnonymous = RPacketContext::ERequired;
   169 		aAnonymous = RPacketContext::ERequired;
   173 	else
   170 	else
   174 		aAnonymous = RPacketContext::ENotRequired;
   171 		aAnonymous = RPacketContext::ENotRequired;
   175 	
   172 	
   176 	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CGPRSPROVISION_RETRIEVEGPRSANONYMOUSACCESS_1, "CGPRSProvision [this=%08x]::InitialiseConfigL() KCDTIdWCDMAAnonymousAccess [%d]", (TUint)this, aAnonymous);
   173 	__CFLOG_VAR((KPDPMCprTag, KPDPMCprSubTag, _L8("CGPRSProvision [this=%08x]::InitialiseConfigL() KCDTIdWCDMAAnonymousAccess [%d]"), this, aAnonymous));
   177 	}
   174 	}
   178 
   175 
   179 void CGPRSProvision::RetrieveApnNameL(TDes8& aApnName, ESock::CCommsDatIapView* aIapView) const
   176 void CGPRSProvision::RetrieveApnNameL(TDes8& aApnName, ESock::CCommsDatIapView* aIapView) const
   180 	{
   177 	{
   181 	HBufC* buf = NULL;
   178 	HBufC* buf = NULL;
   188     		}
   185     		}
   189     	else if (getErr != KErrNotFound )
   186     	else if (getErr != KErrNotFound )
   190     		{
   187     		{
   191     		User::Leave(getErr);
   188     		User::Leave(getErr);
   192     		}
   189     		}
   193 	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CGPRSPROVISION_RETRIEVEAPNNAMEL_1, "CGPRSProvision [this=%08x]::InitialiseConfigL() KCDTIdAPN [%s]", (TUint)this, aApnName);
   190 	__CFLOG_VAR((KPDPMCprTag, KPDPMCprSubTag, _L8("CGPRSProvision [this=%08x]::InitialiseConfigL() KCDTIdAPN [%S]"), this, &aApnName));
   194 	}
   191 	}
   195 
   192 
   196 void CGPRSProvision::RetrievePdpTypeL(RPacketContext::TProtocolType& aPdpType, ESock::CCommsDatIapView* aIapView) const	
   193 void CGPRSProvision::RetrievePdpTypeL(RPacketContext::TProtocolType& aPdpType, ESock::CCommsDatIapView* aIapView) const	
   197 	{
   194 	{
   198 	TUint32 pdpType(0);
   195 	TUint32 pdpType(0);
   199 
   196 
   200 	aIapView->GetIntL(KCDTIdWCDMPDPType | KCDTIdOutgoingGprsRecord, pdpType);
   197 	aIapView->GetIntL(KCDTIdWCDMPDPType | KCDTIdOutgoingGprsRecord, pdpType);
   201 	aPdpType = static_cast<RPacketContext::TProtocolType>(pdpType);
   198 	aPdpType = static_cast<RPacketContext::TProtocolType>(pdpType);
   202 	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CGPRSPROVISION_RETRIEVEPDPTYPEL_1, "CGPRSProvision [this=%08x]::InitialiseConfigL() KCDTIdWCDMPDPType=%d", (TUint)this, aPdpType);
   199 	__CFLOG_VAR((KPDPMCprTag, KPDPMCprSubTag, _L8("CGPRSProvision [this=%08x]::InitialiseConfigL() KCDTIdWCDMPDPType=%d"), this, aPdpType)); 	
   203 	}
   200 	}
   204 
   201 
   205 void CGPRSProvision::RetrieveAuthenticationInfoL(RPacketContext::TProtocolConfigOptionV2& aProtocolConfigOption, ESock::CCommsDatIapView* aIapView)
   202 void CGPRSProvision::RetrieveAuthenticationInfoL(RPacketContext::TProtocolConfigOptionV2& aProtocolConfigOption, ESock::CCommsDatIapView* aIapView)
   206     {
   203     {
   207     HBufC* buf = NULL;
   204     HBufC* buf = NULL;
   208     TInt getErr;
   205     TInt getErr;
   209 
   206 
   210     OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CGPRSPROVISION_RETRIEVEAUTHENTICATIONINFOL_1, "CGPRSProvision [this=%08x]::RetrieveAuthenticationInfoL()", (TUint)this);
   207     __CFLOG_VAR((KPDPMCprTag, KPDPMCprSubTag, _L8("CGPRSProvision [this=%08x]::RetrieveAuthenticationInfoL()"), this));
   211 
   208 
   212     getErr = aIapView->GetText(KCDTIdWCDMAIfAuthName | KCDTIdOutgoingGprsRecord, buf);
   209     getErr = aIapView->GetText(KCDTIdWCDMAIfAuthName | KCDTIdOutgoingGprsRecord, buf);
   213     if ( getErr == KErrNone )
   210     if ( getErr == KErrNone )
   214         {
   211         {
   215         ASSERT(buf);
   212         ASSERT(buf);
   216         aProtocolConfigOption.iAuthInfo.iUsername.Copy(*buf);
   213         aProtocolConfigOption.iAuthInfo.iUsername.Copy(*buf);
   217         delete buf;
   214         delete buf;
   218         buf = NULL;
   215         buf = NULL;
   219         
   216         
   220         OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CGPRSPROVISION_RETRIEVEAUTHENTICATIONINFOL_2, "CGPRSProvision [this=%08x]::RetrieveAuthenticationInfoL() KCDTIdWCDMAIfAuthName [%s] ", (TUint)this, aProtocolConfigOption.iAuthInfo.iUsername);
   217         __CFLOG_VAR((KPDPMCprTag, KPDPMCprSubTag, _L8("CGPRSProvision [this=%08x]::RetrieveAuthenticationInfoL() KCDTIdWCDMAIfAuthName [%S] "), this, &aProtocolConfigOption.iAuthInfo.iUsername));
   221         
   218         
   222 		aProtocolConfigOption.iId = 1;
   219 		aProtocolConfigOption.iId = 1;
   223 		
       
   224         getErr = aIapView->GetText(KCDTIdWCDMAIfAuthPass | KCDTIdOutgoingGprsRecord, buf);
   220         getErr = aIapView->GetText(KCDTIdWCDMAIfAuthPass | KCDTIdOutgoingGprsRecord, buf);
   225         if ( getErr == KErrNone )
   221         if ( getErr == KErrNone )
   226             {
   222             {
   227             ASSERT(buf);
   223             ASSERT(buf);
   228             aProtocolConfigOption.iAuthInfo.iPassword.Copy(*buf);
   224             aProtocolConfigOption.iAuthInfo.iPassword.Copy(*buf);
   229             delete buf;
   225             delete buf;
   230             buf = NULL;
   226             buf = NULL;
   231             
   227             
   232             OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CGPRSPROVISION_RETRIEVEAUTHENTICATIONINFOL_3, "CGPRSProvision [this=%08x]::RetrieveAuthenticationInfoL() KCDTIdWCDMAIfAuthPass [%S]", (TUint)this, aProtocolConfigOption.iAuthInfo.iPassword);
   228             __CFLOG_VAR((KPDPMCprTag, KPDPMCprSubTag, _L8("CGPRSProvision [this=%08x]::RetrieveAuthenticationInfoL() KCDTIdWCDMAIfAuthPass [%S]"), this, &aProtocolConfigOption.iAuthInfo.iPassword));
   233             }
   229             }
   234         else if (getErr != KErrNotFound)
   230         else if (getErr != KErrNotFound)
   235             {
   231             {
   236             User::Leave(getErr);
   232             User::Leave(getErr);
   237             }
   233             }
   409     {
   405     {
   410 	HBufC* buf = NULL;
   406 	HBufC* buf = NULL;
   411 	
   407 	
   412 	aIapView->GetTextL(KCDTIdTsyName, buf);
   408 	aIapView->GetTextL(KCDTIdTsyName, buf);
   413 	iTsyName.Copy(*buf);
   409 	iTsyName.Copy(*buf);
   414 	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CTSYPROVISION_INITIALISECONFIGL_1, "CTSYProvision [this=%08x]::InitialiseConfigL() KCDTIdTsyName=%S", (TUint)this, iTsyName);
   410 	__CFLOG_VAR((KPDPMCprTag, KPDPMCprSubTag, _L8("CTSYProvision [this=%08x]::InitialiseConfigL() KCDTIdTsyName=%s"), this, &iTsyName)); 	
   415 	delete buf;
   411 	delete buf;
   416     }
   412     }
   417 
   413 
   418 CDefaultPacketQoSProvision* CDefaultPacketQoSProvision::NewL(ESock::CCommsDatIapView* aIapView)
   414 CDefaultPacketQoSProvision* CDefaultPacketQoSProvision::NewL(ESock::CCommsDatIapView* aIapView)
   419 	{
   415 	{