williamr@2
|
1 |
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@2
|
4 |
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@2
|
6 |
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
// Interface Manager API
|
williamr@2
|
15 |
//
|
williamr@2
|
16 |
//
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
|
williamr@2
|
20 |
/**
|
williamr@2
|
21 |
@file
|
williamr@2
|
22 |
*/
|
williamr@2
|
23 |
|
williamr@2
|
24 |
|
williamr@2
|
25 |
#if !defined(__NIFMAN_H__)
|
williamr@2
|
26 |
#define __NIFMAN_H__
|
williamr@2
|
27 |
|
williamr@2
|
28 |
#include <es_prot.h>
|
williamr@2
|
29 |
#include <nifvar.h>
|
williamr@2
|
30 |
#include <cdbover.h>
|
williamr@2
|
31 |
|
williamr@2
|
32 |
class CNifMan;
|
williamr@2
|
33 |
class CNifFactory : public CObject
|
williamr@2
|
34 |
/**
|
williamr@2
|
35 |
Manager classes
|
williamr@2
|
36 |
|
williamr@2
|
37 |
@publishedPartner
|
williamr@2
|
38 |
@released
|
williamr@2
|
39 |
*/
|
williamr@2
|
40 |
{
|
williamr@2
|
41 |
friend class CNifMan;
|
williamr@2
|
42 |
public:
|
williamr@2
|
43 |
IMPORT_C CNifFactory();
|
williamr@2
|
44 |
IMPORT_C virtual TInt Open();
|
williamr@2
|
45 |
IMPORT_C virtual void Close();
|
williamr@2
|
46 |
IMPORT_C static void Cleanup(TAny* aObject);
|
williamr@2
|
47 |
IMPORT_C static TInt ControlledDelete(TAny* aFactory);
|
williamr@2
|
48 |
IMPORT_C void InitL(RLibrary& aLib, CObjectCon& aCon);
|
williamr@2
|
49 |
|
williamr@2
|
50 |
protected:
|
williamr@2
|
51 |
IMPORT_C ~CNifFactory();
|
williamr@2
|
52 |
virtual void InstallL()=0;
|
williamr@2
|
53 |
RLibrary iLib;
|
williamr@2
|
54 |
CAsyncCallBack* iAsyncDtor;
|
williamr@2
|
55 |
};
|
williamr@2
|
56 |
|
williamr@2
|
57 |
/**
|
williamr@2
|
58 |
Static internal API class
|
williamr@2
|
59 |
@internalComponent
|
williamr@2
|
60 |
*/
|
williamr@2
|
61 |
enum TNifSocketState { ENifBuffers2048=-4, ENifBuffers1024, ENifBuffers512,
|
williamr@2
|
62 |
ENifSocketNull=-1,
|
williamr@2
|
63 |
ENifSocketCreated=0, ENifSocketOpen=3, ENifSocketConnected=4,
|
williamr@2
|
64 |
ENifSocketError=9 };
|
williamr@2
|
65 |
|
williamr@2
|
66 |
class MNifIfUser;
|
williamr@2
|
67 |
class MNifIfNotify;
|
williamr@2
|
68 |
class CNifIfBase;
|
williamr@2
|
69 |
class CNifAgentBase;
|
williamr@2
|
70 |
class CSockSession;
|
williamr@2
|
71 |
class CConnectionProvdBase;
|
williamr@2
|
72 |
class Nif
|
williamr@2
|
73 |
/**
|
williamr@2
|
74 |
@internalTechnology
|
williamr@2
|
75 |
*/
|
williamr@2
|
76 |
{
|
williamr@2
|
77 |
public:
|
williamr@2
|
78 |
/** Network protocol support */
|
williamr@2
|
79 |
IMPORT_C static void BindL(MNifIfUser& aUser, TAny* aId, TDes& aResult, const TDesC& aName=TPtrC(0,0));
|
williamr@2
|
80 |
IMPORT_C static void NetworkLayerClosed(MNifIfUser& aUser);
|
williamr@2
|
81 |
IMPORT_C static void StartL(TDes& aResult, const TDesC& aName=TPtrC());
|
williamr@2
|
82 |
IMPORT_C static void Stop(const TDesC& aName=TPtrC());
|
williamr@2
|
83 |
IMPORT_C static CNifIfBase* CreateInterfaceL(const TDesC& aName, MNifIfNotify* aNotify);
|
williamr@2
|
84 |
IMPORT_C static CNifAgentBase* CreateAgentL(const TDesC& aAgentName, const TBool aNewInstance = EFalse);
|
williamr@2
|
85 |
IMPORT_C static void CheckInstalledMBufManagerL();
|
williamr@2
|
86 |
IMPORT_C static CProtocolBase* IsProtocolLoaded(const TDesC& aName);
|
williamr@2
|
87 |
IMPORT_C static void CheckInstalledL();
|
williamr@2
|
88 |
IMPORT_C static TInt SetSocketState(TNifSocketState aState, CServProviderBase* aProvd);
|
williamr@2
|
89 |
IMPORT_C static void ProgressL(TNifProgress& aProgress, const TDesC& aName=TPtrC());
|
williamr@2
|
90 |
IMPORT_C static void Stop(TAny* aId, CNifIfBase* aIf=0);
|
williamr@2
|
91 |
IMPORT_C static void ProgressL(TNifProgress& aProgress, TAny* aId, CNifIfBase* aIf=0);
|
williamr@2
|
92 |
IMPORT_C static CConnectionProvdBase* NewConnectionL(MConnectionNotify* aConnection, TUint aId);
|
williamr@2
|
93 |
/** deprecated function */
|
williamr@2
|
94 |
IMPORT_C static CNifIfBase* CreateInterfaceL(const TDesC& aName);
|
williamr@2
|
95 |
};
|
williamr@2
|
96 |
|
williamr@2
|
97 |
|
williamr@2
|
98 |
/**
|
williamr@2
|
99 |
Client side classes
|
williamr@2
|
100 |
async message for progress notifier
|
williamr@2
|
101 |
|
williamr@2
|
102 |
@publishedAll
|
williamr@2
|
103 |
@deprecated 7.0s - replaced with RConnection API
|
williamr@2
|
104 |
*/
|
williamr@2
|
105 |
const TInt KDefaultNifSlots = 1;
|
williamr@2
|
106 |
|
williamr@2
|
107 |
|
williamr@2
|
108 |
/**
|
williamr@2
|
109 |
@publishedPartner
|
williamr@2
|
110 |
@released
|
williamr@2
|
111 |
@capability NetworkControl These control options affect configuration at the designated level.
|
williamr@2
|
112 |
@ref RConnection::Control
|
williamr@2
|
113 |
*/
|
williamr@2
|
114 |
const TUint KCOLInterface = 100;
|
williamr@2
|
115 |
|
williamr@2
|
116 |
/**
|
williamr@2
|
117 |
@publishedPartner
|
williamr@2
|
118 |
@released
|
williamr@2
|
119 |
@capability NetworkControl These control options affect configuration at the designated level.
|
williamr@2
|
120 |
@ref RConnection::Control
|
williamr@2
|
121 |
*/
|
williamr@2
|
122 |
const TUint KCOLAgent = 200;
|
williamr@2
|
123 |
|
williamr@2
|
124 |
|
williamr@2
|
125 |
// RConnection::Ioctl() level for NIFMAN
|
williamr@2
|
126 |
|
williamr@2
|
127 |
/**
|
williamr@2
|
128 |
@publishedPartner
|
williamr@2
|
129 |
@released
|
williamr@2
|
130 |
@ref RConnection::Ioctl
|
williamr@2
|
131 |
*/
|
williamr@2
|
132 |
const TUint KCOLConfiguration = 300;
|
williamr@2
|
133 |
|
williamr@2
|
134 |
#ifdef _DEBUG
|
williamr@2
|
135 |
/**
|
williamr@2
|
136 |
Debug-only option level used to pass test-only option names onto PPP.
|
williamr@2
|
137 |
@internalTechnology
|
williamr@2
|
138 |
*/
|
williamr@2
|
139 |
const TUint KCOLLinkLayerTestLevel = 325;
|
williamr@2
|
140 |
#endif
|
williamr@2
|
141 |
|
williamr@2
|
142 |
|
williamr@2
|
143 |
// RConnection::Control() options
|
williamr@2
|
144 |
|
williamr@2
|
145 |
/**
|
williamr@2
|
146 |
@publishedPartner
|
williamr@2
|
147 |
@released
|
williamr@2
|
148 |
@capability NetworkControl Restrict ability to switch on/off idle timers
|
williamr@2
|
149 |
@ref RConnection::Control
|
williamr@2
|
150 |
*/
|
williamr@2
|
151 |
const TUint KConnDisableTimers = KConnReadUserDataBit | 1;
|
williamr@2
|
152 |
|
williamr@2
|
153 |
/**
|
williamr@2
|
154 |
@publishedPartner
|
williamr@2
|
155 |
@released
|
williamr@2
|
156 |
@ref RConnection::Control
|
williamr@2
|
157 |
*/
|
williamr@2
|
158 |
const TUint KConnGetInterfaceName = KConnReadUserDataBit | KConnWriteUserDataBit | 2;
|
williamr@2
|
159 |
|
williamr@2
|
160 |
|
williamr@2
|
161 |
// RConnection::Ioctl() options
|
williamr@2
|
162 |
|
williamr@2
|
163 |
/**
|
williamr@2
|
164 |
@publishedPartner
|
williamr@2
|
165 |
@released
|
williamr@2
|
166 |
@ref RConnection::Ioctl
|
williamr@2
|
167 |
*/
|
williamr@2
|
168 |
const TUint KConnGetCurrentAddr = KConnWriteUserDataBit | 3;
|
williamr@2
|
169 |
|
williamr@2
|
170 |
/**
|
williamr@2
|
171 |
@publishedPartner
|
williamr@2
|
172 |
@released
|
williamr@2
|
173 |
@ref RConnection::Ioctl
|
williamr@2
|
174 |
*/
|
williamr@2
|
175 |
const TUint KConnGetServerAddr = KConnWriteUserDataBit | 4;
|
williamr@2
|
176 |
|
williamr@2
|
177 |
/**
|
williamr@2
|
178 |
@publishedPartner
|
williamr@2
|
179 |
@released
|
williamr@2
|
180 |
@ref RConnection::Ioctl
|
williamr@2
|
181 |
*/
|
williamr@2
|
182 |
const TUint KConnGetAddrLeaseTimeRemain = KConnWriteUserDataBit | 5;
|
williamr@2
|
183 |
|
williamr@2
|
184 |
/**
|
williamr@2
|
185 |
@publishedPartner
|
williamr@2
|
186 |
@released
|
williamr@2
|
187 |
@capability NetworkControl Restrict ability to release a configured address
|
williamr@2
|
188 |
@ref RConnection::Ioctl
|
williamr@2
|
189 |
*/
|
williamr@2
|
190 |
const TUint KConnAddrRelease = 6;
|
williamr@2
|
191 |
|
williamr@2
|
192 |
/**
|
williamr@2
|
193 |
@publishedPartner
|
williamr@2
|
194 |
@released
|
williamr@2
|
195 |
@capability NetworkControl Restrict ability to renew a configured address
|
williamr@2
|
196 |
@ref RConnection::Ioctl
|
williamr@2
|
197 |
|
williamr@2
|
198 |
This option is used for user initiated RENEW request where an attempt
|
williamr@2
|
199 |
is made to renew the lease obtained from the orginal DHCP server.
|
williamr@2
|
200 |
If the server response is not received before the default timeout(RebindTimeT2 - RenewalTimeT1)
|
williamr@2
|
201 |
the dhcp client will then initiate a REBIND.An user defined timeout can also be
|
williamr@2
|
202 |
supplied when using this option which will override the default timeout value.
|
williamr@2
|
203 |
|
williamr@2
|
204 |
@code
|
williamr@2
|
205 |
RConnection conn;
|
williamr@2
|
206 |
TRequestStatus stat;
|
williamr@2
|
207 |
//Start a connection
|
williamr@2
|
208 |
.....
|
williamr@2
|
209 |
.....
|
williamr@2
|
210 |
//Option1: Initiate a Renew request.
|
williamr@2
|
211 |
conn.Ioctl(KCOLConfiguration, KConnAddrRenew, stat);
|
williamr@2
|
212 |
|
williamr@2
|
213 |
//Option2: Initiate a Renew request with a user defined timeout
|
williamr@2
|
214 |
TInt secValue(2); //Eg timeout set to 2secs
|
williamr@2
|
215 |
TPckg<TInt> val(secValue);
|
williamr@2
|
216 |
conn.Ioctl(KCOLConfiguration, KConnAddrRenew, stat,&val);
|
williamr@2
|
217 |
@endcode
|
williamr@2
|
218 |
*/
|
williamr@2
|
219 |
const TUint KConnAddrRenew = 7;
|
williamr@2
|
220 |
|
williamr@2
|
221 |
/**
|
williamr@2
|
222 |
@internalTechnology
|
williamr@2
|
223 |
@released 9.1
|
williamr@2
|
224 |
*/
|
williamr@2
|
225 |
const TUint KNifSessionSetConnectionAttempt = KConnInternalOptionBit|8;
|
williamr@2
|
226 |
|
williamr@2
|
227 |
/**
|
williamr@2
|
228 |
@internalTechnology
|
williamr@2
|
229 |
@released 9.1
|
williamr@2
|
230 |
*/
|
williamr@2
|
231 |
const TUint KNifSessionGetConnectionAttempt = KConnInternalOptionBit|9;
|
williamr@2
|
232 |
/**
|
williamr@2
|
233 |
@internalTechnology
|
williamr@2
|
234 |
@released 9.1
|
williamr@2
|
235 |
*/
|
williamr@2
|
236 |
const TUint KNifSessionSetBlockProgresses = KConnInternalOptionBit|10;
|
williamr@2
|
237 |
|
williamr@2
|
238 |
/**
|
williamr@2
|
239 |
@internalTechnology
|
williamr@2
|
240 |
@released 9.1
|
williamr@2
|
241 |
*/
|
williamr@2
|
242 |
const TUint KNifSessionGetBlockProgresses = KConnInternalOptionBit|11;
|
williamr@2
|
243 |
|
williamr@2
|
244 |
/**
|
williamr@2
|
245 |
@internalTechnology
|
williamr@2
|
246 |
@released 9.1
|
williamr@2
|
247 |
*/
|
williamr@2
|
248 |
const TUint KNifSessionGetStopping = KConnInternalOptionBit|12;
|
williamr@2
|
249 |
|
williamr@2
|
250 |
// DHCP specific RConnection::Ioctl options
|
williamr@2
|
251 |
/**
|
williamr@2
|
252 |
@publishedPartner
|
williamr@2
|
253 |
@released
|
williamr@2
|
254 |
@ref RConnection::Ioctl
|
williamr@2
|
255 |
*/const TUint KConnGetDhcpRawOptionData = KConnWriteUserDataBit|KConnReadUserDataBit|100;
|
williamr@2
|
256 |
|
williamr@2
|
257 |
/**
|
williamr@2
|
258 |
@publishedPartner
|
williamr@2
|
259 |
@released
|
williamr@2
|
260 |
@ref RConnection::Ioctl
|
williamr@2
|
261 |
*/
|
williamr@2
|
262 |
const TUint KConnGetSipServerAddr = KConnWriteUserDataBit|KConnReadUserDataBit|101;
|
williamr@2
|
263 |
|
williamr@2
|
264 |
/**
|
williamr@2
|
265 |
@publishedPartner
|
williamr@2
|
266 |
@released
|
williamr@2
|
267 |
@ref RConnection::Ioctl
|
williamr@2
|
268 |
*/
|
williamr@2
|
269 |
const TUint KConnGetSipServerDomain = KConnWriteUserDataBit|KConnReadUserDataBit|102;
|
williamr@2
|
270 |
|
williamr@2
|
271 |
#ifdef SYMBIAN_NETWORKING_DHCPSERVER
|
williamr@2
|
272 |
/**
|
williamr@2
|
273 |
@internalTechnology
|
williamr@2
|
274 |
@released
|
williamr@2
|
275 |
@ref RConnection::Ioctl
|
williamr@2
|
276 |
*/
|
williamr@2
|
277 |
const TUint KConnSetDhcpRawOptionData = KConnWriteUserDataBit|KConnReadUserDataBit|103;
|
williamr@2
|
278 |
#endif // SYMBIAN_NETWORKING_DHCPSERVER
|
williamr@2
|
279 |
|
williamr@2
|
280 |
#ifdef SYMBIAN_NETWORKING_DHCP_MSG_HEADERS
|
williamr@2
|
281 |
/**
|
williamr@2
|
282 |
* This constant is used to retrieve the DHCP Header Sname which is the
|
williamr@2
|
283 |
* host name of the next available server. This is sometimes overloaded
|
williamr@2
|
284 |
* to carry option value 66 which is the TftpServerName.
|
williamr@2
|
285 |
* @publishedPartner
|
williamr@2
|
286 |
* @released
|
williamr@2
|
287 |
* @see RConnection::Ioctl()
|
williamr@2
|
288 |
*/
|
williamr@2
|
289 |
const TUint KConnGetDhcpHdrSname = KConnWriteUserDataBit|KConnReadUserDataBit|104;
|
williamr@2
|
290 |
|
williamr@2
|
291 |
/**
|
williamr@2
|
292 |
* This constant is used to retrieve the DHCP Header Siaddr which is the
|
williamr@2
|
293 |
* IPAddress of the next available server.
|
williamr@2
|
294 |
* @publishedPartner
|
williamr@2
|
295 |
* @released
|
williamr@2
|
296 |
* @see RConnection::Ioctl()
|
williamr@2
|
297 |
*/
|
williamr@2
|
298 |
const TUint KConnGetDhcpHdrSiaddr = KConnWriteUserDataBit|KConnReadUserDataBit|105;
|
williamr@2
|
299 |
|
williamr@2
|
300 |
/**
|
williamr@2
|
301 |
* This constant is used to retrieve the DHCP Option 66, Tftp Server Name.
|
williamr@2
|
302 |
* @publishedPartner
|
williamr@2
|
303 |
* @released
|
williamr@2
|
304 |
* @see RConnection::Ioctl()
|
williamr@2
|
305 |
*/
|
williamr@2
|
306 |
const TUint KConnGetTftpServerName = KConnWriteUserDataBit|KConnReadUserDataBit|106;
|
williamr@2
|
307 |
|
williamr@2
|
308 |
/**
|
williamr@2
|
309 |
* This constant is used to retrieve the DHCP Option 150, Tftp Server Address.
|
williamr@2
|
310 |
* @publishedPartner
|
williamr@2
|
311 |
* @released
|
williamr@2
|
312 |
* @see RConnection::Ioctl()
|
williamr@2
|
313 |
*/
|
williamr@2
|
314 |
const TUint KConnGetTftpServerAddr = KConnWriteUserDataBit|KConnReadUserDataBit|107;
|
williamr@2
|
315 |
|
williamr@2
|
316 |
|
williamr@2
|
317 |
/**
|
williamr@2
|
318 |
* This constant is used to retrieve multiple opcode data in a raw format.
|
williamr@2
|
319 |
* @publishedPartner
|
williamr@2
|
320 |
* @released
|
williamr@2
|
321 |
* @see RConnection::Ioctl()
|
williamr@2
|
322 |
*/
|
williamr@2
|
323 |
const TUint KConnDhcpGetMultipleParams = KConnWriteUserDataBit|KConnReadUserDataBit|108;
|
williamr@2
|
324 |
#endif //SYMBIAN_NETWORKING_DHCP_MSG_HEADERS
|
williamr@2
|
325 |
|
williamr@2
|
326 |
|
williamr@2
|
327 |
/**
|
williamr@2
|
328 |
@publishedPartner
|
williamr@2
|
329 |
@released
|
williamr@2
|
330 |
*/
|
williamr@2
|
331 |
const TUint KConnMaxInterfaceName = 32;
|
williamr@2
|
332 |
|
williamr@2
|
333 |
class TConnInterfaceName
|
williamr@2
|
334 |
/**
|
williamr@2
|
335 |
@publishedPartner
|
williamr@2
|
336 |
@released
|
williamr@2
|
337 |
*/
|
williamr@2
|
338 |
{
|
williamr@2
|
339 |
public:
|
williamr@2
|
340 |
TUint iIndex;
|
williamr@2
|
341 |
TBuf<KConnMaxInterfaceName> iName;
|
williamr@2
|
342 |
};
|
williamr@2
|
343 |
/**
|
williamr@2
|
344 |
@internalTechnology
|
williamr@2
|
345 |
*/
|
williamr@2
|
346 |
enum TAgentConnectType
|
williamr@2
|
347 |
{
|
williamr@2
|
348 |
EAgentStartDialOut,
|
williamr@2
|
349 |
EAgentReconnect,
|
williamr@2
|
350 |
EAgentStartCallBack,
|
williamr@2
|
351 |
EAgentNone,
|
williamr@2
|
352 |
EAgentStartDialIn
|
williamr@2
|
353 |
};
|
williamr@2
|
354 |
|
williamr@2
|
355 |
#endif // __NIFMAN_H__
|