Platform SDK: Windows Sockets

TCP/IP Socket Options

The following TCP/IP-specific options are defined.

Value Meaning
SIO_GET_INTERFACE_LIST Returns a list of all IP interfaces on the system.

level=IPPROTO_IP

Value Type Meaning
IP_OPTIONS char FAR * Lists IP options to be inserted into the outgoing packets.
IP_TOS int Specifies the type of service to be used. See following for more information about setting TOS.
IP_TTL int Specifies the TTL to be used.
IP_HDRINCL BOOL If TRUE, the application provides the IP header in the packets sent over SOCK_RAW interface. Otherwise, the header is provided by the service provider.
IP_MULTICAST_IF IN_ADDR FAR *structure Selects the interface for the outgoing multicast packets. The optval should point to the address of the interface to be used. If NULL, the default interface is used.
IP_MULTICAST_TTL int TTL used for the multicast packets.
IP_MULTICAST_LOOP BOOL If TRUE, multicast loopback is enabled. Otherwise, it is disabled.
IP_ADD_MEMBERSHIP IP_MREQ FAR * structure Specifies the multicast group to join.
IP_DROP_MEMBERSHIP IP_MREQ FAR * structure Specifies the multicast group to leave.

level= IPPROTO_UDP

Value Type Meaning
UDP_NOCHECKSUM BOOL If this option is set, UDP datagrams are sent with the checksum of zero. This option is required. If a service provider does not have a mechanism to disable UDP checksum calculation, it may simply store this option without taking any action.

level= IPPROTO_TCP

Value Type Meaning
TCP_EXPEDITED_1122 BOOL If set, the SP implements the expedited data as specified in RFC-1222. Otherwise, the BSD style (default) is used. This option can be set on the connection only once, that is, once on, this option can not be turned off. This option is not required.

IP_OPTIONS
Specifies IP options to be inserted into outgoing datagrams. Setting the new options overwrites all the previously specified options. Setting optval to zero means removing all previously specified options. The support of IP_OPTIONS is not required. In order to check whether IP_OPTIONS is supported, an application should use getsockopt to attempt to get the current options. If getsockopt fails, the IP_OPTIONS is not supported.
IP_TOS
Changes the default value set by the TCP/IP service provider in the TOS field of the IP header in outgoing datagrams. The support of IP_TOS is not required. To check whether IP_TOS is supported, an application should use getsockopt to attempt to get the current options. If getsockopt fails, the IP_TOS is not supported.

There are two important points to keep in mind regarding TOS:

It is important to note that when QOS is enabled on a Windows 2000 computer, all TOS settings are overridden by settings implemented or set using the traffic control API (TC API) or the QOS API.

IP_TTL
Changes the default value set by the TCP/IP service provider in the TTL field of the IP header in outgoing datagrams. The support of IP_TTL is not required. In order to check if IP_TTL is supported, an application should use getsockopt to attempt to get the current options. If getsockopt fails, the IP_TTL is not supported.
IP_HDRINCL
By default TCP/IP service provider forms the IP header for the outgoing datagrams. Some applications, however, may wish to provide their own IP header. Such applications should set IP_HDRINCL option to TRUE and then supply a completed IP header at the front of each outgoing datagram. The only modification TCP/IP service provider may make to the supplied IP header is setting the ID field, if the value supplied by the application is 0. The IP_HDRINCL option is applied only to the SOCK_RAW type of protocol. If a TCP/IP service provider supports SOCK_RAW protocol, it should also support IP_HDRINCL option.
IP_MULTICAST_IF
Information supplied at a later release.
IP_MULTICAST_TTL
Information supplied at a later release.
IP_MULTICAST_LOOP
Information supplied at a later release.
IP_ADD_MEMBERSHIP
Information supplied at a later release.
IP_DROP_MEMBERSHIP
Support of these options is required if a protocol supports multicast. This will be indicated in the WSAPROTOCOL_INFO structure returned by WSAEnumProtocols as follows:

XPI_SUPPORTS_MULTIPOINT = 1
XP1_MULTIPOINT_CONTROL_PLANE = 0
XP1_MULTIPOINT_DATA_PLANE = 0