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

*** 40,61 **** .\" information: Portions Copyright [yyyy] [name of copyright owner] .\" .\" .\" Copyright (c) 1992, X/Open Company Limited All Rights Reserved. .\" Portions Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved. .\" ! .TH SOCKET.H 3HEAD "Jun 18, 2017" .SH NAME ! socket.h, socket \- Internet Protocol family .SH SYNOPSIS - .LP .nf \fB#include <sys/socket.h>\fR .fi .SH DESCRIPTION - .LP The \fB<sys/socket.h>\fR header defines the unsigned integral type \fBsa_family_t\fR through \fBtypedef\fR. .sp .LP The \fB<sys/socket.h>\fR header defines the \fBsockaddr\fR structure that --- 40,60 ---- .\" information: Portions Copyright [yyyy] [name of copyright owner] .\" .\" .\" Copyright (c) 1992, X/Open Company Limited All Rights Reserved. .\" Portions Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved. + .\" Copyright 2020 OmniOS Community Edition (OmniOSce) Association. .\" ! .TH SOCKET.H 3HEAD "Sep 18, 2020" .SH NAME ! socket.h, socket, CMSG_DATA, CMSG_FIRSTHDR, CMSG_LEN, CMSG_NXTHDR, CMSG_SPACE \- Internet Protocol family .SH SYNOPSIS .nf \fB#include <sys/socket.h>\fR .fi .SH DESCRIPTION The \fB<sys/socket.h>\fR header defines the unsigned integral type \fBsa_family_t\fR through \fBtypedef\fR. .sp .LP The \fB<sys/socket.h>\fR header defines the \fBsockaddr\fR structure that
*** 68,78 **** data) */ .fi .in -2 .SS "\fBlibxnet\fR Interfaces" - .LP The \fB<sys/socket.h>\fR header defines the \fBmsghdr\fR structure for \fBlibxnet\fR interfaces that includes the following members: .sp .in +2 .nf --- 67,76 ----
*** 116,348 **** header defines the following macros for use as the \fBcmsg_type\fR values when \fBcmsg_level\fR is \fBSOL_SOCKET\fR. .sp .ne 2 .na ! \fB\fBSCM_RIGHTS\fR\fR .ad .RS 14n ! Indicates that the data array contains the access rights to be sent or ! received. .RE .sp .ne 2 .na ! \fB\fBSCM_UCRED\fR\fR .ad .RS 14n Indicates that the data array contains a \fBucred_t\fR to be received. The \fBucred_t\fR is the credential of the sending process at the time the message was sent. This is a Sun-specific, Evolving interface. See \fBucred_get\fR(3C). .RE .sp .LP ! The IPv4 data formats generally use the same values for data passed back in ! \fBcmsghdr\fR as for \fBsetsockopt()\fR to enable the feature. The IPv4 data ! formats are listed below with the associated payload for each. .sp .ne 2 .na ! \fB\fBIPPROTO_IP\fR\fR .ad - .br - .na - \fB\fBIP_RECVDSTADDR\fR\fR - .ad .sp .6 .RS 4n \fBipaddr_t\fR, IP address .RE .sp .ne 2 .na ! \fB\fBIPPROTO_IP\fR\fR .ad ! .br .na ! \fB\fBIP_RECVOPTS\fR\fR .ad .sp .6 .RS 4n variable-length IP options, up to 40 bytes .RE .sp .ne 2 .na ! \fB\fBIPPROTO_IP\fR\fR .ad - .br - .na - \fB\fBIP_RECVIF\fR\fR - .ad .sp .6 .RS 4n ! \fBuint_t\fR, \fBifIndex\fR number .RE .sp .ne 2 .na ! \fB\fBIPPROTO_IP\fR\fR .ad - .br - .na - \fB\fBIP_RECVSLLA\fR\fR - .ad .sp .6 .RS 4n \fBstruct sockaddr_dl\fR, link layer address .RE .sp .ne 2 .na ! \fB\fBIPPROTO_IP\fR\fR .ad ! .br .na ! \fB\fBIP_RECVTTL\fR\fR .ad .sp .6 .RS 4n ! \fBuint8_t\fR .RE .sp .ne 2 .na ! \fB\fBSOL_SOCKET\fR\fR .ad - .br - .na - \fB\fBSO_RECVUCRED\fR\fR - .ad .sp .6 .RS 4n ! \fBucred_t\fR \(em \fBcmsghdr.cmsg_type\fR is \fBSCM_UCRED\fR, not ! \fBSO_RECVUCRED\fR .RE .sp .LP ! 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. .sp .ne 2 .na ! \fB\fBIPPROTO_IPV6\fR\fR .ad - .br - .na - \fB\fBIPV6_RECVPKTINFO\fR\fR - .ad .sp .6 .RS 4n ! \fBin_pktinfo\fR, \fBcmsg_type\fR \fBIPV6_PKTINFO\fR .RE .sp .ne 2 .na ! \fB\fBIPPROTO_IPV6\fR\fR .ad - .br - .na - \fB\fBIPV6_RECVTCLASS\fR\fR - .ad .sp .6 .RS 4n ! \fBuint_t\fR, \fBcmsg_type\fR \fBIPV6_TCLASS\fR .RE .sp .ne 2 .na ! \fB\fBIPPROTO_IPV6\fR\fR .ad - .br - .na - \fB\fBIPV6_RECVPATHMTU\fR\fR - .ad .sp .6 .RS 4n ! \fBip6_mtuinfo\fR, \fBcmsg_type\fR \fBIPV6_PATHMTU\fR .RE .sp .ne 2 .na ! \fB\fBIPPROTO_IPV6\fR\fR .ad - .br - .na - \fB\fBIPV6_RECVHOPLIMIT\fR\fR - .ad .sp .6 .RS 4n ! \fBuint_t\fR, \fBcmsg_type\fR \fBIPV6_HOPLIMIT\fR .RE .sp .ne 2 .na ! \fB\fBIPPROTO_IPV6\fR\fR .ad - .br - .na - \fB\fBIPV6_RECVHOPOPTS\fR\fR - .ad .sp .6 .RS 4n ! variable-length IPv6 options, \fBcmsg_type\fR \fBIPV6_HOPOPTS\fR .RE .sp .ne 2 .na ! \fB\fBIPPROTO_IPV6\fR\fR .ad - .br - .na - \fB\fBIPV6_RECVDSTOPTS\fR\fR - .ad .sp .6 .RS 4n ! variable-length IPv6 options, \fBcmsg_type\fR \fBIPV6_DSTOPTS\fR .RE .sp .ne 2 .na ! \fB\fBIPPROTO_IPV6\fR\fR .ad - .br - .na - \fB\fBIPV6_RECVRTHDR\fR\fR - .ad .sp .6 .RS 4n ! variable-length IPv6 options, \fBcmsg_type\fR \fBIPV6_RTHDR\fR .RE .sp .ne 2 .na ! \fB\fBIPPROTO_IPV6\fR\fR .ad - .br - .na - \fB\fBIPV6_RECVRTHDRDSTOPTS\fR\fR - .ad .sp .6 .RS 4n ! variable-length IPv6 options, \fBcmsg_type\fR \fBIPV6_DSTOPTS\fR .RE .sp .LP The \fB<sys/socket.h>\fR header defines the following macros to gain access to --- 114,307 ---- header defines the following macros for use as the \fBcmsg_type\fR values when \fBcmsg_level\fR is \fBSOL_SOCKET\fR. .sp .ne 2 .na ! \fBSCM_RIGHTS\fR .ad .RS 14n ! Indicates that the data array contains the access rights (set of open file ! descriptors) to be sent or received. .RE .sp .ne 2 .na ! \fBSCM_UCRED\fR .ad .RS 14n Indicates that the data array contains a \fBucred_t\fR to be received. The \fBucred_t\fR is the credential of the sending process at the time the message was sent. This is a Sun-specific, Evolving interface. See \fBucred_get\fR(3C). .RE .sp .LP ! The IPv4 ancillary data formats are listed below by \fBcmsg_level\fR and ! \fBcmsg_type\fR, along with the associated payload for each. .sp .ne 2 .na ! \fBIPPROTO_IP\fR, \fBIP_RECVDSTADDR\fR \(em \fBSOCK_DGRAM\fR only .ad .sp .6 .RS 4n \fBipaddr_t\fR, IP address .RE .sp .ne 2 .na ! \fBIPPROTO_IP\fR, \fBIP_RECVIF\fR .ad ! .sp .6 ! .RS 4n ! \fBuint_t\fR, \fBifIndex\fR number ! .RE ! ! .sp ! .ne 2 .na ! \fBIPPROTO_IP\fR, \fBIP_RECVOPTS\fR \(em \fBSOCK_DGRAM\fR only .ad .sp .6 .RS 4n variable-length IP options, up to 40 bytes .RE .sp .ne 2 .na ! \fBIPPROTO_IP\fR, \fBIP_RECVPKTINFO\fR \(em \fBSOCK_DGRAM\fR only .ad .sp .6 .RS 4n ! \fBin_pktinfo_t\fR .RE .sp .ne 2 .na ! \fBIPPROTO_IP\fR, \fBIP_RECVSLLA\fR \(em \fBSOCK_DGRAM\fR only .ad .sp .6 .RS 4n \fBstruct sockaddr_dl\fR, link layer address .RE .sp .ne 2 .na ! \fBIPPROTO_IP\fR, \fBIP_RECVTTL\fR \(em \fBSOCK_DGRAM\fR only .ad ! .sp .6 ! .RS 4n ! \fBuint8_t\fR, the IP TTL (time to live) ! .RE ! ! .sp ! .ne 2 .na ! \fBIPPROTO_IP\fR, \fBIP_RECVTOS\fR .ad .sp .6 .RS 4n ! \fBuint8_t\fR, the IP TOS (type of service) .RE .sp .ne 2 .na ! \fBSOL_SOCKET\fR, \fBSO_UCRED\fR .ad .sp .6 .RS 4n ! \fBucred_t\fR .RE .sp .LP ! The IPv6 ancillary data formats are listed below by \fBcmsg_level\fR and ! \fBcmsg_type\fR, along with the associated payload for each. .sp .ne 2 .na ! \fBIPPROTO_IPV6\fR, \fBIPV6_PKTINFO\fR .ad .sp .6 .RS 4n ! \fBin_pktinfo_t\fR .RE .sp .ne 2 .na ! \fBIPPROTO_IPV6\fR, \fBIPV6_TCLASS\fR .ad .sp .6 .RS 4n ! \fBuint_t\fR .RE .sp .ne 2 .na ! \fBIPPROTO_IPV6\fR, \fBIPV6_PATHMTU\fR .ad .sp .6 .RS 4n ! \fBip6_mtuinfo\fR .RE .sp .ne 2 .na ! \fBIPPROTO_IPV6\fR, \fBIPV6_HOPLIMIT\fR .ad .sp .6 .RS 4n ! \fBuint_t\fR .RE .sp .ne 2 .na ! \fBIPPROTO_IPV6\fR, \fBIPV6_HOPOPTS\fR .ad .sp .6 .RS 4n ! variable-length IPv6 options .RE .sp .ne 2 .na ! \fBIPPROTO_IPV6\fR, \fBIPV6_DSTOPTS\fR .ad .sp .6 .RS 4n ! variable-length IPv6 options .RE .sp .ne 2 .na ! \fBIPPROTO_IPV6\fR, \fBIPV6_RTHDR\fR .ad .sp .6 .RS 4n ! variable-length IPv6 options .RE .sp .ne 2 .na ! \fBIPPROTO_IPV6\fR, \fBIPV6_DSTOPTS\fR .ad .sp .6 .RS 4n ! variable-length IPv6 options .RE .sp .LP The \fB<sys/socket.h>\fR header defines the following macros to gain access to
*** 429,457 **** .LP The \fB<sys/socket.h>\fR header defines the following macros: .sp .ne 2 .na ! \fB\fBSOCK_DGRAM\fR\fR .ad .RS 18n Datagram socket .RE .sp .ne 2 .na ! \fB\fBSOCK_STREAM\fR\fR .ad .RS 18n Byte-stream socket .RE .sp .ne 2 .na ! \fB\fBSOCK_SEQPACKET\fR\fR .ad .RS 18n Sequenced-packet socket .RE --- 388,416 ---- .LP The \fB<sys/socket.h>\fR header defines the following macros: .sp .ne 2 .na ! \fBSOCK_DGRAM\fR .ad .RS 18n Datagram socket .RE .sp .ne 2 .na ! \fBSOCK_STREAM\fR .ad .RS 18n Byte-stream socket .RE .sp .ne 2 .na ! \fBSOCK_SEQPACKET\fR .ad .RS 18n Sequenced-packet socket .RE
*** 460,479 **** The \fB<sys/socket.h>\fR header defines the following macros for use as the \fIlevel\fR argument of \fBsetsockopt()\fR and \fBgetsockopt()\fR. .sp .ne 2 .na ! \fB\fBSOL_SOCKET\fR\fR .ad .RS 14n Options to be accessed at the socket level, not the protocol level. .RE .sp .ne 2 .na ! \fB\fBSOL_ROUTE\fR\fR .ad .RS 14n Options to be accessed at the routing socket level, not the protocol level. .RE --- 419,438 ---- The \fB<sys/socket.h>\fR header defines the following macros for use as the \fIlevel\fR argument of \fBsetsockopt()\fR and \fBgetsockopt()\fR. .sp .ne 2 .na ! \fBSOL_SOCKET\fR .ad .RS 14n Options to be accessed at the socket level, not the protocol level. .RE .sp .ne 2 .na ! \fBSOL_ROUTE\fR .ad .RS 14n Options to be accessed at the routing socket level, not the protocol level. .RE
*** 482,611 **** The \fB<sys/socket.h>\fR header defines the following macros for use as the \fIoption_name\fR argument of \fBgetsockopt()\fR or \fBsetsockopt()\fR calls: .sp .ne 2 .na ! \fB\fBSO_DEBUG\fR\fR .ad .RS 17n Debugging information is being recorded. .RE .sp .ne 2 .na ! \fB\fBSO_ACCEPTCONN\fR\fR .ad .RS 17n Socket is accepting connections. .RE .sp .ne 2 .na ! \fB\fBSO_BROADCAST\fR\fR .ad .RS 17n Transmission of broadcast messages is supported. .RE .sp .ne 2 .na ! \fB\fBSO_REUSEADDR\fR\fR .ad .RS 17n Reuse of local addresses is supported. .RE .sp .ne 2 .na ! \fB\fBSO_KEEPALIVE\fR\fR .ad .RS 17n Connections are kept alive with periodic messages. .RE .sp .ne 2 .na ! \fB\fBSO_LINGER\fR\fR .ad .RS 17n Socket lingers on close. .RE .sp .ne 2 .na ! \fB\fBSO_OOBINLINE\fR\fR .ad .RS 17n Out-of-band data is transmitted in line. .RE .sp .ne 2 .na ! \fB\fBSO_SNDBUF\fR\fR .ad .RS 17n Send buffer size. .RE .sp .ne 2 .na ! \fB\fBSO_RCVBUF\fR\fR .ad .RS 17n Receive buffer size. .RE .sp .ne 2 .na ! \fB\fBSO_ERROR\fR\fR .ad .RS 17n Socket error status. .RE .sp .ne 2 .na ! \fB\fBSO_TYPE\fR\fR .ad .RS 17n Socket type. .RE .sp .ne 2 .na ! \fB\fBSO_RECVUCRED\fR\fR .ad .RS 17n Request the reception of user credential ancillary data. This is a Sun-specific, Evolving interface. See \fBucred_get\fR(3C). .RE .sp .ne 2 .na ! \fB\fBSO_MAC_EXEMPT\fR\fR .ad .RS 17n Mandatory Access Control (\fBMAC\fR) exemption for unlabeled peers. This option is available only if the system is configured with Trusted Extensions. .RE .sp .ne 2 .na ! \fB\fBSO_ALLZONES\fR\fR .ad .RS 17n Bypass zone boundaries (privileged). .RE --- 441,570 ---- The \fB<sys/socket.h>\fR header defines the following macros for use as the \fIoption_name\fR argument of \fBgetsockopt()\fR or \fBsetsockopt()\fR calls: .sp .ne 2 .na ! \fBSO_DEBUG\fR .ad .RS 17n Debugging information is being recorded. .RE .sp .ne 2 .na ! \fBSO_ACCEPTCONN\fR .ad .RS 17n Socket is accepting connections. .RE .sp .ne 2 .na ! \fBSO_BROADCAST\fR .ad .RS 17n Transmission of broadcast messages is supported. .RE .sp .ne 2 .na ! \fBSO_REUSEADDR\fR .ad .RS 17n Reuse of local addresses is supported. .RE .sp .ne 2 .na ! \fBSO_KEEPALIVE\fR .ad .RS 17n Connections are kept alive with periodic messages. .RE .sp .ne 2 .na ! \fBSO_LINGER\fR .ad .RS 17n Socket lingers on close. .RE .sp .ne 2 .na ! \fBSO_OOBINLINE\fR .ad .RS 17n Out-of-band data is transmitted in line. .RE .sp .ne 2 .na ! \fBSO_SNDBUF\fR .ad .RS 17n Send buffer size. .RE .sp .ne 2 .na ! \fBSO_RCVBUF\fR .ad .RS 17n Receive buffer size. .RE .sp .ne 2 .na ! \fBSO_ERROR\fR .ad .RS 17n Socket error status. .RE .sp .ne 2 .na ! \fBSO_TYPE\fR .ad .RS 17n Socket type. .RE .sp .ne 2 .na ! \fBSO_RECVUCRED\fR .ad .RS 17n Request the reception of user credential ancillary data. This is a Sun-specific, Evolving interface. See \fBucred_get\fR(3C). .RE .sp .ne 2 .na ! \fBSO_MAC_EXEMPT\fR .ad .RS 17n Mandatory Access Control (\fBMAC\fR) exemption for unlabeled peers. This option is available only if the system is configured with Trusted Extensions. .RE .sp .ne 2 .na ! \fBSO_ALLZONES\fR .ad .RS 17n Bypass zone boundaries (privileged). .RE
*** 616,680 **** the flags parameter in \fBrecvfrom()\fR, \fBrecvmsg()\fR, \fBsendto()\fR, or \fBsendmsg()\fR calls: .sp .ne 2 .na ! \fB\fBMSG_CTRUNC\fR\fR .ad .RS 15n Control data truncated. .RE .sp .ne 2 .na ! \fB\fBMSG_EOR\fR\fR .ad .RS 15n Terminates a record (if supported by the protocol). .RE .sp .ne 2 .na ! \fB\fBMSG_OOB\fR\fR .ad .RS 15n Out-of-band data. .RE .sp .ne 2 .na ! \fB\fBMSG_PEEK\fR\fR .ad .RS 15n Leave received data in queue. .RE .sp .ne 2 .na ! \fB\fBMSG_TRUNC\fR\fR .ad .RS 15n Normal data truncated. .RE .sp .ne 2 .na ! \fB\fBMSG_WAITALL\fR\fR .ad .RS 15n Wait for complete message. .RE .sp .ne 2 .na ! \fB\fBMSG_NOSIGNAL\fR\fR .ad .RS 15n Do not generate \fBSIGPIPE\fR signal. .RE --- 575,639 ---- the flags parameter in \fBrecvfrom()\fR, \fBrecvmsg()\fR, \fBsendto()\fR, or \fBsendmsg()\fR calls: .sp .ne 2 .na ! \fBMSG_CTRUNC\fR .ad .RS 15n Control data truncated. .RE .sp .ne 2 .na ! \fBMSG_EOR\fR .ad .RS 15n Terminates a record (if supported by the protocol). .RE .sp .ne 2 .na ! \fBMSG_OOB\fR .ad .RS 15n Out-of-band data. .RE .sp .ne 2 .na ! \fBMSG_PEEK\fR .ad .RS 15n Leave received data in queue. .RE .sp .ne 2 .na ! \fBMSG_TRUNC\fR .ad .RS 15n Normal data truncated. .RE .sp .ne 2 .na ! \fBMSG_WAITALL\fR .ad .RS 15n Wait for complete message. .RE .sp .ne 2 .na ! \fBMSG_NOSIGNAL\fR .ad .RS 15n Do not generate \fBSIGPIPE\fR signal. .RE
*** 682,701 **** .LP The \fB<sys/socket.h>\fR header defines the following macros: .sp .ne 2 .na ! \fB\fBAF_UNIX\fR\fR .ad .RS 11n UNIX domain sockets .RE .sp .ne 2 .na ! \fB\fBAF_INET\fR\fR .ad .RS 11n Internet domain sockets .RE --- 641,660 ---- .LP The \fB<sys/socket.h>\fR header defines the following macros: .sp .ne 2 .na ! \fBAF_UNIX\fR .ad .RS 11n UNIX domain sockets .RE .sp .ne 2 .na ! \fBAF_INET\fR .ad .RS 11n Internet domain sockets .RE
*** 703,738 **** .LP The \fB<sys/socket.h>\fR header defines the following macros: .sp .ne 2 .na ! \fB\fBSHUT_RD\fR\fR .ad .RS 13n Disables further receive operations. .RE .sp .ne 2 .na ! \fB\fBSHUT_WR\fR\fR .ad .RS 13n Disables further send operations. .RE .sp .ne 2 .na ! \fB\fBSHUT_RDWR\fR\fR .ad .RS 13n Disables further send and receive operations. .RE .SS "\fBlibsocket\fR Interfaces" - .LP The \fB<sys/socket.h>\fR header defines the \fBmsghdr\fR structure for \fBlibsocket\fR interfaces that includes the following members: .sp .in +2 .nf --- 662,696 ---- .LP The \fB<sys/socket.h>\fR header defines the following macros: .sp .ne 2 .na ! \fBSHUT_RD\fR .ad .RS 13n Disables further receive operations. .RE .sp .ne 2 .na ! \fBSHUT_WR\fR .ad .RS 13n Disables further send operations. .RE .sp .ne 2 .na ! \fBSHUT_RDWR\fR .ad .RS 13n Disables further send and receive operations. .RE .SS "\fBlibsocket\fR Interfaces" The \fB<sys/socket.h>\fR header defines the \fBmsghdr\fR structure for \fBlibsocket\fR interfaces that includes the following members: .sp .in +2 .nf
*** 752,762 **** \fImsg_iovlen\fR parameters describe the scatter-gather locations, as described in \fBread\fR(2). The \fImsg_accrights\fR parameter specifies the buffer in which access rights sent along with the message are received. The \fImsg_accrightslen\fR specifies the length of the buffer. .SH ATTRIBUTES - .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS --- 710,719 ----
*** 767,777 **** _ Interface Stability Standard .TE .SH SEE ALSO - .LP \fBaccept\fR(3SOCKET), \fBaccept\fR(3XNET), \fBbind\fR(3SOCKET), \fBbind\fR(3XNET), \fBconnect\fR(3SOCKET), \fBconnect\fR(3XNET), \fBgetpeername\fR(3SOCKET), \fBgetpeername\fR(3XNET), \fBgetpeerucred\fR(3C), \fBgetsockname\fR(3SOCKET), \fBgetsockname\fR(3XNET), \fBgetsockopt\fR(3SOCKET), \fBgetsockopt\fR(3XNET), \fBlibsocket\fR(3LIB), --- 724,733 ----