TCP/IP Programming Manual

user-protocol can be any protocol number other than the numbers for TCP, UDP, IP, ICMP,
and raw. Appendix A (page 241), lists the protocol numbers.
optname
input value; the socket option name.
When level is SOL_SOCKET, the possible values are:
Get the value of the SO_BROADCAST flag. See setsockopt, setsockopt_nw (page 184)
for details.
SO_BROADCAST
Get the error status and clear the socket error. This option applies only to the
getsockopt function.
SO_ERROR
Get the socket type. This option applies only to the getsockopt and getsockopt_nw
functions.
SO_TYPE
Stream socketSOCK_STREAM
Datagram socketSOCK_DGRAM
Raw socketSOCK_RAW
Get the value of the SO_DONTROUTE flag. See setsockopt, setsockopt_nw (page 184)
for details.
SO_DONTROUTE
Get the value of the SO_REUSEADD flag. See setsockopt, setsockopt_nw (page 184) for
details.
SO_REUSEADDR
Get the value of the SO_LINGER flag. See setsockopt, setsockopt_nw (page 184) for
details.
SO_LINGER
Get the value of the SO_KEEPALIVE flag. See setsockopt, setsockopt_nw (page 184)
for details.
SO_KEEPALIVE
Get the value of the SO_OOBINLINE flag. See setsockopt, setsockopt_nw (page 184)
for details.
SO_OOBINLINE
Get the value of the SO_SNDBUF flag. See setsockopt, setsockopt_nw (page 184) for
details.
SO_SNDBUF
Get the value of the SO_RCVBUF flag. See setsockopt, setsockopt_nw (page 184) for
details.
SO_RCVBUF
When level is IPPROTO_IP or IPPROTO_IPV6, the value is:
Get the value of the IP_OPTIONS flag. See setsockopt, setsockopt_nw (page 184) for
details.
IP_OPTIONS
Get the multicast interface IP address. See setsockopt, setsockopt_nw (page 184) for
details.
IP_MULTICAST_IF or
IPV6_MULTICAST_IF
Get the time-to-live for the multicast datagram. setsockopt, setsockopt_nw (page 184) for
details.
IP_MULTICAST_TTL or
IPV6_MULTICAST_HOPS
Get the value of the IP_MULTICAST_LOOP flag. See setsockopt, setsockopt_nw
(page 184) for details.
IP_MULTICAST_LOOP or
IPV6_MULTICAST_LOOP
AF_INET6 sockets are restricted to IPv6–only communication.IPV6_V6ONLY
When level is IPPROTO_TCP, you should include the tcp.h file. The value is:
Get the value of the TCP_NODELAY flag. See setsockopt, setsockopt_nw (page 184) for
details.
TCP_NODELAY
Get the value of the TCP_SACKENA flag. See setsockopt, setsockopt_nw (page 184) for
details.
TCP_SACKENA
Get the value of the TCP_MINRXMT flag. See setsockopt, setsockopt_nw (page 184) for
details.
TCP_MINRXMT
getsockopt, getsockopt_nw 129