TCP/IP Socket Options

The following TCP/IP specific options are defined:

level=IPPROTO_IP

Value Type Meaning
IP_OPTIONS char FAR * List of IP options to be inserted into outgoing packets.
IP_TOS int Specifies type of service to be used
IP_TTL int Specify TTL to be used
IP_HDRINCL BOOL If true, application will provide IP header in the packets sent over SOCK_RAW interface, otherwise the header is provided by the service provider.
IP_MULTICAST_IF struct in_addr FAR * Select interface for 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 - disabled.
IP_ADD_MEMBERSHIP struct ip_mreq FAR * Specify the multicast group to join
IP_DROP_MEMBERSHIP struct ip_mreq FAR * Specify the multicast group to leave

level= IPPROTO_UDP

Value Type Meaning
UDP_NOCHECKSUM BOOL If the 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 just store this option without doing any actions.

level= IPPROTO_TCP

Value Type Meaning
TCP_EXPEDITED_1122 BOOL If set, the Service Provider 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, i.e. 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 the previously specified options. The support of IP_OPTIONS is not required. In order to check if IP_OPTIONS is supported or not, an application should use getsockopt trying 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 IP header in outgoing datagrams. The support of IP_TOS is not required. In order to check if IP_TOS is supported or not, an application should use getsockopt trying to get the current options. If getsockopt fails, the IP_TOS is not supported.
IP_TTL
Change the default value set by the TCP/IP service provider in the TTL field of IP header in outgoing datagrams. The support of IP_TTL is not required. In order to check if IP_TTL is supported or not, an application should use getsockopt trying 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 outcoming datagrams. Some applications, however, may wish to provide their own IP header. Such applications should set IP_HDRINCL option into true and then supply a completed IP header at the front of each outgoing datagram. The only modification TCP/IP service provider may do 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