2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
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
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
26 #if !defined(__IN_IFACE_H__)
27 #define __IN_IFACE_H__
29 #if !defined(__IN_SOCK_H__)
33 #if !defined(__NIFVAR_H__)
40 Is a loopback interface
43 const TUint KIfIsLoopback = 0x00000001;
46 Is single point to point
49 const TUint KIfIsPointToPoint = 0x00000002;
55 const TUint KIfCanBroadcast = 0x00000004;
61 const TUint KIfCanMulticast = 0x00000008;
67 const TUint KIfCanSetMTU = 0x00000010;
70 Has a hardware address (ie needs ARP)
73 const TUint KIfHasHardwareAddr = 0x00000020;
76 Can have its hardware address changed
79 const TUint KIfCanSetHardwareAddr = 0x00000040;
85 const TUint KIfIsDialup = 0x00000080;
87 // Control options level received by network interfaces
89 * Option level for network interface driver options.
92 const TUint KSOLInterface = 0x203;
96 * The current network interface driver operation parameters are written to the
97 * passed TSoIfInfo structure.
99 * An interface that supports only this is assumed IPv4 only.
101 * anOption should be a TPckgBuf<TSoIfInfo>.
103 * @internalTechnology
105 const TUint KSoIfInfo = 0x101; // Get Interface Information
108 * Gets the interface's local hardware address, if the link layer is using addresses.
110 * anOption should be a TPckgBuf<TSoIfInfo>.
112 * The option is not supported until v7.0.
114 * @internalTechnology
116 const TUint KSoIfHardwareAddr = 0x102; // Get Hardware Address
119 * Gets the current network interface driver configuration options.
121 * There may be three kind of interfaces: IPv4 only, IPv6 only and hybrid IPv4/IPv6.
122 * The last one is passing traffic for both protocols and thus accepts either
123 * family in a single KSoIfConfig call. Hybrid interfaces must be queried twice,
124 * once for IPv4 and once for IPv6, to get both the IPv4 and the IPv6 settings.
126 * For IPv4, anOption should be a TPckgBuf<TSoInetIfConfig>, for IPv6 TPckgBuf<TSoInet6IfConfig>.
128 * The iFamily field in either TSoInetIfConfig or TSoInet6IfConfig must be set
129 * to either KAfInet for IPv4 or KAfInet6 for IPv6) before the call. If the family
130 * is not supported by the interface, it returns KErrNotSupported.
132 * @internalTechnology
134 const TUint KSoIfConfig = 0x103; // Get Network parameters
137 * For the IPv4 only stack, compares the passed address with the current local
138 * address, and returns KErrBadName if not equal.
140 * anOption should be a TPckgBuf< TInetAddr >.
142 * This is not used for the IPv4/v6 stack.
144 * @internalTechnology
146 const TUint KSoIfCompareAddr = 0x104; // Compare address with one passed in
148 /** Retrieve IAP and NID information
150 * @internalTechnology
152 const TUint KSoIfGetConnectionInfo = 0xf001; // Retrieve IAP and NID information
157 const TUint KMaxInterfaceName=32;
160 * Holds the name of a network interface.
162 * This is used in TSoIfInfo.
164 * @internalTechnology
166 typedef TBuf<KMaxInterfaceName> TInterfaceName;
169 // Information which allows IP to enter route table entries
171 * Describes the IP routing options for a network interface.
173 * It is used in TSoInetIfConfig.
179 /** Interface IP address. */
183 /** IP broadcast address. */
185 /** IP default gateway or peer address (if known). */
187 /** IP primary name server (if any). */
189 /** IP secondary name server (if any). */
194 // Socket option structure for KSoIfInfo
196 * Current network interface operation parameters.
198 * It is returned by RSocket::GetOpt(), when that function is called with anOptionLevel
199 * set to KSOLInterface and anOptionName set to KSoIfInfo.
201 * @internalTechnology
205 /** Feature flags. Possible values are defined in in_iface.h. */
206 TUint iFeatures; // Feature flags
207 /** Maximum transmission unit. */
208 TInt iMtu; // Max frame size
209 /** An approximation of the interface speed in Kbps. */
210 TInt iSpeedMetric; // Indication of performance, approx to Kbps
211 /** Interface protocol name, ipcp::\<port\>. */
212 TInterfaceName iName;
215 class TSoIfHardwareAddr
216 // Socket option structure for KSoIfHardwareAddr
218 * An interface's local hardware address.
220 * This is obtained using KSoIfHardwareAddr.
226 /** Local hardware address. */
227 TSockAddr iHardwareAddr;
230 class TSoIfConfigBase
232 * Base class for TSoInetIfConfig, which simply identifies the protocol family
233 * using the interface.
239 /** The protocol family, e.g. KAfInet. */
243 class TSoInetIfConfig : public TSoIfConfigBase
245 * Describes the current interface routing configuration.
247 * It is returned by RSocket::GetOpt(), when this function is called with anOptionLevel
248 * set to KSOLInterface and anOptionName set to KSoIfConfig.
250 * @internalTechnology
254 /** Current interface routing configuration parameters. */
255 TInetIfConfig iConfig;
258 enum TIfProgressNotification
262 * @deprecated v7.0s - maintained for compatibility with v6.1
264 * New software should use the progress ranges defined in nifvar.h
268 EIfProgressLinkUp = KMinInterfaceProgress,
270 EIfProgressAuthenticationComplete
276 const TInt KErrIfAuthenticationFailure = -3050;
281 const TInt KErrIfAuthNotSecure = -3051;
286 const TInt KErrIfAccountDisabled = -3052;
291 const TInt KErrIfRestrictedLogonHours = -3053;
296 const TInt KErrIfPasswdExpired = -3054;
301 const TInt KErrIfNoDialInPermission = -3055;
306 const TInt KErrIfChangingPassword = -3056;
311 const TInt KErrIfCallbackNotAcceptable = -3057;
316 const TInt KErrIfDNSNotFound = -3058;
321 const TInt KErrIfLRDBadLine = -3059;
323 #endif // __IN_IFACE_H__