Expand description
Socket options as used by setsockopt
and getsockopt
.
Structs§
- Accept
Conn - Returns a value indicating whether or not this socket has been marked to
accept connections with
listen(2)
. - AlgSet
Aead Auth Size - AlgSet
Key - Bind
ToDevice - Bind this socket to a particular device like “eth0”.
- Broadcast
- Set or get the broadcast flag.
- Dont
Route - Set or get the don’t route flag.
- Ip6t
Original Dst - IpAdd
Membership - Join a multicast group
- IpBind
Address NoPort - If enabled, the kernel will not reserve an ephemeral port when binding socket with a port number of 0. The port will later be automatically chosen at connect time, in a way that allows sharing a source port as long as the 4-tuple is unique.
- IpDrop
Membership - Leave a multicast group.
- IpFreebind
- If enabled, this boolean option allows binding to an IP address that is nonlocal or does not (yet) exist.
- IpMtu
- Fetch the current system-estimated Path MTU.
- IpMulticast
Loop - Set or read a boolean integer argument that determines whether sent multicast packets should be looped back to the local sockets.
- IpMulticast
Ttl - Set or read the time-to-live value of outgoing multicast packets for this socket.
- IpTos
- Set or receive the Type-Of-Service (TOS) field that is sent with every IP packet originating from this socket
- IpTransparent
- Setting this boolean option enables transparent proxying on this socket.
- Ipv4
Orig DstAddr - The
recvmsg(2)
call will return the destination IP address for a UDP datagram. - Ipv4
Packet Info - Pass an
IP_PKTINFO
ancillary message that contains a pktinfo structure that supplies some information about the incoming packet. - Ipv4
Recv Err - Enable extended reliable error message passing.
- Ipv4Ttl
- Set or retrieve the current time-to-live field that is used in every packet sent from this socket.
- Ipv6
AddMembership - Join an IPv6 multicast group.
- Ipv6
Dont Frag - Set “don’t fragment packet” flag on the IPv6 packet.
- Ipv6
Drop Membership - Leave an IPv6 multicast group.
- Ipv6
Multicast Hops - Set or read the hop limit value of outgoing IPv6 multicast packets for this socket.
- Ipv6
Orig DstAddr - The
recvmsg(2)
call will return the destination IP address for a UDP datagram. - Ipv6
Recv Err - Control receiving of asynchronous error options.
- Ipv6
Recv Packet Info - Set delivery of the
IPV6_PKTINFO
control message on incoming datagrams. - Ipv6T
Class - Traffic class associated with outgoing packets
- Ipv6Ttl
- Set the unicast hop limit for the socket.
- Ipv6
V6Only - The socket is restricted to sending and receiving IPv6 packets only.
- Keep
Alive - Enable sending of keep-alive messages on connection-oriented sockets.
- Linger
- When enabled, a close(2) or shutdown(2) will not return until all queued messages for the socket have been successfully sent or the linger timeout has been reached.
- Mark
- Set the mark for each packet sent through this socket (similar to the netfilter MARK target but socket-based).
- OobInline
- If this option is enabled, out-of-band data is directly placed into the receive data stream.
- Original
Dst - Pass
Cred - Enable or disable the receiving of the
SCM_CREDENTIALS
control message. - Peer
Credentials - Return the credentials of the foreign process connected to this socket.
- Priority
- Set the protocol-defined priority for all packets to be sent on this socket
- RcvBuf
- Sets or gets the maximum socket receive buffer in bytes.
- RcvBuf
Force - Using this socket option, a privileged (
CAP_NET_ADMIN
) process can perform the same task asSO_RCVBUF
, but thermem_max limit
can be overridden. - Receive
Timeout - Specify the receiving timeout until reporting an error.
- Receive
Timestamp - Enable or disable the receiving of the
SO_TIMESTAMP
control message. - Receive
Timestampns - Enable or disable the receiving of the
SO_TIMESTAMPNS
control message. - Reuse
Addr - Enables local address reuse
- Reuse
Port - Permits multiple AF_INET or AF_INET6 sockets to be bound to an identical socket address.
- RxqOvfl
- Indicates that an unsigned 32-bit value ancillary message (cmsg) should be attached to received skbs indicating the number of packets dropped by the socket since its creation.
- Send
Timeout - Specify the sending timeout until reporting an error.
- SndBuf
- Sets or gets the maximum socket send buffer in bytes.
- SndBuf
Force - Using this socket option, a privileged (
CAP_NET_ADMIN
) process can perform the same task asSO_SNDBUF
, but thewmem_max
limit can be overridden. - Sock
Type - Gets the socket type as an integer.
- Socket
Error - Get and clear the pending socket error.
- TcpCongestion
- This option allows the caller to set the TCP congestion control algorithm to be used, on a per-socket basis.
- TcpFast
Open Connect - Enables TCP Fast Open (RFC 7413) on a connecting socket. If a fast open
cookie is not available (first attempt to connect),
connect
syscall will behave as usual, except for internally trying to solicit a cookie from remote peer. When cookie is available, the nextconnect
syscall will immediately succeed without actually establishing TCP connection. The connection establishment will be defered till the nextwrite
orsendmsg
syscalls on the socket, allowing TCP prtocol to establish connection and send data in the same packets. Note: callingread
right afterconnect
withoutwrite
on the socket will cause the blocking socket to be blocked forever. - TcpKeep
Count - The maximum number of keepalive probes TCP should send before dropping the connection.
- TcpKeep
Idle - The time (in seconds) the connection needs to remain idle before TCP starts sending keepalive probes
- TcpKeep
Interval - The time (in seconds) between individual keepalive probes.
- TcpMax
Seg - The maximum segment size for outgoing TCP packets.
- TcpNo
Delay - Under most circumstances, TCP sends data when it is presented; when outstanding data has not yet been acknowledged, it gathers small amounts of output to be sent in a single packet once an acknowledgement is received. For a small number of clients, such as window systems that send a stream of mouse events which receive no replies, this packetization may cause significant delays. The boolean option TCP_NODELAY defeats this algorithm.
- TcpRepair
- TcpTls
Rx - Set the Kernel TLS read parameters on the TCP socket.
- TcpTls
Tx - Set the Kernel TLS write parameters on the TCP socket.
- TcpUlp
- Set the Upper Layer Protocol (ULP) on the TCP socket.
- TcpUser
Timeout - Specifies the maximum amount of time in milliseconds that transmitted data may remain unacknowledged before TCP will forcibly close the corresponding connection
- Timestamping
- Specifies exact type of timestamping information collected by the kernel Further reading
- TxTime
- Configures the behavior of time-based transmission of packets, for use
with the
TxTime
control message. - UdpGro
Segment - UdpGso
Segment
Enums§
- TlsCrypto
Info - Value used with the
TcpTlsTx
andTcpTlsRx
socket options.