24
|
1 |
// Copyright (c) 2002-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 file contains the definitions of the Simulator TSY Packet Context class.
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
/**
|
|
19 |
@file
|
|
20 |
@internalAll
|
|
21 |
*/
|
|
22 |
|
|
23 |
#ifndef __CSIMPACKETCONTEXT_H__
|
|
24 |
#define __CSIMPACKETCONTEXT_H__
|
|
25 |
|
|
26 |
#include <et_phone.h>
|
|
27 |
#include <etelpckt.h>
|
|
28 |
#include <testconfigfileparser.h>
|
|
29 |
#include "csimtimer.h"
|
|
30 |
#include "utils.h"
|
|
31 |
#include "CSimNtras.h"
|
|
32 |
#include "CSimPubSubChange.h"
|
|
33 |
#include "CSimPhone.h"
|
|
34 |
#include <ctsy/serviceapi/cmmutility.h>
|
|
35 |
|
|
36 |
const TUint KNotFound=0xfffffff;
|
|
37 |
const TInt KLimitForErrorCodeForContextGoToInactive=-700;
|
|
38 |
const TInt KContextGoToInactiveWithNormalErrorCode=-600;
|
|
39 |
const TInt KContextGoToInactiveWithExtendedErrorCode=-400;
|
|
40 |
const TInt KContextGoToInactiveWithErrorWhenTryingToGetLastErrorCode = -300;
|
|
41 |
|
|
42 |
enum TContextEvent //< Enum for the state machine
|
|
43 |
{
|
|
44 |
EContextEventNone,
|
|
45 |
EContextEventActivate,
|
|
46 |
EContextEventDeactivate,
|
|
47 |
EContextEventDoDeactivate,
|
|
48 |
EContextEventSuspend,
|
|
49 |
EContextEventDelete,
|
|
50 |
EContextEventNtRas,
|
|
51 |
EContextEventTimeOut
|
|
52 |
};
|
|
53 |
|
|
54 |
const RPacketContext::TContextStatus KContextStateTableTerminator=(RPacketContext::TContextStatus)999;
|
|
55 |
|
|
56 |
struct TContextStateChangeValidity
|
|
57 |
{
|
|
58 |
RPacketContext::TContextStatus iOldState;
|
|
59 |
RPacketContext::TContextStatus iNewState;
|
|
60 |
TInt iError;
|
|
61 |
};
|
|
62 |
|
|
63 |
//< This table is used to ensure that the TSY state changes are as accurate as possibly
|
|
64 |
//< It makes sure that there is no state irregularities and the TSY does not skip any state.
|
|
65 |
//< Returns KErrNone for a valid change state request (3rd column).
|
|
66 |
const struct TContextStateChangeValidity KContextStateChangeValidity[]= {
|
|
67 |
{ RPacketContext::EStatusInactive, RPacketContext::EStatusActivating, KErrNone },
|
|
68 |
{ RPacketContext::EStatusInactive, RPacketContext::EStatusDeleted, KErrNone },
|
|
69 |
|
|
70 |
{ RPacketContext::EStatusActivating, RPacketContext::EStatusActive, KErrNone },
|
|
71 |
{ RPacketContext::EStatusActivating, RPacketContext::EStatusInactive, KErrNone },
|
|
72 |
{ RPacketContext::EStatusActivating, RPacketContext::EStatusDeleted, KErrNone },
|
|
73 |
|
|
74 |
{ RPacketContext::EStatusActive, RPacketContext::EStatusDeactivating, KErrNone },
|
|
75 |
{ RPacketContext::EStatusActive, RPacketContext::EStatusSuspended, KErrNone },
|
|
76 |
{ RPacketContext::EStatusActive, RPacketContext::EStatusDeleted, KErrNone },
|
|
77 |
|
|
78 |
{ RPacketContext::EStatusDeactivating, RPacketContext::EStatusInactive, KErrNone },
|
|
79 |
{ RPacketContext::EStatusDeactivating, RPacketContext::EStatusActive, KErrNone },
|
|
80 |
{ RPacketContext::EStatusDeactivating, RPacketContext::EStatusDeleted, KErrNone },
|
|
81 |
|
|
82 |
{ RPacketContext::EStatusSuspended, RPacketContext::EStatusDeactivating, KErrNone },
|
|
83 |
{ RPacketContext::EStatusSuspended, RPacketContext::EStatusActive, KErrNone },
|
|
84 |
{ RPacketContext::EStatusSuspended, RPacketContext::EStatusDeleted, KErrNone },
|
|
85 |
|
|
86 |
{ RPacketContext::EStatusDeleted, RPacketContext::EStatusInactive, KErrNone },
|
|
87 |
|
|
88 |
|
|
89 |
{ KContextStateTableTerminator, KContextStateTableTerminator, KContextStateTableTerminator}
|
|
90 |
};
|
|
91 |
|
|
92 |
|
|
93 |
struct TProtocolConfigOption // used for authentication parameters
|
|
94 |
{
|
|
95 |
TInt iAuthProtocol;
|
|
96 |
TPtrC8 iUsername;
|
|
97 |
TPtrC8 iPassword;
|
|
98 |
TPtrC8 iChallenge;
|
|
99 |
TPtrC8 iResponse;
|
|
100 |
TPtrC8 iPrimaryDNS;
|
|
101 |
TPtrC8 iSecondaryDNS;
|
|
102 |
TUint iId;
|
|
103 |
RPacketContext::TMiscProtocolBuffer iMiscBuffer;
|
|
104 |
};
|
|
105 |
|
|
106 |
/**
|
|
107 |
Used for holding valid GPRS/R99/R4/R99/R5 context configuration parameters
|
|
108 |
*/
|
|
109 |
struct TContextConfigParam
|
|
110 |
{
|
|
111 |
TInt iProtocolType;
|
|
112 |
TPtrC8 iGsnAddress;
|
|
113 |
TPtrC8 iProtocolAddress;
|
|
114 |
TInt iAnonymousAccess;
|
|
115 |
TBool iUseEdge;
|
|
116 |
TProtocolConfigOption iProtocolConfigOption;
|
|
117 |
TUint iPdpHeaderCompression;
|
|
118 |
TUint iPdpDataCompression;
|
|
119 |
};
|
|
120 |
|
|
121 |
struct TConfigFail // Used for failing SetConfig, DeleteTFT, CreateTFT, AddPacketFilter call
|
|
122 |
{
|
|
123 |
TName iContextName;
|
|
124 |
TInt32 iNumberOfTimes;
|
|
125 |
TInt32 iFailErrorCode;
|
|
126 |
};
|
|
127 |
|
|
128 |
struct TTftConfig
|
|
129 |
{
|
|
130 |
TName iContextName;
|
|
131 |
TInt32 iNumberOfFailures;
|
|
132 |
TInt32 iFailErrorCode;
|
|
133 |
TInt32 iDelay;
|
|
134 |
};
|
|
135 |
|
|
136 |
struct TRel99ContextConfig // Used holding the Rel99 configuration parameters
|
|
137 |
{
|
|
138 |
TName iContextName;
|
|
139 |
TUint iActivatePause;
|
|
140 |
TInt iActivateErrorCode;
|
|
141 |
TUint iDeactivatePause;
|
|
142 |
TUint iDeactivateErrorCode;
|
|
143 |
TUint iDeletionPause;
|
|
144 |
TUint iDeletionErrorCode;
|
|
145 |
TBool iConnectToNtRas;
|
|
146 |
};
|
|
147 |
|
|
148 |
struct TNetworkRegStatus // Used for holding the network registration
|
|
149 |
{
|
|
150 |
TInt iDuration;
|
|
151 |
RPacketService::TRegistrationStatus iRegStatus;
|
|
152 |
};
|
|
153 |
|
|
154 |
struct TNotifyContextStatusChange // Used for notifying context status
|
|
155 |
{
|
|
156 |
TName iContextName;
|
|
157 |
TInt iDuration;
|
|
158 |
RPacketContext::TContextStatus iStatus;
|
|
159 |
};
|
|
160 |
|
|
161 |
struct TPacketFilterV3 // Used for holding packet filter configuration
|
|
162 |
{
|
|
163 |
TInt iId; //< Packet filter identifier. Value range: 1 - 8
|
|
164 |
TInt iEvaluationPrecedenceIndex; //< Evaluation Precedence Index. Value range: 255 (lowest) - 0 (highest)
|
|
165 |
TUint8 iSrcAddr[RPacketContext::KIPAddressSize]; //< Domain Source address
|
|
166 |
TUint8 iSrcAddrSubnetMask[RPacketContext::KIPAddressSize]; //< Domain Subnet mask
|
|
167 |
TInt iProtocolNumberOrNextHeader; //< Protocol number (IPv4) or Next Header (IPv6) field of incoming packets. Value range 0 - 255
|
|
168 |
TInt iSrcPortMin; //< Minimum source port number of incoming packets. Value range 0 - 65 535
|
|
169 |
TInt iSrcPortMax; //< Maximum source port number of incoming packets. Value range 0 - 65 535
|
|
170 |
TInt iDestPortMin; //< Lowest destination port number of incoming packets. Value range 0 - 65 535
|
|
171 |
TInt iDestPortMax; //< Maximum destination port number of incoming packets. Value range 0 - 65 535
|
|
172 |
TUint32 iIPSecSPI; //< Security Parameter Index, 32-bit field.
|
|
173 |
TUint16 iTOSorTrafficClass; //< Type of Service (IPv4) or Traffic Class (IPv6). 1 octet TOS/Traffic class + 1 octet TOS/Traffic class Mask.
|
|
174 |
TUint32 iFlowLabel;
|
|
175 |
TBool iAdded;
|
|
176 |
RPacketContext::TPacketFilterType iFilterType;
|
|
177 |
};
|
|
178 |
|
|
179 |
struct TAuthorizationTokenResponse //< Used for SIMTSY responses for authorization tokens
|
|
180 |
{
|
|
181 |
RPacketContext::TAuthorizationToken iAuthorizationToken;
|
|
182 |
TInt iResponse;
|
|
183 |
};
|
|
184 |
|
|
185 |
/**
|
|
186 |
* This class is used to hold the details of batch read requests between the first and
|
|
187 |
* second phases of a "two phase read". During the first phase, an instance of this class
|
|
188 |
* is created containing a unique identifier to the request and the resulting information.
|
|
189 |
* Once the second phase operation has identified this instance from a list and completed
|
|
190 |
* the client request, this instance will be deleted.
|
|
191 |
*/
|
|
192 |
class CPcktListReadAllAttempt : public CBase
|
|
193 |
{
|
|
194 |
public:
|
|
195 |
static CPcktListReadAllAttempt* NewL(TClientId& aId, TTsyReqHandle aReqHandle);
|
|
196 |
~CPcktListReadAllAttempt();
|
|
197 |
|
|
198 |
protected:
|
|
199 |
CPcktListReadAllAttempt(TClientId& aId, TTsyReqHandle aReqHandle);
|
|
200 |
|
|
201 |
private:
|
|
202 |
void ConstructL();
|
|
203 |
|
|
204 |
public:
|
|
205 |
CBufBase* iListBuf; // < The result of the read operation.
|
|
206 |
TClientId iClient; // < A unique identifier of the read request.
|
|
207 |
TTsyReqHandle iReqHandle; // < The first phase request handle.
|
|
208 |
};
|
|
209 |
|
|
210 |
|
|
211 |
class CSimPacketService;
|
|
212 |
class CSimPacketQoS;
|
|
213 |
class CATDialGPRSData;
|
|
214 |
class CSimPacketContext : public CSubSessionExtBase, public MTimerCallBack, public MNTRasCallBack, public MPubSubChangeCallback
|
|
215 |
{
|
|
216 |
public:
|
|
217 |
static CSimPacketContext* NewL(CSimPhone* aPhone, CSimPacketService* aPacketService, const TDesC& aContextName);
|
|
218 |
CSimPacketContext(CSimPhone* aPhone, CSimPacketService* aPacketService, const TName& aContextName);
|
|
219 |
void ConstructL();
|
|
220 |
~CSimPacketContext();
|
|
221 |
|
|
222 |
virtual TInt ExtFunc(const TTsyReqHandle aTsyReqHandle,const TInt aIpc,const TDataPackage& aPackage);
|
|
223 |
virtual TReqMode ReqModeL(const TInt aIpc);
|
|
224 |
virtual CTelObject* OpenNewObjectByNameL(const TDesC& aName);
|
|
225 |
virtual CTelObject* OpenNewObjectL(TDes& aNewName);
|
|
226 |
virtual TInt CancelService(const TInt aIpc, const TTsyReqHandle aTsyReqHandle);
|
|
227 |
virtual void Init();
|
|
228 |
virtual TInt RegisterNotification(const TInt aIpc);
|
|
229 |
virtual TInt DeregisterNotification(const TInt aIpc);
|
|
230 |
virtual TInt NumberOfSlotsL(const TInt aIpc);
|
|
231 |
|
|
232 |
TInt AttemptDeactivateImmediately();
|
|
233 |
|
|
234 |
TInt ChangeState(RPacketContext::TContextStatus aNewState); //< Changes the state of the packetcontext
|
|
235 |
const CTestConfigSection* CfgFile();
|
|
236 |
TInt ReActivate(CSimPacketService* aPacketService, const TName& aContextName);
|
|
237 |
|
|
238 |
void ConstructPacketFiltersL();
|
|
239 |
|
|
240 |
void PubSubCallback(TInt aId);
|
|
241 |
|
|
242 |
private:
|
|
243 |
TInt GetProfileName(const TTsyReqHandle aTsyReqHandle, TName* aQoSProfile);
|
|
244 |
|
|
245 |
TInt SetConfig(const TTsyReqHandle aTsyReqHandle,const TDesC8* aConfig);
|
|
246 |
TInt SetConfigCancel(const TTsyReqHandle aTsyReqHandle);
|
|
247 |
|
|
248 |
TInt GetConfig(const TTsyReqHandle aTsyReqHandle,TDes8* aConfig);
|
|
249 |
TInt GetConfigCancel(const TTsyReqHandle aTsyReqHandle);
|
|
250 |
|
|
251 |
TInt NotifyConfigChanged(const TTsyReqHandle aTsyReqHandle, TDes8* aConfig);
|
|
252 |
TInt NotifyConfigChangedCancel(const TTsyReqHandle aTsyReqHandle);
|
|
253 |
|
|
254 |
TInt Activate(const TTsyReqHandle aTsyReqHandle);
|
|
255 |
TInt ActivateCancel(const TTsyReqHandle aTsyReqHandle);
|
|
256 |
|
|
257 |
TInt Deactivate(const TTsyReqHandle aTsyReqHandle);
|
|
258 |
TInt DeactivateCancel(const TTsyReqHandle aTsyReqHandle);
|
|
259 |
|
|
260 |
TInt Delete(const TTsyReqHandle aTsyReqHandle);
|
|
261 |
TInt DeleteCancel(const TTsyReqHandle aTsyReqHandle);
|
|
262 |
|
|
263 |
TInt LoanCommPort(const TTsyReqHandle aTsyReqHandle,RCall::TCommPort* aDataPort);
|
|
264 |
TInt LoanCommPortCancel(const TTsyReqHandle aTsyReqHandle);
|
|
265 |
TInt RecoverCommPort(const TTsyReqHandle aTsyReqHandle);
|
|
266 |
TInt RecoverCommPortCancel(const TTsyReqHandle aTsyReqHandle);
|
|
267 |
|
|
268 |
TInt GetStatus(const TTsyReqHandle aTsyReqHandle,RPacketContext::TContextStatus* aContextStatus);
|
|
269 |
TInt NotifyStatusChange(const TTsyReqHandle aTsyReqHandle,RPacketContext::TContextStatus* aContextStatus);
|
|
270 |
TInt NotifyStatusChangeCancel(const TTsyReqHandle aTsyReqHandle);
|
|
271 |
|
|
272 |
TInt GetDataVolumeTransferred(const TTsyReqHandle aTsyReqHandle,RPacketContext::TDataVolume* aVolume);
|
|
273 |
TInt NotifyDataTransferred(const TTsyReqHandle aTsyReqHandle, RPacketContext::TDataVolume* aVolume, RPacketContext::TNotifyDataTransferredRequest* aData);
|
|
274 |
TInt NotifyDataTransferredCancel(const TTsyReqHandle aTsyReqHandle);
|
|
275 |
|
|
276 |
TInt GetLastErrorCause(const TTsyReqHandle aTsyReqHandle,TInt* aError);
|
|
277 |
|
|
278 |
IMPORT_C static TInt OpenNewSecondaryContext(CSimPacketService& aPacketService,
|
|
279 |
const TDesC& anExistingContextName,
|
|
280 |
TDes& aNewContextName);
|
|
281 |
|
|
282 |
TInt CreateNewTFT(const TTsyReqHandle aTsyReqHandle, const TInt* aSize);
|
|
283 |
TInt DoCreateNewTFT();
|
|
284 |
TInt DeleteTFT(const TTsyReqHandle aTsyReqHandle);
|
|
285 |
TInt EnumeratePacketFilters(const TTsyReqHandle aTsyReqHandle, TInt& aCount);
|
|
286 |
TInt GetPacketFilterInfoL(const TTsyReqHandle aTsyReqHandle, TInt aIndex, TDes8* aPacketFilterInfo);
|
|
287 |
TInt AddPacketFilter(const TTsyReqHandle aTsyReqHandle, const TDesC8* aPacketFilterInfo);
|
|
288 |
TInt RemovePacketFilter(const TTsyReqHandle aTsyReqHandle, TInt aId);
|
|
289 |
TInt ModifyActiveContext(const TTsyReqHandle aTsyReqHandle);
|
|
290 |
TInt InitialiseContext(const TTsyReqHandle aTsyReqHandle, TDes8* aDataChannelV2Pckg); // This method supersedes the LoanCommPort() and RecoverCommPort() methods.
|
|
291 |
TInt DoInitialiseContext();
|
|
292 |
TInt GetDnsInfo(const TTsyReqHandle aTsyReqHandle, const TDesC8* aDnsInfo); // retrieves primary and secondary DNS server names
|
|
293 |
TInt GetAddMediaAuthorization(const TTsyReqHandle aTsyReqHandle, TDes8* aBuffer);
|
|
294 |
TInt GetRemoveMediaAuthorization(const TTsyReqHandle aTsyReqHandle, RPacketContext::TAuthorizationToken* aAuthorizationToken);
|
|
295 |
TInt GetAddMediaAuthorizationCancel(const TTsyReqHandle aTsyReqHandle);
|
|
296 |
TInt GetRemoveMediaAuthorizationCancel(const TTsyReqHandle aTsyReqHandle);
|
|
297 |
|
|
298 |
TInt CreateNewTFTCancel(const TTsyReqHandle aTsyReqHandle);
|
|
299 |
TInt DeleteTFTCancel(const TTsyReqHandle aTsyReqHandle);
|
|
300 |
TInt EnumeratePacketFiltersCancel(const TTsyReqHandle aTsyReqHandle);
|
|
301 |
TInt GetPacketFilterInfoCancel(const TTsyReqHandle aTsyReqHandle);
|
|
302 |
TInt AddPacketFilterCancel(const TTsyReqHandle aTsyReqHandle);
|
|
303 |
TInt RemovePacketFilterCancel(const TTsyReqHandle aTsyReqHandle);
|
|
304 |
TInt ModifyActiveContextCancel(const TTsyReqHandle aTsyReqHandle);
|
|
305 |
TInt InitialiseContextCancel(const TTsyReqHandle aTsyReqHandle); // This method supersedes the LoanCommPort() and RecoverCommPort() methods.
|
|
306 |
TInt GetDnsInfoCancel(const TTsyReqHandle aTsyReqHandle);
|
|
307 |
|
|
308 |
void TimerCallBackNotifyContextStatusChange();
|
|
309 |
|
|
310 |
void CompleteContextStatusChange(RPacketContext::TContextStatus& aStatus);
|
|
311 |
CSimPubSubChange *iContextStatusChange;
|
|
312 |
|
|
313 |
private:
|
|
314 |
|
|
315 |
CSimPhone* iPhone;
|
|
316 |
|
|
317 |
TBool iDeleted; //< Used to indicate whether this context is deleted or not
|
|
318 |
TBool iIsActive; //< Used to indicate whether this context is active as only one
|
|
319 |
//< context can be active at any one time.
|
|
320 |
|
|
321 |
CSimPacketService* iPacketService; //< Pointer to the parent class
|
|
322 |
CSimPacketQoS* iPacketqos; //< Pointer to the qos associated with this context
|
|
323 |
CSimNtRas* iNtRas; //< pointer to the NtRas class that uses ntras to connect to network
|
|
324 |
TName iContextName; //< Current Packet context name
|
|
325 |
TName iQoSName;
|
|
326 |
CSimTimer* iTimer; //< pointer to the timer object
|
|
327 |
CSimTimer* iNotifyContextStatusChangeTimer;
|
|
328 |
CSimTimer* iNotifyContextConfigChangeTimer;
|
|
329 |
CSimTimer* iSetConfigTimer;
|
|
330 |
CSimTimer* iInitContextTimer;
|
|
331 |
CSimTimer* iCreateTftTimer;
|
|
332 |
|
|
333 |
TNotifyData iNotifyStatusChange; //< Holds the notification data (a flag, TsyReqHandle and any raw data)
|
|
334 |
CArrayFixFlat<TContextConfigParam>* iContextConfigParams; //< Pointer to a list of valid Context (GPRS/R99/R5) config parameters
|
|
335 |
|
|
336 |
CArrayFixFlat<TRel99ContextConfig>* iContextConfigsRel99;
|
|
337 |
TBool iTFTCreated;
|
|
338 |
TInt iNumTFTsCreated;
|
|
339 |
TInt iNumFiltersAdded;
|
|
340 |
CArrayFixFlat<TPacketFilterV3>* iPacketFilterInfoArray;
|
|
341 |
TInt GetContextStatusChangeCount();
|
|
342 |
TNotifyContextStatusChange& GetContextStatusChangeAt(TInt aIndex);
|
|
343 |
CArrayFixFlat<TNotifyContextStatusChange>* iNotifyContextStatusChangeArray;
|
|
344 |
CArrayFixFlat<TAuthorizationTokenResponse>* iAuthorizationTokenResponse; //< Holds tokens and desired responses for SIMTSY to report
|
|
345 |
CArrayFixFlat<RPacketContext::CTFTMediaAuthorizationV3>* iMediaAuthorization; //< Contains authorization token and flow Ids for verification
|
|
346 |
|
|
347 |
TInt iContextConfigParamsIndex; //< index in iContextConfigParams
|
|
348 |
|
|
349 |
|
|
350 |
TNotifyData iNotifyConfigGPRS; //< Holds the GPRS context config change notification data (a flag, TsyReqHandle and any raw data)
|
|
351 |
TNotifyData iNotifyConfigR99; //< Holds the R99 context config changenotification data (a flag, TsyReqHandle and any raw data)
|
|
352 |
TNotifyData iNotifyConfigR5; //< Holds the R5 context config changenotification data (a flag, TsyReqHandle and any raw data)
|
|
353 |
|
|
354 |
TTsyReqHandle iActivateRequestHandle; //< Request handle used for activating a context
|
|
355 |
TTsyReqHandle iDeactivateRequestHandle; //< Request handle used for deactivating a context
|
|
356 |
TTsyReqHandle iDeleteRequestHandle; //< Request handle used to complete a delete request
|
|
357 |
TBool iCommPortLoaned; //< A flag indicating whether the CommPort is loaned.
|
|
358 |
TContextEvent iCurrentEvent; //< holds the current event taking place.
|
|
359 |
|
|
360 |
TInt iActivatePause; //< duration spent in activating the context
|
|
361 |
TInt iActivateFail; //< Fail the activate request with this error
|
|
362 |
TInt iDeactivatePause; //< duration spent in deactivating the context
|
|
363 |
TInt iDeactivateFail; //< Fail the deactivate request with this error
|
|
364 |
TInt iDeletePause; //< duration spent in deleting the context
|
|
365 |
TInt iDeleteFail; //< Fail the delete request with this error
|
|
366 |
|
|
367 |
TInt iQoSObjectCount; //< used to append a number to the QoS object created
|
|
368 |
|
|
369 |
TConfigFail iSetConfigFail;
|
|
370 |
TConfigFail iDeleteTftFail;
|
|
371 |
TTftConfig iCreateTftConfig;
|
|
372 |
TConfigFail iAddPacketFilter;
|
|
373 |
|
|
374 |
TInt iSetConfigDelay;
|
|
375 |
|
|
376 |
class TNotifyContextConfigChangeData
|
|
377 |
{
|
|
378 |
public:
|
|
379 |
TInt iDelay;
|
|
380 |
TInt iNewContextConfigIndex;
|
|
381 |
};
|
|
382 |
CArrayFixFlat<TNotifyContextConfigChangeData> *iNotifyContextConfigChangeArray;
|
|
383 |
|
|
384 |
class TSetConfigData
|
|
385 |
{
|
|
386 |
public:
|
|
387 |
static TInt Find(CArrayFixFlat<TSetConfigData>* aSetConfigArray, TTsyReqHandle aTsyReqHandle, TInt& aIndex);
|
|
388 |
TTsyReqHandle iTsyReqHandle;
|
|
389 |
TDesC8* iData;
|
|
390 |
};
|
|
391 |
CArrayFixFlat<TSetConfigData> *iSetConfigData;
|
|
392 |
|
|
393 |
class TCreateTftData
|
|
394 |
{
|
|
395 |
public:
|
|
396 |
TTsyReqHandle iTsyReqHandle;
|
|
397 |
TInt iSize;
|
|
398 |
};
|
|
399 |
TCreateTftData iCreateTftData;
|
|
400 |
|
|
401 |
TInt iSetConfigCallCount;
|
|
402 |
TInt iContextType;
|
|
403 |
TBool iTFTChangeBool;
|
|
404 |
TBool iCommReset;
|
|
405 |
TInt iNotifyContextStatusChangeIndex;
|
|
406 |
RPacketContext::TContextStatus iCurrentNotifyContextStatusChange;
|
|
407 |
TNotificationType iNotifyContextStatusChangeType;
|
|
408 |
|
|
409 |
private:
|
|
410 |
virtual void NTRasCallBack(TInt aStatus);
|
|
411 |
TInt ActionEvent(TContextEvent aEvent,TInt aStatus);
|
|
412 |
RPacketService::TStatus ConvertToPacketServiceStatus(RPacketContext::TContextStatus aNewState);
|
|
413 |
|
|
414 |
TInt DoActivate(); //< this is where we try to connect to a network using ntras
|
|
415 |
TInt DoDeactivate(); //< deactivates the context by clossing the comm port
|
|
416 |
TInt DoDelete(); //< deletes the context
|
|
417 |
|
|
418 |
void GetCommSetupSettingsL();
|
|
419 |
void GetContextConfigParamSettingsL(TPtrC8 aTag);
|
|
420 |
void GetActivateSettings();
|
|
421 |
void GetSetConfigSettings();
|
|
422 |
void GetPacketFilterSettings();
|
|
423 |
void GetContextConfigRel99SettingsL();
|
|
424 |
void GetContextStatusChangeSettingsL();
|
|
425 |
void GetContextConfigChangeSettingsL();
|
|
426 |
|
|
427 |
public:
|
|
428 |
TName ContextName() const;
|
|
429 |
inline TInt ContextType() const {return iContextType; }
|
|
430 |
inline RPacketContext::TContextStatus ContextStatus() const {return iState; }
|
|
431 |
|
|
432 |
protected:
|
|
433 |
|
|
434 |
RPacketContext::TContextStatus iState; //< Holds the current state of the packet context
|
|
435 |
|
|
436 |
class TCommSetupItem
|
|
437 |
{
|
|
438 |
public:
|
|
439 |
TFileName iCsyName; //< The CSY name used for comm communication
|
|
440 |
TCommConfigV01 iConfig; //< The configuration to be used with the NTRas port.
|
|
441 |
TName iPortName; //< The port to be used for read / write data read from the config file.
|
|
442 |
TName iContextName;
|
|
443 |
TBool iCommReset;
|
|
444 |
TInt iNumInitializeFailures;
|
|
445 |
TInt iErrorCode;
|
|
446 |
TInt iDelay;
|
|
447 |
};
|
|
448 |
|
|
449 |
class TInitContextData
|
|
450 |
{
|
|
451 |
public:
|
|
452 |
TTsyReqHandle iTsyReqHandle;
|
|
453 |
TDesC8* iChannel;
|
|
454 |
};
|
|
455 |
TInitContextData iInitContextData;
|
|
456 |
|
|
457 |
CArrayFixFlat<TCommSetupItem>* iCommSetupArray;
|
|
458 |
virtual void TimerCallBack(TInt aId);
|
|
459 |
TCommSetupItem FindCommSettings();
|
|
460 |
|
|
461 |
private:
|
|
462 |
TInt iLastError;
|
|
463 |
TInt iErrorCodeForGetLastErrorCause;
|
|
464 |
};
|
|
465 |
|
|
466 |
#endif
|