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