williamr@2
|
1 |
/**
|
williamr@2
|
2 |
* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@2
|
5 |
* 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
|
6 |
* which accompanies this distribution, and is available
|
williamr@2
|
7 |
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description:
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*/
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
|
williamr@2
|
20 |
|
williamr@2
|
21 |
|
williamr@2
|
22 |
/**
|
williamr@2
|
23 |
@file IN_IFACE.H
|
williamr@2
|
24 |
*/
|
williamr@2
|
25 |
|
williamr@2
|
26 |
#if !defined(__IN_IFACE_H__)
|
williamr@2
|
27 |
#define __IN_IFACE_H__
|
williamr@2
|
28 |
|
williamr@2
|
29 |
#if !defined(__IN_SOCK_H__)
|
williamr@2
|
30 |
#include <in_sock.h>
|
williamr@2
|
31 |
#endif
|
williamr@2
|
32 |
|
williamr@2
|
33 |
#if !defined(__NIFVAR_H__)
|
williamr@2
|
34 |
#include <nifvar.h>
|
williamr@2
|
35 |
#endif
|
williamr@2
|
36 |
|
williamr@2
|
37 |
// Feature Flags
|
williamr@2
|
38 |
|
williamr@2
|
39 |
/**
|
williamr@2
|
40 |
Is a loopback interface
|
williamr@2
|
41 |
@internalAll
|
williamr@2
|
42 |
*/
|
williamr@2
|
43 |
const TUint KIfIsLoopback = 0x00000001;
|
williamr@2
|
44 |
|
williamr@2
|
45 |
/**
|
williamr@2
|
46 |
Is single point to point
|
williamr@2
|
47 |
@internalAll
|
williamr@2
|
48 |
*/
|
williamr@2
|
49 |
const TUint KIfIsPointToPoint = 0x00000002;
|
williamr@2
|
50 |
|
williamr@2
|
51 |
/**
|
williamr@2
|
52 |
Supports broadcasting
|
williamr@2
|
53 |
@internalAll
|
williamr@2
|
54 |
*/
|
williamr@2
|
55 |
const TUint KIfCanBroadcast = 0x00000004;
|
williamr@2
|
56 |
|
williamr@2
|
57 |
/**
|
williamr@2
|
58 |
Supports multicasting
|
williamr@2
|
59 |
@internalAll
|
williamr@2
|
60 |
*/
|
williamr@2
|
61 |
const TUint KIfCanMulticast = 0x00000008;
|
williamr@2
|
62 |
|
williamr@2
|
63 |
/**
|
williamr@2
|
64 |
Can have its MTU set
|
williamr@2
|
65 |
@internalAll
|
williamr@2
|
66 |
*/
|
williamr@2
|
67 |
const TUint KIfCanSetMTU = 0x00000010;
|
williamr@2
|
68 |
|
williamr@2
|
69 |
/**
|
williamr@2
|
70 |
Has a hardware address (ie needs ARP)
|
williamr@2
|
71 |
@internalAll
|
williamr@2
|
72 |
*/
|
williamr@2
|
73 |
const TUint KIfHasHardwareAddr = 0x00000020;
|
williamr@2
|
74 |
|
williamr@2
|
75 |
/**
|
williamr@2
|
76 |
Can have its hardware address changed
|
williamr@2
|
77 |
@internalAll
|
williamr@2
|
78 |
*/
|
williamr@2
|
79 |
const TUint KIfCanSetHardwareAddr = 0x00000040;
|
williamr@2
|
80 |
|
williamr@2
|
81 |
/**
|
williamr@2
|
82 |
Dialup interface
|
williamr@2
|
83 |
@internalAll
|
williamr@2
|
84 |
*/
|
williamr@2
|
85 |
const TUint KIfIsDialup = 0x00000080;
|
williamr@2
|
86 |
|
williamr@2
|
87 |
// Control options level received by network interfaces
|
williamr@2
|
88 |
/**
|
williamr@2
|
89 |
* Option level for network interface driver options.
|
williamr@2
|
90 |
* @internalTechnology
|
williamr@2
|
91 |
*/
|
williamr@2
|
92 |
const TUint KSOLInterface = 0x203;
|
williamr@2
|
93 |
|
williamr@2
|
94 |
// Option names
|
williamr@2
|
95 |
/**
|
williamr@2
|
96 |
* The current network interface driver operation parameters are written to the
|
williamr@2
|
97 |
* passed TSoIfInfo structure.
|
williamr@2
|
98 |
*
|
williamr@2
|
99 |
* An interface that supports only this is assumed IPv4 only.
|
williamr@2
|
100 |
*
|
williamr@2
|
101 |
* anOption should be a TPckgBuf<TSoIfInfo>.
|
williamr@2
|
102 |
*
|
williamr@2
|
103 |
* @internalTechnology
|
williamr@2
|
104 |
*/
|
williamr@2
|
105 |
const TUint KSoIfInfo = 0x101; // Get Interface Information
|
williamr@2
|
106 |
|
williamr@2
|
107 |
/**
|
williamr@2
|
108 |
* Gets the interface's local hardware address, if the link layer is using addresses.
|
williamr@2
|
109 |
*
|
williamr@2
|
110 |
* anOption should be a TPckgBuf<TSoIfInfo>.
|
williamr@2
|
111 |
*
|
williamr@2
|
112 |
* The option is not supported until v7.0.
|
williamr@2
|
113 |
*
|
williamr@2
|
114 |
* @internalTechnology
|
williamr@2
|
115 |
*/
|
williamr@2
|
116 |
const TUint KSoIfHardwareAddr = 0x102; // Get Hardware Address
|
williamr@2
|
117 |
|
williamr@2
|
118 |
/**
|
williamr@2
|
119 |
* Gets the current network interface driver configuration options.
|
williamr@2
|
120 |
*
|
williamr@2
|
121 |
* There may be three kind of interfaces: IPv4 only, IPv6 only and hybrid IPv4/IPv6.
|
williamr@2
|
122 |
* The last one is passing traffic for both protocols and thus accepts either
|
williamr@2
|
123 |
* family in a single KSoIfConfig call. Hybrid interfaces must be queried twice,
|
williamr@2
|
124 |
* once for IPv4 and once for IPv6, to get both the IPv4 and the IPv6 settings.
|
williamr@2
|
125 |
*
|
williamr@2
|
126 |
* For IPv4, anOption should be a TPckgBuf<TSoInetIfConfig>, for IPv6 TPckgBuf<TSoInet6IfConfig>.
|
williamr@2
|
127 |
*
|
williamr@2
|
128 |
* The iFamily field in either TSoInetIfConfig or TSoInet6IfConfig must be set
|
williamr@2
|
129 |
* to either KAfInet for IPv4 or KAfInet6 for IPv6) before the call. If the family
|
williamr@2
|
130 |
* is not supported by the interface, it returns KErrNotSupported.
|
williamr@2
|
131 |
*
|
williamr@2
|
132 |
* @internalTechnology
|
williamr@2
|
133 |
*/
|
williamr@2
|
134 |
const TUint KSoIfConfig = 0x103; // Get Network parameters
|
williamr@2
|
135 |
|
williamr@2
|
136 |
/**
|
williamr@2
|
137 |
* For the IPv4 only stack, compares the passed address with the current local
|
williamr@2
|
138 |
* address, and returns KErrBadName if not equal.
|
williamr@2
|
139 |
*
|
williamr@2
|
140 |
* anOption should be a TPckgBuf< TInetAddr >.
|
williamr@2
|
141 |
*
|
williamr@2
|
142 |
* This is not used for the IPv4/v6 stack.
|
williamr@2
|
143 |
*
|
williamr@2
|
144 |
* @internalTechnology
|
williamr@2
|
145 |
*/
|
williamr@2
|
146 |
const TUint KSoIfCompareAddr = 0x104; // Compare address with one passed in
|
williamr@2
|
147 |
|
williamr@2
|
148 |
/** Retrieve IAP and NID information
|
williamr@2
|
149 |
*
|
williamr@2
|
150 |
* @internalTechnology
|
williamr@2
|
151 |
*/
|
williamr@2
|
152 |
const TUint KSoIfGetConnectionInfo = 0xf001; // Retrieve IAP and NID information
|
williamr@2
|
153 |
|
williamr@2
|
154 |
/**
|
williamr@2
|
155 |
@internalComponent
|
williamr@2
|
156 |
*/
|
williamr@2
|
157 |
const TUint KMaxInterfaceName=32;
|
williamr@2
|
158 |
|
williamr@2
|
159 |
/**
|
williamr@2
|
160 |
* Holds the name of a network interface.
|
williamr@2
|
161 |
*
|
williamr@2
|
162 |
* This is used in TSoIfInfo.
|
williamr@2
|
163 |
*
|
williamr@2
|
164 |
* @internalTechnology
|
williamr@2
|
165 |
*/
|
williamr@2
|
166 |
typedef TBuf<KMaxInterfaceName> TInterfaceName;
|
williamr@2
|
167 |
|
williamr@2
|
168 |
class TInetIfConfig
|
williamr@2
|
169 |
// Information which allows IP to enter route table entries
|
williamr@2
|
170 |
/**
|
williamr@2
|
171 |
* Describes the IP routing options for a network interface.
|
williamr@2
|
172 |
*
|
williamr@2
|
173 |
* It is used in TSoInetIfConfig.
|
williamr@2
|
174 |
*
|
williamr@2
|
175 |
* @internalComponent
|
williamr@2
|
176 |
*/
|
williamr@2
|
177 |
{
|
williamr@2
|
178 |
public:
|
williamr@2
|
179 |
/** Interface IP address. */
|
williamr@2
|
180 |
TInetAddr iAddress;
|
williamr@2
|
181 |
/** IP netmask. */
|
williamr@2
|
182 |
TInetAddr iNetMask;
|
williamr@2
|
183 |
/** IP broadcast address. */
|
williamr@2
|
184 |
TInetAddr iBrdAddr;
|
williamr@2
|
185 |
/** IP default gateway or peer address (if known). */
|
williamr@2
|
186 |
TInetAddr iDefGate;
|
williamr@2
|
187 |
/** IP primary name server (if any). */
|
williamr@2
|
188 |
TInetAddr iNameSer1;
|
williamr@2
|
189 |
/** IP secondary name server (if any). */
|
williamr@2
|
190 |
TInetAddr iNameSer2;
|
williamr@2
|
191 |
};
|
williamr@2
|
192 |
|
williamr@2
|
193 |
class TSoIfInfo
|
williamr@2
|
194 |
// Socket option structure for KSoIfInfo
|
williamr@2
|
195 |
/**
|
williamr@2
|
196 |
* Current network interface operation parameters.
|
williamr@2
|
197 |
*
|
williamr@2
|
198 |
* It is returned by RSocket::GetOpt(), when that function is called with anOptionLevel
|
williamr@2
|
199 |
* set to KSOLInterface and anOptionName set to KSoIfInfo.
|
williamr@2
|
200 |
*
|
williamr@2
|
201 |
* @internalTechnology
|
williamr@2
|
202 |
*/
|
williamr@2
|
203 |
{
|
williamr@2
|
204 |
public:
|
williamr@2
|
205 |
/** Feature flags. Possible values are defined in in_iface.h. */
|
williamr@2
|
206 |
TUint iFeatures; // Feature flags
|
williamr@2
|
207 |
/** Maximum transmission unit. */
|
williamr@2
|
208 |
TInt iMtu; // Max frame size
|
williamr@2
|
209 |
/** An approximation of the interface speed in Kbps. */
|
williamr@2
|
210 |
TInt iSpeedMetric; // Indication of performance, approx to Kbps
|
williamr@2
|
211 |
/** Interface protocol name, ipcp::\<port\>. */
|
williamr@2
|
212 |
TInterfaceName iName;
|
williamr@2
|
213 |
};
|
williamr@2
|
214 |
|
williamr@2
|
215 |
class TSoIfHardwareAddr
|
williamr@2
|
216 |
// Socket option structure for KSoIfHardwareAddr
|
williamr@2
|
217 |
/**
|
williamr@2
|
218 |
* An interface's local hardware address.
|
williamr@2
|
219 |
*
|
williamr@2
|
220 |
* This is obtained using KSoIfHardwareAddr.
|
williamr@2
|
221 |
*
|
williamr@2
|
222 |
* @internalComponent
|
williamr@2
|
223 |
*/
|
williamr@2
|
224 |
{
|
williamr@2
|
225 |
public:
|
williamr@2
|
226 |
/** Local hardware address. */
|
williamr@2
|
227 |
TSockAddr iHardwareAddr;
|
williamr@2
|
228 |
};
|
williamr@2
|
229 |
|
williamr@2
|
230 |
class TSoIfConfigBase
|
williamr@2
|
231 |
/**
|
williamr@2
|
232 |
* Base class for TSoInetIfConfig, which simply identifies the protocol family
|
williamr@2
|
233 |
* using the interface.
|
williamr@2
|
234 |
*
|
williamr@2
|
235 |
* @internalComponent
|
williamr@2
|
236 |
*/
|
williamr@2
|
237 |
{
|
williamr@2
|
238 |
public:
|
williamr@2
|
239 |
/** The protocol family, e.g. KAfInet. */
|
williamr@2
|
240 |
TUint iFamily;
|
williamr@2
|
241 |
};
|
williamr@2
|
242 |
|
williamr@2
|
243 |
class TSoInetIfConfig : public TSoIfConfigBase
|
williamr@2
|
244 |
/**
|
williamr@2
|
245 |
* Describes the current interface routing configuration.
|
williamr@2
|
246 |
*
|
williamr@2
|
247 |
* It is returned by RSocket::GetOpt(), when this function is called with anOptionLevel
|
williamr@2
|
248 |
* set to KSOLInterface and anOptionName set to KSoIfConfig.
|
williamr@2
|
249 |
*
|
williamr@2
|
250 |
* @internalTechnology
|
williamr@2
|
251 |
*/
|
williamr@2
|
252 |
{
|
williamr@2
|
253 |
public:
|
williamr@2
|
254 |
/** Current interface routing configuration parameters. */
|
williamr@2
|
255 |
TInetIfConfig iConfig;
|
williamr@2
|
256 |
};
|
williamr@2
|
257 |
|
williamr@2
|
258 |
enum TIfProgressNotification
|
williamr@2
|
259 |
/**
|
williamr@2
|
260 |
* @internalAll
|
williamr@2
|
261 |
*
|
williamr@2
|
262 |
* @deprecated v7.0s - maintained for compatibility with v6.1
|
williamr@2
|
263 |
*
|
williamr@2
|
264 |
* New software should use the progress ranges defined in nifvar.h
|
williamr@2
|
265 |
*
|
williamr@2
|
266 |
*/
|
williamr@2
|
267 |
{
|
williamr@2
|
268 |
EIfProgressLinkUp = KMinInterfaceProgress,
|
williamr@2
|
269 |
EIfProgressLinkDown,
|
williamr@2
|
270 |
EIfProgressAuthenticationComplete
|
williamr@2
|
271 |
};
|
williamr@2
|
272 |
|
williamr@2
|
273 |
/**
|
williamr@2
|
274 |
@internalAll
|
williamr@2
|
275 |
*/
|
williamr@2
|
276 |
const TInt KErrIfAuthenticationFailure = -3050;
|
williamr@2
|
277 |
|
williamr@2
|
278 |
/**
|
williamr@2
|
279 |
@internalComponent
|
williamr@2
|
280 |
*/
|
williamr@2
|
281 |
const TInt KErrIfAuthNotSecure = -3051;
|
williamr@2
|
282 |
|
williamr@2
|
283 |
/**
|
williamr@2
|
284 |
@internalComponent
|
williamr@2
|
285 |
*/
|
williamr@2
|
286 |
const TInt KErrIfAccountDisabled = -3052;
|
williamr@2
|
287 |
|
williamr@2
|
288 |
/**
|
williamr@2
|
289 |
@internalComponent
|
williamr@2
|
290 |
*/
|
williamr@2
|
291 |
const TInt KErrIfRestrictedLogonHours = -3053;
|
williamr@2
|
292 |
|
williamr@2
|
293 |
/**
|
williamr@2
|
294 |
@internalComponent
|
williamr@2
|
295 |
*/
|
williamr@2
|
296 |
const TInt KErrIfPasswdExpired = -3054;
|
williamr@2
|
297 |
|
williamr@2
|
298 |
/**
|
williamr@2
|
299 |
@internalComponent
|
williamr@2
|
300 |
*/
|
williamr@2
|
301 |
const TInt KErrIfNoDialInPermission = -3055;
|
williamr@2
|
302 |
|
williamr@2
|
303 |
/**
|
williamr@2
|
304 |
@internalComponent
|
williamr@2
|
305 |
*/
|
williamr@2
|
306 |
const TInt KErrIfChangingPassword = -3056;
|
williamr@2
|
307 |
|
williamr@2
|
308 |
/**
|
williamr@2
|
309 |
@internalComponent
|
williamr@2
|
310 |
*/
|
williamr@2
|
311 |
const TInt KErrIfCallbackNotAcceptable = -3057;
|
williamr@2
|
312 |
|
williamr@2
|
313 |
/**
|
williamr@2
|
314 |
@internalComponent
|
williamr@2
|
315 |
*/
|
williamr@2
|
316 |
const TInt KErrIfDNSNotFound = -3058;
|
williamr@2
|
317 |
|
williamr@2
|
318 |
/**
|
williamr@2
|
319 |
@internalComponent
|
williamr@2
|
320 |
*/
|
williamr@2
|
321 |
const TInt KErrIfLRDBadLine = -3059;
|
williamr@2
|
322 |
|
williamr@2
|
323 |
#endif // __IN_IFACE_H__
|