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

Split Close
Expand all
Collapse all
          --- old/usr/src/man/man3head/socket.h.3head.man.txt
          +++ new/usr/src/man/man3head/socket.h.3head.man.txt
   1    1  SOCKET.H(3HEAD)                     Headers                    SOCKET.H(3HEAD)
   2    2  
   3    3  
   4    4  
   5    5  NAME
   6      -       socket.h, socket - Internet Protocol family
        6 +       socket.h, socket, CMSG_DATA, CMSG_FIRSTHDR, CMSG_LEN, CMSG_NXTHDR,
        7 +       CMSG_SPACE - Internet Protocol family
   7    8  
   8    9  SYNOPSIS
   9   10         #include <sys/socket.h>
  10   11  
  11   12  
  12   13  DESCRIPTION
  13   14         The <sys/socket.h> header defines the unsigned integral type
  14   15         sa_family_t through typedef.
  15   16  
  16   17  
↓ open down ↓ 38 lines elided ↑ open up ↑
  55   56         to the getsockopt() and setsockopt() functions. The SCM_RIGHTS type is
  56   57         supported for level SOL_SOCKET.
  57   58  
  58   59  
  59   60         Ancillary data is also possible at the socket level. The <sys/socket.h>
  60   61         header defines the following macros for use as the cmsg_type values
  61   62         when cmsg_level is SOL_SOCKET.
  62   63  
  63   64         SCM_RIGHTS
  64   65                       Indicates that the data array contains the access rights
  65      -                     to be sent or received.
       66 +                     (set of open file descriptors) to be sent or received.
  66   67  
  67   68  
  68   69         SCM_UCRED
  69   70                       Indicates that the data array contains a ucred_t to be
  70   71                       received. The ucred_t is the credential of the sending
  71   72                       process at the time the message was sent. This is a Sun-
  72   73                       specific, Evolving interface. See ucred_get(3C).
  73   74  
  74   75  
  75   76  
  76      -       The IPv4 data formats generally use the same values for data passed
  77      -       back in cmsghdr as for setsockopt() to enable the feature. The IPv4
  78      -       data formats are listed below with the associated payload for each.
       77 +       The IPv4 ancillary data formats are listed below by cmsg_level and
       78 +       cmsg_type, along with the associated payload for each.
  79   79  
  80      -       IPPROTO_IP
  81      -       IP_RECVDSTADDR
       80 +       IPPROTO_IP, IP_RECVDSTADDR -- SOCK_DGRAM only
  82   81  
  83   82             ipaddr_t, IP address
  84   83  
  85   84  
  86      -       IPPROTO_IP
  87      -       IP_RECVOPTS
       85 +       IPPROTO_IP, IP_RECVIF
  88   86  
       87 +           uint_t, ifIndex number
       88 +
       89 +
       90 +       IPPROTO_IP, IP_RECVOPTS -- SOCK_DGRAM only
       91 +
  89   92             variable-length IP options, up to 40 bytes
  90   93  
  91   94  
  92      -       IPPROTO_IP
  93      -       IP_RECVIF
       95 +       IPPROTO_IP, IP_RECVPKTINFO -- SOCK_DGRAM only
  94   96  
  95      -           uint_t, ifIndex number
       97 +           in_pktinfo_t
  96   98  
  97   99  
  98      -       IPPROTO_IP
  99      -       IP_RECVSLLA
      100 +       IPPROTO_IP, IP_RECVSLLA -- SOCK_DGRAM only
 100  101  
 101  102             struct sockaddr_dl, link layer address
 102  103  
 103  104  
 104      -       IPPROTO_IP
 105      -       IP_RECVTTL
      105 +       IPPROTO_IP, IP_RECVTTL -- SOCK_DGRAM only
 106  106  
 107      -           uint8_t
      107 +           uint8_t, the IP TTL (time to live)
 108  108  
 109  109  
 110      -       SOL_SOCKET
 111      -       SO_RECVUCRED
      110 +       IPPROTO_IP, IP_RECVTOS
 112  111  
 113      -           ucred_t -- cmsghdr.cmsg_type is SCM_UCRED, not SO_RECVUCRED
      112 +           uint8_t, the IP TOS (type of service)
 114  113  
 115  114  
      115 +       SOL_SOCKET, SO_UCRED
 116  116  
 117      -       The IPv6 data formats use different values for enabling the option and
 118      -       for passing the value back to the application. The IPv6 data formats
 119      -       are listed below with the associated payload for each.
      117 +           ucred_t
 120  118  
 121      -       IPPROTO_IPV6
 122      -       IPV6_RECVPKTINFO
 123  119  
 124      -           in_pktinfo, cmsg_type IPV6_PKTINFO
 125  120  
      121 +       The IPv6 ancillary data formats are listed below by cmsg_level and
      122 +       cmsg_type, along with the associated payload for each.
 126  123  
 127      -       IPPROTO_IPV6
 128      -       IPV6_RECVTCLASS
      124 +       IPPROTO_IPV6, IPV6_PKTINFO
 129  125  
 130      -           uint_t, cmsg_type IPV6_TCLASS
      126 +           in_pktinfo_t
 131  127  
 132  128  
 133      -       IPPROTO_IPV6
 134      -       IPV6_RECVPATHMTU
      129 +       IPPROTO_IPV6, IPV6_TCLASS
 135  130  
 136      -           ip6_mtuinfo, cmsg_type IPV6_PATHMTU
      131 +           uint_t
 137  132  
 138  133  
 139      -       IPPROTO_IPV6
 140      -       IPV6_RECVHOPLIMIT
      134 +       IPPROTO_IPV6, IPV6_PATHMTU
 141  135  
 142      -           uint_t, cmsg_type IPV6_HOPLIMIT
      136 +           ip6_mtuinfo
 143  137  
 144  138  
 145      -       IPPROTO_IPV6
 146      -       IPV6_RECVHOPOPTS
      139 +       IPPROTO_IPV6, IPV6_HOPLIMIT
 147  140  
 148      -           variable-length IPv6 options, cmsg_type IPV6_HOPOPTS
      141 +           uint_t
 149  142  
 150  143  
 151      -       IPPROTO_IPV6
 152      -       IPV6_RECVDSTOPTS
      144 +       IPPROTO_IPV6, IPV6_HOPOPTS
 153  145  
 154      -           variable-length IPv6 options, cmsg_type IPV6_DSTOPTS
      146 +           variable-length IPv6 options
 155  147  
 156  148  
 157      -       IPPROTO_IPV6
 158      -       IPV6_RECVRTHDR
      149 +       IPPROTO_IPV6, IPV6_DSTOPTS
 159  150  
 160      -           variable-length IPv6 options, cmsg_type IPV6_RTHDR
      151 +           variable-length IPv6 options
 161  152  
 162  153  
 163      -       IPPROTO_IPV6
 164      -       IPV6_RECVRTHDRDSTOPTS
      154 +       IPPROTO_IPV6, IPV6_RTHDR
 165  155  
 166      -           variable-length IPv6 options, cmsg_type IPV6_DSTOPTS
      156 +           variable-length IPv6 options
 167  157  
 168  158  
      159 +       IPPROTO_IPV6, IPV6_DSTOPTS
 169  160  
      161 +           variable-length IPv6 options
      162 +
      163 +
      164 +
 170  165         The <sys/socket.h> header defines the following macros to gain access
 171  166         to the data arrays in the ancillary data associated with a message
 172  167         header:
 173  168  
 174  169         CMSG_DATA(cmsg)
 175  170  
 176  171             If the argument is a pointer to a cmsghdr structure, this macro
 177  172             returns an unsigned character pointer to the data array associated
 178  173             with the cmsghdr structure.
 179  174  
↓ open down ↓ 235 lines elided ↑ open up ↑
 415  410         libsocket(3LIB), listen(3SOCKET), listen(3XNET), recv(3SOCKET),
 416  411         recv(3XNET), recvfrom(3SOCKET), recvfrom(3XNET), recvmsg(3SOCKET),
 417  412         recvmsg(3XNET), send(3SOCKET), send(3XNET), sendmsg(3SOCKET),
 418  413         sendmsg(3XNET), sendto(3SOCKET), sendto(3XNET), setsockopt(3SOCKET),
 419  414         setsockopt(3XNET), shutdown(3SOCKET), shutdown(3XNET),
 420  415         sockaddr(3SOCKET), socket(3SOCKET), socket(3XNET), socketpair(3SOCKET),
 421  416         socketpair(3XNET), ucred_get(3C), attributes(5), standards(5)
 422  417  
 423  418  
 424  419  
 425      -                                 June 18, 2017                 SOCKET.H(3HEAD)
      420 +                              September 18, 2020               SOCKET.H(3HEAD)
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX