|
1 // Copyright (c) 2006-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 // This is part of an ECOM plug-in |
|
15 // |
|
16 // |
|
17 |
|
18 #define SYMBIAN_NETWORKING_UPS |
|
19 |
|
20 #include "netmcpr.h" |
|
21 #include "netmcprstates.h" |
|
22 #include "netmcpractivities.h" |
|
23 #include "policyrequest.h" |
|
24 |
|
25 |
|
26 |
|
27 #include <comms-infras/ss_log.h> |
|
28 #include <comms-infras/ss_msgintercept.h> |
|
29 //#include <comms-infras/ss_roles.h> |
|
30 #include <ss_glob.h> |
|
31 #include <cs_subconparams.h> |
|
32 #include <networking/qos3gpp_subconparams.h> |
|
33 |
|
34 #ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW |
|
35 #include <tcpdfltrecvwin.h> |
|
36 #endif //SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW |
|
37 #include <commsdattypeinfov1_1_internal.h> |
|
38 |
|
39 #if defined __CFLOG_ACTIVE || defined SYMBIAN_TRACE_ENABLE |
|
40 #define KNetMCprTag KESockMetaConnectionTag |
|
41 _LIT8(KNetMCprSubTag, "netmcpr"); |
|
42 #endif |
|
43 |
|
44 using namespace Messages; |
|
45 using namespace MeshMachine; |
|
46 using namespace ESock; |
|
47 using namespace NetStateMachine; |
|
48 using namespace MCprActivities; |
|
49 using namespace CommsDat; |
|
50 |
|
51 // |
|
52 // CNetworkMetaConnectionProvider |
|
53 |
|
54 #ifndef SYMBIAN_NETWORKING_UPS |
|
55 |
|
56 CNetworkMetaConnectionProvider* CNetworkMetaConnectionProvider::NewL(CMetaConnectionProviderFactoryBase& aFactory, const TProviderInfo& aProviderInfo) |
|
57 { |
|
58 __CFLOG_VAR((KNetMCprTag, KNetMCprSubTag, _L8("CNetworkMetaConnectionProvider:\tNewL()"))); |
|
59 |
|
60 CNetworkMetaConnectionProvider* self = new (ELeave) CNetworkMetaConnectionProvider(aFactory,aProviderInfo,NetMCprActivities::netMCprActivities::Self()); |
|
61 CleanupStack::PushL(self); |
|
62 self->ConstructL(); |
|
63 CleanupStack::Pop(self); |
|
64 return self; |
|
65 } |
|
66 |
|
67 #endif |
|
68 |
|
69 CNetworkMetaConnectionProvider::CNetworkMetaConnectionProvider(CMetaConnectionProviderFactoryBase& aFactory, const TProviderInfo& aProviderInfo, const MeshMachine::TNodeActivityMap& aActivityMap) |
|
70 : CMobilityMetaConnectionProvider(aFactory,aProviderInfo,aActivityMap) |
|
71 { |
|
72 LOG_NODE_CREATE(KNetMCprTag, CNetworkMetaConnectionProvider); |
|
73 } |
|
74 |
|
75 void CNetworkMetaConnectionProvider::ConstructL() |
|
76 { |
|
77 CCoreMetaConnectionProvider::ConstructL(); |
|
78 |
|
79 #ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW |
|
80 RMetaExtensionContainer mec; |
|
81 mec.Open(iAccessPointConfig); |
|
82 CleanupClosePushL(mec); |
|
83 |
|
84 //Append pointer to lookup table which holds the various TCP receive window sizes for different bearer types. |
|
85 CTCPReceiveWindowSize* receiveWindow; |
|
86 receiveWindow = new (ELeave)CDfltTCPReceiveWindowSize(); |
|
87 CleanupStack::PushL(receiveWindow); |
|
88 mec.AppendExtensionL(receiveWindow); |
|
89 CleanupStack::Pop(receiveWindow); |
|
90 |
|
91 //Append the pointer of CSAPSetOpt which provides generic SetOpt( ) implementation |
|
92 CSAPSetOpt* protoOption = new (ELeave)CSAPSetOpt(); |
|
93 CleanupStack::PushL(protoOption); |
|
94 mec.AppendExtensionL(protoOption); |
|
95 CleanupStack::Pop(protoOption); |
|
96 |
|
97 iAccessPointConfig.Close(); |
|
98 iAccessPointConfig.Open(mec); |
|
99 CleanupStack::PopAndDestroy(&mec); |
|
100 #endif //SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW |
|
101 } |
|
102 |
|
103 |
|
104 CNetworkMetaConnectionProvider::~CNetworkMetaConnectionProvider() |
|
105 { |
|
106 delete iPolicySelectorRecSet; |
|
107 delete iDbSession; |
|
108 LOG_NODE_DESTROY(KNetMCprTag, CNetworkMetaConnectionProvider); |
|
109 } |
|
110 |
|
111 |
|
112 void CNetworkMetaConnectionProvider::ReceivedL(const TRuntimeCtxId& aSender, const TNodeId& aRecipient, TSignatureBase& aMessage) |
|
113 { |
|
114 __CFLOG_VAR((KNetMCprTag, KNetMCprSubTag, _L8("CNetworkMetaConnectionProvider %08x:\tReceivedL() aMessage=%d"), |
|
115 this, aMessage.MessageId().MessageId())); |
|
116 |
|
117 ESOCK_DEBUG_MESSAGE_INTERCEPT(aSender, aMessage, aRecipient); |
|
118 |
|
119 TNodeContext<CNetworkMetaConnectionProvider> ctx(*this, aMessage, aSender, aRecipient); |
|
120 CMobilityMetaConnectionProvider::Received(ctx); |
|
121 User::LeaveIfError(ctx.iReturn); |
|
122 } |
|
123 |
|
124 void CNetworkMetaConnectionProvider::ProcessPolicyParamsL(const TRuntimeCtxId& aSender, TCFIPMessage::TPolicyParams& aPolicyParam) |
|
125 { |
|
126 // this is the best effort call. If db is not there then ignore it |
|
127 TRAPD(err, InitDbL()); |
|
128 if(err == KErrNone) |
|
129 { |
|
130 RCFParameterFamilyBundleC paramBundle = CreateParameterBundleL(FindMatchingPolicyL(aPolicyParam)); |
|
131 |
|
132 // create worker node |
|
133 |
|
134 #ifndef __GCCXML__ |
|
135 RClientInterface::OpenPostMessageClose(Id(), |
|
136 SockManGlobals::Get()->GetPlaneFC(TCFPlayerRole(TCFPlayerRole::ESubConnPlane)), |
|
137 TCFConnPolicyRequest(paramBundle, aPolicyParam.iFlowId, aPolicyParam.iSrcNodeId, address_cast<TNodeId>(aSender))); |
|
138 #endif |
|
139 } |
|
140 } |
|
141 |
|
142 void CNetworkMetaConnectionProvider::InitDbL() |
|
143 { |
|
144 if(iDbSession == NULL) |
|
145 { |
|
146 iDbSession = CMDBSession::NewL(KCDVersion1_2); |
|
147 } |
|
148 |
|
149 if(iPolicySelectorRecSet == NULL) |
|
150 { |
|
151 iPolicySelectorRecSet = new (ELeave) CMDBRecordSet<CCDPolicySelectorRecord>(KCDTIdPolicySelectorRecord); |
|
152 iPolicySelectorRecSet->LoadL(*iDbSession); |
|
153 |
|
154 if(iPolicySelectorRecSet->iRecords.Count() == 0) |
|
155 { |
|
156 User::Leave(KErrNotFound); |
|
157 } |
|
158 } |
|
159 else |
|
160 { |
|
161 iPolicySelectorRecSet->RefreshL(*iDbSession); |
|
162 |
|
163 if(iPolicySelectorRecSet->iRecords.Count() == 0) |
|
164 { |
|
165 User::Leave(KErrNotFound); |
|
166 } |
|
167 } |
|
168 } |
|
169 |
|
170 TInt CNetworkMetaConnectionProvider::FindMatchingPolicyL(TCFIPMessage::TPolicyParams& aPolicyParam) |
|
171 { |
|
172 TBool found(EFalse); |
|
173 TUint count(iPolicySelectorRecSet->iRecords.Count()); |
|
174 |
|
175 CCDPolicySelectorRecord* currentRec(NULL); |
|
176 |
|
177 for(TInt i=0;i<count && !found;++i) |
|
178 { |
|
179 currentRec = static_cast<CCDPolicySelectorRecord*>(iPolicySelectorRecSet->iRecords[i]); |
|
180 |
|
181 found = (CheckProtocol(aPolicyParam.iAddrUpdate.iProtocolId, currentRec) |
|
182 && CheckSrcPort(aPolicyParam.iAddrUpdate.iSrcSockAddr.Port(), currentRec) |
|
183 && CheckDstPort(aPolicyParam.iAddrUpdate.iDestSockAddr.Port(), currentRec) |
|
184 && CheckIap(aPolicyParam.iAddrUpdate.iIapId, currentRec) |
|
185 && CheckSrcAddressMatch(aPolicyParam.iAddrUpdate.iSrcSockAddr, currentRec) |
|
186 && CheckDstAddressMatch(aPolicyParam.iAddrUpdate.iDestSockAddr, currentRec) |
|
187 && CheckAppUid(aPolicyParam.iAppSid, currentRec)); |
|
188 } |
|
189 |
|
190 if (!found) |
|
191 { |
|
192 __CFLOG_VAR((KNetMCprTag, KNetMCprSubTag, _L8("CNetworkMetaConnectionProvider::FindMatchingPolicyL not found"))); |
|
193 User::Leave(KErrNotFound); |
|
194 } |
|
195 else |
|
196 { |
|
197 __CFLOG_VAR((KNetMCprTag, KNetMCprSubTag, _L8("CNetworkMetaConnectionProvider::FindMatchingPolicyL found"))); |
|
198 return currentRec->iPolicyId; |
|
199 } |
|
200 |
|
201 // never executed |
|
202 return 0; |
|
203 } |
|
204 |
|
205 ESock::RCFParameterFamilyBundleC CNetworkMetaConnectionProvider::CreateParameterBundleL(TUint aPolicyId) |
|
206 { |
|
207 CMDBRecordSet<CCDPolicySelector2ParamsRecord>* iRecSet = new(ELeave) CMDBRecordSet<CCDPolicySelector2ParamsRecord>(KCDTIdPolicySelector2ParamsRecord); |
|
208 CleanupStack::PushL(iRecSet); |
|
209 |
|
210 // create new record |
|
211 CCDPolicySelector2ParamsRecord* iRec = static_cast<CCDPolicySelector2ParamsRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdPolicySelector2ParamsRecord)); |
|
212 |
|
213 // Prime record |
|
214 iRec->iPolicySelectorId = aPolicyId; |
|
215 // Append primed record to recordset |
|
216 TInt err = iRecSet->iRecords.Append(iRec); |
|
217 if(err != KErrNone) |
|
218 { |
|
219 delete iRec; |
|
220 User::Leave(err); |
|
221 } |
|
222 |
|
223 TBool searchResult = iRecSet->FindL(*iDbSession); |
|
224 if(!searchResult) |
|
225 { |
|
226 // Params not found |
|
227 User::Leave(KErrNotFound); |
|
228 } |
|
229 |
|
230 TUint count = iRecSet->iRecords.Count(); |
|
231 err = KErrNotFound; |
|
232 |
|
233 RCFParameterFamilyBundle tempBundle; |
|
234 RCFParameterFamilyBundleC paramBundle; |
|
235 if(count>0) |
|
236 { |
|
237 paramBundle.CreateL(); |
|
238 CleanupClosePushL(paramBundle); |
|
239 tempBundle.CreateL(); |
|
240 CleanupClosePushL(tempBundle); |
|
241 |
|
242 |
|
243 // create family |
|
244 paramBundle.Open(tempBundle); |
|
245 RParameterFamily family = tempBundle.CreateFamilyL(KSubConQoSFamily); |
|
246 CleanupStack::Pop(/*tempBundle*/); |
|
247 |
|
248 //[401TODO]: Replace with fency code with uid's */ |
|
249 for (TUint i=0; i<count ; ++i) |
|
250 { |
|
251 // check if at least one param is filled in |
|
252 if(FillInParamsL(static_cast<CCDPolicySelector2ParamsRecord*>(iRecSet->iRecords[i])->iParamsId, family) == KErrNone) |
|
253 { |
|
254 // found at least one param, it is not an error any more |
|
255 err = KErrNone; |
|
256 } |
|
257 } |
|
258 } |
|
259 |
|
260 if(err != KErrNone) |
|
261 { |
|
262 CleanupStack::PopAndDestroy(/*paramBundle*/); |
|
263 } |
|
264 else |
|
265 { |
|
266 CleanupStack::Pop(/*paramBundle*/); |
|
267 } |
|
268 |
|
269 CleanupStack::PopAndDestroy(iRecSet); |
|
270 |
|
271 return paramBundle; |
|
272 } |
|
273 |
|
274 TInt CNetworkMetaConnectionProvider::FillInParamsL(TUint aParamId, RParameterFamily& aFamily) |
|
275 { |
|
276 TInt err(KErrGeneral); |
|
277 |
|
278 switch(aParamId & KCDMaskShowRecordType) |
|
279 { |
|
280 case KCDTIdGenericQosRecord: |
|
281 err = FillInGenericQosParamsL(aParamId, aFamily); |
|
282 break; |
|
283 case KCDTIdUmtsR99QoSAndOnTableRecord: |
|
284 err = FillInUMTSParamsL(aParamId, aFamily); |
|
285 break; |
|
286 default: ; |
|
287 } |
|
288 |
|
289 return err; |
|
290 } |
|
291 |
|
292 TInt CNetworkMetaConnectionProvider::FillInGenericQosParamsL(TUint aParamId, RParameterFamily& aFamily) |
|
293 { |
|
294 CCDGenericQosRecord *rec = static_cast<CCDGenericQosRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdGenericQosRecord)); |
|
295 CleanupStack::PushL(rec); |
|
296 |
|
297 rec->SetRecordId(aParamId & ~KCDMaskShowRecordType); |
|
298 TRAPD(err, rec->LoadL(*iDbSession);) |
|
299 if(err == KErrNone) |
|
300 { |
|
301 CSubConQosGenericParamSet* param = CSubConQosGenericParamSet::NewL(aFamily,RParameterFamily::ERequested); |
|
302 |
|
303 param->SetHeaderMode(rec->iHeaderMode); |
|
304 param->SetDownlinkBandwidth(rec->iDownlinkBandwidth); |
|
305 param->SetUplinkBandwidth(rec->iUplinkBandwidth); |
|
306 param->SetDownLinkMaximumBurstSize(rec->iDownLinkMaximumBurstSize); |
|
307 param->SetUpLinkMaximumBurstSize(rec->iUpLinkMaximumBurstSize); |
|
308 param->SetDownLinkAveragePacketSize(rec->iDownLinkAveragePacketSize); |
|
309 param->SetUpLinkAveragePacketSize(rec->iUpLinkAveragePacketSize); |
|
310 param->SetDownLinkMaximumPacketSize(rec->iDownLinkMaximumPacketSize); |
|
311 param->SetUpLinkMaximumPacketSize(rec->iUpLinkMaximumPacketSize); |
|
312 param->SetDownLinkDelay(rec->iDownLinkDelay); |
|
313 param->SetUpLinkDelay(rec->iUpLinkDelay); |
|
314 param->SetDownLinkDelayVariation(rec->iDownLinkDelayVariation); |
|
315 param->SetUpLinkDelayVariation(rec->iUpLinkDelayVariation); |
|
316 param->SetDownLinkPriority(rec->iDownLinkPriority); |
|
317 param->SetUpLinkPriority(rec->iUpLinkPriority); |
|
318 } |
|
319 |
|
320 CleanupStack::PopAndDestroy(rec); |
|
321 return err; |
|
322 } |
|
323 |
|
324 TInt CNetworkMetaConnectionProvider::FillInUMTSParamsL(TUint aParamId, RParameterFamily& aFamily) |
|
325 { |
|
326 CCDUmtsR99QoSAndOnTableRecord *rec = static_cast<CCDUmtsR99QoSAndOnTableRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdUmtsR99QoSAndOnTableRecord)); |
|
327 CleanupStack::PushL(rec); |
|
328 |
|
329 rec->SetRecordId(aParamId & ~KCDMaskShowRecordType); |
|
330 TRAPD(err, rec->LoadL(*iDbSession);) |
|
331 if(err == KErrNone) |
|
332 { |
|
333 //Fill up the structures |
|
334 CSubConQosR5ParamSet* param = CSubConQosR5ParamSet::NewL(aFamily,RParameterFamily::ERequested); |
|
335 |
|
336 param->SetTrafficClass(rec->iGPRSReqTrafficClass); |
|
337 param->SetDeliveryOrder(rec->iGPRSReqDeliveryOrder); |
|
338 param->SetErroneousSDUDelivery(rec->iGPRSReqDeliverErroneousSDU); |
|
339 param->SetResidualBitErrorRatio(rec->iGPRSReqBER); |
|
340 param->SetSDUErrorRatio(rec->iGPRSReqSDUErrorRatio); |
|
341 param->SetTrafficHandlingPriority(rec->iGPRSReqTrafficHandlingPriority); |
|
342 param->SetTransferDelay(rec->iGPRSReqTransferDelay); |
|
343 param->SetMaxSduSize(rec->iGPRSReqMaxSDUSize); |
|
344 param->SetMaxBitrateUplink(rec->iGPRSReqMaxUplinkRate); |
|
345 param->SetMaxBitrateDownlink(rec->iGPRSReqMaxDownlinkRate); |
|
346 param->SetGuaBitrateUplink(rec->iGPRSReqGuaranteedUplinkRate); |
|
347 param->SetGuaBitrateDownlink(rec->iGPRSReqGuaranteedDownlinkRate); |
|
348 param->SetSignallingIndicator(rec->iGPRSSignallingIndication); |
|
349 param->SetSourceStatisticsDescriptor(rec->iGPRSSourceStatisticsDescriptor); |
|
350 } |
|
351 |
|
352 CleanupStack::PopAndDestroy(rec); |
|
353 return err; |
|
354 } |
|
355 |
|
356 TBool CNetworkMetaConnectionProvider::CheckSrcAddressMatch(const TSockAddr& aFirst, CCDPolicySelectorRecord* aRecord) |
|
357 { |
|
358 if(aRecord && (!(aRecord->iSrcAddress.IsNull() || aRecord->iSrcMask.IsNull()))) |
|
359 { |
|
360 TInetAddr first(aFirst); |
|
361 |
|
362 TInetAddr second; |
|
363 second.Input(aRecord->iSrcAddress); |
|
364 |
|
365 TInetAddr mask; |
|
366 mask.Input(aRecord->iSrcMask); |
|
367 |
|
368 return first.Match(second, mask); |
|
369 } |
|
370 |
|
371 return ETrue; |
|
372 } |
|
373 |
|
374 TBool CNetworkMetaConnectionProvider::CheckDstAddressMatch(const TSockAddr& aFirst, CCDPolicySelectorRecord* aRecord) |
|
375 { |
|
376 if(aRecord && (!(aRecord->iDstAddress.IsNull() || aRecord->iDstMask.IsNull()))) |
|
377 { |
|
378 TInetAddr first(aFirst); |
|
379 |
|
380 TInetAddr second; |
|
381 second.Input(aRecord->iDstAddress); |
|
382 |
|
383 TInetAddr mask; |
|
384 mask.Input(aRecord->iDstMask); |
|
385 |
|
386 return first.Match(second, mask); |
|
387 } |
|
388 |
|
389 return ETrue; |
|
390 } |
|
391 |
|
392 TBool CNetworkMetaConnectionProvider::CheckProtocol(TUint aProtocolId, CCDPolicySelectorRecord* aRecord) |
|
393 { |
|
394 // compare protocolId |
|
395 if(aRecord && !aRecord->iProtocolId.IsNull()) |
|
396 { |
|
397 return aProtocolId == aRecord->iProtocolId; |
|
398 } |
|
399 |
|
400 return ETrue; |
|
401 } |
|
402 |
|
403 |
|
404 TBool CNetworkMetaConnectionProvider::CheckSrcPort(TUint aPort, CCDPolicySelectorRecord* aRecord) |
|
405 { |
|
406 // match src port |
|
407 if(aRecord && (!(aRecord->iSrcPort.IsNull() || aRecord->iSrcPortMax.IsNull()))) |
|
408 { |
|
409 return (aPort >= aRecord->iSrcPort) && (aPort <= aRecord->iSrcPortMax); |
|
410 } |
|
411 |
|
412 return ETrue; |
|
413 } |
|
414 |
|
415 TBool CNetworkMetaConnectionProvider::CheckDstPort(TUint aPort, CCDPolicySelectorRecord* aRecord) |
|
416 { |
|
417 // match src port |
|
418 if(aRecord && (!(aRecord->iDstPort.IsNull() || aRecord->iDstPortMax.IsNull()))) |
|
419 { |
|
420 return (aPort >= aRecord->iDstPort) && (aPort <= aRecord->iDstPortMax); |
|
421 } |
|
422 |
|
423 return ETrue; |
|
424 } |
|
425 |
|
426 TBool CNetworkMetaConnectionProvider::CheckIap(TUint aIapId, CCDPolicySelectorRecord* aRecord) |
|
427 { |
|
428 // check IAP |
|
429 if(aRecord && !aRecord->iIapId.IsNull()) |
|
430 { |
|
431 return aIapId == aRecord->iIapId; |
|
432 } |
|
433 |
|
434 return ETrue; |
|
435 } |
|
436 |
|
437 TBool CNetworkMetaConnectionProvider::CheckAppUid(TUid aAppUid, CCDPolicySelectorRecord* aRecord) |
|
438 { |
|
439 // check AppUid |
|
440 if(aRecord && !aRecord->iAppUid.IsNull()) |
|
441 { |
|
442 return aAppUid == aRecord->iAppUid; |
|
443 } |
|
444 |
|
445 return ETrue; |
|
446 } |
|
447 |
|
448 #ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW |
|
449 |
|
450 CDfltTCPReceiveWindowSize::CDfltTCPReceiveWindowSize() |
|
451 :CTCPReceiveWindowSize() |
|
452 |
|
453 /** |
|
454 * Populate TCP window lookup table. |
|
455 */ |
|
456 { |
|
457 Init(); |
|
458 } |
|
459 |
|
460 void CDfltTCPReceiveWindowSize::Init() |
|
461 /** |
|
462 * Initialize TCP receive window lookup table |
|
463 */ |
|
464 { |
|
465 //TCP receive window size for GPRS |
|
466 iBearerInfoMap.Insert(KGprsBearer,KBearerGprsWinSize); |
|
467 |
|
468 //TCP receive window size for EGPRS |
|
469 iBearerInfoMap.Insert(KEGprsBearer,KBearerEdgeWinSize); |
|
470 |
|
471 //TCP receive window size for UMTS |
|
472 iBearerInfoMap.Insert(KUmtsBearer,KBearerUmtsWinSize); |
|
473 |
|
474 //TCP receive window size for HSDPA |
|
475 iBearerInfoMap.Insert(KHsdpaBearer,KBearerHsdpaWinSize); |
|
476 |
|
477 //TCP receive window size for ethernet |
|
478 iBearerInfoMap.Insert(KEthernetBearer,KBearerEthernetWinSize); |
|
479 |
|
480 //TCP receive window size for other bearer |
|
481 iBearerInfoMap.Insert(KDefaultBearer,KBearerWlanWinSize); |
|
482 } |
|
483 |
|
484 void CDfltTCPReceiveWindowSize::SetTcpWin(TUint aBearerType) |
|
485 /** |
|
486 * Set TCP receive window |
|
487 */ |
|
488 { |
|
489 //Set the TCP Receive Window. |
|
490 iWinSize = *static_cast<TUint*>(iBearerInfoMap.Find(aBearerType)); |
|
491 |
|
492 //Set the Max TCP receive Window. |
|
493 SetMaxWinSize(aBearerType); |
|
494 } |
|
495 |
|
496 |
|
497 void CDfltTCPReceiveWindowSize::SetMaxWinSize(TUint aBearerType) |
|
498 /** |
|
499 * Set Max TCP receive Window. |
|
500 * @Param Bearer type |
|
501 */ |
|
502 { |
|
503 switch(aBearerType) |
|
504 { |
|
505 case KGprsBearer: |
|
506 case KEGprsBearer: |
|
507 case KUmtsBearer: |
|
508 case KHsdpaBearer: |
|
509 // |
|
510 // TCP receive window size will be maximum for HSDPA bearers. |
|
511 // |
|
512 iMaxWinSize = KBearerHsdpaWinSize; |
|
513 break; |
|
514 case KEthernetBearer: |
|
515 iMaxWinSize = KEthernetMaxWinSize; |
|
516 break; |
|
517 |
|
518 default: |
|
519 iMaxWinSize = KEthernetMaxWinSize; |
|
520 break; |
|
521 } |
|
522 } |
|
523 |
|
524 |
|
525 CDfltTCPReceiveWindowSize::~CDfltTCPReceiveWindowSize() |
|
526 /** |
|
527 * Close TCP receive window lookup table |
|
528 */ |
|
529 { |
|
530 iBearerInfoMap.Close(); |
|
531 } |
|
532 |
|
533 /** |
|
534 * Register the variables of TCP receive window class, |
|
535 * since it derives from SMetaData class |
|
536 */ |
|
537 START_ATTRIBUTE_TABLE(CTCPReceiveWindowSize,CTCPReceiveWindowSize::ERealmId, CTCPReceiveWindowSize::iId) |
|
538 REGISTER_ATTRIBUTE(CTCPReceiveWindowSize, iMaxWinSize, TMetaNumber) |
|
539 REGISTER_ATTRIBUTE(CTCPReceiveWindowSize, iWinSize, TMetaNumber) |
|
540 END_ATTRIBUTE_TABLE() |
|
541 |
|
542 #endif //SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW |