Print this page
13175 Add support for IP_RECVTOS
13182 CMSG_ macros should have man pages
Change-ID: I784aa36cfd3c17e3cccbf1fd329fa7e69b663ef9

@@ -1,11 +1,12 @@
 SOCKET.H(3HEAD)                     Headers                    SOCKET.H(3HEAD)
 
 
 
 NAME
-       socket.h, socket - Internet Protocol family
+       socket.h, socket, CMSG_DATA, CMSG_FIRSTHDR, CMSG_LEN, CMSG_NXTHDR,
+       CMSG_SPACE - Internet Protocol family
 
 SYNOPSIS
        #include <sys/socket.h>
 
 

@@ -60,11 +61,11 @@
        header defines the following macros for use as the cmsg_type values
        when cmsg_level is SOL_SOCKET.
 
        SCM_RIGHTS
                      Indicates that the data array contains the access rights
-                     to be sent or received.
+                     (set of open file descriptors) to be sent or received.
 
 
        SCM_UCRED
                      Indicates that the data array contains a ucred_t to be
                      received. The ucred_t is the credential of the sending

@@ -71,104 +72,98 @@
                      process at the time the message was sent. This is a Sun-
                      specific, Evolving interface. See ucred_get(3C).
 
 
 
-       The IPv4 data formats generally use the same values for data passed
-       back in cmsghdr as for setsockopt() to enable the feature. The IPv4
-       data formats are listed below with the associated payload for each.
+       The IPv4 ancillary data formats are listed below by cmsg_level and
+       cmsg_type, along with the associated payload for each.
 
-       IPPROTO_IP
-       IP_RECVDSTADDR
+       IPPROTO_IP, IP_RECVDSTADDR -- SOCK_DGRAM only
 
            ipaddr_t, IP address
 
 
-       IPPROTO_IP
-       IP_RECVOPTS
+       IPPROTO_IP, IP_RECVIF
 
+           uint_t, ifIndex number
+
+
+       IPPROTO_IP, IP_RECVOPTS -- SOCK_DGRAM only
+
            variable-length IP options, up to 40 bytes
 
 
-       IPPROTO_IP
-       IP_RECVIF
+       IPPROTO_IP, IP_RECVPKTINFO -- SOCK_DGRAM only
 
-           uint_t, ifIndex number
+           in_pktinfo_t
 
 
-       IPPROTO_IP
-       IP_RECVSLLA
+       IPPROTO_IP, IP_RECVSLLA -- SOCK_DGRAM only
 
            struct sockaddr_dl, link layer address
 
 
-       IPPROTO_IP
-       IP_RECVTTL
+       IPPROTO_IP, IP_RECVTTL -- SOCK_DGRAM only
 
-           uint8_t
+           uint8_t, the IP TTL (time to live)
 
 
-       SOL_SOCKET
-       SO_RECVUCRED
+       IPPROTO_IP, IP_RECVTOS
 
-           ucred_t -- cmsghdr.cmsg_type is SCM_UCRED, not SO_RECVUCRED
+           uint8_t, the IP TOS (type of service)
 
 
+       SOL_SOCKET, SO_UCRED
 
-       The IPv6 data formats use different values for enabling the option and
-       for passing the value back to the application. The IPv6 data formats
-       are listed below with the associated payload for each.
+           ucred_t
 
-       IPPROTO_IPV6
-       IPV6_RECVPKTINFO
 
-           in_pktinfo, cmsg_type IPV6_PKTINFO
 
+       The IPv6 ancillary data formats are listed below by cmsg_level and
+       cmsg_type, along with the associated payload for each.
 
-       IPPROTO_IPV6
-       IPV6_RECVTCLASS
+       IPPROTO_IPV6, IPV6_PKTINFO
 
-           uint_t, cmsg_type IPV6_TCLASS
+           in_pktinfo_t
 
 
-       IPPROTO_IPV6
-       IPV6_RECVPATHMTU
+       IPPROTO_IPV6, IPV6_TCLASS
 
-           ip6_mtuinfo, cmsg_type IPV6_PATHMTU
+           uint_t
 
 
-       IPPROTO_IPV6
-       IPV6_RECVHOPLIMIT
+       IPPROTO_IPV6, IPV6_PATHMTU
 
-           uint_t, cmsg_type IPV6_HOPLIMIT
+           ip6_mtuinfo
 
 
-       IPPROTO_IPV6
-       IPV6_RECVHOPOPTS
+       IPPROTO_IPV6, IPV6_HOPLIMIT
 
-           variable-length IPv6 options, cmsg_type IPV6_HOPOPTS
+           uint_t
 
 
-       IPPROTO_IPV6
-       IPV6_RECVDSTOPTS
+       IPPROTO_IPV6, IPV6_HOPOPTS
 
-           variable-length IPv6 options, cmsg_type IPV6_DSTOPTS
+           variable-length IPv6 options
 
 
-       IPPROTO_IPV6
-       IPV6_RECVRTHDR
+       IPPROTO_IPV6, IPV6_DSTOPTS
 
-           variable-length IPv6 options, cmsg_type IPV6_RTHDR
+           variable-length IPv6 options
 
 
-       IPPROTO_IPV6
-       IPV6_RECVRTHDRDSTOPTS
+       IPPROTO_IPV6, IPV6_RTHDR
 
-           variable-length IPv6 options, cmsg_type IPV6_DSTOPTS
+           variable-length IPv6 options
 
 
+       IPPROTO_IPV6, IPV6_DSTOPTS
 
+           variable-length IPv6 options
+
+
+
        The <sys/socket.h> header defines the following macros to gain access
        to the data arrays in the ancillary data associated with a message
        header:
 
        CMSG_DATA(cmsg)

@@ -420,6 +415,6 @@
        sockaddr(3SOCKET), socket(3SOCKET), socket(3XNET), socketpair(3SOCKET),
        socketpair(3XNET), ucred_get(3C), attributes(5), standards(5)
 
 
 
-                                 June 18, 2017                 SOCKET.H(3HEAD)
+                              September 18, 2020               SOCKET.H(3HEAD)