Options are formatted according to the t_opthdr structure as described in "Use of Options for the X/Open Transport Interface". A transport provider compliant to this specification supports none, all, or any subset of the options defined in the following sections: "TCP/IP-Level Options" to "IP-level Options". An implementation may restrict the use of any of these options by offering them only in the privileged or read-only mode.
The protocol level is INET_TCP. For this level, the following table shows the options that are defined.
TCP-Level Options | |||
Option Name | Type of Option Value | Legal Option Value | Meaning |
TCP_KEEPALIVE | struct t_kpalive | see text following table | check if connections are live |
TCP_MAXSEG | unsigned long | length in octets | get TCP maximum segment size |
TCP_NODELAY | unsigned long | T_YES T_NO | don't delay send to coalesce packets |
These options are not association-related. The options may be negotiated in all X/Open Transport Interface states except T_UNBIND and T_UNINIT. The options are read-only in the T_UNBIND state. See "The Use of Options for the X/Open Transport Interface" for the differences between association-related options and those options that are not.
A request for TCP_NODELAY and a request to activate TCP_KEEPALIVE is an absolute requirement. TCP_MAXSEG is a read-only option.
The protocol level is INET_UDP. The option defined for this level is shown in the following table.
UDP-Level Options | |||
Option Name | Type of Option Value | Legal Option Value | Meaning |
UDP_CHECKSUM | unsigned long | T_YES/T_NO | checksum computation |
UDP_CHECKSUM | Allows disabling and enabling of the UDP checksum computation. The
legal values are:
This option is association-related. It may be negotiated in all XTI states except T_UNBIND and T_UNINIT. It is read-only in state T_UNBND. If this option is returned with the t_rcvudata subroutine, its value indicates whether a checksum was present in the received datagram or not. Numerous cases of undetected errors have been reported when applications chose to turn off checksums for efficiency. The advisability of ever turning off the checksum check is very controversial. |
A request for this option is an absolute requirement.
The protocol level is INET_IP. The options defined for this level are listed in the following table.
IP-Level Options | |||
Option Name | Type of Option Value | Legal Option Value | Meaning |
IP_BROADCAST | unsigned int | T_YES/T_NO | permit sending of broadcast messages |
IP_DONTROUTE | unsigned int | T_YES/T_NO | just use interface addresses |
IP_OPTIONS | array of unsigned characters | see text | IP per-packet options |
IP_REUSEADDR | unsigned int | T_YES/T_NO | allow local address reuse |
IP_TOS | unsigned char | see text | IP per-packet type of service |
IP_TTL | unsigned char | time in seconds | IP per packet time-to-live |
IF_BROADCAST | Requests permission to send broadcast datagrams. It was defined to make sure that broadcasts are not generated by mistake. The use of this option is often restricted to privileged users. | ||||||||||||||||
IP_DONTROUTE | Indicates that outgoing messages should bypass the standard routing facilities. It is mainly used for testing and development. | ||||||||||||||||
IP_OPTIONS | Sets or retrieves the OPTIONS field of each outgoing (incoming) IP
datagram. Its value is a string of octets composed of a number of IP options,
whose format matches those defined in the IP specification with one exception:
the list of addresses for the source routing options must include the first-hop
gateway at the beginning of the list of gateways. The first-hop gateway address
will be extracted from the option list and the size adjusted accordingly before
use.
The option is disabled if it is specified with "no value," for example, with an option header only. The t_connect (in synchronous mode), t_listen, t_rcvconnect and t_rcvudata subroutines return the OPTIONS field, if any, of the received IP datagram associated with this call. The t_rcvuderr subroutine returns the OPTIONS field of the data unit previously sent that produced the error. The t_optmgmt subroutine with T_CURRENT set retrieves the currently effective IP_OPTIONS that is sent with outgoing datagrams. Common applications never need this option. It is mainly used for network debugging and control purposes. | ||||||||||||||||
IP_REUSEADDR | Many TCP implementations do not allow the user to bind more than one transport endpoint to addresses with identical port numbers. If IP_REUSEADDR is set to T_YES this restriction is relaxed in the sense that it is now allowed to bind a transport endpoint to an address with a port number and an underspecified internet address ("wild card" address) and further endpoints to addresses with the same port number and (mutually exclusive) fully specified internet addresses. | ||||||||||||||||
IP_TOS | Sets or retrieves the type-of-service field of an outgoing
(incoming) IP datagram. This field can be constructed by any OR'ed combination
of one of the precedence flags and the type-of-service flags T_LDELAY,
T_HITHRPT, and T_HIREL:
| ||||||||||||||||
IP_TIL | This option is used to set the time-to-live field in an outgoing IP datagram. It specifies how long, in seconds, the datagram is allowed to remain in the Internet. The time-to-live field of an incoming datagram is not returned by any function (since it is not an association-related option). |
IP_OPTIONS and IP_TOS are both association-related options. All other options are not association-related.
IP_REUSEADDR may be negotiated in all XTI states except T_UNINIT. All other options may be negotiated in all other XTI states except T_UNBND and T_UNINIT; they are read-only in the state T_UNBND.
A request for any of these options in an absolute requirement.