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

@@ -106,11 +106,11 @@
                              this interface. Takes an integer as an argument.
                              The integer is the selected interface index.
 
 
 
-       The following options take in_pktinfo_t as the parameter:
+       The following option takes in_pktinfo_t as the parameter:
 
        IP_PKTINFO
 
            Set the source address and/or transmit interface of  the packet(s).
            Note that the IP_BOUND_IF socket option takes precedence over the

@@ -125,19 +125,68 @@
            When passed in (on transmit) via ancillary data with IP_PKTINFO,
            ipi_spec_dst is used as the source address and ipi_ifindex is used
            as the interface index to send the packet out.
 
 
+
+       The following options are boolean switches controlling the reception of
+       ancillary data:
+
+
+       IP_RECVDSTADDR
+                             When enabled on a SOCK_DGRAM socket, enables
+                             receipt of the destination IP address of the
+                             incoming packet. Returns inaddr_t as ancillary
+                             data.
+
+
+       IP_RECVIF
+                             Enable/disable receipt of the inbound interface
+                             index. Returns uint_t as ancillary data.
+
+
+       IP_RECVOPTS
+                             When enabled on a SOCK_DGRAM socket, enables
+                             receipt of the IP options from the incoming
+                             packet. Returns variable-length IP options, up to
+                             40 bytes, as ancillary data.
+
+
        IP_RECVPKTINFO
+                             Enable/disable receipt of the index of the
+                             interface the packet arrived on, the local
+                             address that was matched for reception, and the
+                             inbound packet's actual destination address.
+                             Takes boolean as the parameter.  Returns
+                             in_pktinfo_t as ancillary data.
 
-           Enable/disable receipt of the index of the interface the packet
-           arrived on, the local address that was matched for reception, and
-           the inbound packet's actual destination address. Takes boolean as
-           the parameter.  Returns struct in_pktinfo_t as ancillary data.
 
+       IP_RECVSLLA
+                             When enabled on a SOCK_DGRAM socket, enables
+                             receipt of the source link-layer address for the
+                             incoming packet. Returns struct sockaddr_dl as
+                             ancillary data.
 
 
+       IP_RECVTTL
+                             When enabled on a SOCK_DGRAM socket, the IP TTL
+                             (time to live) field for an incoming datagram is
+                             returned as uint8_t in ancillary data.
+
+
+       IP_RECVTOS
+                             When enabled, the IP TOS (type of service) field
+                             is returned as uint8_t in ancillary data. For
+                             SOCK_DGRAM sockets, the ancillary data item is
+                             included for every call to recvmsg(). For
+                             SOCK_STREAM sockets, where there is no direct
+                             mapping between received TCP segments and receive
+                             operations, the ancillary data item will only be
+                             present when the value has changed.
+
+
+
        The following options take a struct ip_mreq as the parameter. The
        structure contains a multicast address which must be set to the CLASS-D
        IP multicast address and an interface address. Normally the interface
        address is set to INADDR_ANY which causes the kernel to choose the
        interface on which to join.

@@ -243,14 +292,10 @@
                             opposite behavior, meaning that when multiple
                             zones are present, the datagrams are delivered to
                             all zones except the sending zone.
 
 
-       IP_RECVIF
-                            Receive the inbound interface index.
-
-
        IP_TOS
                             This option takes an integer argument as its input
                             value. The least significant 8 bits of the value
                             are used to set the Type Of Service field in the
                             IP header of the outgoing packets.

@@ -480,15 +525,15 @@
        address change
                          An address has changed on a logical  interface.
 
 
 SEE ALSO
-       ifconfig(1M), routeadm(1M), ndd(1M), read(2), write(2), bind(3SOCKET),
-       connect(3SOCKET), getsockopt(3SOCKET), recv(3SOCKET), send(3SOCKET),
-       defaultrouter(4), icmp(7P), if_tcp(7P), inet(7P), ip6(7P), ipsec(7P),
-       routing(7P), tcp(7P), udp(7P), net_hook_register(9F),
-       hook_pkt_event(9S)
+       ifconfig(1M), routeadm(1M), ndd(1M), read(2), write(2),
+       socket.h(3HEAD), bind(3SOCKET), connect(3SOCKET), getsockopt(3SOCKET),
+       recv(3SOCKET), send(3SOCKET), defaultrouter(4), icmp(7P), if_tcp(7P),
+       inet(7P), ip(7P), ip6(7P), ipsec(7P), routing(7P), tcp(7P), udp(7P),
+       net_hook_register(9F), hook_pkt_event(9S)
 
 
        Braden, R., RFC 1122, Requirements for Internet Hosts - Communication
        Layers, Information Sciences Institute, University of Southern
        California, October 1989.

@@ -628,6 +673,6 @@
        Users of higher-level protocols such as TCP and UDP should be able to
        see received IP options.
 
 
 
-                               December 3, 2008                         IP(7P)
+                              September 18, 2020                        IP(7P)