24
|
1 |
// Copyright (c) 2006-2010 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 |
// PDP SubConnection Provider states/transitions
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
/**
|
|
19 |
@file
|
|
20 |
@internalComponent
|
|
21 |
*/
|
|
22 |
|
|
23 |
#include <comms-infras/es_config.h>
|
|
24 |
#include <comms-infras/corescpractivities.h>
|
|
25 |
#include <comms-infras/ss_mcprnodemessages.h>
|
|
26 |
#include "PDPSCPRStates.h"
|
|
27 |
#include "PDPDeftSCPR.h"
|
|
28 |
#include "PDPParamMapper.h"
|
|
29 |
#include <comms-infras/ss_log.h>
|
|
30 |
#include <networking/ipaddrinfoparams.h>
|
|
31 |
#include <networking/mbmsparams.h>
|
|
32 |
#include <ip_subconparams.h>
|
|
33 |
#include <genericscprparams.h>
|
|
34 |
#include "pdpfsmnmspace.h"
|
|
35 |
#include "pdpdef.h"
|
|
36 |
#include <comms-infras/ss_nodemessages_flow.h>
|
|
37 |
#include <comms-infras/ss_nodemessages.h>
|
|
38 |
#include <comms-infras/ss_api_ext.h>
|
|
39 |
#include <elements/nm_messages_errorrecovery.h>
|
|
40 |
#include <comms-infras/sockmes.h> // for ioctl ipc
|
|
41 |
#include <nifvar_internal.h>
|
|
42 |
#include <elements/mm_activities.h>
|
|
43 |
#include <comms-infras/ss_tiermanagerutils.h>
|
|
44 |
#include <comms-infras/connectionsettings.h>
|
|
45 |
#include <hash.h>
|
|
46 |
#include <e32math.h>
|
|
47 |
|
|
48 |
using namespace Messages;
|
|
49 |
using namespace MeshMachine;
|
|
50 |
using namespace ESock;
|
|
51 |
using namespace NetStateMachine;
|
|
52 |
using namespace PDPSCprActivities;
|
|
53 |
using namespace SpudMan;
|
|
54 |
using namespace ConnectionServ;
|
|
55 |
|
|
56 |
#ifdef _DEBUG
|
|
57 |
_LIT (KPdpSCprPanic,"PpdScprPanic");
|
|
58 |
#endif
|
|
59 |
|
|
60 |
const TUint8 KGenericNifChallengeSize = 8;
|
|
61 |
const TUint KGenericNifIdLength = 1;
|
|
62 |
|
|
63 |
//-=========================================================
|
|
64 |
//
|
|
65 |
// States
|
|
66 |
//
|
|
67 |
//-=========================================================
|
|
68 |
namespace PDPSCprStates
|
|
69 |
{
|
|
70 |
//-=========================================================
|
|
71 |
//Util
|
|
72 |
//-=========================================================
|
|
73 |
DEFINE_SMELEMENT(TAwaitingPDPFSMMessage, NetStateMachine::MState, PDPSCprStates::TContext)
|
|
74 |
TBool TAwaitingPDPFSMMessage::Accept()
|
|
75 |
{
|
|
76 |
return iContext.iMessage.IsMessage<TPDPMessages::TPDPFSMMessage>();
|
|
77 |
}
|
|
78 |
|
|
79 |
DEFINE_SMELEMENT(TNoTagOrError, NetStateMachine::MStateFork, PDPSCprStates::TContext)
|
|
80 |
TInt TNoTagOrError::TransitionTag()
|
|
81 |
{
|
|
82 |
ASSERT(iContext.iNodeActivity);
|
|
83 |
TPDPMessages::TPDPFSMMessage& msg = message_cast<TPDPMessages::TPDPFSMMessage>(iContext.iMessage);
|
|
84 |
if (msg.iValue2 != KErrNone)
|
|
85 |
{
|
|
86 |
iContext.iNodeActivity->SetError(msg.iValue2);
|
|
87 |
return KErrorTag;
|
|
88 |
}
|
|
89 |
return KNoTag;
|
|
90 |
}
|
|
91 |
|
|
92 |
DEFINE_SMELEMENT(TNoTagOrUserAuthenticateOrAlreadyStarted, NetStateMachine::MStateFork, PDPSCprStates::TDefContext)
|
|
93 |
TInt TNoTagOrUserAuthenticateOrAlreadyStarted::TransitionTag()
|
|
94 |
{
|
|
95 |
ASSERT(iContext.iMessage.IsMessage<TCFDataClient::TStart>());
|
|
96 |
ASSERT(iContext.iNodeActivity);
|
|
97 |
if (iContext.Node().iPDPFsmContextId != CPDPSubConnectionProvider::EInvalidContextId)
|
|
98 |
{
|
|
99 |
return CoreNetStates::KAlreadyStarted;
|
|
100 |
}
|
|
101 |
|
|
102 |
if (iContext.Node().PromptForAuth())
|
|
103 |
{
|
|
104 |
return PDPSCprStates::KUserAuthenticate;
|
|
105 |
}
|
|
106 |
|
|
107 |
return KNoTag;
|
|
108 |
}
|
|
109 |
|
|
110 |
TBool TAwaitingPDPFSMMessage::Accept(TInt aExtensionId)
|
|
111 |
{
|
|
112 |
TPDPMessages::TPDPFSMMessage* pdpmsg = message_cast<TPDPMessages::TPDPFSMMessage>(&iContext.iMessage);
|
|
113 |
if ( pdpmsg )
|
|
114 |
{
|
|
115 |
if (pdpmsg->iValue1 == aExtensionId)
|
|
116 |
{
|
|
117 |
return ETrue;
|
|
118 |
}
|
|
119 |
}
|
|
120 |
return EFalse;
|
|
121 |
}
|
|
122 |
|
|
123 |
DEFINE_SMELEMENT(TSendDataClientIdleIfNoSubconnsAndNoClients, NetStateMachine::MStateTransition, PDPSCprStates::TDefContext)
|
|
124 |
void TSendDataClientIdleIfNoSubconnsAndNoClients::DoL()
|
|
125 |
{
|
|
126 |
iContext.Node().SendDataClientIdleIfNoSubconnsAndNoClientsL();
|
|
127 |
}
|
|
128 |
|
|
129 |
DEFINE_SMELEMENT(TNoTagOrSendErrorRecoveryRequestOrError, NetStateMachine::MStateFork, PDPSCprStates::TContext)
|
|
130 |
TInt TNoTagOrSendErrorRecoveryRequestOrError::TransitionTag()
|
|
131 |
{
|
|
132 |
ASSERT(iContext.iNodeActivity);
|
|
133 |
TPDPMessages::TPDPFSMMessage& msg = message_cast<TPDPMessages::TPDPFSMMessage>(iContext.iMessage);
|
|
134 |
if (msg.iValue2 == KErrUmtsMaxNumOfContextExceededByNetwork ||
|
|
135 |
msg.iValue2 == KErrUmtsMaxNumOfContextExceededByPhone)
|
|
136 |
{
|
|
137 |
return KSendErrorRecoveryRequest;
|
|
138 |
}
|
|
139 |
else if (msg.iValue2 != KErrNone)
|
|
140 |
{
|
|
141 |
iContext.iNodeActivity->SetError(msg.iValue2);
|
|
142 |
return KErrorTag;
|
|
143 |
}
|
|
144 |
return KNoTag;
|
|
145 |
}
|
|
146 |
|
|
147 |
DEFINE_SMELEMENT(TNoTagBackwardOrErrorTag, NetStateMachine::MStateFork, PDPSCprStates::TContext)
|
|
148 |
TInt TNoTagBackwardOrErrorTag::TransitionTag()
|
|
149 |
{
|
|
150 |
__ASSERT_DEBUG(iContext.iNodeActivity, User::Panic(KPdpSCprPanic, CorePanics::KPanicNoActivity));
|
|
151 |
iContext.Node().SetContentionRequested(EFalse);
|
|
152 |
if (iContext.iMessage.IsMessage<TEErrorRecovery::TErrorRecoveryResponse>() &&
|
|
153 |
message_cast<TEErrorRecovery::TErrorRecoveryResponse>(iContext.iMessage).iErrResponse.iAction == TErrResponse::ERetry)
|
|
154 |
{
|
|
155 |
return KNoTag | NetStateMachine::EBackward;
|
|
156 |
}
|
|
157 |
|
|
158 |
|
|
159 |
TEErrorRecovery::TErrorRecoveryResponse* recoveryMsg = message_cast<TEErrorRecovery::TErrorRecoveryResponse>(&iContext.iMessage);
|
|
160 |
if (recoveryMsg)
|
|
161 |
{
|
|
162 |
iContext.iNodeActivity->SetError(recoveryMsg->iErrResponse.iError);
|
|
163 |
}
|
|
164 |
|
|
165 |
|
|
166 |
TEBase::TError* errMsg = message_cast<TEBase::TError>(&iContext.iMessage);
|
|
167 |
if (errMsg)
|
|
168 |
{
|
|
169 |
iContext.iNodeActivity->SetError(errMsg->iValue);
|
|
170 |
}
|
|
171 |
return KErrorTag;
|
|
172 |
}
|
|
173 |
|
|
174 |
DEFINE_SMELEMENT(TNoTagOrContentionTag, NetStateMachine::MStateFork, PDPSCprStates::TContext)
|
|
175 |
TInt TNoTagOrContentionTag::TransitionTag()
|
|
176 |
{
|
|
177 |
if (iContext.Node().ContentionRequested())
|
|
178 |
{
|
|
179 |
return KContentionTag;
|
|
180 |
}
|
|
181 |
return KNoTag;
|
|
182 |
}
|
|
183 |
|
|
184 |
|
|
185 |
|
|
186 |
//-=========================================================
|
|
187 |
//Provisioning
|
|
188 |
//-=========================================================
|
|
189 |
DEFINE_SMELEMENT(TSelfInit, NetStateMachine::MStateTransition, PDPSCprStates::TContext)
|
|
190 |
// This is should be revisited in future releases, basic idea is that information
|
|
191 |
// that can be modified should have a visibility that is to that node's
|
|
192 |
// level and not further (i.e. changes here will affect this connection
|
|
193 |
// only, not every connection that uses this MCPR)
|
|
194 |
// MCPR - AccessPointConfig() contains information that is used by
|
|
195 |
// all connections under that MCPR and is unchanging
|
|
196 |
// CPR - Again for all connections under that CPR and is unchanging
|
|
197 |
// SCPR - Connection specific information (i.e. can change and does change)
|
|
198 |
// DC - No point - just reads information.
|
|
199 |
// Here we've moved basically all of the configuration information that was in
|
|
200 |
// the MCPR [that could be moved] this is because some of it changes / is overwritten
|
|
201 |
// with information that comes out of etel/modem. This also has the added benefit of
|
|
202 |
// freeing up memory in cases where the connection is torn down but the MCPR lies
|
|
203 |
// around for availability purposes. In the future, this code (or something like it)
|
|
204 |
// should be moved into the PDP.CPR when it exists.
|
|
205 |
|
|
206 |
void TSelfInit::SetupProvisionCfgL(ESock::CCommsDatIapView* aIapView)
|
|
207 |
{
|
|
208 |
CPDPSubConnectionProvider &tNode = static_cast<CPDPSubConnectionProvider&>(iContext.Node());
|
|
209 |
|
|
210 |
RMetaExtensionContainer mec;
|
|
211 |
mec.Open(tNode.AccessPointConfig());
|
|
212 |
CleanupClosePushL(mec);
|
|
213 |
|
|
214 |
mec.AppendExtensionL(CIPConfig::NewFromGPRSOutLC(aIapView));
|
|
215 |
CleanupStack::Pop();
|
|
216 |
|
|
217 |
mec.AppendExtensionL(CBCAProvision::NewLC(aIapView));
|
|
218 |
CleanupStack::Pop();
|
|
219 |
|
|
220 |
mec.AppendExtensionL(CImsExtProvision::NewLC(aIapView));
|
|
221 |
CleanupStack::Pop();
|
|
222 |
|
|
223 |
CGPRSProvision* gprsProvision = CGPRSProvision::NewLC(aIapView);
|
|
224 |
mec.AppendExtensionL(gprsProvision);
|
|
225 |
CleanupStack::Pop(gprsProvision);
|
|
226 |
|
|
227 |
//It's not legal for the qos defaults to be absent.
|
|
228 |
CDefaultPacketQoSProvision* defaultQoS = NULL;
|
|
229 |
|
|
230 |
TRAPD(ret, defaultQoS = CDefaultPacketQoSProvision::NewL(aIapView));
|
|
231 |
|
|
232 |
if ((KErrNone == ret) && defaultQoS)
|
|
233 |
{
|
|
234 |
CleanupStack::PushL(defaultQoS);
|
|
235 |
mec.AppendExtensionL(defaultQoS);
|
|
236 |
CleanupStack::Pop(defaultQoS);
|
|
237 |
}
|
|
238 |
else
|
|
239 |
{
|
|
240 |
if (KErrNoMemory == ret)
|
|
241 |
{
|
|
242 |
User::Leave(KErrNoMemory);
|
|
243 |
}
|
|
244 |
else
|
|
245 |
{
|
|
246 |
User::Leave(KErrCorrupt);
|
|
247 |
}
|
|
248 |
}
|
|
249 |
|
|
250 |
CRawIpAgentConfig* rawIpAgentConfig = CRawIpAgentConfig::NewLC(aIapView, &gprsProvision->GetScratchContextAs<TPacketDataConfigBase>());
|
|
251 |
mec.AppendExtensionL(rawIpAgentConfig);
|
|
252 |
CleanupStack::Pop();
|
|
253 |
|
|
254 |
tNode.AccessPointConfig().Close();
|
|
255 |
tNode.AccessPointConfig().Open(mec);
|
|
256 |
CleanupStack::PopAndDestroy(&mec);
|
|
257 |
}
|
|
258 |
|
|
259 |
void TSelfInit::DoL()
|
|
260 |
{
|
|
261 |
CPDPSubConnectionProvider &tNode = static_cast<CPDPSubConnectionProvider&>(iContext.Node());
|
|
262 |
|
|
263 |
const TProviderInfoExt* providerInfoExt = static_cast<const TProviderInfoExt*>(tNode.AccessPointConfig().FindExtension(
|
|
264 |
STypeId::CreateSTypeId(TProviderInfoExt::EUid, TProviderInfoExt::ETypeId)));
|
|
265 |
|
|
266 |
// this should always be here, however, a bit of defensive programming
|
|
267 |
// never hurt..
|
|
268 |
if (providerInfoExt == NULL)
|
|
269 |
{
|
|
270 |
User::Leave(KErrCorrupt);
|
|
271 |
}
|
|
272 |
|
|
273 |
CCommsDatIapView* iapView = CCommsDatIapView::NewLC(providerInfoExt->iProviderInfo.APId());
|
|
274 |
|
|
275 |
TRAP(tNode.iProvisionFailure,SetupProvisionCfgL(iapView));
|
|
276 |
|
|
277 |
// Don't want any failure here to be masked by successful configuration later on.
|
|
278 |
// A leave here will not cause a roll back of the connection but it will show an
|
|
279 |
// Error -> message in the SVG diagram. The provision failure error code will
|
|
280 |
// cause the connection rollback.
|
|
281 |
User::LeaveIfError(tNode.iProvisionFailure);
|
|
282 |
|
|
283 |
// if the FSM interface is null, this means that we're initializing a secondary context
|
|
284 |
// as this code is common for both
|
|
285 |
|
|
286 |
if (tNode.iPdpFsmInterface == NULL)
|
|
287 |
{
|
|
288 |
//Non-default SCPR running this code
|
|
289 |
ASSERT(iContext.Node().ControlProvider());
|
|
290 |
ESock::TDefaultSCPRFactoryQuery query(iContext.Node().ControlProvider()->RecipientId(), TSubConnOpen::EAttachToDefault );
|
|
291 |
ESock::CSubConnectionProviderBase* defProvider = static_cast<ESock::CSubConnectionProviderBase*>(static_cast<ESock::CSubConnectionProviderFactoryBase&>(iContext.Node().Factory()).Find(query));
|
|
292 |
ASSERT(defProvider);
|
|
293 |
iContext.Node().iDefaultSCPR = static_cast<CPDPDefaultSubConnectionProvider*>(defProvider);
|
|
294 |
ASSERT(iContext.Node().iDefaultSCPR != &iContext.Node()); //This transition is not expected to be executed for defaults.
|
|
295 |
ASSERT(iContext.Node().iDefaultSCPR->iPdpFsmInterface != NULL);
|
|
296 |
ASSERT(iContext.Node().iPdpFsmInterface == NULL);
|
|
297 |
iContext.Node().iPdpFsmInterface = iContext.Node().iDefaultSCPR->iPdpFsmInterface;
|
|
298 |
iContext.Node().iPdpFsmInterface->Open();
|
|
299 |
}
|
|
300 |
else
|
|
301 |
{
|
|
302 |
//default SCPR running this code (i.e. primary context)
|
|
303 |
const CTSYProvision* tsyProvision =\
|
|
304 |
static_cast<const CTSYProvision*>(tNode.AccessPointConfig().FindExtension(CTSYProvision::TypeId()));
|
|
305 |
|
|
306 |
if (tsyProvision == NULL)
|
|
307 |
{
|
|
308 |
// we do not have to set provision failure here
|
|
309 |
// as it was set in the base class constructor
|
|
310 |
// svg will show the leave error code though
|
|
311 |
User::Leave(KErrCorrupt);
|
|
312 |
}
|
|
313 |
|
|
314 |
CGPRSProvision* gprsProvision = const_cast<CGPRSProvision*>(static_cast<const CGPRSProvision*>(
|
|
315 |
tNode.AccessPointConfig().FindExtension(STypeId::CreateSTypeId(CGPRSProvision::EUid,CGPRSProvision::ETypeId))));
|
|
316 |
|
|
317 |
if (gprsProvision == NULL)
|
|
318 |
{
|
|
319 |
tNode.iProvisionFailure = KErrCorrupt;
|
|
320 |
User::Leave(KErrCorrupt);
|
|
321 |
}
|
|
322 |
|
|
323 |
TInt configType = TPacketDataConfigBase::KConfigGPRS;
|
|
324 |
|
|
325 |
switch (gprsProvision->UmtsGprsRelease())
|
|
326 |
{
|
|
327 |
case TPacketDataConfigBase::KConfigGPRS:
|
|
328 |
configType = TPacketDataConfigBase::KConfigGPRS;
|
|
329 |
break;
|
|
330 |
case TPacketDataConfigBase::KConfigRel99Rel4:
|
|
331 |
configType = TPacketDataConfigBase::KConfigRel99Rel4;
|
|
332 |
break;
|
|
333 |
case TPacketDataConfigBase::KConfigRel5:
|
|
334 |
configType = TPacketDataConfigBase::KConfigRel5;
|
|
335 |
break;
|
|
336 |
default:
|
|
337 |
// we do not have to set provision failure here
|
|
338 |
// as it was set in the base class constructor
|
|
339 |
// svg will show the leave error code though
|
|
340 |
User::Leave(KErrNotSupported);
|
|
341 |
break;
|
|
342 |
}
|
|
343 |
|
|
344 |
// a provisioning failure would be unrecoverable as this only happens
|
|
345 |
// we cannot create memory, access etel or there is a configuration
|
|
346 |
// problem - however, leaving with an error here does not stop the
|
|
347 |
// sequence of events because the handler for provision config is not
|
|
348 |
// expecting a response. if there is a failure then it will be errored in
|
|
349 |
// the next activity in the sequence, i.e. DataClientStart
|
|
350 |
TRAP(tNode.iProvisionFailure,tNode.iPdpFsmInterface->NewL(tsyProvision->iTsyName,configType));
|
|
351 |
|
|
352 |
tNode.iDefaultSCPR = static_cast<CPDPDefaultSubConnectionProvider*>(&tNode);
|
|
353 |
|
|
354 |
TBool promptForAuth = EFalse;
|
|
355 |
iapView->GetBool(KCDTIdWCDMAIfPromptForAuth | KCDTIdOutgoingGprsRecord, promptForAuth);
|
|
356 |
|
|
357 |
//Default SCPR executing this code, so safe to cast.
|
|
358 |
CPDPDefaultSubConnectionProvider &tempNode = static_cast<CPDPDefaultSubConnectionProvider&>(iContext.Node());
|
|
359 |
tempNode.SetPromptForAuth(promptForAuth);
|
|
360 |
}
|
|
361 |
CleanupStack::PopAndDestroy(); // CloseIapView();
|
|
362 |
}
|
|
363 |
|
|
364 |
|
|
365 |
//-=========================================================
|
|
366 |
//Creating context
|
|
367 |
//-=========================================================
|
|
368 |
MeshMachine::CNodeActivityBase* CStartActivity::NewL( const MeshMachine::TNodeActivity& aActivitySig, MeshMachine::AMMNodeBase& aNode )
|
|
369 |
{
|
|
370 |
return new (ELeave) CStartActivity(aActivitySig, aNode);
|
|
371 |
};
|
|
372 |
|
|
373 |
CStartActivity::~CStartActivity()
|
|
374 |
{
|
|
375 |
RNodeInterface* startedDataClient = iNode.GetFirstClient<TDefaultClientMatchPolicy>(TClientType(TCFClientType::EData, TCFClientType::EStarted));
|
|
376 |
ASSERT(iNode.GetClientIter<TDefaultClientMatchPolicy>(TClientType(TCFClientType::EData))[1] == NULL);
|
|
377 |
CPDPSubConnectionProvider& pdpscpr = static_cast<CPDPSubConnectionProvider&>(iNode);
|
|
378 |
if (pdpscpr.iPDPFsmContextId == CPDPSubConnectionProvider::EInvalidContextId ||
|
|
379 |
startedDataClient == NULL)
|
|
380 |
{
|
|
381 |
pdpscpr.LinkDown(Error());
|
|
382 |
}
|
|
383 |
}
|
|
384 |
|
|
385 |
CStartActivity::CStartActivity( const MeshMachine::TNodeActivity& aActivitySig, MeshMachine::AMMNodeBase& aNode)
|
|
386 |
:MeshMachine::CNodeRetryActivity(aActivitySig, aNode)
|
|
387 |
{
|
|
388 |
}
|
|
389 |
|
|
390 |
DEFINE_SMELEMENT(TCreateSecondaryOrMbmsPDPCtx, NetStateMachine::MStateTransition, PDPSCprStates::TContext)
|
|
391 |
void TCreateSecondaryOrMbmsPDPCtx::DoL()
|
|
392 |
{
|
|
393 |
ASSERT(iContext.Node().iPdpFsmInterface);
|
|
394 |
|
|
395 |
RParameterFamily mbmsInfoFamily = iContext.Node().iParameterBundle.FindFamily(KSubConChannelParamsType);
|
|
396 |
STypeId typeId = STypeId::CreateSTypeId(KSubConChannelParamsImplUid, KSubConChannelParamsType);
|
|
397 |
CSubConChannelParamSet *mbmsSubConParamSet = mbmsInfoFamily.IsNull() ? NULL :
|
|
398 |
(CSubConChannelParamSet *)(mbmsInfoFamily.FindParameterSet(typeId, RParameterFamily::ERequested));
|
|
399 |
|
|
400 |
if (mbmsSubConParamSet)
|
|
401 |
{
|
|
402 |
RPacketMbmsContext::TContextConfigMbmsV1 mbmsConfig;
|
|
403 |
ConnectionServ::TMBMSChannelInfoV1* channelPtr = reinterpret_cast<ConnectionServ::TMBMSChannelInfoV1*>(mbmsSubConParamSet->GetChannelInfo());
|
|
404 |
mbmsConfig.iTmgi = channelPtr->GetTmgi();
|
|
405 |
mbmsConfig.iMbmsServicePriority = channelPtr->GetServicePriority();
|
|
406 |
mbmsConfig.iMbmsAccessBearer = channelPtr->GetScope();
|
|
407 |
|
|
408 |
TSessionOperatioInfo sessionInfo;
|
|
409 |
CSubConMBMSExtensionParamSet *mbmsSessionSet=static_cast<CSubConMBMSExtensionParamSet *>(mbmsInfoFamily.FindParameterSet(
|
|
410 |
STypeId::CreateSTypeId(KSubConMBMSExtParamsImplUid,KSubConMBMSSessionExtParamsType),RParameterFamily::ERequested));
|
|
411 |
if (mbmsSessionSet)
|
|
412 |
{
|
|
413 |
sessionInfo.iSessionIds.Reset();
|
|
414 |
for(TInt i=0;i<mbmsSessionSet->GetSessionCount();i++)
|
|
415 |
{
|
|
416 |
sessionInfo.iSessionIds.Append(mbmsSessionSet->GetSessionId(i));
|
|
417 |
}
|
|
418 |
sessionInfo.iOperation = mbmsSessionSet->GetOperationType();
|
|
419 |
mbmsConfig.iMbmsServiceMode = mbmsSessionSet->GetServiceMode();
|
|
420 |
}
|
|
421 |
else
|
|
422 |
{
|
|
423 |
User::Leave(KErrCorrupt);
|
|
424 |
}
|
|
425 |
|
|
426 |
iContext.Node().iPDPFsmContextId = iContext.Node().iPdpFsmInterface->NewFsmContextL(iContext.Node(),SpudMan::EMbms);
|
|
427 |
|
|
428 |
iContext.Node().iContextType=SpudMan::EMbms;
|
|
429 |
|
|
430 |
iContext.Node().iPdpFsmInterface->Set(iContext.Node().iPDPFsmContextId,mbmsConfig);
|
|
431 |
|
|
432 |
TTFTInfo tft;
|
|
433 |
User::LeaveIfError(iContext.Node().iPdpFsmInterface->Set(iContext.Node().iPDPFsmContextId, tft));
|
|
434 |
User::LeaveIfError(iContext.Node().iPdpFsmInterface->Set(iContext.Node().iPDPFsmContextId, sessionInfo));
|
|
435 |
User::LeaveIfError(iContext.Node().iPdpFsmInterface->Input(iContext.Node().iPDPFsmContextId, SpudMan::ECreateMbmsPDPContext));
|
|
436 |
iContext.Node().iActivityAwaitingResponse = iContext.iNodeActivity->ActivityId();
|
|
437 |
sessionInfo.iSessionIds.Close();
|
|
438 |
}
|
|
439 |
else
|
|
440 |
{
|
|
441 |
// Reset the default QoS and TFT here. KContextQoSSet should arrive soon
|
|
442 |
// with the proper values.
|
|
443 |
#ifdef SYMBIAN_NETWORKING_UMTSR5
|
|
444 |
RPacketQoS::TQoSR5Requested qos;
|
|
445 |
#else
|
|
446 |
RPacketQoS::TQoSR99_R4Requested qos;
|
|
447 |
#endif
|
|
448 |
// SYMBIAN_NETWORKING_UMTSR5
|
|
449 |
|
|
450 |
iContext.Node().iPDPFsmContextId = iContext.Node().iPdpFsmInterface->NewFsmContextL(iContext.Node(),SpudMan::ESecondary);
|
|
451 |
|
|
452 |
iContext.Node().iContextType = SpudMan::ESecondary;
|
|
453 |
|
|
454 |
User::LeaveIfError(iContext.Node().iPdpFsmInterface->Set(iContext.Node().iPDPFsmContextId, qos));
|
|
455 |
|
|
456 |
TTFTInfo tft;
|
|
457 |
User::LeaveIfError(iContext.Node().iPdpFsmInterface->Set(iContext.Node().iPDPFsmContextId, tft));
|
|
458 |
User::LeaveIfError(iContext.Node().iPdpFsmInterface->Input(iContext.Node().iPDPFsmContextId, SpudMan::ECreateSecondaryPDPContext));
|
|
459 |
iContext.Node().iActivityAwaitingResponse = iContext.iNodeActivity->ActivityId();
|
|
460 |
}
|
|
461 |
}
|
|
462 |
|
|
463 |
DEFINE_SMELEMENT(TAwaitingPDPCtxCreated, NetStateMachine::MState, PDPSCprStates::TContext)
|
|
464 |
TBool TAwaitingPDPCtxCreated::Accept()
|
|
465 |
{
|
|
466 |
if (iContext.Node().iContextType != SpudMan::EMbms)
|
|
467 |
{
|
|
468 |
return TAwaitingPDPFSMMessage::Accept(KSecondaryContextCreated);
|
|
469 |
}
|
|
470 |
else
|
|
471 |
{
|
|
472 |
return TAwaitingPDPFSMMessage::Accept(KMbmsContextCreated); //
|
|
473 |
}
|
|
474 |
}
|
|
475 |
|
|
476 |
DEFINE_SMELEMENT(TAwaitingPrimaryPDPCtxCreated, NetStateMachine::MState, PDPSCprStates::TContext)
|
|
477 |
TBool TAwaitingPrimaryPDPCtxCreated::Accept()
|
|
478 |
{
|
|
479 |
return TAwaitingPDPFSMMessage::Accept(KPrimaryContextCreated);
|
|
480 |
}
|
|
481 |
|
|
482 |
DEFINE_SMELEMENT(TCreatePrimaryPDPCtx, NetStateMachine::MStateTransition, PDPSCprStates::TDefContext)
|
|
483 |
void TCreatePrimaryPDPCtx::SetupSipServerAddrRetrievalL(RPacketContext::TProtocolConfigOptionV2& aPco)
|
|
484 |
{
|
|
485 |
TPtr8 pcoPtr(const_cast<TUint8*>(aPco.iMiscBuffer.Ptr()),aPco.iMiscBuffer.Length(),aPco.iMiscBuffer.MaxLength());
|
|
486 |
|
|
487 |
// attach TTlv to the buffer
|
|
488 |
TTlvStruct<RPacketContext::TPcoId,RPacketContext::TPcoItemDataLength> tlv(pcoPtr,0);
|
|
489 |
tlv.AppendItemL(RPacketContext::TPcoId(RPacketContext::EEtelPcktPCSCFAddressRequest),
|
|
490 |
TPtr8(static_cast<TUint8*>(NULL), 0, 0));
|
|
491 |
aPco.iMiscBuffer.SetLength(pcoPtr.Length());
|
|
492 |
}
|
|
493 |
|
|
494 |
void TCreatePrimaryPDPCtx::SetImsSignallingFlagL(RPacketContext::TProtocolConfigOptionV2& aPco, TBool aImcn)
|
|
495 |
{
|
|
496 |
if (aImcn)
|
|
497 |
{
|
|
498 |
TPtr8 pcoPtr(const_cast<TUint8*>(aPco.iMiscBuffer.Ptr()),aPco.iMiscBuffer.Length(),aPco.iMiscBuffer.MaxLength());
|
|
499 |
TTlvStruct<RPacketContext::TPcoId,RPacketContext::TPcoItemDataLength> tlv(pcoPtr,0);
|
|
500 |
tlv.AppendItemL(RPacketContext::TPcoId(RPacketContext::EEtelPcktIMCNMSSubsystemSignallingFlag ),
|
|
501 |
TPtr8(static_cast<TUint8*>(NULL), 0, 0));
|
|
502 |
aPco.iMiscBuffer.SetLength(pcoPtr.Length());
|
|
503 |
}
|
|
504 |
}
|
|
505 |
|
|
506 |
TBool TCreatePrimaryPDPCtx::IsModeGsmL() const
|
|
507 |
{
|
|
508 |
const CTSYProvision* tsyProvision = static_cast<const CTSYProvision*>(
|
|
509 |
iContext.Node().AccessPointConfig().FindExtension(CTSYProvision::TypeId()));
|
|
510 |
if (tsyProvision == NULL)
|
|
511 |
{
|
|
512 |
User::Leave(KErrCorrupt);
|
|
513 |
}
|
|
514 |
|
|
515 |
RTelServer telServer;
|
|
516 |
User::LeaveIfError(telServer.Connect());
|
|
517 |
CleanupClosePushL(telServer);
|
|
518 |
|
|
519 |
User::LeaveIfError(telServer.LoadPhoneModule(tsyProvision->iTsyName));
|
|
520 |
|
|
521 |
TInt phones = 0;
|
|
522 |
User::LeaveIfError(telServer.EnumeratePhones(phones));
|
|
523 |
|
|
524 |
RTelServer::TPhoneInfo phoneInfo;
|
|
525 |
TBuf<KCommsDbSvrMaxFieldLength> currentTsyName;
|
|
526 |
TBool found = EFalse;
|
|
527 |
_LIT(KTsyNameExtension, ".tsy");
|
|
528 |
for (TInt i = 0; i < phones; ++i)
|
|
529 |
{
|
|
530 |
User::LeaveIfError(telServer.GetTsyName(i, currentTsyName));
|
|
531 |
// remove .TSY extension if necessary
|
|
532 |
if (currentTsyName.Right(4).CompareF(KTsyNameExtension()) == 0)
|
|
533 |
{
|
|
534 |
currentTsyName = currentTsyName.Left(currentTsyName.Length() - 4);
|
|
535 |
}
|
|
536 |
// compare current TSY name with the one we're looking for
|
|
537 |
if (currentTsyName.CompareF(tsyProvision->iTsyName) == 0)
|
|
538 |
{
|
|
539 |
// get phone info from the TSY
|
|
540 |
User::LeaveIfError(telServer.GetPhoneInfo(i, phoneInfo));
|
|
541 |
found = ETrue;
|
|
542 |
break;
|
|
543 |
}
|
|
544 |
}
|
|
545 |
if (!found)
|
|
546 |
{
|
|
547 |
User::Leave(KErrNotFound);
|
|
548 |
}
|
|
549 |
|
|
550 |
RMobilePhone phone;
|
|
551 |
User::LeaveIfError(phone.Open(telServer, phoneInfo.iName));
|
|
552 |
CleanupClosePushL(phone);
|
|
553 |
|
|
554 |
RMobilePhone::TMobilePhoneNetworkMode networkMode = RMobilePhone::ENetworkModeUnknown;
|
|
555 |
User::LeaveIfError(phone.GetCurrentMode(networkMode));
|
|
556 |
CleanupStack::PopAndDestroy(2); // phone, telServer
|
|
557 |
return (networkMode == RMobilePhone::ENetworkModeGsm);
|
|
558 |
}
|
|
559 |
|
|
560 |
void TCreatePrimaryPDPCtx::SetChapInformationL(RPacketContext::TProtocolConfigOptionV2& aPco)
|
|
561 |
/*
|
|
562 |
* This function basically checks if secure authentication is required or not.
|
|
563 |
* If it is needed then it sets all secure authentication related information.
|
|
564 |
*/
|
|
565 |
{
|
|
566 |
const TProviderInfoExt* providerInfoExt = static_cast<const TProviderInfoExt*>(iContext.Node().AccessPointConfig().FindExtension(
|
|
567 |
STypeId::CreateSTypeId(TProviderInfoExt::EUid, TProviderInfoExt::ETypeId)));
|
|
568 |
|
|
569 |
if (providerInfoExt == NULL)
|
|
570 |
{
|
|
571 |
User::Leave(KErrCorrupt);
|
|
572 |
}
|
|
573 |
|
|
574 |
CCommsDatIapView* iapView = CCommsDatIapView::NewLC(providerInfoExt->iProviderInfo.APId());
|
|
575 |
|
|
576 |
TBool isDisablePlainTextAuth = EFalse;
|
|
577 |
iapView->GetBool(KCDTIdWCDMADisablePlainTextAuth | KCDTIdOutgoingGprsRecord, isDisablePlainTextAuth);
|
|
578 |
|
|
579 |
//If user name is not available then no authentication Required.
|
|
580 |
if (aPco.iAuthInfo.iUsername.Length() == 0)
|
|
581 |
{
|
|
582 |
aPco.iAuthInfo.iProtocol = RPacketContext::EProtocolNone;
|
|
583 |
}
|
|
584 |
else if (isDisablePlainTextAuth) //If Disable, CHAP will be used.
|
|
585 |
{
|
|
586 |
if (aPco.iAuthInfo.iPassword.Length() == 0)
|
|
587 |
{
|
|
588 |
User::Leave(KErrArgument); //CHAP without password?
|
|
589 |
}
|
|
590 |
else
|
|
591 |
{
|
|
592 |
aPco.iAuthInfo.iProtocol = RPacketContext::EProtocolCHAP;
|
|
593 |
CreateChallengeAndResponseForChapL(aPco);
|
|
594 |
}
|
|
595 |
}
|
|
596 |
else
|
|
597 |
{
|
|
598 |
aPco.iAuthInfo.iProtocol = RPacketContext::EProtocolPAP;
|
|
599 |
}
|
|
600 |
|
|
601 |
CleanupStack::PopAndDestroy(); // CloseIapView();
|
|
602 |
}
|
|
603 |
|
|
604 |
void TCreatePrimaryPDPCtx::CreateChallengeAndResponseForChapL(RPacketContext::TProtocolConfigOptionV2& aProtocolConfigOption)
|
|
605 |
/*
|
|
606 |
* This function basically sets the CHAP protocol authentication such as (challenge) and (response)
|
|
607 |
*/
|
|
608 |
{
|
|
609 |
//Challenge
|
|
610 |
TTime currentTime;
|
|
611 |
currentTime.UniversalTime();
|
|
612 |
|
|
613 |
TInt64 seedValue = currentTime.Int64();
|
|
614 |
|
|
615 |
TUint8 challenge[KGenericNifChallengeSize] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
|
616 |
|
|
617 |
TUint8 i=0;
|
|
618 |
while(i < KGenericNifChallengeSize)
|
|
619 |
{
|
|
620 |
challenge[i] = (TUint8)(Math::Rand(seedValue)%256);
|
|
621 |
aProtocolConfigOption.iChallenge.Append(challenge[i++]);
|
|
622 |
}
|
|
623 |
|
|
624 |
//Response
|
|
625 |
TBuf8<KGenericNifIdLength+KCommsDbSvrMaxColumnNameLength+KGenericNifChallengeSize> message;
|
|
626 |
message.Append(aProtocolConfigOption.iId);
|
|
627 |
message.Append(aProtocolConfigOption.iAuthInfo.iPassword);
|
|
628 |
message.Append(aProtocolConfigOption.iChallenge);
|
|
629 |
|
|
630 |
TInt length = 1 /*iId length */ + aProtocolConfigOption.iAuthInfo.iPassword.Length() + KGenericNifChallengeSize;
|
|
631 |
|
|
632 |
HBufC8* buf = HBufC8::NewL(length);
|
|
633 |
|
|
634 |
CleanupStack::PushL(buf);
|
|
635 |
|
|
636 |
TPtr8 ptr((TUint8*)buf->Des().Ptr(),length);
|
|
637 |
|
|
638 |
ptr.Copy(message);
|
|
639 |
|
|
640 |
CMD5* md5=0;
|
|
641 |
md5 = CMD5::NewL();
|
|
642 |
|
|
643 |
CleanupStack::PushL(md5);
|
|
644 |
|
|
645 |
TPtrC8 Response = md5->Hash(ptr);
|
|
646 |
|
|
647 |
aProtocolConfigOption.iResponse.Copy(Response);
|
|
648 |
|
|
649 |
CleanupStack::PopAndDestroy(2); //buf, md5
|
|
650 |
}
|
|
651 |
|
|
652 |
void TCreatePrimaryPDPCtx::DoL()
|
|
653 |
{
|
|
654 |
// if the provisionconfig failed, there is no way to inform the CPR of the failure
|
|
655 |
// as the framework doesn't expect a response from provisionconfig, so error here
|
|
656 |
// if there was a problem so that the appropriate clean up can happen.
|
|
657 |
|
|
658 |
CPDPDefaultSubConnectionProvider &tNode = static_cast<CPDPDefaultSubConnectionProvider&>(iContext.Node());
|
|
659 |
|
|
660 |
User::LeaveIfError(tNode.iProvisionFailure);
|
|
661 |
|
|
662 |
ASSERT(tNode.iPdpFsmInterface);
|
|
663 |
|
|
664 |
tNode.PostToClients<TDefaultClientMatchPolicy>(
|
|
665 |
iContext.NodeId(),
|
|
666 |
TCFMessage::TStateChange(
|
|
667 |
Elements::TStateChange(KPsdStartingConfiguration, KErrNone)).CRef(),
|
|
668 |
TClientType(TCFClientType::ECtrlProvider));
|
|
669 |
|
|
670 |
CGPRSProvision* gprsProvision = const_cast<CGPRSProvision*>(static_cast<const CGPRSProvision*>(
|
|
671 |
tNode.AccessPointConfig().FindExtension(STypeId::CreateSTypeId(CGPRSProvision::EUid,CGPRSProvision::ETypeId))));
|
|
672 |
|
|
673 |
if (gprsProvision == NULL)
|
|
674 |
{
|
|
675 |
User::Leave(KErrCorrupt);
|
|
676 |
}
|
|
677 |
|
|
678 |
//retrieve QoS (should be provisioned, but can also be overriden with SetParams).
|
|
679 |
RPacketQoS::TQoSR5Requested qosOverridenParams;
|
|
680 |
|
|
681 |
const RPacketQoS::TQoSR5Requested* qosParams = NULL;
|
|
682 |
|
|
683 |
if ((!tNode.iParameterBundle.IsNull()) &&\
|
|
684 |
(!tNode.iParameterBundle.FindFamily(KSubConQoSFamily).IsNull()))
|
|
685 |
{
|
|
686 |
MPDPParamMapper::MapQosParamBundleToEtelL(tNode.iParameterBundle, qosOverridenParams);
|
|
687 |
qosParams = &qosOverridenParams;
|
|
688 |
}
|
|
689 |
else
|
|
690 |
{
|
|
691 |
const CDefaultPacketQoSProvision* defaultQoSProvision = static_cast<const CDefaultPacketQoSProvision*>(
|
|
692 |
tNode.AccessPointConfig().FindExtension(STypeId::CreateSTypeId(CDefaultPacketQoSProvision::EUid,CDefaultPacketQoSProvision::ETypeId)));
|
|
693 |
|
|
694 |
if (defaultQoSProvision)
|
|
695 |
{
|
|
696 |
qosParams = &defaultQoSProvision->iParams;
|
|
697 |
}
|
|
698 |
else
|
|
699 |
{
|
|
700 |
User::Leave(KErrCorrupt);
|
|
701 |
}
|
|
702 |
|
|
703 |
//Here we're taking the qos defaults from the provision info, hence skipping the iParameterBundle.
|
|
704 |
//The lack of iParameterBundle however and the respective ERequested params is badly tolerated by the rest
|
|
705 |
//of the code (e.g.: when subsequently raising granted params it is assumed something has been requested).
|
|
706 |
|
|
707 |
// These parameter bundles are also used in a situation when a context has failed to create because of a lack
|
|
708 |
// of modem / network resources, as the SCPR isn't torn down, the parameter bundles need to hold the
|
|
709 |
// information of the default QoS otherwise bad things happen [bad QoS].
|
|
710 |
|
|
711 |
RCFParameterFamilyBundle newBundle;
|
|
712 |
newBundle.CreateL();
|
|
713 |
tNode.iParameterBundle.Open(newBundle);
|
|
714 |
RParameterFamily family = newBundle.CreateFamilyL(KSubConQoSFamily);
|
|
715 |
|
|
716 |
TInt tRelease = gprsProvision->UmtsGprsRelease();
|
|
717 |
|
|
718 |
CSubConQosR99ParamSet* extRequestedR99 = NULL;
|
|
719 |
CSubConQosR99ParamSet* extAcceptableR99 = NULL;
|
|
720 |
CSubConQosR5ParamSet* extRequestedR5 = NULL;
|
|
721 |
CSubConQosR5ParamSet* extAcceptableR5 = NULL;
|
|
722 |
|
|
723 |
if (tRelease == TPacketDataConfigBase::KConfigRel5)
|
|
724 |
{
|
|
725 |
// R5 - basically R4 + a few parameters
|
|
726 |
|
|
727 |
extRequestedR5 = CSubConQosR5ParamSet::NewL(family,RParameterFamily::ERequested);
|
|
728 |
extAcceptableR5 = CSubConQosR5ParamSet::NewL(family,RParameterFamily::EAcceptable);
|
|
729 |
|
|
730 |
// Requested QoS Parameters
|
|
731 |
extRequestedR5->SetSourceStatisticsDescriptor(qosParams->iSourceStatisticsDescriptor);
|
|
732 |
extRequestedR5->SetSignallingIndicator(qosParams->iSignallingIndication);
|
|
733 |
|
|
734 |
extRequestedR99 = dynamic_cast<CSubConQosR99ParamSet*>(extRequestedR5);
|
|
735 |
|
|
736 |
// Acceptable QoS Parameters
|
|
737 |
|
|
738 |
extAcceptableR5->SetSourceStatisticsDescriptor(qosParams->iSourceStatisticsDescriptor);
|
|
739 |
extAcceptableR5->SetSignallingIndicator(qosParams->iSignallingIndication);
|
|
740 |
|
|
741 |
extAcceptableR99 = dynamic_cast<CSubConQosR99ParamSet*>(extAcceptableR5);
|
|
742 |
|
|
743 |
}
|
|
744 |
else
|
|
745 |
{
|
|
746 |
// R4 and R99
|
|
747 |
extRequestedR99 = CSubConQosR99ParamSet::NewL(family,RParameterFamily::ERequested);
|
|
748 |
extAcceptableR99 = CSubConQosR99ParamSet::NewL(family,RParameterFamily::EAcceptable);
|
|
749 |
}
|
|
750 |
|
|
751 |
// Requested QoS Parameters
|
|
752 |
extRequestedR99->SetTrafficClass(qosParams->iReqTrafficClass);
|
|
753 |
extRequestedR99->SetDeliveryOrder(qosParams->iReqDeliveryOrderReqd);
|
|
754 |
extRequestedR99->SetErroneousSDUDelivery(qosParams->iReqDeliverErroneousSDU);
|
|
755 |
extRequestedR99->SetResidualBitErrorRatio(qosParams->iReqBER);
|
|
756 |
extRequestedR99->SetSDUErrorRatio(qosParams->iReqSDUErrorRatio);
|
|
757 |
extRequestedR99->SetTrafficHandlingPriority(qosParams->iReqTrafficHandlingPriority);
|
|
758 |
extRequestedR99->SetTransferDelay(qosParams->iReqTransferDelay);
|
|
759 |
extRequestedR99->SetMaxSduSize(qosParams->iReqMaxSDUSize);
|
|
760 |
extRequestedR99->SetMaxBitrateUplink(qosParams->iReqMaxRate.iUplinkRate);
|
|
761 |
extRequestedR99->SetMaxBitrateDownlink(qosParams->iReqMaxRate.iDownlinkRate);
|
|
762 |
extRequestedR99->SetGuaBitrateUplink(qosParams->iReqGuaranteedRate.iUplinkRate);
|
|
763 |
extRequestedR99->SetGuaBitrateDownlink(qosParams->iReqGuaranteedRate.iDownlinkRate);
|
|
764 |
|
|
765 |
// Acceptable QoS Parameters
|
|
766 |
extAcceptableR99->SetTrafficClass(qosParams->iMinTrafficClass);
|
|
767 |
extAcceptableR99->SetDeliveryOrder(qosParams->iMinDeliveryOrderReqd);
|
|
768 |
extAcceptableR99->SetErroneousSDUDelivery(qosParams->iMinDeliverErroneousSDU);
|
|
769 |
extAcceptableR99->SetResidualBitErrorRatio(qosParams->iMaxBER);
|
|
770 |
extAcceptableR99->SetSDUErrorRatio(qosParams->iMaxSDUErrorRatio);
|
|
771 |
extAcceptableR99->SetTrafficHandlingPriority(qosParams->iMinTrafficHandlingPriority);
|
|
772 |
extAcceptableR99->SetTransferDelay(qosParams->iMaxTransferDelay);
|
|
773 |
extAcceptableR99->SetMaxSduSize(qosParams->iMinAcceptableMaxSDUSize);
|
|
774 |
extAcceptableR99->SetMaxBitrateUplink(qosParams->iMinAcceptableMaxRate.iUplinkRate);
|
|
775 |
extAcceptableR99->SetMaxBitrateDownlink(qosParams->iMinAcceptableMaxRate.iDownlinkRate);
|
|
776 |
extAcceptableR99->SetGuaBitrateUplink(qosParams->iMinGuaranteedRate.iUplinkRate);
|
|
777 |
extAcceptableR99->SetGuaBitrateDownlink(qosParams->iMinGuaranteedRate.iDownlinkRate);
|
|
778 |
|
|
779 |
}
|
|
780 |
|
|
781 |
TTFTInfo tft; //We'll use empty/thus default TFT
|
|
782 |
|
|
783 |
const CImsExtProvision* imsprov = static_cast<const CImsExtProvision*>(
|
|
784 |
tNode.AccessPointConfig().FindExtension(STypeId::CreateSTypeId(CImsExtProvision::EUid, CImsExtProvision::ETypeId)));
|
|
785 |
|
|
786 |
TRAP_IGNORE(tNode.iIsModeGsm = IsModeGsmL());
|
|
787 |
|
|
788 |
switch (gprsProvision->UmtsGprsRelease())
|
|
789 |
{
|
|
790 |
case TPacketDataConfigBase::KConfigGPRS:
|
|
791 |
{
|
|
792 |
SetImsSignallingFlagL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigGPRS>().iProtocolConfigOption, imsprov->iImsSignalIndicator);
|
|
793 |
|
|
794 |
// Only request SIP server address retrieval when network not in GSM/GPRS mode
|
|
795 |
// e.g. UMTS/WCDMA
|
|
796 |
if (!tNode.iIsModeGsm)
|
|
797 |
{
|
|
798 |
SetupSipServerAddrRetrievalL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigGPRS>().iProtocolConfigOption);
|
|
799 |
}
|
|
800 |
|
|
801 |
SetChapInformationL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigGPRS>().iProtocolConfigOption);
|
|
802 |
|
|
803 |
}
|
|
804 |
break;
|
|
805 |
|
|
806 |
case TPacketDataConfigBase::KConfigRel5:
|
|
807 |
case TPacketDataConfigBase::KConfigRel99Rel4:
|
|
808 |
{
|
|
809 |
SetImsSignallingFlagL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigR99_R4>().iProtocolConfigOption, imsprov->iImsSignalIndicator);
|
|
810 |
|
|
811 |
// Only request SIP server address retrieval when network not in GSM/GPRS mode
|
|
812 |
// e.g. UMTS/WCDMA
|
|
813 |
if (!tNode.iIsModeGsm)
|
|
814 |
{
|
|
815 |
SetupSipServerAddrRetrievalL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigR99_R4>().iProtocolConfigOption);
|
|
816 |
}
|
|
817 |
|
|
818 |
SetChapInformationL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigR99_R4>().iProtocolConfigOption);
|
|
819 |
|
|
820 |
}
|
|
821 |
break;
|
|
822 |
}
|
|
823 |
|
|
824 |
tNode.iPDPFsmContextId = tNode.iPdpFsmInterface->NewFsmContextL(tNode,SpudMan::EPrimary);
|
|
825 |
|
|
826 |
tNode.PostToClients<TDefaultClientMatchPolicy>(
|
|
827 |
iContext.NodeId(),
|
|
828 |
TCFMessage::TStateChange(
|
|
829 |
Elements::TStateChange(KPsdFinishedConfiguration, KErrNone)).CRef(),
|
|
830 |
TClientType(TCFClientType::ECtrlProvider));
|
|
831 |
|
|
832 |
tNode.PostToClients<TDefaultClientMatchPolicy>(
|
|
833 |
iContext.NodeId(),
|
|
834 |
TCFMessage::TStateChange(
|
|
835 |
Elements::TStateChange(KPsdStartingActivation, KErrNone)).CRef(),
|
|
836 |
TClientType(TCFClientType::ECtrlProvider));
|
|
837 |
|
|
838 |
ASSERT(tNode.iPDPFsmContextId == KPrimaryContextId);
|
|
839 |
tNode.iContextType=SpudMan::EPrimary;
|
|
840 |
tNode.iPdpFsmInterface->Set(KPrimaryContextId, gprsProvision->GetScratchContextAs<TPacketDataConfigBase>());
|
|
841 |
//Set default QoS
|
|
842 |
tNode.iPdpFsmInterface->Set(KPrimaryContextId, *qosParams);
|
|
843 |
//Set default TFTs
|
|
844 |
tNode.iPdpFsmInterface->Set(KPrimaryContextId, tft); // ignore any error
|
|
845 |
//Start the primary.
|
|
846 |
User::LeaveIfError(tNode.iPdpFsmInterface->Input(KPrimaryContextId, SpudMan::ECreatePrimaryPDPContext));
|
|
847 |
iContext.iNodeActivity->ClearPostedTo();
|
|
848 |
tNode.iActivityAwaitingResponse = iContext.iNodeActivity->ActivityId();
|
|
849 |
}
|
|
850 |
|
|
851 |
DEFINE_SMELEMENT(TOverrideProvision, NetStateMachine::MStateTransition, PDPSCprStates::TContext)
|
|
852 |
void TOverrideProvision::DoL()
|
|
853 |
{
|
|
854 |
const CBCAProvision& bcaExtension = static_cast<const CBCAProvision&>(iContext.Node().AccessPointConfig().FindExtensionL(CBCAProvision::TypeId()));
|
|
855 |
|
|
856 |
// This cannot return NULL - checked in an earlier transition
|
|
857 |
const CTSYProvision& tsyProvision = static_cast<const CTSYProvision&>(
|
|
858 |
iContext.Node().AccessPointConfig().FindExtensionL(CTSYProvision::TypeId()));
|
|
859 |
|
|
860 |
RPacketContext::TDataChannelV2& dataChannel = iContext.Node().iTempDataChannelV2;
|
|
861 |
iContext.Node().iPdpFsmInterface->Get(iContext.Node().iPDPFsmContextId, dataChannel);
|
|
862 |
|
|
863 |
// The telephony etel documentation is confusing/misleading.
|
|
864 |
// In source it states that both iChannel and iPort have been deprecated, and that iPort is undeprecated
|
|
865 |
// and that iPort should be used.
|
|
866 |
// Other etel documentation states that iPort is deprecated and that iChannel should be used.
|
|
867 |
// Current CBS TA advise suggests iChannelId should be used rather than iPort
|
|
868 |
// Legacy SPUDs and this PDP SCpr use iPort and will do this when common TSY is not used maintaining compatibility with existing licensee TSYs
|
|
869 |
|
|
870 |
_LIT(KCommonTsy, "phonetsy");
|
|
871 |
if (!tsyProvision.iTsyName.Left(KCommonTsy().Length()).CompareF(KCommonTsy))
|
|
872 |
{
|
|
873 |
// CTSY has been changed to return the context name + channel Id in iChannelId,
|
|
874 |
const_cast<CBCAProvision&>(bcaExtension).SetPortName(dataChannel.iChannelId);
|
|
875 |
}
|
|
876 |
else
|
|
877 |
{
|
|
878 |
// Co-incidentally SIMTSY will return the same value in both iChannelId and iPort meaning that
|
|
879 |
// a change here would not show a regression in our tests - YOU HAVE BEEN CAUTIONED!
|
|
880 |
const_cast<CBCAProvision&>(bcaExtension).SetPortName(dataChannel.iPort);
|
|
881 |
}
|
|
882 |
|
|
883 |
if (iContext.Node().iContextType != SpudMan::EMbms)
|
|
884 |
{
|
|
885 |
CGPRSProvision& gprsProvision = const_cast<CGPRSProvision&>(static_cast<const CGPRSProvision&>(
|
|
886 |
iContext.Node().AccessPointConfig().FindExtensionL(STypeId::CreateSTypeId(CGPRSProvision::EUid,CGPRSProvision::ETypeId))));
|
|
887 |
iContext.Node().iPdpFsmInterface->Get(iContext.Node().iPDPFsmContextId, gprsProvision.GetScratchContextAs<TPacketDataConfigBase>());
|
|
888 |
}
|
|
889 |
iContext.Node().PostToClients<TDefaultClientMatchPolicy>(
|
|
890 |
iContext.NodeId(),
|
|
891 |
TCFMessage::TStateChange(
|
|
892 |
Elements::TStateChange(KPsdFinishedActivation, KErrNone)).CRef(),
|
|
893 |
TClientType(TCFClientType::ECtrlProvider));
|
|
894 |
}
|
|
895 |
|
|
896 |
DEFINE_SMELEMENT(TSendErrorRecoveryRequest, NetStateMachine::MStateTransition, PDPSCprStates::TContext)
|
|
897 |
void TSendErrorRecoveryRequest::DoL()
|
|
898 |
{
|
|
899 |
TPDPMessages::TPDPFSMMessage* msg = message_cast<TPDPMessages::TPDPFSMMessage>(&iContext.iMessage);
|
|
900 |
|
|
901 |
__ASSERT_DEBUG(msg, User::Panic(KPdpSCprPanic, CorePanics::KPanicIncorrectMessage));
|
|
902 |
__ASSERT_DEBUG(iContext.iNodeActivity, User::Panic(KPdpSCprPanic, CorePanics::KPanicNoActivity));
|
|
903 |
|
|
904 |
const RNodeInterface* controlProvider = iContext.Node().ControlProvider();
|
|
905 |
__ASSERT_DEBUG(controlProvider, User::Panic(KPdpSCprPanic, CorePanics::KPanicNoControlProvider));
|
|
906 |
|
|
907 |
|
|
908 |
TErrContext ctx(controlProvider->RecipientId(), msg->MessageId(), iContext.iNodeActivity->ActivitySigId(), Elements::TStateChange(0, msg->iValue2));
|
|
909 |
|
|
910 |
TEErrorRecovery::TErrorRecoveryRequest rawReq(ctx);
|
|
911 |
|
|
912 |
|
|
913 |
iContext.iNodeActivity->PostRequestTo(
|
|
914 |
*controlProvider,
|
|
915 |
TCFSafeMessage::TRequestCarrierEast<TEErrorRecovery::TErrorRecoveryRequest>(rawReq).CRef()
|
|
916 |
);
|
|
917 |
iContext.iNodeActivity->ClearPostedTo();
|
|
918 |
|
|
919 |
iContext.Node().SetContentionRequested(ETrue);
|
|
920 |
}
|
|
921 |
|
|
922 |
|
|
923 |
|
|
924 |
//-=========================================================
|
|
925 |
//Activiating context
|
|
926 |
//-=========================================================
|
|
927 |
|
|
928 |
DEFINE_SMELEMENT(TActivatePDPContext, NetStateMachine::MStateTransition, PDPSCprStates::TContext)
|
|
929 |
void TActivatePDPContext::DoL()
|
|
930 |
{
|
|
931 |
ASSERT(iContext.Node().iPdpFsmInterface);
|
|
932 |
User::LeaveIfError(iContext.Node().iPdpFsmInterface->Input(iContext.Node().iPDPFsmContextId, SpudMan::EContextActivate));
|
|
933 |
|
|
934 |
//Expect Response
|
|
935 |
iContext.iNodeActivity->ClearPostedTo();
|
|
936 |
iContext.Node().iActivityAwaitingResponse = iContext.iNodeActivity->ActivityId();
|
|
937 |
}
|
|
938 |
|
|
939 |
|
|
940 |
DEFINE_SMELEMENT(TAwaitingPDPContextActive, NetStateMachine::MState, PDPSCprStates::TContext)
|
|
941 |
TBool TAwaitingPDPContextActive::Accept()
|
|
942 |
{
|
|
943 |
return TAwaitingPDPFSMMessage::Accept(KContextActivateEvent);
|
|
944 |
}
|
|
945 |
|
|
946 |
DEFINE_SMELEMENT(TModifyActivePDPContext, NetStateMachine::MStateTransition, PDPSCprStates::TContext)
|
|
947 |
void TModifyActivePDPContext::DoL()
|
|
948 |
{
|
|
949 |
ASSERT(iContext.Node().iPdpFsmInterface);
|
|
950 |
|
|
951 |
TBool QoSChanged=MPDPParamMapper::QoSRequested(iContext.Node().iParameterBundle);
|
|
952 |
|
|
953 |
const RParameterFamily &IPAddressInfoFamily = iContext.Node().iParameterBundle.FindFamily(KSubConIPAddressInfoFamily);
|
|
954 |
const CSubConIPAddressInfoParamSet* IPAddressInfoSet = IPAddressInfoFamily.IsNull() ? NULL : static_cast<const CSubConIPAddressInfoParamSet*>(
|
|
955 |
IPAddressInfoFamily.FindParameterSet(STypeId::CreateSTypeId(CSubConIPAddressInfoParamSet::EUid,CSubConIPAddressInfoParamSet::ETypeId),RParameterFamily::ERequested));
|
|
956 |
|
|
957 |
TBool TFTChanged = IPAddressInfoSet?ETrue:EFalse;
|
|
958 |
|
|
959 |
if(QoSChanged || TFTChanged)
|
|
960 |
{
|
|
961 |
User::LeaveIfError(iContext.Node().iPdpFsmInterface->Input(iContext.Node().iPDPFsmContextId, SpudMan::EContextModifyActive));
|
|
962 |
}
|
|
963 |
else
|
|
964 |
{
|
|
965 |
RClientInterface::OpenPostMessageClose(TNodeCtxId(iContext.ActivityId(), iContext.NodeId()), iContext.NodeId(),
|
|
966 |
TPDPMessages::TPDPFSMMessage(KContextModifyActiveEvent, KErrNone).CRef());
|
|
967 |
}
|
|
968 |
|
|
969 |
//Expect Response
|
|
970 |
iContext.iNodeActivity->ClearPostedTo();
|
|
971 |
iContext.Node().iActivityAwaitingResponse = iContext.iNodeActivity->ActivityId();
|
|
972 |
}
|
|
973 |
|
|
974 |
DEFINE_SMELEMENT(TAwaitingActivePDPContextModified, NetStateMachine::MState, PDPSCprStates::TContext)
|
|
975 |
TBool TAwaitingActivePDPContextModified::Accept()
|
|
976 |
{
|
|
977 |
return TAwaitingPDPFSMMessage::Accept(KContextModifyActiveEvent);
|
|
978 |
}
|
|
979 |
|
|
980 |
DEFINE_SMELEMENT(TAwaitingNegotiatedQoSRetrieved, NetStateMachine::MState, PDPSCprStates::TContext)
|
|
981 |
TBool TAwaitingNegotiatedQoSRetrieved::Accept()
|
|
982 |
{
|
|
983 |
|
|
984 |
return TAwaitingPDPFSMMessage::Accept(KGetNegQoSEvent);
|
|
985 |
}
|
|
986 |
|
|
987 |
DEFINE_SMELEMENT(TGetNegotiatedQoS, NetStateMachine::MStateTransition, PDPSCprStates::TContext)
|
|
988 |
void TGetNegotiatedQoS::DoL()
|
|
989 |
{
|
|
990 |
if (iContext.Node().iContextType == SpudMan::EMbms)
|
|
991 |
{
|
|
992 |
//just move to next step
|
|
993 |
RClientInterface::OpenPostMessageClose(
|
|
994 |
TNodeCtxId(iContext.ActivityId(), iContext.NodeId()),
|
|
995 |
iContext.NodeId(),
|
|
996 |
TPDPMessages::TPDPFSMMessage(KGetNegQoSEvent, KErrNone).CRef()
|
|
997 |
);
|
|
998 |
}
|
|
999 |
else
|
|
1000 |
{
|
|
1001 |
ASSERT(iContext.Node().iPdpFsmInterface);
|
|
1002 |
User::LeaveIfError(iContext.Node().iPdpFsmInterface->Input(iContext.Node().iPDPFsmContextId, SpudMan::EGetNegQoS));
|
|
1003 |
}
|
|
1004 |
//Expect Response
|
|
1005 |
iContext.iNodeActivity->ClearPostedTo();
|
|
1006 |
iContext.Node().iActivityAwaitingResponse = iContext.iNodeActivity->ActivityId();
|
|
1007 |
}
|
|
1008 |
|
|
1009 |
|
|
1010 |
DEFINE_SMELEMENT(TSendDataClientStarted, NetStateMachine::MStateTransition, PDPSCprStates::TContext)
|
|
1011 |
void TSendDataClientStarted::DoL()
|
|
1012 |
{
|
|
1013 |
PRStates::TSendDataClientStarted coreDCStarted(iContext);
|
|
1014 |
coreDCStarted.DoL();
|
|
1015 |
iContext.Node().LinkUp();
|
|
1016 |
}
|
|
1017 |
|
|
1018 |
DEFINE_SMELEMENT(TSendDataClientStopped, NetStateMachine::MStateTransition, PDPSCprStates::TContext)
|
|
1019 |
void TSendDataClientStopped::DoL()
|
|
1020 |
{
|
|
1021 |
PRStates::TSendDataClientStopped coreDCStopped(iContext);
|
|
1022 |
coreDCStopped.DoL();
|
|
1023 |
iContext.Node().LinkDown(coreDCStopped.iStopCode);
|
|
1024 |
}
|
|
1025 |
|
|
1026 |
|
|
1027 |
|
|
1028 |
//-=========================================================
|
|
1029 |
//Setting Params
|
|
1030 |
//-=========================================================
|
|
1031 |
DEFINE_SMELEMENT(TSetQoS, NetStateMachine::MStateTransition, PDPSCprStates::TContext)
|
|
1032 |
void TSetQoS::DoL()
|
|
1033 |
{
|
|
1034 |
ASSERT(iContext.Node().iPdpFsmInterface);
|
|
1035 |
ASSERT(!iContext.Node().GetParameterBundle().IsNull());
|
|
1036 |
|
|
1037 |
if (MPDPParamMapper::QoSRequested(iContext.Node().GetParameterBundle()))
|
|
1038 |
{
|
|
1039 |
RPacketQoS::TQoSR5Requested requestedParams;
|
|
1040 |
iContext.Node().iParamsRelease = MPDPParamMapper::MapQosParamBundleToEtelL(iContext.Node().GetParameterBundle(), requestedParams);
|
|
1041 |
iContext.Node().iPdpFsmInterface->Set(iContext.Node().iPDPFsmContextId, requestedParams);
|
|
1042 |
User::LeaveIfError(iContext.Node().iPdpFsmInterface->Input(iContext.Node().iPDPFsmContextId, SpudMan::EContextQoSSet));
|
|
1043 |
}
|
|
1044 |
else
|
|
1045 |
{
|
|
1046 |
//No QoS Requested. Complete this message locally to push yourself forward
|
|
1047 |
RClientInterface::OpenPostMessageClose(TNodeCtxId(iContext.ActivityId(), iContext.NodeId()), iContext.NodeId(),
|
|
1048 |
TPDPMessages::TPDPFSMMessage(KContextQoSSetEvent, KErrNone).CRef());
|
|
1049 |
}
|
|
1050 |
|
|
1051 |
//Expect Response
|
|
1052 |
iContext.iNodeActivity->ClearPostedTo();
|
|
1053 |
iContext.Node().iActivityAwaitingResponse = iContext.iNodeActivity->ActivityId();
|
|
1054 |
}
|
|
1055 |
|
|
1056 |
DEFINE_SMELEMENT(TAwaitingQoSSet, NetStateMachine::MState, PDPSCprStates::TContext)
|
|
1057 |
TBool TAwaitingQoSSet::Accept()
|
|
1058 |
{
|
|
1059 |
return TAwaitingPDPFSMMessage::Accept(KContextQoSSetEvent);
|
|
1060 |
}
|
|
1061 |
|
|
1062 |
DEFINE_SMELEMENT(TSetTFT, NetStateMachine::MStateTransition, PDPSCprStates::TContext)
|
|
1063 |
void TSetTFT::DoL()
|
|
1064 |
{
|
|
1065 |
ASSERT(iContext.Node().iPdpFsmInterface);
|
|
1066 |
ASSERT(!iContext.Node().GetParameterBundle().IsNull());
|
|
1067 |
|
|
1068 |
RParameterFamily ipAddressInfoFamily =
|
|
1069 |
iContext.Node().GetParameterBundle().FindFamily(KSubConIPAddressInfoFamily);
|
|
1070 |
CSubConIPAddressInfoParamSet* ipAddressInfoSet = NULL;
|
|
1071 |
if( ! ipAddressInfoFamily.IsNull())
|
|
1072 |
{
|
|
1073 |
ipAddressInfoSet = static_cast<CSubConIPAddressInfoParamSet*>(
|
|
1074 |
ipAddressInfoFamily.FindParameterSet(
|
|
1075 |
STypeId::CreateSTypeId(CSubConIPAddressInfoParamSet::EUid,CSubConIPAddressInfoParamSet::ETypeId),
|
|
1076 |
RParameterFamily::ERequested));
|
|
1077 |
}
|
|
1078 |
|
|
1079 |
if (ipAddressInfoSet)
|
|
1080 |
{
|
|
1081 |
iContext.Node().iPdpFsmInterface->Set(iContext.Node().iPDPFsmContextId, iContext.Node().GetTftInfoL(ipAddressInfoSet));
|
|
1082 |
iContext.Node().iPdpFsmInterface->Set(iContext.Node().iPDPFsmContextId, iContext.Node().GetOperationCodeL(ipAddressInfoSet));
|
|
1083 |
User::LeaveIfError(iContext.Node().iPdpFsmInterface->Input(iContext.Node().iPDPFsmContextId, SpudMan::EContextTFTModify));
|
|
1084 |
}
|
|
1085 |
else
|
|
1086 |
{
|
|
1087 |
//No QoS Requested. Complete this message locally to push yourself forward
|
|
1088 |
RClientInterface::OpenPostMessageClose(TNodeCtxId(iContext.ActivityId(), iContext.NodeId()), iContext.NodeId(),
|
|
1089 |
TPDPMessages::TPDPFSMMessage(KContextTFTModifiedEvent, KErrNone).CRef());
|
|
1090 |
}
|
|
1091 |
|
|
1092 |
//Expect Response
|
|
1093 |
iContext.iNodeActivity->ClearPostedTo();
|
|
1094 |
iContext.Node().iActivityAwaitingResponse = iContext.iNodeActivity->ActivityId();
|
|
1095 |
}
|
|
1096 |
|
|
1097 |
DEFINE_SMELEMENT(TAwaitingTFTSet, NetStateMachine::MState, PDPSCprStates::TDefContext)
|
|
1098 |
TBool TAwaitingTFTSet::Accept()
|
|
1099 |
{
|
|
1100 |
return TAwaitingPDPFSMMessage::Accept(KContextTFTModifiedEvent);
|
|
1101 |
}
|
|
1102 |
|
|
1103 |
|
|
1104 |
|
|
1105 |
//-=========================================================
|
|
1106 |
//Setting MBMS Params (session ids)
|
|
1107 |
//-=========================================================
|
|
1108 |
DEFINE_SMELEMENT(TSetMbmsParameters, NetStateMachine::MStateTransition, PDPSCprStates::TContext)
|
|
1109 |
void TSetMbmsParameters::DoL()
|
|
1110 |
{
|
|
1111 |
ASSERT(iContext.Node().iPdpFsmInterface);
|
|
1112 |
if (iContext.Node().iContextType == SpudMan::EMbms)
|
|
1113 |
{
|
|
1114 |
/* extract session ids from MBMS Extension Set*/
|
|
1115 |
RParameterFamily mbmsInfoFamily = iContext.Node().iParameterBundle.FindFamily(KSubConChannelParamsType);
|
|
1116 |
CSubConMBMSExtensionParamSet *mbmsExtensionSet = mbmsInfoFamily.IsNull() ? NULL :
|
|
1117 |
static_cast<CSubConMBMSExtensionParamSet *>(mbmsInfoFamily.FindParameterSet(
|
|
1118 |
STypeId::CreateSTypeId(KSubConMBMSExtParamsImplUid,KSubConMBMSSessionExtParamsType), RParameterFamily::ERequested));
|
|
1119 |
if (mbmsExtensionSet)
|
|
1120 |
{
|
|
1121 |
TSessionOperatioInfo sessionInfo;
|
|
1122 |
sessionInfo.iSessionIds.Reset();
|
|
1123 |
for(int i=0 ;i < mbmsExtensionSet->GetSessionCount(); i++)
|
|
1124 |
{
|
|
1125 |
sessionInfo.iSessionIds.Append(mbmsExtensionSet->GetSessionId(i));
|
|
1126 |
}
|
|
1127 |
sessionInfo.iOperation=mbmsExtensionSet->GetOperationType();
|
|
1128 |
User::LeaveIfError(iContext.Node().iPdpFsmInterface->Set(iContext.Node().iPDPFsmContextId, sessionInfo));
|
|
1129 |
User::LeaveIfError(iContext.Node().iPdpFsmInterface->Input(iContext.Node().iPDPFsmContextId, SpudMan::EMbmsSessionUpdate));
|
|
1130 |
sessionInfo.iSessionIds.Close();
|
|
1131 |
}
|
|
1132 |
}
|
|
1133 |
}
|
|
1134 |
|
|
1135 |
//-=========================================================
|
|
1136 |
//Events
|
|
1137 |
//-=========================================================
|
|
1138 |
DEFINE_SMELEMENT(TBlockedOrUnblocked, NetStateMachine::MStateFork, PDPSCprStates::TContext)
|
|
1139 |
TInt TBlockedOrUnblocked::TransitionTag()
|
|
1140 |
{
|
|
1141 |
TPDPMessages::TPDPFSMMessage& pdpmsg = message_cast<TPDPMessages::TPDPFSMMessage>(iContext.iMessage);
|
|
1142 |
if (pdpmsg.iValue1 == KContextBlockedEvent)
|
|
1143 |
return KBlocked;
|
|
1144 |
else
|
|
1145 |
return KUnblocked;
|
|
1146 |
}
|
|
1147 |
|
|
1148 |
|
|
1149 |
|
|
1150 |
DEFINE_SMELEMENT(TAwaitingParamsChanged, NetStateMachine::MState, PDPSCprStates::TContext)
|
|
1151 |
TBool TAwaitingParamsChanged::Accept()
|
|
1152 |
{
|
|
1153 |
return TAwaitingPDPFSMMessage::Accept(KContextParametersChangeEvent);
|
|
1154 |
}
|
|
1155 |
|
|
1156 |
DEFINE_SMELEMENT(TAwaitingContextBlockedOrUnblocked, NetStateMachine::MState, PDPSCprStates::TContext)
|
|
1157 |
TBool TAwaitingContextBlockedOrUnblocked::Accept()
|
|
1158 |
{
|
|
1159 |
return TAwaitingPDPFSMMessage::Accept(KContextBlockedEvent) || TAwaitingPDPFSMMessage::Accept(KContextUnblockedEvent);
|
|
1160 |
}
|
|
1161 |
|
|
1162 |
DEFINE_SMELEMENT(TForwardContextBlockedOrUnblockedToDC, NetStateMachine::MStateTransition, PDPSCprStates::TContext)
|
|
1163 |
void TForwardContextBlockedOrUnblockedToDC::DoL()
|
|
1164 |
{
|
|
1165 |
TPDPMessages::TPDPFSMMessage& pdpmsg = message_cast<TPDPMessages::TPDPFSMMessage>(iContext.iMessage);
|
|
1166 |
|
|
1167 |
RNodeInterface* theOnlyDataClient = iContext.iNode.GetFirstClient<TDefaultClientMatchPolicy>(TCFClientType::EData);
|
|
1168 |
ASSERT(iContext.iNode.GetClientIter<TDefaultClientMatchPolicy>(TCFClientType::EData)[1] == NULL);
|
|
1169 |
ASSERT(theOnlyDataClient);
|
|
1170 |
|
|
1171 |
switch (pdpmsg.iValue1)
|
|
1172 |
{
|
|
1173 |
case KContextBlockedEvent:
|
|
1174 |
theOnlyDataClient->PostMessage(iContext.NodeId(), ESock::TCFFlow::TBlock().CRef());
|
|
1175 |
break;
|
|
1176 |
|
|
1177 |
case KContextUnblockedEvent:
|
|
1178 |
theOnlyDataClient->PostMessage(iContext.NodeId(), ESock::TCFFlow::TUnBlock().CRef());
|
|
1179 |
break;
|
|
1180 |
|
|
1181 |
default:
|
|
1182 |
ASSERT(EFalse);
|
|
1183 |
}
|
|
1184 |
}
|
|
1185 |
|
|
1186 |
DEFINE_SMELEMENT(TSendDataTransferTemporarilyBlocked, NetStateMachine::MStateTransition, PDPSCprStates::TContext)
|
|
1187 |
void TSendDataTransferTemporarilyBlocked::DoL()
|
|
1188 |
{
|
|
1189 |
if (iContext.Node().iPDPFsmContextId == KPrimaryContextId)
|
|
1190 |
{
|
|
1191 |
iContext.Node().PostToClients<TDefaultClientMatchPolicy>(
|
|
1192 |
iContext.NodeId(),
|
|
1193 |
TCFMessage::TStateChange(
|
|
1194 |
Elements::TStateChange(KDataTransferTemporarilyBlocked, KErrNone)).CRef(),
|
|
1195 |
TClientType(TCFClientType::ECtrlProvider));
|
|
1196 |
}
|
|
1197 |
}
|
|
1198 |
|
|
1199 |
DEFINE_SMELEMENT(TSendDataTransferUnblocked, NetStateMachine::MStateTransition, PDPSCprStates::TContext)
|
|
1200 |
void TSendDataTransferUnblocked::DoL()
|
|
1201 |
{
|
|
1202 |
if (iContext.Node().iPDPFsmContextId == KPrimaryContextId)
|
|
1203 |
{
|
|
1204 |
iContext.Node().PostToClients<TDefaultClientMatchPolicy>(
|
|
1205 |
iContext.NodeId(),
|
|
1206 |
TCFMessage::TStateChange(
|
|
1207 |
Elements::TStateChange(KDataTransferUnblocked, KErrNone)).CRef(),
|
|
1208 |
TClientType(TCFClientType::ECtrlProvider));
|
|
1209 |
}
|
|
1210 |
}
|
|
1211 |
|
|
1212 |
DEFINE_SMELEMENT(TFillInGrantedParams, NetStateMachine::MStateTransition, PDPSCprStates::TContext)
|
|
1213 |
void TFillInGrantedParams::DoL()
|
|
1214 |
{
|
|
1215 |
ASSERT(!iContext.Node().GetParameterBundle().IsNull());
|
|
1216 |
RCFParameterFamilyBundleC& bundle = iContext.Node().GetParameterBundle();
|
|
1217 |
TBool notifySetFlag=EFalse;
|
|
1218 |
|
|
1219 |
CSubConGenEventParamsGranted* event;
|
|
1220 |
RParameterFamily parFamily;
|
|
1221 |
|
|
1222 |
//-=============================================
|
|
1223 |
//Qos Params
|
|
1224 |
//-=============================================
|
|
1225 |
//Fish out the qos family
|
|
1226 |
if (MPDPParamMapper::QoSRequested(bundle))
|
|
1227 |
{
|
|
1228 |
//Quite awkward CSubConnectionParameterBundle API doesn't allow browsing
|
|
1229 |
//the extensions. CSubConGenEventParamsGranted does. Hence the
|
|
1230 |
//MPDPParamMapper fills in events (and not bundles), as bundles
|
|
1231 |
//can be populated from the events and not vice versa.
|
|
1232 |
//It's unfortunate, as we're not even raising an event here.
|
|
1233 |
//CSubConGenEventParamsGranted & CSubConnectionParameterBundle
|
|
1234 |
//would benefit greatly from having a common ancestor.
|
|
1235 |
parFamily = bundle.FindFamily(KSubConQoSFamily);
|
|
1236 |
if( parFamily.IsNull() )
|
|
1237 |
{
|
|
1238 |
// really should have been found!
|
|
1239 |
User::Leave(KErrUnknown);
|
|
1240 |
}
|
|
1241 |
event = CSubConGenEventParamsGranted::NewL();
|
|
1242 |
CleanupStack::PushL(event);
|
|
1243 |
event->SetFamily (KSubConQoSFamily);
|
|
1244 |
FillInEventL(*event); //fill in the params.
|
|
1245 |
notifySetFlag = ETrue;
|
|
1246 |
}
|
|
1247 |
else if (!(parFamily = iContext.Node().iParameterBundle.FindFamily(KSubConAuthorisationFamily)).IsNull()) // check out sblp session ids granted
|
|
1248 |
{ // check out sblp familytype (KSubConAuthorisationFamily==5)
|
|
1249 |
event = CSubConGenEventParamsGranted::NewL();
|
|
1250 |
CleanupStack::PushL(event);
|
|
1251 |
event->SetFamily (KSubConAuthorisationFamily);
|
|
1252 |
FillInEventL(*event); //fill in the params.
|
|
1253 |
notifySetFlag = ETrue;
|
|
1254 |
}
|
|
1255 |
else //check out mbms session ids granted
|
|
1256 |
{
|
|
1257 |
parFamily = iContext.Node().iParameterBundle.FindFamily(KSubConChannelParamsType);
|
|
1258 |
STypeId typeId = STypeId::CreateSTypeId(KSubConChannelParamsImplUid, KSubConChannelParamsType);
|
|
1259 |
if (!parFamily.IsNull() && parFamily.FindParameterSet(typeId, RParameterFamily::ERequested))
|
|
1260 |
{
|
|
1261 |
event = CSubConGenEventParamsGranted::NewL();
|
|
1262 |
CleanupStack::PushL(event);
|
|
1263 |
event->SetFamily (KSubConChannelParamsType);
|
|
1264 |
FillInMbmsSessionIdsL(*event); //Fill Session Ids
|
|
1265 |
notifySetFlag = ETrue;
|
|
1266 |
}
|
|
1267 |
}
|
|
1268 |
|
|
1269 |
if (notifySetFlag)
|
|
1270 |
{
|
|
1271 |
parFamily.ClearAllParameters(RParameterFamily::ERequested);
|
|
1272 |
parFamily.ClearAllParameters(RParameterFamily::EAcceptable);
|
|
1273 |
parFamily.ClearAllParameters(RParameterFamily::EGranted);
|
|
1274 |
|
|
1275 |
//Populate EGranted params from the event.
|
|
1276 |
FillInGrantedL(parFamily, *event);
|
|
1277 |
|
|
1278 |
iContext.Node().NotifyClientsL(*event);
|
|
1279 |
CleanupStack::Pop(event);
|
|
1280 |
}
|
|
1281 |
|
|
1282 |
|
|
1283 |
//-=============================================
|
|
1284 |
//TFT Params
|
|
1285 |
//-=============================================
|
|
1286 |
// Should use KSubConIPAddressInfoFamily in FindFamily as argument instead of EUid
|
|
1287 |
// DEF123513 FindFamily uses EUid as argument raised to fix regressions.
|
|
1288 |
RParameterFamily ipAddressInfoFamily=bundle.FindFamily(CSubConIPAddressInfoParamSet::EUid);
|
|
1289 |
if ( ! ipAddressInfoFamily.IsNull())
|
|
1290 |
{
|
|
1291 |
CSubConIPAddressInfoParamSet* requestedIPAddressInfo = CSubConIPAddressInfoParamSet::NewL(ipAddressInfoFamily, RParameterFamily::ERequested);
|
|
1292 |
TInt count = requestedIPAddressInfo->GetParamNum();
|
|
1293 |
if (count > 0)
|
|
1294 |
{
|
|
1295 |
CSubConIPAddressInfoParamSet::TSubConIPAddressInfo paramInfo(requestedIPAddressInfo->GetParamInfoL(0));
|
|
1296 |
TUint id = iContext.Node().FindPacketFilterIdL(paramInfo);
|
|
1297 |
|
|
1298 |
switch(paramInfo.iState)
|
|
1299 |
{
|
|
1300 |
case CSubConIPAddressInfoParamSet::TSubConIPAddressInfo::EAdd :
|
|
1301 |
iContext.Node().NewPacketFilterAddedL(paramInfo, id);
|
|
1302 |
break;
|
|
1303 |
case CSubConIPAddressInfoParamSet::TSubConIPAddressInfo::ERemove :
|
|
1304 |
iContext.Node().PacketFilterRemovedL(id);
|
|
1305 |
break;
|
|
1306 |
case CSubConIPAddressInfoParamSet::TSubConIPAddressInfo::ENone :
|
|
1307 |
break;
|
|
1308 |
default: ;
|
|
1309 |
/** TODO: What to do with an error */
|
|
1310 |
}
|
|
1311 |
}
|
|
1312 |
|
|
1313 |
ipAddressInfoFamily.ClearAllParameters(RParameterFamily::ERequested);
|
|
1314 |
|
|
1315 |
}
|
|
1316 |
//something must have had been granted.
|
|
1317 |
/* [401TODO]: We have a case where applyrequest after rejoin on transfloshim will cause this bit to execute
|
|
1318 |
Since we don't have neither qos nor addrInfo parameters set it will kick this assert*/
|
|
1319 |
}
|
|
1320 |
|
|
1321 |
void TParamsEvent::FillInEventL(CSubConGenEventParamsGranted& aEvent)
|
|
1322 |
{
|
|
1323 |
RPacketQoS::TQoSR5Negotiated negotiatedQoS;
|
|
1324 |
iContext.Node().iPdpFsmInterface->Get(iContext.Node().iPDPFsmContextId, negotiatedQoS);
|
|
1325 |
MPDPParamMapper::MapQosEtelToGrantedParamsL(&negotiatedQoS, aEvent, iContext.Node().iParamsRelease);
|
|
1326 |
}
|
|
1327 |
|
|
1328 |
|
|
1329 |
void TParamsEvent::FillInMbmsSessionIdsL(CSubConGenEventParamsGranted& aEvent)
|
|
1330 |
{
|
|
1331 |
|
|
1332 |
CSubConChannelParamSet* genericMbms = CSubConChannelParamSet::NewL ();
|
|
1333 |
aEvent.SetGenericSet(genericMbms);
|
|
1334 |
|
|
1335 |
//Fill List of Session Ids received in Extension Set
|
|
1336 |
TSessionOperatioInfo sessionInfo;
|
|
1337 |
User::LeaveIfError(iContext.Node().iPdpFsmInterface->Get(iContext.Node().iPDPFsmContextId, sessionInfo));
|
|
1338 |
CSubConMBMSExtensionParamSet *mbmsSessionExtn= CSubConMBMSExtensionParamSet::NewL();
|
|
1339 |
CleanupStack::PushL(mbmsSessionExtn);
|
|
1340 |
for (TInt i=0;i<sessionInfo.iSessionIds.Count();i++)
|
|
1341 |
{
|
|
1342 |
mbmsSessionExtn->SetSessionId(sessionInfo.iSessionIds[i]);
|
|
1343 |
}
|
|
1344 |
aEvent.AddExtensionSetL(mbmsSessionExtn);
|
|
1345 |
sessionInfo.iSessionIds.Close();
|
|
1346 |
CleanupStack::Pop(mbmsSessionExtn);
|
|
1347 |
}
|
|
1348 |
|
|
1349 |
void TParamsEvent::FillInGrantedL(RParameterFamily& aFamily, const CSubConGenEventParamsGranted& aEvent)
|
|
1350 |
{
|
|
1351 |
//Unfortunatelly no easy way to copy a content of an event into
|
|
1352 |
//a bundle family. Using ECOM Load/Store to do that.
|
|
1353 |
//Unfortunatelly CSubConGenEventParamsGranted::GetNumExtensionSets is a non-const
|
|
1354 |
//method.
|
|
1355 |
CSubConGenEventParamsGranted& noncEvent = const_cast<CSubConGenEventParamsGranted&>(aEvent);
|
|
1356 |
|
|
1357 |
//clear granted params in the bundle
|
|
1358 |
aFamily.ClearAllParameters(RParameterFamily::EGranted);
|
|
1359 |
ASSERT(aEvent.GetGenericSet());
|
|
1360 |
const CSubConParameterSet* genSetSource = aEvent.GetGenericSet();
|
|
1361 |
|
|
1362 |
TInt i = 0;
|
|
1363 |
|
|
1364 |
//dry run - find out the max length for the buffer.
|
|
1365 |
TInt bufLen = genSetSource->Length();
|
|
1366 |
for (i = 0; i < noncEvent.GetNumExtensionSets(); i++)
|
|
1367 |
{
|
|
1368 |
TInt extLen = aEvent.GetExtensionSet(i)->Length();
|
|
1369 |
bufLen = extLen > bufLen ? extLen : bufLen;
|
|
1370 |
}
|
|
1371 |
|
|
1372 |
|
|
1373 |
RBuf8 buffer;
|
|
1374 |
buffer.CreateL(bufLen);
|
|
1375 |
buffer.CleanupClosePushL();
|
|
1376 |
|
|
1377 |
genSetSource->Store(buffer);
|
|
1378 |
TPtrC8 whyDoWeNeedPointerToRbufHere(buffer);
|
|
1379 |
CSubConGenericParameterSet* genSetTarget = static_cast<CSubConGenericParameterSet*>(
|
|
1380 |
CSubConGenericParameterSet::LoadL(whyDoWeNeedPointerToRbufHere));
|
|
1381 |
CleanupStack::PushL(genSetTarget);
|
|
1382 |
aFamily.AddParameterSetL(genSetTarget, RParameterFamily::EGranted);
|
|
1383 |
CleanupStack::Pop(genSetTarget);
|
|
1384 |
|
|
1385 |
//loop thru the extensions
|
|
1386 |
for (i = 0; i < noncEvent.GetNumExtensionSets(); i++)
|
|
1387 |
{
|
|
1388 |
const CSubConExtensionParameterSet* extSetSource = aEvent.GetExtensionSet(i);
|
|
1389 |
buffer.Zero();
|
|
1390 |
extSetSource->Store(buffer);
|
|
1391 |
whyDoWeNeedPointerToRbufHere.Set(buffer);
|
|
1392 |
CSubConExtensionParameterSet* extSetTarget = static_cast<CSubConExtensionParameterSet*>(CSubConParameterSet::LoadL(whyDoWeNeedPointerToRbufHere));
|
|
1393 |
CleanupStack::PushL(extSetTarget);
|
|
1394 |
aFamily.AddParameterSetL(extSetTarget, RParameterFamily::EGranted);
|
|
1395 |
CleanupStack::Pop(extSetTarget);
|
|
1396 |
}
|
|
1397 |
CleanupStack::PopAndDestroy(&buffer);
|
|
1398 |
}
|
|
1399 |
|
|
1400 |
|
|
1401 |
DEFINE_SMELEMENT(TRaiseParamsRejectedL, NetStateMachine::MStateTransition, PDPSCprStates::TContext)
|
|
1402 |
void TRaiseParamsRejectedL::DoL()
|
|
1403 |
{
|
|
1404 |
ASSERT(iContext.iNodeActivity && iContext.iNodeActivity->Error() != KErrNone);
|
|
1405 |
CSubConGenEventParamsRejected* event= CSubConGenEventParamsRejected::NewL();
|
|
1406 |
CleanupStack::PushL(event);
|
|
1407 |
|
|
1408 |
if (iContext.Node().iContextType == SpudMan::EMbms)
|
|
1409 |
{
|
|
1410 |
TPDPMessages::TPDPFSMMessage& message = message_cast<TPDPMessages::TPDPFSMMessage>(iContext.iMessage);
|
|
1411 |
TInt prevOperationValue = message.iValue2;
|
|
1412 |
if ((prevOperationValue == KErrNotFound) || (prevOperationValue == KErrNotSupported ) ||
|
|
1413 |
(prevOperationValue == KErrMbmsImpreciseServiceEntries ) ||(prevOperationValue == KErrMbmsServicePreempted) )
|
|
1414 |
{
|
|
1415 |
event->SetFamilyId (KSubConChannelParamsType);
|
|
1416 |
}
|
|
1417 |
}
|
|
1418 |
else
|
|
1419 |
{
|
|
1420 |
event->SetFamilyId (KSubConQoSFamily);
|
|
1421 |
}
|
|
1422 |
event->SetError(iContext.iNodeActivity->Error());
|
|
1423 |
iContext.Node().NotifyClientsL(*event);
|
|
1424 |
CleanupStack::Pop(event);
|
|
1425 |
|
|
1426 |
TInt err = iContext.iNodeActivity->Error();
|
|
1427 |
iContext.iNodeActivity->SetError(KErrNone);
|
|
1428 |
User::Leave(err);
|
|
1429 |
}
|
|
1430 |
|
|
1431 |
DEFINE_SMELEMENT(TRaiseParamsChanged, NetStateMachine::MStateTransition, PDPSCprStates::TContext)
|
|
1432 |
void TRaiseParamsChanged::DoL()
|
|
1433 |
{
|
|
1434 |
TPDPMessages::TPDPFSMMessage& message = message_cast<TPDPMessages::TPDPFSMMessage>(iContext.iMessage);
|
|
1435 |
TInt err=KErrNone;
|
|
1436 |
ASSERT(message.iValue2 == KErrNone);
|
|
1437 |
CSubConGenEventParamsChanged* event = NULL;
|
|
1438 |
TRAP_IGNORE(event = CSubConGenEventParamsChanged::NewL());
|
|
1439 |
if (event)
|
|
1440 |
{
|
|
1441 |
RParameterFamily parFamily = iContext.Node().iParameterBundle.FindFamily(KSubConChannelParamsType);
|
|
1442 |
if (!parFamily.IsNull()) //check the changed mbms session ids
|
|
1443 |
{
|
|
1444 |
STypeId typeId = STypeId::CreateSTypeId(KSubConChannelParamsImplUid, KSubConChannelParamsType);
|
|
1445 |
CSubConChannelParamSet* mbmsSubConParamSet = parFamily.IsNull() ? NULL :
|
|
1446 |
static_cast<CSubConChannelParamSet *>(parFamily.FindParameterSet(typeId, RParameterFamily::ERequested));
|
|
1447 |
if (mbmsSubConParamSet)
|
|
1448 |
{
|
|
1449 |
event->SetFamily (KSubConChannelParamsType);
|
|
1450 |
event->SetError(message.iValue2);
|
|
1451 |
TRAP(err,FillInMbmsSessionIdsL(*event)); //Fill Session Ids
|
|
1452 |
}
|
|
1453 |
}
|
|
1454 |
else
|
|
1455 |
{
|
|
1456 |
parFamily = iContext.Node().iParameterBundle.FindFamily(KSubConQoSFamily);
|
|
1457 |
event->SetFamily (KSubConQoSFamily);
|
|
1458 |
event->SetError(message.iValue2);
|
|
1459 |
TRAP(err, FillInEventL(*event));
|
|
1460 |
}
|
|
1461 |
if (err == KErrNone)
|
|
1462 |
{
|
|
1463 |
FillInGrantedL(parFamily, *event);
|
|
1464 |
iContext.Node().NotifyClientsL(*event);
|
|
1465 |
}
|
|
1466 |
}
|
|
1467 |
else
|
|
1468 |
{
|
|
1469 |
delete event;
|
|
1470 |
}
|
|
1471 |
}
|
|
1472 |
|
|
1473 |
|
|
1474 |
DEFINE_SMELEMENT(TAwaitingNetworkStatusEvent, NetStateMachine::MState, PDPSCprStates::TContext)
|
|
1475 |
TBool TAwaitingNetworkStatusEvent::Accept()
|
|
1476 |
{
|
|
1477 |
return TAwaitingPDPFSMMessage::Accept(KNetworkStatusEvent);
|
|
1478 |
}
|
|
1479 |
|
|
1480 |
DEFINE_SMELEMENT(TNetworkStatusEventTypeTag, NetStateMachine::MStateFork, PDPSCprStates::TContext)
|
|
1481 |
TInt TNetworkStatusEventTypeTag::TransitionTag()
|
|
1482 |
{
|
|
1483 |
RPacketService::TStatus status;
|
|
1484 |
iContext.Node().iPdpFsmInterface->Get(status);
|
|
1485 |
switch (status)
|
|
1486 |
{
|
|
1487 |
case RPacketService::EStatusUnattached:
|
|
1488 |
// If status change is to unattached, but stop has been requested,
|
|
1489 |
// or we haven't been started, do nothing
|
|
1490 |
if (iContext.Node().CountActivities(ECFActivityStopDataClient) > 0
|
|
1491 |
|| iContext.Node().CountClients<TDefaultClientMatchPolicy>(TClientType(TCFClientType::EData, TCFClientType::EStarted)) == 0)
|
|
1492 |
{
|
|
1493 |
return KNoTag;
|
|
1494 |
}
|
|
1495 |
return status;
|
|
1496 |
case RPacketService::EStatusAttached:
|
|
1497 |
case RPacketService::EStatusActive:
|
|
1498 |
case RPacketService::EStatusSuspended:
|
|
1499 |
return status;
|
|
1500 |
}
|
|
1501 |
return KNoTag;
|
|
1502 |
}
|
|
1503 |
|
|
1504 |
DEFINE_SMELEMENT(TSendGoneDown, NetStateMachine::MStateTransition, PDPSCprStates::TContext)
|
|
1505 |
void TSendGoneDown::DoL()
|
|
1506 |
{
|
|
1507 |
ASSERT(iContext.iNodeActivity);
|
|
1508 |
|
|
1509 |
const TProviderInfo& providerInfo = static_cast<const TProviderInfoExt&>(iContext.Node().AccessPointConfig().FindExtensionL(
|
|
1510 |
STypeId::CreateSTypeId(TProviderInfoExt::EUid, TProviderInfoExt::ETypeId))).iProviderInfo;
|
|
1511 |
iContext.Node().PostToClients<TDefaultClientMatchPolicy>(
|
|
1512 |
iContext.NodeId(),
|
|
1513 |
TCFControlClient::TGoneDown(KErrDisconnected,providerInfo.APId()).CRef(),
|
|
1514 |
TClientType(TCFClientType::ECtrl));
|
|
1515 |
|
|
1516 |
iContext.Node().ControlProvider()->PostMessage(
|
|
1517 |
iContext.NodeId(),
|
|
1518 |
TCFControlProvider::TDataClientGoneDown(KErrDisconnected,providerInfo.APId()).CRef());
|
|
1519 |
|
|
1520 |
}
|
|
1521 |
|
|
1522 |
|
|
1523 |
//-=========================================================
|
|
1524 |
//Destroying context
|
|
1525 |
//-=========================================================
|
|
1526 |
DEFINE_SMELEMENT(TDestroyPDPContext, NetStateMachine::MStateTransition, PDPSCprStates::TContext)
|
|
1527 |
void TDestroyPDPContext::DoL()
|
|
1528 |
{
|
|
1529 |
ASSERT(iContext.Node().iPdpFsmInterface);
|
|
1530 |
if (iContext.Node().iPDPFsmContextId == KPrimaryContextId)
|
|
1531 |
{
|
|
1532 |
iContext.Node().PostToClients<TDefaultClientMatchPolicy>(
|
|
1533 |
iContext.NodeId(),
|
|
1534 |
TCFMessage::TStateChange(
|
|
1535 |
Elements::TStateChange(KPsdStartingDeactivation, KErrNone)).CRef(),
|
|
1536 |
TClientType(TCFClientType::ECtrlProvider));
|
|
1537 |
}
|
|
1538 |
|
|
1539 |
iContext.Node().iPdpFsmInterface->Input(iContext.Node().iPDPFsmContextId, SpudMan::EContextDelete);
|
|
1540 |
|
|
1541 |
//Expect Response
|
|
1542 |
iContext.iNodeActivity->ClearPostedTo();
|
|
1543 |
iContext.Node().iActivityAwaitingResponse = iContext.iNodeActivity->ActivityId();
|
|
1544 |
}
|
|
1545 |
|
|
1546 |
DEFINE_SMELEMENT(TCleanupFSM, NetStateMachine::MStateTransition, PDPSCprStates::TContext)
|
|
1547 |
void TCleanupFSM::DoL()
|
|
1548 |
{
|
|
1549 |
CPDPSubConnectionProvider &tNode = static_cast<CPDPSubConnectionProvider &>(iContext.Node());
|
|
1550 |
|
|
1551 |
if (tNode.iPDPFsmContextId != CPDPSubConnectionProvider::EInvalidContextId)
|
|
1552 |
{
|
|
1553 |
|
|
1554 |
// removing the memory associated with the context - this should hopefully
|
|
1555 |
// ensure that the memory allocations that happen afterwards can be
|
|
1556 |
// accomplished without OOM errors
|
|
1557 |
|
|
1558 |
tNode.iPdpFsmInterface->DeleteFsmContext(tNode.iPDPFsmContextId);
|
|
1559 |
|
|
1560 |
if (tNode.ContentionRequested() == EFalse)
|
|
1561 |
{
|
|
1562 |
CSubConGenEventSubConDown* event = CSubConGenEventSubConDown::NewL();
|
|
1563 |
CleanupStack::PushL(event);
|
|
1564 |
tNode.NotifyClientsL(*event);
|
|
1565 |
CleanupStack::Pop(event);
|
|
1566 |
}
|
|
1567 |
|
|
1568 |
if (tNode.iPDPFsmContextId == KPrimaryContextId)
|
|
1569 |
{
|
|
1570 |
tNode.PostToClients<TDefaultClientMatchPolicy>(
|
|
1571 |
iContext.NodeId(),
|
|
1572 |
TCFMessage::TStateChange(
|
|
1573 |
Elements::TStateChange(KPsdFinishedDeactivation, KErrNone)).CRef(),
|
|
1574 |
TClientType(TCFClientType::ECtrlProvider));
|
|
1575 |
}
|
|
1576 |
|
|
1577 |
tNode.iPDPFsmContextId = CPDPSubConnectionProvider::EInvalidContextId;
|
|
1578 |
|
|
1579 |
}
|
|
1580 |
}
|
|
1581 |
|
|
1582 |
|
|
1583 |
DEFINE_SMELEMENT(TAwaitingPDPContextDestroyed, NetStateMachine::MState, PDPSCprStates::TContext)
|
|
1584 |
TBool TAwaitingPDPContextDestroyed::Accept()
|
|
1585 |
{
|
|
1586 |
if (TAwaitingPDPFSMMessage::Accept(KContextDeleteEvent))
|
|
1587 |
{
|
|
1588 |
return ETrue;
|
|
1589 |
}
|
|
1590 |
return EFalse;
|
|
1591 |
}
|
|
1592 |
|
|
1593 |
DEFINE_SMELEMENT(TAwaitingPDPContextGoneDown, NetStateMachine::MState, PDPSCprStates::TContext)
|
|
1594 |
TBool TAwaitingPDPContextGoneDown::Accept()
|
|
1595 |
{
|
|
1596 |
if (TAwaitingPDPContextDestroyed::Accept())
|
|
1597 |
{
|
|
1598 |
if (!iContext.Node().ContentionRequested())
|
|
1599 |
{
|
|
1600 |
//Following SPUD, we're ignoring the error raised by the FSM and override it with KErrDisconnected
|
|
1601 |
iContext.Node().LinkDown(KErrDisconnected);
|
|
1602 |
}
|
|
1603 |
return ETrue;
|
|
1604 |
}
|
|
1605 |
return EFalse;
|
|
1606 |
}
|
|
1607 |
|
|
1608 |
|
|
1609 |
DEFINE_SMELEMENT(TNoTagOrProviderStopped, NetStateMachine::MStateFork, PDPSCprStates::TContext)
|
|
1610 |
TInt TNoTagOrProviderStopped::TransitionTag()
|
|
1611 |
{
|
|
1612 |
if (iContext.Node().iPDPFsmContextId != CPDPSubConnectionProvider::EInvalidContextId &&
|
|
1613 |
iContext.Node().iPdpFsmInterface->FsmContextExists(iContext.Node().iPDPFsmContextId))
|
|
1614 |
{
|
|
1615 |
//context is alive
|
|
1616 |
return KNoTag;
|
|
1617 |
}
|
|
1618 |
return CoreNetStates::KProviderStopped;
|
|
1619 |
}
|
|
1620 |
|
|
1621 |
|
|
1622 |
|
|
1623 |
//===========================================================
|
|
1624 |
// Sip Address retrieval
|
|
1625 |
//===========================================================
|
|
1626 |
DEFINE_SMELEMENT(TAwaitingIoctlMessage, NetStateMachine::MState, PDPSCprStates::TContext)
|
|
1627 |
TBool TAwaitingIoctlMessage::Accept()
|
|
1628 |
{
|
|
1629 |
if (iContext.iMessage.IsTypeOf(Meta::STypeId::CreateSTypeId(TCFSigLegacyRMessage2Ext::EUid, TCFSigLegacyRMessage2Ext::ETypeId)))
|
|
1630 |
{
|
|
1631 |
TCFSigLegacyRMessage2Ext& msg = static_cast<TCFSigLegacyRMessage2Ext&>(iContext.iMessage);
|
|
1632 |
if (msg.iMessage.Function() == ECNIoctl)
|
|
1633 |
{
|
|
1634 |
return ETrue;
|
|
1635 |
}
|
|
1636 |
}
|
|
1637 |
return EFalse;
|
|
1638 |
}
|
|
1639 |
|
|
1640 |
DEFINE_SMELEMENT(TRetrieveSipAddr, NetStateMachine::MStateTransition, PDPSCprStates::TDefContext)
|
|
1641 |
void TRetrieveSipAddr::DoL()
|
|
1642 |
{
|
|
1643 |
MeshMachine::CNodeParallelMessageStoreActivityBase* act = static_cast<MeshMachine::CNodeParallelMessageStoreActivityBase*>(iContext.Activity());
|
|
1644 |
|
|
1645 |
ASSERT(act->Message().IsTypeOf(Meta::STypeId::CreateSTypeId(TCFSigLegacyRMessage2Ext::EUid, TCFSigLegacyRMessage2Ext::ETypeId)));
|
|
1646 |
RLegacyResponseMsg ioctl(iContext, static_cast<TCFSigLegacyRMessage2Ext&>(act->Message()).iMessage, static_cast<TCFSigLegacyRMessage2Ext&>(act->Message()).iMessage.Int0());
|
|
1647 |
|
|
1648 |
TInt err = KErrNotFound;
|
|
1649 |
|
|
1650 |
if (iContext.Node().iIsModeGsm)
|
|
1651 |
{
|
|
1652 |
err = KErrNotSupported;
|
|
1653 |
}
|
|
1654 |
else
|
|
1655 |
{
|
|
1656 |
CGPRSProvision* gprsProvision = const_cast<CGPRSProvision*>(
|
|
1657 |
static_cast<const CGPRSProvision*>(iContext.Node().AccessPointConfig().FindExtension(
|
|
1658 |
STypeId::CreateSTypeId(CGPRSProvision::EUid,CGPRSProvision::ETypeId))));
|
|
1659 |
|
|
1660 |
RPacketContext::TProtocolConfigOptionV2* protConfigOpt = NULL;
|
|
1661 |
|
|
1662 |
if(gprsProvision != NULL)
|
|
1663 |
{
|
|
1664 |
switch (gprsProvision->UmtsGprsRelease())
|
|
1665 |
{
|
|
1666 |
case TPacketDataConfigBase::KConfigGPRS:
|
|
1667 |
{
|
|
1668 |
protConfigOpt = &(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigGPRS>().iProtocolConfigOption);
|
|
1669 |
}
|
|
1670 |
break;
|
|
1671 |
|
|
1672 |
case TPacketDataConfigBase::KConfigRel5:
|
|
1673 |
case TPacketDataConfigBase::KConfigRel99Rel4:
|
|
1674 |
{
|
|
1675 |
protConfigOpt = &(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigR99_R4>().iProtocolConfigOption);
|
|
1676 |
}
|
|
1677 |
break;
|
|
1678 |
}
|
|
1679 |
}
|
|
1680 |
|
|
1681 |
if(protConfigOpt != NULL)
|
|
1682 |
{
|
|
1683 |
if (protConfigOpt->iMiscBuffer.Length() > 0)
|
|
1684 |
{
|
|
1685 |
TSipServerAddrBuf sipbuf;
|
|
1686 |
ioctl.ReadL(2, sipbuf);
|
|
1687 |
|
|
1688 |
TPtr8 pcoPtr(const_cast<TUint8*>(protConfigOpt->iMiscBuffer.Ptr()),
|
|
1689 |
protConfigOpt->iMiscBuffer.Length(),
|
|
1690 |
protConfigOpt->iMiscBuffer.MaxLength());
|
|
1691 |
TTlvStruct<RPacketContext::TPcoId,RPacketContext::TPcoItemDataLength> tlv(pcoPtr,0);
|
|
1692 |
tlv.ResetCursorPos();
|
|
1693 |
|
|
1694 |
TIp6Addr addr;
|
|
1695 |
TPtr8 addrPtr(NULL, 0);
|
|
1696 |
TPckg<TIp6Addr> addrPckg(addr);
|
|
1697 |
|
|
1698 |
for (TInt i = 0; tlv.NextItemL(RPacketContext::EEtelPcktPCSCFAddress,addrPtr) == KErrNone; i++)
|
|
1699 |
{
|
|
1700 |
if (i == sipbuf().index)
|
|
1701 |
{
|
|
1702 |
addrPckg.Copy(addrPtr);
|
|
1703 |
sipbuf().address.SetAddress(addr);
|
|
1704 |
if (!sipbuf().address.IsUnspecified())
|
|
1705 |
err = KErrNone;
|
|
1706 |
break;
|
|
1707 |
}
|
|
1708 |
}
|
|
1709 |
|
|
1710 |
ioctl.WriteL(2, sipbuf);
|
|
1711 |
}
|
|
1712 |
else
|
|
1713 |
{
|
|
1714 |
err = KErrNotFound;
|
|
1715 |
}
|
|
1716 |
}
|
|
1717 |
}
|
|
1718 |
|
|
1719 |
ioctl.Complete(err);
|
|
1720 |
}
|
|
1721 |
|
|
1722 |
|
|
1723 |
//===========================================================
|
|
1724 |
// Rejoin
|
|
1725 |
//===========================================================
|
|
1726 |
|
|
1727 |
MeshMachine::CNodeActivityBase* CPrimaryPDPGoneDownActivity::NewL(const MeshMachine::TNodeActivity& aActivitySig, MeshMachine::AMMNodeBase& aNode)
|
|
1728 |
{
|
|
1729 |
return new (ELeave) CPrimaryPDPGoneDownActivity(aActivitySig, aNode);
|
|
1730 |
}
|
|
1731 |
|
|
1732 |
CPrimaryPDPGoneDownActivity::~CPrimaryPDPGoneDownActivity()
|
|
1733 |
{
|
|
1734 |
}
|
|
1735 |
|
|
1736 |
CPDPSubConnectionProvider* CPrimaryPDPGoneDownActivity::NewDefault()
|
|
1737 |
{
|
|
1738 |
if (iNewDefault == NULL)
|
|
1739 |
{
|
|
1740 |
THighestQoSQuery query(static_cast<CPDPSubConnectionProvider&>(iNode).ControlProvider()->RecipientId());
|
|
1741 |
static_cast<CSubConnectionProviderFactoryBase&>(static_cast<CPDPSubConnectionProvider&>(iNode).Factory()).Find(query);
|
|
1742 |
iNewDefault = query.HighestQoSProvider();
|
|
1743 |
}
|
|
1744 |
return iNewDefault;
|
|
1745 |
}
|
|
1746 |
|
|
1747 |
CPrimaryPDPGoneDownActivity::CPrimaryPDPGoneDownActivity(const MeshMachine::TNodeActivity& aActivitySig, MeshMachine::AMMNodeBase& aNode )
|
|
1748 |
:MeshMachine::CNodeActivityBase(aActivitySig, aNode)
|
|
1749 |
{
|
|
1750 |
iOriginalDataClient.SetNull();
|
|
1751 |
}
|
|
1752 |
|
|
1753 |
|
|
1754 |
DEFINE_SMELEMENT( CPrimaryPDPGoneDownActivity::TApplyNewDefault, NetStateMachine::MStateTransition, CPrimaryPDPGoneDownActivity::TContext)
|
|
1755 |
void CPrimaryPDPGoneDownActivity::TApplyNewDefault::DoL()
|
|
1756 |
{
|
|
1757 |
ASSERT(iContext.iNodeActivity);
|
|
1758 |
CPrimaryPDPGoneDownActivity* primaryGoneDownActivity = static_cast<CPrimaryPDPGoneDownActivity*>(iContext.iNodeActivity);
|
|
1759 |
|
|
1760 |
RClientInterface::OpenPostMessageClose(TNodeCtxId(iContext.ActivityId(), iContext.NodeId()), primaryGoneDownActivity->NewDefault()->Id(),
|
|
1761 |
TCFScpr::TApplyRequest().CRef());
|
|
1762 |
}
|
|
1763 |
|
|
1764 |
DEFINE_SMELEMENT( CPrimaryPDPGoneDownActivity::TStoreOriginalDataClient, NetStateMachine::MStateTransition, CPrimaryPDPGoneDownActivity::TContext)
|
|
1765 |
void CPrimaryPDPGoneDownActivity::TStoreOriginalDataClient::DoL()
|
|
1766 |
{
|
|
1767 |
ASSERT(iContext.iNodeActivity);
|
|
1768 |
CPrimaryPDPGoneDownActivity* act = static_cast<CPrimaryPDPGoneDownActivity*>(iContext.iNodeActivity);
|
|
1769 |
act->iOriginalDataClient
|
|
1770 |
= iContext.Node().GetFirstClient<TDefaultClientMatchPolicy>(TClientType(TCFClientType::EData))->RecipientId();
|
|
1771 |
}
|
|
1772 |
|
|
1773 |
DEFINE_SMELEMENT( CPrimaryPDPGoneDownActivity::TStopOriginalDataClient, NetStateMachine::MStateTransition, CPrimaryPDPGoneDownActivity::TContext)
|
|
1774 |
void CPrimaryPDPGoneDownActivity::TStopOriginalDataClient::DoL()
|
|
1775 |
{
|
|
1776 |
ASSERT(iContext.iNodeActivity);
|
|
1777 |
CPrimaryPDPGoneDownActivity* act = static_cast<CPrimaryPDPGoneDownActivity*>(iContext.iNodeActivity);
|
|
1778 |
ASSERT(!act->iOriginalDataClient.IsNull());
|
|
1779 |
|
|
1780 |
iContext.iNodeActivity->PostRequestTo(act->iOriginalDataClient,
|
|
1781 |
TCFDataClient::TStop(KErrCancel).CRef());
|
|
1782 |
}
|
|
1783 |
|
|
1784 |
|
|
1785 |
DEFINE_SMELEMENT( CPrimaryPDPGoneDownActivity::TSwitchToNewDefault, NetStateMachine::MStateTransition, CPrimaryPDPGoneDownActivity::TContext)
|
|
1786 |
void CPrimaryPDPGoneDownActivity::TSwitchToNewDefault::DoL()
|
|
1787 |
{
|
|
1788 |
ASSERT(&iContext.Node() == iContext.Node().iDefaultSCPR); //only to be excecuted by the current default
|
|
1789 |
ASSERT(iContext.iNodeActivity);
|
|
1790 |
CPrimaryPDPGoneDownActivity* primaryGoneDownActivity = static_cast<CPrimaryPDPGoneDownActivity*>(iContext.iNodeActivity);
|
|
1791 |
CPDPSubConnectionProvider* newDefault = primaryGoneDownActivity->NewDefault();
|
|
1792 |
ASSERT( newDefault && newDefault != &iContext.Node());
|
|
1793 |
newDefault->RemoveClient(iContext.NodeId());
|
|
1794 |
|
|
1795 |
//switch the context owner - the current owner will go down.
|
|
1796 |
iContext.Node().iPDPFsmContextId = newDefault->iPDPFsmContextId;
|
|
1797 |
newDefault->iPDPFsmContextId = CPDPSubConnectionProvider::EInvalidContextId;
|
|
1798 |
iContext.Node().iPdpFsmInterface->Set(iContext.Node().iPDPFsmContextId, iContext.Node());
|
|
1799 |
}
|
|
1800 |
|
|
1801 |
DEFINE_SMELEMENT( CPrimaryPDPGoneDownActivity::TRejoinDataClient, NetStateMachine::MStateTransition, CPrimaryPDPGoneDownActivity::TContext)
|
|
1802 |
void CPrimaryPDPGoneDownActivity::TRejoinDataClient::DoL()
|
|
1803 |
{
|
|
1804 |
ASSERT(&iContext.Node() == iContext.Node().iDefaultSCPR); //only to be excecuted by the current default
|
|
1805 |
ASSERT(iContext.iNodeActivity);
|
|
1806 |
CPrimaryPDPGoneDownActivity* primaryGoneDownActivity = static_cast<CPrimaryPDPGoneDownActivity*>(iContext.iNodeActivity);
|
|
1807 |
CPDPSubConnectionProvider* newDefault = primaryGoneDownActivity->NewDefault();
|
|
1808 |
ASSERT( newDefault && newDefault != &iContext.Node());
|
|
1809 |
if(!newDefault)
|
|
1810 |
{
|
|
1811 |
User::Leave(KErrNotFound);
|
|
1812 |
}
|
|
1813 |
newDefault->AddClientL(iContext.NodeId(), TClientType(TCFClientType::ECtrl));
|
|
1814 |
|
|
1815 |
//migrate the flow - will need TApply
|
|
1816 |
TCFRejoiningProvider::TRejoinDataClientRequest msg(newDefault->GetFirstClient<TDefaultClientMatchPolicy>(TClientType(TCFClientType::EData))->RecipientId(), iContext.NodeId());
|
|
1817 |
RClientInterface::OpenPostMessageClose(TNodeCtxId(iContext.ActivityId(), iContext.NodeId()), newDefault->Id(), msg);
|
|
1818 |
}
|
|
1819 |
|
|
1820 |
|
|
1821 |
DEFINE_SMELEMENT( CPrimaryPDPGoneDownActivity::TNoTagOrProviderStopped, NetStateMachine::MStateFork, CPrimaryPDPGoneDownActivity::TContext)
|
|
1822 |
TInt CPrimaryPDPGoneDownActivity::TNoTagOrProviderStopped::TransitionTag()
|
|
1823 |
{
|
|
1824 |
ASSERT(iContext.iNodeActivity);
|
|
1825 |
CPrimaryPDPGoneDownActivity* primaryGoneDownActivity = static_cast<CPrimaryPDPGoneDownActivity*>(iContext.iNodeActivity);
|
|
1826 |
if (primaryGoneDownActivity->NewDefault())
|
|
1827 |
{
|
|
1828 |
return KNoTag;
|
|
1829 |
}
|
|
1830 |
return CoreNetStates::KProviderStopped;
|
|
1831 |
}
|
|
1832 |
|
|
1833 |
DEFINE_SMELEMENT(TFillInImsExtParams, NetStateMachine::MStateTransition, PDPSCprStates::TContext)
|
|
1834 |
void TFillInImsExtParams::DoL()
|
|
1835 |
{
|
|
1836 |
CGPRSProvision* gprsProvision = const_cast<CGPRSProvision*>(
|
|
1837 |
static_cast<const CGPRSProvision*>(iContext.Node().AccessPointConfig().FindExtension(
|
|
1838 |
STypeId::CreateSTypeId(CGPRSProvision::EUid,CGPRSProvision::ETypeId))));
|
|
1839 |
ASSERT(gprsProvision);
|
|
1840 |
|
|
1841 |
iContext.Node().iPdpFsmInterface->Get(KPrimaryContextId, gprsProvision->GetScratchContextAs<TPacketDataConfigBase>());
|
|
1842 |
// the bundle is assumed to be valid, since its created in createPdpContext
|
|
1843 |
//RParameterFamily imcnFamily = iContext.Node().GetOrCreateParameterBundleL().CreateFamilyL(KSubConnContextDescrParamsFamily); //PJLEFT
|
|
1844 |
|
|
1845 |
RCFParameterFamilyBundle newBundle;
|
|
1846 |
newBundle.CreateL();
|
|
1847 |
newBundle.Open(iContext.Node().iParameterBundle);
|
|
1848 |
RParameterFamily imcnFamily = newBundle.CreateFamilyL(KSubConnContextDescrParamsFamily);
|
|
1849 |
|
|
1850 |
CSubConImsExtParamSet *imcnFlag = CSubConImsExtParamSet::NewL(imcnFamily,RParameterFamily::EGranted);
|
|
1851 |
newBundle.Close();
|
|
1852 |
|
|
1853 |
RPacketContext::TProtocolConfigOptionV2* pco = NULL;
|
|
1854 |
switch (gprsProvision->UmtsGprsRelease())
|
|
1855 |
{
|
|
1856 |
case TPacketDataConfigBase::KConfigGPRS:
|
|
1857 |
{
|
|
1858 |
pco = &(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigGPRS>().iProtocolConfigOption);
|
|
1859 |
}
|
|
1860 |
break;
|
|
1861 |
case TPacketDataConfigBase::KConfigRel5:
|
|
1862 |
case TPacketDataConfigBase::KConfigRel99Rel4:
|
|
1863 |
{
|
|
1864 |
pco = &(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigR99_R4>().iProtocolConfigOption);
|
|
1865 |
}
|
|
1866 |
break;
|
|
1867 |
}
|
|
1868 |
|
|
1869 |
if(pco)
|
|
1870 |
{
|
|
1871 |
TPtr8 pcoPtr(const_cast<TUint8*>(pco->iMiscBuffer.Ptr()),pco->iMiscBuffer.Length(),pco->iMiscBuffer.MaxLength());
|
|
1872 |
TTlvStruct<RPacketContext::TPcoId,RPacketContext::TPcoItemDataLength> tlv(pcoPtr,0);
|
|
1873 |
tlv.ResetCursorPos();
|
|
1874 |
|
|
1875 |
TPtr8 imsFlagPtr(NULL, 0);
|
|
1876 |
TInt err = tlv.NextItemL(RPacketContext::EEtelPcktIMCNNetworkSubsystemSignallingFlag, imsFlagPtr);
|
|
1877 |
imcnFlag->SetImsSignallingIndicator(err == KErrNone);
|
|
1878 |
}
|
|
1879 |
|
|
1880 |
}
|
|
1881 |
|
|
1882 |
//===========================================================
|
|
1883 |
// Cancel Start or Stop
|
|
1884 |
//===========================================================
|
|
1885 |
|
|
1886 |
DEFINE_SMELEMENT(TAwaitingDataClientStopOrCancel, NetStateMachine::MState, TContext)
|
|
1887 |
TBool TAwaitingDataClientStopOrCancel::Accept()
|
|
1888 |
{
|
|
1889 |
CNodeActivityBase* startActivity = iContext.Node().FindActivityById(ECFActivityStartDataClient);
|
|
1890 |
if (startActivity)
|
|
1891 |
{
|
|
1892 |
//cancel start
|
|
1893 |
startActivity->Cancel(iContext);
|
|
1894 |
return EFalse;
|
|
1895 |
}
|
|
1896 |
|
|
1897 |
CoreNetStates::TAwaitingDataClientStop state(iContext);
|
|
1898 |
return state.Accept();
|
|
1899 |
}
|
|
1900 |
|
|
1901 |
DEFINE_SMELEMENT(TCancelDataClientStartInPDP, NetStateMachine::MStateTransition, PDPSCprStates::TContext)
|
|
1902 |
void TCancelDataClientStartInPDP::DoL()
|
|
1903 |
{
|
|
1904 |
CNodeActivityBase* startActivity = iContext.Node().FindActivityById(ECFActivityStartDataClient);
|
|
1905 |
if (startActivity)
|
|
1906 |
{
|
|
1907 |
//cancel start with KErrDisconnected
|
|
1908 |
startActivity->SetError(KErrDisconnected);
|
|
1909 |
startActivity->Cancel(iContext);
|
|
1910 |
}
|
|
1911 |
else
|
|
1912 |
{
|
|
1913 |
RClientInterface::OpenPostMessageClose(TNodeCtxId(ECFActivityStart, iContext.NodeId()), iContext.NodeId(), TEBase::TCancel().CRef());
|
|
1914 |
}
|
|
1915 |
}
|
|
1916 |
|
|
1917 |
//===========================================================
|
|
1918 |
// User Authentication
|
|
1919 |
//===========================================================
|
|
1920 |
|
|
1921 |
DEFINE_SMELEMENT(TSendAuthenticate, NetStateMachine::MStateTransition, PDPSCprStates::TDefContext)
|
|
1922 |
void TSendAuthenticate::DoL()
|
|
1923 |
{
|
|
1924 |
iContext.Node().AuthenticateL();
|
|
1925 |
}
|
|
1926 |
|
|
1927 |
DEFINE_SMELEMENT(TAwaitingAuthenticateComplete, NetStateMachine::MState, PDPSCprStates::TDefContext)
|
|
1928 |
TBool TAwaitingAuthenticateComplete::Accept()
|
|
1929 |
{
|
|
1930 |
if (iContext.iMessage.IsMessage<TPDPMessages::TAuthenticateComplete>())
|
|
1931 |
{
|
|
1932 |
TPDPMessages::TAuthenticateComplete& msg = message_cast<TPDPMessages::TAuthenticateComplete>(iContext.iMessage);
|
|
1933 |
if (msg.iValue != KErrNone)
|
|
1934 |
{
|
|
1935 |
iContext.iNodeActivity->SetError(msg.iValue);
|
|
1936 |
}
|
|
1937 |
return ETrue;
|
|
1938 |
}
|
|
1939 |
return EFalse;
|
|
1940 |
}
|
|
1941 |
|
|
1942 |
} //namespace end
|