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