epoc32/include/in6_opt.h
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     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
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     7 //
     8 // Initial Contributors:
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
    47 @li 2 = ECN enabled with ECT(0) (recommended over ECT(1), because some implementations may
    47 @li 2 = ECN enabled with ECT(0) (recommended over ECT(1), because some implementations may
    48 not implement ECT(1))
    48 not implement ECT(1))
    49 
    49 
    50 See RFC 3168 for more information.
    50 See RFC 3168 for more information.
    51 @publishedAll
    51 @publishedAll
    52 @interim
    52 @released
    53 */
    53 */
    54 const TUint KSoIpEcn = 0x1010;
    54 const TUint KSoIpEcn = 0x1010;
    55 
    55 
    56 /**
    56 /**
    57 Next hop route selection.
    57 Next hop route selection.
    82 // -- Socket option level: KSolInetTcp --
    82 // -- Socket option level: KSolInetTcp --
    83 /**
    83 /**
    84 If set, only full-sized TCP segments are sent before closing the connection. This is like
    84 If set, only full-sized TCP segments are sent before closing the connection. This is like
    85 Nagle, but stricter.
    85 Nagle, but stricter.
    86 @publishedAll
    86 @publishedAll
    87 @interim
    87 @released
    88 */
    88 */
    89 const TUint KSoTcpCork = 0x1020;
    89 const TUint KSoTcpCork = 0x1020;
    90 
    90 
    91 /**
    91 /**
    92 Send only full-sized TCP segments. Separate option in addition to KSoTcpCork is needed for
    92 Send only full-sized TCP segments. Separate option in addition to KSoTcpCork is needed for
    93 BSD compatibility.
    93 BSD compatibility.
    94 @publishedAll
    94 @publishedAll
    95 @interim
    95 @released
    96 */
    96 */
    97 const TUint KSoTcpNoPush = 0x1021;
    97 const TUint KSoTcpNoPush = 0x1021;
    98 
    98 
    99 /**
    99 /**
   100 Do not return from close immediately, but linger for given maximum time to wait that the
   100 Do not return from close immediately, but linger for given maximum time to wait that the
   101 send buffers are emptied. Socket option parameter is TSoTcpLingerOpt struct.
   101 send buffers are emptied. Socket option parameter is TSoTcpLingerOpt struct.
   102 @publishedAll
   102 @publishedAll
   103 @interim
   103 @released
   104 */
   104 */
   105 const TUint KSoTcpLinger = 0x1022;
   105 const TUint KSoTcpLinger = 0x1022;
   106 
   106 
   107 
   107 
   108 /**
   108 /**
   120 		connection as usual.
   120 		connection as usual.
   121 		
   121 		
   122 A similar structure is used in BSD Unix sockets, hence porting Unix apps using linger option
   122 A similar structure is used in BSD Unix sockets, hence porting Unix apps using linger option
   123 should be straight forward.
   123 should be straight forward.
   124 @publishedAll
   124 @publishedAll
   125 @interim
   125 @released
   126 */
   126 */
   127 class TSoTcpLingerOpt
   127 class TSoTcpLingerOpt
   128 	{
   128 	{
   129 public:
   129 public:
   130 	TInt	iOnOff;		///< 0=Linger off; nonzero=Linger on.
   130 	TInt	iOnOff;		//< 0=Linger off; nonzero=Linger on.
   131 	TInt	iLinger;	///< Linger time in seconds.
   131 	TInt	iLinger;	//< Linger time in seconds.
   132 	};
   132 	};
   133 	
   133 	
   134 
   134 
   135 // -- Socket option level: KSolInetIfQuery --
   135 // -- Socket option level: KSolInetIfQuery --
   136 
   136 
   139 // There are no incoming parameters for these queries
   139 // There are no incoming parameters for these queries
   140 
   140 
   141 /**
   141 /**
   142 Return array of TInetInterfaceInfo objects as the response of GetOptions call.
   142 Return array of TInetInterfaceInfo objects as the response of GetOptions call.
   143 @publishedAll
   143 @publishedAll
   144 @interim
   144 @released
   145 */
   145 */
   146 const TUint KSoInetInterfaceInfo = 0x1001;
   146 const TUint KSoInetInterfaceInfo = 0x1001;
   147 
   147 
   148 /**
   148 /**
   149 Return array of TInetAddressInfo objects as the response of GetOptions call.
   149 Return array of TInetAddressInfo objects as the response of GetOptions call.
   150 @publishedAll
   150 @publishedAll
   151 @interim
   151 @released
   152 */
   152 */
   153 const TUint KSoInetAddressInfo = 0x1002;
   153 const TUint KSoInetAddressInfo = 0x1002;
   154 
   154 
   155 /**
   155 /**
   156 Return array of TInetRouteInfo objects as the response of GetOptions call.
   156 Return array of TInetRouteInfo objects as the response of GetOptions call.
   157 @publishedAll
   157 @publishedAll
   158 @interim
   158 @released
   159 */
   159 */
   160 const TUint KSoInetRouteInfo = 0x1003;
   160 const TUint KSoInetRouteInfo = 0x1003;
   161 
   161 
   162 /**
   162 /**
   163 Information of an address attached to interface.
   163 Information of an address attached to interface.
   164 Used by the event service (EClassAddress events) and KSoInetAddressInfo socket option.
   164 Used by the event service (EClassAddress events) and KSoInetAddressInfo socket option.
   165 @publishedAll
   165 @publishedAll
   166 @interim
   166 @released
   167 */
   167 */
   168 class TInetAddressInfo
   168 class TInetAddressInfo
   169 	{
   169 	{
   170 public:
   170 public:
   171 	TUint32	    iInterface;	    ///< Network interface index to which this address is bound.
   171 	TUint32	    iInterface;	    //< Network interface index to which this address is bound.
   172 	TIp6Addr    iAddress;	    ///< Prefix or Id part of the address described.
   172 	TIp6Addr    iAddress;	    //< Prefix or Id part of the address described.
   173 	TUint8	    iPrefixLen;	    ///< Length of the prefix part in bits.
   173 	TUint8	    iPrefixLen;	    //< Length of the prefix part in bits.
   174 	TUint32	    iScopeId;	    ///< ScopeId of this address.
   174 	TUint32	    iScopeId;	    //< ScopeId of this address.
   175 	TUint32	    iPrefLifetime;  ///< Remaining Preferred lifetime of this address.
   175 	TUint32	    iPrefLifetime;  //< Remaining Preferred lifetime of this address.
   176 	TUint32	    iValidLifetime; ///< Remaining Valid lifetime of this address.
   176 	TUint32	    iValidLifetime; //< Remaining Valid lifetime of this address.
   177 	TUint	    iFlags;	    ///< Is address entry for prefix or id, etc. See enum TFlags
   177 	TUint	    iFlags;	    //< Is address entry for prefix or id, etc. See enum TFlags
   178 	TUint	    iState;	    ///< Address state, copied from TIp6AddressInfo, see enum TAddressState
   178 	TUint	    iState;	    //< Address state, copied from TIp6AddressInfo, see enum TAddressState
   179 	TUint	    iType;	    ///< Address type copied from TIp6AddressInfo, see enum TAddressType
   179 	TUint	    iType;	    //< Address type copied from TIp6AddressInfo, see enum TAddressType
   180 	TUint	    iGenerations;   ///< Number of times the address Id is generated (or randomly re-generated)
   180 	TUint	    iGenerations;   //< Number of times the address Id is generated (or randomly re-generated)
   181 	TUint	    iNS;	    ///< Number of neighbour solicitations sent for DAD.
   181 	TUint	    iNS;	    //< Number of neighbour solicitations sent for DAD.
   182 
   182 
   183 	/// Values used in iFlags field.
   183 	// Values used in iFlags field.
   184 	enum TFlags
   184 	enum TFlags
   185 		{
   185 		{
   186 	    EF_Prefix = 0x1,	///< This address entry specifies prefix
   186 	    EF_Prefix = 0x1,	//< This address entry specifies prefix
   187 	    EF_Id = 0x2,    	///< This address entry specifies id part of the address
   187 	    EF_Id = 0x2,    	//< This address entry specifies id part of the address
   188 	    EF_Deprecated = 0x4 ///< Address is deprecated
   188 	    EF_Deprecated = 0x4 //< Address is deprecated
   189 		};
   189 		};
   190 
   190 
   191 	/// Values used in iState field. The field is directly copied from iface.cpp.
   191 	// Values used in iState field. The field is directly copied from iface.cpp.
   192 	enum TAddressState
   192 	enum TAddressState
   193 		{
   193 		{
   194 	    ENoAddress	= 0,	///< 0 0 - unassigned initial state (no address present)
   194 	    ENoAddress	= 0,	//< 0 0 - unassigned initial state (no address present)
   195 	    EDuplicate	= 1,	///< 0 1 - address is duplicate
   195 	    EDuplicate	= 1,	//< 0 1 - address is duplicate
   196 	    EAssigned	= 2,	///< 1 0 - address fully available
   196 	    EAssigned	= 2,	//< 1 0 - address fully available
   197 	    ETentative	= 3	///< 1 1 - address is tentative (DAD in progress)
   197 	    ETentative	= 3	//< 1 1 - address is tentative (DAD in progress)
   198 		};
   198 		};
   199 
   199 
   200 	/// Values used in iType field. The field is directly copied from iface.cpp.
   200 	// Values used in iType field. The field is directly copied from iface.cpp.
   201 	enum TAddressType
   201 	enum TAddressType
   202 		{
   202 		{
   203 	    EProxy	= 2,	///< Do DAD, is not for me (forward)
   203 	    EProxy	= 2,	//< Do DAD, is not for me (forward)
   204 	    EAnycast	= 1,	///< Don't do DAD, is for me address
   204 	    EAnycast	= 1,	//< Don't do DAD, is for me address
   205 	    ENormal	= 0	///< Do DAD, is for me
   205 	    ENormal	= 0	//< Do DAD, is for me
   206 		};
   206 		};
   207 	};
   207 	};
   208 
   208 
   209 
   209 
   210 /**
   210 /**
   211 Information of a network interface.
   211 Information of a network interface.
   212 Used by event service (EClassInterface events) and KSoInetInterfaceInfo socket option.
   212 Used by event service (EClassInterface events) and KSoInetInterfaceInfo socket option.
   213 @publishedAll
   213 @publishedAll
   214 @interim
   214 @released
   215 */
   215 */
   216 class TInetInterfaceInfo
   216 class TInetInterfaceInfo
   217 	{
   217 	{
   218 public:
   218 public:
   219 	TUint32	    iIndex;
   219 	TUint32	    iIndex;
   220 	TName	    iName;		///< Interface name
   220 	TName	    iName;		//< Interface name
   221 	TInt	    iState;		///< State
   221 	TInt	    iState;		//< State
   222 	TInt	    iSMtu;		///< Maximum transmit unit size
   222 	TInt	    iSMtu;		//< Maximum transmit unit size
   223 	TInt	    iRMtu;		///< Maximum receive unit size
   223 	TInt	    iRMtu;		//< Maximum receive unit size
   224 	TInt	    iSpeedMetric;	///< Metric - bigger is better
   224 	TInt	    iSpeedMetric;	//< Metric - bigger is better
   225 	TUint	    iFeatures;		///< Feature flags
   225 	TUint	    iFeatures;		//< Feature flags
   226 	TSockAddr   iHwAddr;		///< Hardware address
   226 	TSockAddr   iHwAddr;		//< Hardware address
   227 
   227 
   228 	/// Possible interface states.
   228 	// Possible interface states.
   229 	/// Can also have negative values when on error state.
   229 	// Can also have negative values when on error state.
   230 	enum
   230 	enum
   231 		{
   231 		{
   232 	    IfState_READY   = 0,  ///< Ready to receive data from protocol
   232 	    IfState_READY   = 0,  //< Ready to receive data from protocol
   233 	    IfState_PENDING = 1,  ///< Not ready for data yet
   233 	    IfState_PENDING = 1,  //< Not ready for data yet
   234 	    IfState_HOLD    = 2
   234 	    IfState_HOLD    = 2
   235 		};
   235 		};
   236 	};
   236 	};
   237 
   237 
   238 
   238 
   239 /**
   239 /**
   240 Information of a route entry in IP stack.
   240 Information of a route entry in IP stack.
   241 Used by event service (EClassRoute events) and KSoInetRouteInfo socket option.
   241 Used by event service (EClassRoute events) and KSoInetRouteInfo socket option.
   242 @publishedAll
   242 @publishedAll
   243 @interim
   243 @released
   244 */
   244 */
   245 class TInetRouteInfo
   245 class TInetRouteInfo
   246 	{
   246 	{
   247 public:
   247 public:
   248 	TUint32	    iIndex;	///< Route index
   248 	TUint32	    iIndex;	//< Route index
   249 	TUint	    iType;	///< Type of route (kernel generated have 0 at the present)
   249 	TUint	    iType;	//< Type of route (kernel generated have 0 at the present)
   250 	TUint	    iState;	///< State of route (copied from iState in CIp6Route)
   250 	TUint	    iState;	//< State of route (copied from iState in CIp6Route)
   251 	TInt	    iMetric;	///< Smaller is better (less hops and/or faster link)
   251 	TInt	    iMetric;	//< Smaller is better (less hops and/or faster link)
   252 	TUint32	    iInterface; ///< Network interface index of the route
   252 	TUint32	    iInterface; //< Network interface index of the route
   253 	TIp6Addr    iGateway;	///< IP address of gateway (might be the interface)
   253 	TIp6Addr    iGateway;	//< IP address of gateway (might be the interface)
   254 	TIp6Addr    iDstAddr;	///< Destination network or host
   254 	TIp6Addr    iDstAddr;	//< Destination network or host
   255 	TUint8	    iPrefixLen;	///< Length of the route prefix in bits
   255 	TUint8	    iPrefixLen;	//< Length of the route prefix in bits
   256 	TUint32	    iScopeId;	///< Scope Id of this route
   256 	TUint32	    iScopeId;	//< Scope Id of this route
   257 	TUint32	    iLifetime;  ///< Route lifetime in seconds
   257 	TUint32	    iLifetime;  //< Route lifetime in seconds
   258 
   258 
   259 	enum
   259 	enum
   260 		{ 
   260 		{ 
   261 		EDeprecated = 0x80000000	///< This bit is set in iType if the route is deprecated
   261 		EDeprecated = 0x80000000	//< This bit is set in iType if the route is deprecated
   262 		};
   262 		};
   263 
   263 
   264 	/// Values used in iState field
   264 	// Values used in iState field
   265 	enum TState
   265 	enum TState
   266 	  	{
   266 	  	{
   267 	    EIncomplete = 0,
   267 	    EIncomplete = 0,
   268 	    ELoopback = 1,
   268 	    ELoopback = 1,
   269 	    EOnlink = 2,
   269 	    EOnlink = 2,
   277 	
   277 	
   278 
   278 
   279 /**
   279 /**
   280 Information on a neighbour cache entry in the IP stack.
   280 Information on a neighbour cache entry in the IP stack.
   281 Used by event service (EClassNeighbour events).
   281 Used by event service (EClassNeighbour events).
       
   282 @publishedAll
   282 @released
   283 @released
   283 */
   284 */
   284 class TInetNeighbourInfo
   285 class TInetNeighbourInfo
   285 	{
   286 	{
   286 public:
   287 public:
   287 	TUint32	    iIndex;		///< Route index.
   288 	TUint32	    iIndex;		//< Route index.
   288 	TIp6Addr    iDstAddr;	///< Neighbour's IP address.
   289 	TIp6Addr    iDstAddr;	//< Neighbour's IP address.
   289 	TUint	    iState;		///< State of neigbour entry. @see TInetRouteInfo::TState.
   290 	TUint	    iState;		//< State of neigbour entry. @see TInetRouteInfo::TState.
   290 	TInt	    iMetric;	///< Smaller is better (less hops and/or faster link).
   291 	TInt	    iMetric;	//< Smaller is better (less hops and/or faster link).
   291 	TUint32	    iInterface; ///< Network interface index of the route.
   292 	TUint32	    iInterface; //< Network interface index of the route.
   292 	TUint32	    iScopeId;	///< Scope Id of this neighbour.
   293 	TUint32	    iScopeId;	//< Scope Id of this neighbour.
   293 	TUint32	    iLifetime;  ///< Cache entry lifetime in seconds.
   294 	TUint32	    iLifetime;  //< Cache entry lifetime in seconds.
   294 
   295 
   295 	/// Hardware address (e.g. Ethernet MAC).
   296 	// Hardware address (e.g. Ethernet MAC).
   296 	TBuf8<KMaxSockAddrSize>	iHwAddr;
   297 	TBuf8<KMaxSockAddrSize>	iHwAddr;
   297 	};
   298 	};
   298 
   299 
   299 
   300 
   300 /**
   301 /**
   301 For building an array on top of TDes8. This is like casting a TDes8 data pointer to an array, but
   302 For building an array on top of TDes8. This is like casting a TDes8 data pointer to an array, but
   302 it provides protection against array boundary violations, and some small helpful utilities.
   303 it provides protection against array boundary violations, and some small helpful utilities.
   303 The motivation of this class is to help in handling the information accessed by MNetworkInfo
   304 The motivation of this class is to help in handling the information accessed by MNetworkInfo
   304 interface.
   305 interface.
   305 @publishedAll
   306 @publishedAll
   306 @interim
   307 @released
   307 */
   308 */
   308 template<class T> class TOverlayArray
   309 template<class T> class TOverlayArray
   309 	{
   310 	{
   310 public:
   311 public:
   311 	inline TOverlayArray(TDes8& aDes) : iDes(aDes)
   312 	inline TOverlayArray(TDes8& aDes) : iDes(aDes)
   353 
   354 
   354 /**
   355 /**
   355 Information of a multicast group joined by the IP stack. This class is not currently
   356 Information of a multicast group joined by the IP stack. This class is not currently
   356 used by socket options, only EClassMulticast events.
   357 used by socket options, only EClassMulticast events.
   357 @publishedAll
   358 @publishedAll
   358 @interim
   359 @released
   359 */
   360 */
   360 class TInetMulticastInfo
   361 class TInetMulticastInfo
   361 	{
   362 	{
   362 public:
   363 public:
   363 	TIp6Addr	iMulticastGroup;	///< IP address of the multicast group.
   364 	TIp6Addr	iMulticastGroup;	//< IP address of the multicast group.
   364 	TUint32		iInterface;		///< Interface index of the group.
   365 	TUint32		iInterface;		//< Interface index of the group.
   365 	TUint32		iLifetime;		///< Lifetime of the group in seconds.
   366 	TUint32		iLifetime;		//< Lifetime of the group in seconds.
   366 	};
   367 	};
   367 
   368 
   368 
   369 
   369 // -- Socket option level: KSolInetIfCtrl --
   370 // -- Socket option level: KSolInetIfCtrl --
   370 
   371 
   371 /**
   372 /**
   372 Control the use of link-local addresses per interface.
   373 Control the use of link-local addresses per interface.
   373 Argument: TSoInetIpv4LinkLocalInfo  (SetOpt only).
   374 Argument: TSoInetIpv4LinkLocalInfo  (SetOpt only).
   374 @publishedAll
   375 @publishedAll
   375 @interim
   376 @released
   376 
   377 
   377 @capability ECapabilityNetworkControl Configuring IPv4 Link-local addresses is restricted.
   378 @capability ECapabilityNetworkControl Configuring IPv4 Link-local addresses is restricted.
   378 @ref RSocket::SetOpt()
   379 @ref RSocket::SetOpt()
   379 */
   380 */
   380 const TUint KSoIpv4LinkLocal = 0x1001;
   381 const TUint KSoIpv4LinkLocal = 0x1001;
   381 
   382 
   382 /**
   383 /**
   383 Used as a parameter in KSoIpv4LinkLocal.
   384 Used as a parameter in KSoIpv4LinkLocal.
   384 @publishedAll
   385 @publishedAll
   385 @interim
   386 @released
   386 */
   387 */
   387 class TSoInetIpv4LinkLocalInfo
   388 class TSoInetIpv4LinkLocalInfo
   388 	{
   389 	{
   389 public:
   390 public:
   390 	TUint	iInterface;		///< Interface index to be affected.
   391 	TUint	iInterface;		//< Interface index to be affected.
   391 	TUint	iFlag;			///< Indicates whether IPv4 link locals are used  (0='no'; 1='yes').
   392 	TUint	iFlag;			//< Indicates whether IPv4 link locals are used  (0='no'; 1='yes').
   392 	};
   393 	};
   393 
   394 
   394 #endif  // __INSOCK_IN6_ROUTE_H__
   395 #endif  // __INSOCK_IN6_ROUTE_H__