|
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // @file UMTSNifControlIf.h |
|
15 // Header file for UMTS-NIF Control API |
|
16 // |
|
17 |
|
18 #ifndef __UMTSNIF_CONTROL__ |
|
19 #define __UMTSNIF_CONTROL__ |
|
20 |
|
21 #include <nifman.h> |
|
22 |
|
23 #if MM_ETEL_API |
|
24 #include "uscl_packet.h" // RPacketContext from UMTSSim |
|
25 #include "uscl_qos.h" // RPacketQoS from UMTSSim |
|
26 #else |
|
27 #include "etelpckt.h" // |
|
28 #include "etelqos.h" // |
|
29 #endif |
|
30 |
|
31 const TUint KMaxNumberOfPacketFilterElements = 5; // From UMTS standards |
|
32 const TUint KMaxNumberOfPacketFilters = 8; // From UMTS standards |
|
33 |
|
34 /** |
|
35 * |
|
36 * @publishedPartner |
|
37 * @released |
|
38 */ |
|
39 class MNifEvent |
|
40 { |
|
41 public: |
|
42 virtual TInt Event(CProtocolBase *aProtocol, TUint aEvent, TDes8& aOption, TAny* aSource=0) = 0; |
|
43 }; |
|
44 |
|
45 /** |
|
46 * |
|
47 * @publishedPartner |
|
48 * @released |
|
49 */ |
|
50 class TEvent |
|
51 { |
|
52 public: |
|
53 MNifEvent *iEvent; |
|
54 }; |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 // List of filters for TTFTInfo |
|
60 typedef TSglQue<RPacketContext::TPacketFilterV2> FilterQueue; |
|
61 typedef TSglQueIter<RPacketContext::TPacketFilterV2> FilterQueueIterator; |
|
62 |
|
63 /** |
|
64 * Class to handle one Traffic Flow Template |
|
65 * Includes 1 - 8 Filters |
|
66 * |
|
67 * @publishedPartner |
|
68 * @released |
|
69 */ |
|
70 class TTFTInfo |
|
71 { |
|
72 public : |
|
73 |
|
74 IMPORT_C explicit TTFTInfo(); |
|
75 IMPORT_C ~TTFTInfo(); |
|
76 IMPORT_C TInt Set(const TTFTInfo& aTFTInfo); |
|
77 IMPORT_C TInt AddPacketFilter(RPacketContext::TPacketFilterV2 aFilter); |
|
78 IMPORT_C TInt GetPacketFilter(RPacketContext::TPacketFilterV2& aFilter); |
|
79 IMPORT_C TInt RemovePacketFilter(RPacketContext::TPacketFilterV2 aFilter); |
|
80 IMPORT_C TInt NextPacketFilter(RPacketContext::TPacketFilterV2& aFilter); |
|
81 IMPORT_C void SetToFirst(); |
|
82 IMPORT_C TUint8 FilterCount(); |
|
83 |
|
84 |
|
85 IMPORT_C TTFTInfo& operator=(const TTFTInfo& aTFTInfo); |
|
86 // Additional Functions for the SBLP Params Handling |
|
87 IMPORT_C TInt AddSblpToken ( RPacketContext::TAuthorizationToken aAuthorizationToken, |
|
88 RArray<RPacketContext::CTFTMediaAuthorizationV3::TFlowIdentifier> aFlowIds); |
|
89 IMPORT_C TInt GetSblpToken ( RPacketContext::CTFTMediaAuthorizationV3 &aSblpParams ) const; |
|
90 IMPORT_C TInt RemovSblpToken (); |
|
91 |
|
92 #ifdef SYMBIAN_NETWORKING_UMTSR5 |
|
93 IMPORT_C TInt SetIMCNSubsystemflag(TBool aIMCNSubsystemflag); |
|
94 IMPORT_C TInt GetIMCNSubsystemflag(TBool &aIMCNSubsystemflag) const; |
|
95 #endif |
|
96 |
|
97 private : |
|
98 TUint8 iFilterCount; |
|
99 TUint8 iLastReturnedFilter; |
|
100 RPacketContext::TPacketFilterV2 iPacketFilters[KMaxNumberOfPacketFilters]; |
|
101 TBool iFilterSlots[KMaxNumberOfPacketFilters]; |
|
102 // Adding ETel Member for Holding the SBLP Parameters |
|
103 RPacketContext::CTFTMediaAuthorizationV3 *iSblpParams; |
|
104 #ifdef SYMBIAN_NETWORKING_UMTSR5 |
|
105 TBool iIMCNSubsystemflag; |
|
106 #endif |
|
107 }; |
|
108 |
|
109 // |
|
110 // Type of the context. Mainly used for upkeeping and consistency checking. |
|
111 // |
|
112 enum TContextType |
|
113 { |
|
114 EPrimaryContext, // Primary context |
|
115 ESecondaryContext, // Secondary context |
|
116 ENetworkInitiatedContext, // Initiated from network |
|
117 EContextTypeUnknown // Default. Used to catch errors. This should be filled by the Nif when returning context info |
|
118 }; |
|
119 // |
|
120 // Type: context identifier |
|
121 // |
|
122 typedef TInt8 TContextId; // Nif's representation |
|
123 |
|
124 /** |
|
125 * Class contains all configuration info of a single context |
|
126 * - Configuration: RPacketContext::TContextConfigGPRS |
|
127 * - Requested QoS: RPacketQoS::TQoSR99_R4Requested |
|
128 * - Negotiated QoS: RPacketQoS::TQoSR99_R4Negotiated |
|
129 * - TFT: TTFTInfo |
|
130 * |
|
131 * @publishedPartner |
|
132 * @released |
|
133 */ |
|
134 class TContextConfig |
|
135 { |
|
136 public: |
|
137 IMPORT_C ~TContextConfig(); |
|
138 |
|
139 IMPORT_C TInt Set(const TContextConfig& aConfig); |
|
140 IMPORT_C void Reset(); |
|
141 IMPORT_C TContextConfig(); |
|
142 |
|
143 // Set-methods: Used to set the corresponding member variable |
|
144 IMPORT_C TInt SetTFTInfo(const TTFTInfo& aTFTInfo); |
|
145 IMPORT_C TInt SetUMTSQoSReq(const RPacketQoS::TQoSR99_R4Requested& aUMTSQoSRequest); |
|
146 IMPORT_C TInt SetUMTSQoSNeg(const RPacketQoS::TQoSR99_R4Negotiated& aUMTSQoS); |
|
147 #ifdef SYMBIAN_NETWORKING_UMTSR5 |
|
148 IMPORT_C TInt SetUMTSQoSReq(const RPacketQoS::TQoSR5Requested& aR5QoSReq); |
|
149 IMPORT_C TInt SetUMTSQoSNeg(const RPacketQoS::TQoSR5Negotiated& aR5QoSNeg); |
|
150 #endif |
|
151 IMPORT_C TInt SetContextConfig(const RPacketContext::TContextConfigGPRS& aUMTSConfig); |
|
152 IMPORT_C TInt SetPdpCompression(TUint aPdpCompression); |
|
153 IMPORT_C TInt SetPdpType(RPacketContext::TProtocolType aPdpType); |
|
154 IMPORT_C TInt SetAccessPointName(const RPacketContext::TGSNAddress& aAccessPointName); |
|
155 IMPORT_C TInt SetPdpAddress(const RPacketContext::TProtocolAddress& aPdpAddress); |
|
156 |
|
157 |
|
158 // Get-methods: Used to fetch the corresponding member variable |
|
159 IMPORT_C TInt GetUMTSQoSReq(RPacketQoS::TQoSR99_R4Requested& aUMTSQoSRequest) const; |
|
160 IMPORT_C TInt GetTFTInfo(TTFTInfo& aTFTInfo) const; |
|
161 IMPORT_C TInt GetUMTSQoSNeg(RPacketQoS::TQoSR99_R4Negotiated& aUMTSQoS) const; |
|
162 IMPORT_C TInt GetContextConfig(RPacketContext::TContextConfigGPRS& aUMTSConfig) const; |
|
163 IMPORT_C TInt GetPdpCompression(TUint& aPdpCompression) const; |
|
164 IMPORT_C TInt GetPdpType(RPacketContext::TProtocolType& aPdpType) const; |
|
165 IMPORT_C TInt GetAccessPointName(RPacketContext::TGSNAddress& aAccessPointName) const; |
|
166 IMPORT_C TInt GetPdpAddress(RPacketContext::TProtocolAddress& aPdpAddress) const; |
|
167 #ifdef SYMBIAN_NETWORKING_UMTSR5 |
|
168 IMPORT_C TInt GetUMTSQoSReq(RPacketQoS::TQoSR5Requested& aR5QoSReq) const; |
|
169 IMPORT_C TInt GetUMTSQoSNeg(RPacketQoS::TQoSR5Negotiated& aR5QoSNeg) const; |
|
170 #endif |
|
171 |
|
172 protected: |
|
173 RPacketContext::TContextConfigGPRS iContextConfig; // Configuration |
|
174 #ifdef SYMBIAN_NETWORKING_UMTSR5 |
|
175 RPacketQoS::TQoSR5Requested iUMTSQoSReq; // Requested R5 QoS |
|
176 RPacketQoS::TQoSR5Negotiated iUMTSQoS; // Negotiated R5 QoS |
|
177 #else |
|
178 RPacketQoS::TQoSR99_R4Requested iUMTSQoSReq; // Requested R99/R4 QoS |
|
179 RPacketQoS::TQoSR99_R4Negotiated iUMTSQoS; // Negotiated R99/R4 QoS |
|
180 #endif |
|
181 TTFTInfo iTFTInfo; // Traffic Flow Template |
|
182 }; |
|
183 |
|
184 |
|
185 // |
|
186 // Operation result codes. Removed, now using standard codes + Etel codes |
|
187 // |
|
188 //typedef TInt TContextReasonCode; |
|
189 //const TInt KContextOk = 0x00; // OK KErrNone |
|
190 //const TInt KErrContextBusy = -0x03; // Another operation pending KErrInUse |
|
191 //const TInt KErrContextInvalidId = -0x05; // Context id out of range: FATAL KErrBadHandle |
|
192 //const TInt KErrContextUnusedId = -0x06; // Context with given ID missing KErrNotReady |
|
193 //const TInt KErrContextCreateFailed = -0x07; // Error while creating context // Not needed |
|
194 //const TInt KErrMaxNumberOfContextsReached = -0x0a; // Device configuration does not support more contexts //KErrNotSupported |
|
195 //const TInt KErrMemory = -0x0b; // General out of memory error //KErrNoMemory |
|
196 //const TInt KErrContextStatus = -0x0c; // Context status/requested operation mismatch |
|
197 //const TInt KErrContextGeneral = -0x0d; // General error //KErrGeneral |
|
198 |
|
199 /** |
|
200 * Single Context's identification info |
|
201 * |
|
202 * @publishedPartner |
|
203 * @released |
|
204 */ |
|
205 class TContextInfo |
|
206 { |
|
207 public: |
|
208 TContextId iContextId; // Context id in Nif |
|
209 RPacketContext::TContextStatus iStatus; // The current status from Etel |
|
210 }; |
|
211 |
|
212 |
|
213 // |
|
214 // Events the Nif sends to upper layers |
|
215 // |
|
216 const TUint KContextDeleteEvent = 0x01; // When deletion is initiated from network. |
|
217 const TUint KContextActivateEvent = 0x02; // Response to KContextActivate |
|
218 const TUint KContextParametersChangeEvent = 0x03; // Contexts parameters/status have changed. |
|
219 const TUint KContextBlockedEvent = 0x04; // A PDP context becomes blocked |
|
220 const TUint KContextUnblockedEvent = 0x05; // A PDP context becomes unblocked |
|
221 const TUint KNetworkStatusEvent = 0x06; // For different network indications |
|
222 const TUint KContextQoSSetEvent = 0x07; // Response to KContextQoSSet |
|
223 const TUint KContextTFTModifiedEvent = 0x08; // Response to KContextTFTModify |
|
224 const TUint KPrimaryContextCreated = 0x09; // Primary context at startup created |
|
225 const TUint KSecondaryContextCreated = 0x0a; // Secondary context created |
|
226 const TUint KContextModifyActiveEvent = 0x0b; // Response to KModifyActive |
|
227 const TUint KGetNegQoSEvent = 0x0c; // Response to KGetNegQoS. ** Used internally by NIF ** |
|
228 |
|
229 |
|
230 // |
|
231 // Control operations used to signal the UMTSNif |
|
232 // |
|
233 const TUint KContextCreate = 0x01; // Create a new context |
|
234 const TUint KContextDelete = 0x02; // Delete an existing context |
|
235 const TUint KContextActivate = 0x03; // Activate an existing context |
|
236 const TUint KRegisterEventHandler = 0x04; // Option to enable event method registration |
|
237 const TUint KContextSetEvents = 0x05; // Option to enable / disable event notification to upper layers |
|
238 const TUint KContextQoSSet = 0x06; // Set QoS |
|
239 const TUint KContextModifyActive = 0x07; // Modify an active context |
|
240 const TUint KContextTFTModify = 0x08; // Traffic Flow Template modification |
|
241 const TUint KNifSetDefaultQoS = 0x09; // Set the QoS of the primary context created at startup |
|
242 const TUint KStartupPrimaryContextCreation = 0x0a; // Standalone pdp context creation. ** Used internally by Nif ** |
|
243 const TUint KGetNegQoS = 0x0b; // Retrieve negotiated QoS from the TSY. ** Used internally by NIF ** |
|
244 |
|
245 // |
|
246 // Codes to identify requested TFT-operation when issuing KContextTFTModify-command |
|
247 // |
|
248 typedef TInt TTFTOperationCode; |
|
249 const TInt KAddFilters = 0x01; // Add packet filters(s) |
|
250 const TInt KRemoveFilters = 0x02; // Remove packet filters(s) |
|
251 const TInt KAddSblpParameter = 0x03; // Add sblp parameter |
|
252 const TInt KRemoveSblpParameter = 0x04; // Remove sblp parameter |
|
253 const TInt KDeleteTFT = 0x05; // Delete the Traffic Flow Template |
|
254 #ifdef SYMBIAN_NETWORKING_UMTSR5 |
|
255 const TInt KAddIMCNSubsystemflag = 0x06; // Add IM CN Subsystem flag |
|
256 const TInt KRemoveIMCNSubsystemflag = 0x07; // Remove IM CN Subsystem flag |
|
257 #endif |
|
258 |
|
259 /** |
|
260 * Structure used when passing context related parameters to/from the Nif |
|
261 * |
|
262 * @publishedPartner |
|
263 * @released |
|
264 */ |
|
265 class TContextParameters |
|
266 { |
|
267 public: |
|
268 IMPORT_C TContextParameters(); |
|
269 TContextType iContextType; // UP: Primary / Secondary |
|
270 TContextInfo iContextInfo; // UP&DOWN: Context Id and status |
|
271 TContextConfig iContextConfig; // UP&DOWN: QoS, TFT and configuration |
|
272 TTFTOperationCode iTFTOperationCode;// DOWN: Indicating requested TFT operation |
|
273 TInt iReasonCode; // UP: Operation successful/failed |
|
274 }; |
|
275 |
|
276 // |
|
277 // List of Network status codes |
|
278 // These are used to signal the upper layers of status changes |
|
279 // |
|
280 typedef TUint TNetworkEventCode; |
|
281 const TUint KNetworkConnectionLost = 0x01; // No connection available |
|
282 const TUint KNetworkInterfaceDown = 0x02; // Nif is going down -> Do not access it anymore |
|
283 |
|
284 /** |
|
285 * |
|
286 * @publishedPartner |
|
287 * @released |
|
288 */ |
|
289 class TNetworkParameters |
|
290 { |
|
291 public: |
|
292 TNetworkEventCode iNetworkEventCode; // Event code indicating what happened |
|
293 RPacketService::TStatus iNetworkStatus; // Unattached, Attached, Active, Suspended |
|
294 }; |
|
295 |
|
296 #endif // __UMTSNIF_CONTROL__ |