Module sockopt

Source
Expand description

getsockopt and setsockopt functions.

In the rustix API, there is a separate function for each option, so that it can be given an option-specific type signature.

§References for all getter functions:

§References for all set_* functions:

§References for get_socket_* and set_socket_* functions:

§References for get_ip_* and set_ip_* functions:

§References for get_ipv6_* and set_ipv6_* functions:

§References for get_tcp_* and set_tcp_* functions:

Enums§

Timeout
Timeout identifier for use with set_socket_timeout and socket_timeout.

Functions§

ip_multicast_if
getsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF)
ip_multicast_loop
getsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP)
ip_multicast_ttl
getsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL)
ip_recvtos
getsockopt(fd, IPPROTO_IP, IP_RECVTOS)
ip_tos
getsockopt(fd, IPPROTO_IP, IP_TOS)
ip_ttl
getsockopt(fd, IPPROTO_IP, IP_TTL)
ipv6_multicast_hops
getsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS)
ipv6_multicast_if
getsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_IF)
ipv6_multicast_loop
getsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_LOOP)
ipv6_recvtclass
getsockopt(fd, IPPROTO_IPV6, IPV6_RECVTCLASS)
ipv6_tclass
getsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS)
ipv6_unicast_hops
getsockopt(fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS)
ipv6_v6only
getsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY)
set_ip_add_membership
setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, multiaddr, interface)
set_ip_add_membership_with_ifindex
setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, multiaddr, address, ifindex)
set_ip_add_source_membership
setsockopt(fd, IPPROTO_IP, IP_ADD_SOURCE_MEMBERSHIP, value)
set_ip_drop_membership
setsockopt(fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, multiaddr, interface)
set_ip_drop_membership_with_ifindex
setsockopt(fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, multiaddr, interface)
set_ip_drop_source_membership
setsockopt(fd, IPPROTO_IP, IP_DROP_SOURCE_MEMBERSHIP, value)
set_ip_multicast_if
setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF, value)
set_ip_multicast_if_with_ifindex
setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF, multiaddr, address, ifindex)
set_ip_multicast_loop
setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP, value)
set_ip_multicast_ttl
setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL, value)
set_ip_recvtos
setsockopt(fd, IPPROTO_IP, IP_RECVTOS, value)
set_ip_tos
setsockopt(fd, IPPROTO_IP, IP_TOS, value)
set_ip_ttl
setsockopt(fd, IPPROTO_IP, IP_TTL, value)
set_ipv6_add_membership
setsockopt(fd, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, multiaddr, interface)
set_ipv6_drop_membership
setsockopt(fd, IPPROTO_IPV6, IPV6_DROP_MEMBERSHIP, multiaddr, interface)
set_ipv6_multicast_hops
setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, value)
set_ipv6_multicast_if
setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_IF, value)
set_ipv6_multicast_loop
setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, value)
set_ipv6_recvtclass
setsockopt(fd, IPPROTO_IPV6, IPV6_RECVTCLASS, value)
set_ipv6_tclass
setsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS, value)
set_ipv6_unicast_hops
setsockopt(fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, value)
set_ipv6_v6only
setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, value)
set_socket_broadcast
setsockopt(fd, SOL_SOCKET, SO_BROADCAST, value)
set_socket_keepalive
setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, value)
set_socket_linger
setsockopt(fd, SOL_SOCKET, SO_LINGER, value)
set_socket_nosigpipe
setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, value)
set_socket_oobinline
setsockopt(fd, SOL_SOCKET, SO_OOBINLINE, value)
set_socket_recv_buffer_size
setsockopt(fd, SOL_SOCKET, SO_RCVBUF, value)
set_socket_reuseaddr
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, value)—Set whether local addresses may be reused in bind.
set_socket_reuseport
setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, value)
set_socket_send_buffer_size
setsockopt(fd, SOL_SOCKET, SO_SNDBUF, value)
set_socket_timeout
setsockopt(fd, SOL_SOCKET, id, value)—Set the sending or receiving timeout.
set_tcp_keepcnt
setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, value)
set_tcp_keepidle
setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, value)
set_tcp_keepintvl
setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, value)
set_tcp_nodelay
setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, value)
socket_broadcast
getsockopt(fd, SOL_SOCKET, SO_BROADCAST)
socket_error
getsockopt(fd, SOL_SOCKET, SO_ERROR)
socket_keepalive
getsockopt(fd, SOL_SOCKET, SO_KEEPALIVE)
socket_linger
getsockopt(fd, SOL_SOCKET, SO_LINGER)
socket_nosigpipe
getsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE)
socket_oobinline
getsockopt(fd, SOL_SOCKET, SO_OOBINLINE)
socket_recv_buffer_size
getsockopt(fd, SOL_SOCKET, SO_RCVBUF)
socket_reuseaddr
getsockopt(fd, SOL_SOCKET, SO_REUSEADDR)
socket_reuseport
getsockopt(fd, SOL_SOCKET, SO_REUSEPORT)
socket_send_buffer_size
getsockopt(fd, SOL_SOCKET, SO_SNDBUF)
socket_timeout
getsockopt(fd, SOL_SOCKET, id)—Get the sending or receiving timeout.
socket_type
getsockopt(fd, SOL_SOCKET, SO_TYPE)—Returns the type of a socket.
tcp_keepcnt
getsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT)
tcp_keepidle
getsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE)
tcp_keepintvl
getsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL)
tcp_nodelay
getsockopt(fd, IPPROTO_TCP, TCP_NODELAY)