Skip to main content

Module socket

Module socket 

Source

Re-exports§

pub use ::dns_lookup as dns;
pub use ::socket2 as raw;

Structs§

AncillaryMessage
RawSocketAddress
RecvMsgResult
sockaddr_alg
sockaddr_can
sockaddr_storage

Enums§

AncillaryPackError

Constants§

AF_ALG
AF_APPLETALK
AF_ASH
AF_ATMPVC
AF_ATMSVC
AF_AX25
AF_BLUETOOTH
AF_BRIDGE
AF_CAN
AF_DECnet
AF_ECONET
AF_INET
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
AF_INET6
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
AF_IPX
AF_IRDA
AF_KEY
AF_LLC
AF_NETBEUI
AF_NETLINK
AF_NETROM
AF_PACKET
AF_PPPOX
AF_RDS
AF_ROUTE
AF_SECURITY
AF_SNA
AF_TIPC
AF_UNIX
AF_UNSPEC
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
AF_VSOCK
AF_WANPIPE
AF_X25
AI_ADDRCONFIG
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
AI_ALL
AI_CANONNAME
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
AI_NUMERICHOST
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
AI_NUMERICSERV
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
AI_PASSIVE
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
AI_V4MAPPED
ALG_OP_DECRYPT
ALG_OP_ENCRYPT
ALG_SET_AEAD_ASSOCLEN
ALG_SET_AEAD_AUTHSIZE
ALG_SET_IV
ALG_SET_KEY
ALG_SET_OP
BDADDR_ANY
Bluetooth wildcard / local addresses. Header strings, not libc names.
BDADDR_LOCAL
CAN_BCM
CAN_BCM_CAN_FD_FRAME
CAN_BCM_RX_ANNOUNCE_RESUME
CAN_BCM_RX_CHANGED
CAN_BCM_RX_CHECK_DLC
CAN_BCM_RX_DELETE
CAN_BCM_RX_FILTER_ID
CAN_BCM_RX_NO_AUTOTIMER
CAN_BCM_RX_READ
CAN_BCM_RX_RTR_FRAME
CAN_BCM_RX_SETUP
CAN_BCM_RX_STATUS
CAN_BCM_RX_TIMEOUT
CAN_BCM_SETTIMER
CAN_BCM_STARTTIMER
CAN_BCM_TX_ANNOUNCE
CAN_BCM_TX_COUNTEVT
CAN_BCM_TX_CP_CAN_ID
CAN_BCM_TX_DELETE
CAN_BCM_TX_EXPIRED
CAN_BCM_TX_READ
CAN_BCM_TX_RESET_MULTI_IDX
CAN_BCM_TX_SEND
CAN_BCM_TX_SETUP
linux/can/bcm.h opcodes and flags. Not in libc.
CAN_BCM_TX_STATUS
CAN_EFF_FLAG
CAN_EFF_MASK
CAN_ERR_FLAG
CAN_ERR_MASK
CAN_ISOTP
CAN_J1939
CAN_RAW
CAN_RAW_ERR_FILTER
CAN_RAW_FD_FRAMES
CAN_RAW_FILTER
CAN_RAW_JOIN_FILTERS
CAN_RAW_LOOPBACK
CAN_RAW_RECV_OWN_MSGS
CAN_RTR_FLAG
CAN_SFF_MASK
EAI_AGAIN
EAI_BADFLAGS
EAI_FAIL
EAI_FAMILY
EAI_MEMORY
EAI_NODATA
EAI_NONAME
EAI_OVERFLOW
EAI_SERVICE
EAI_SOCKTYPE
EAI_SYSTEM
INADDR_ALLHOSTS_GROUP
INADDR_ANY
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
INADDR_BROADCAST
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
INADDR_LOOPBACK
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
INADDR_MAX_LOCAL_GROUP
INADDR_NONE
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
INADDR_UNSPEC_GROUP
Multicast groups as unsigned host-order words. Windows publishes the same bits as signed C longs (INADDR_*_GROUP below).
IPPORT_RESERVED
Port numbers some Unix libcs omit. Windows takes IPPORT_RESERVED from WinSock and defines IPPORT_USERRESERVED beside the other extras.
IPPORT_USERRESERVED
IPPROTO_AH
IP6 Auth Header
IPPROTO_DSTOPTS
IP6 destination option
IPPROTO_EGP
exterior gateway protocol
IPPROTO_ESP
IP6 Encap Sec. Payload
IPPROTO_FRAGMENT
IP6 fragmentation header
IPPROTO_GRE
General Routing Encap.
IPPROTO_HOPOPTS
Hop-by-hop option header
IPPROTO_ICMP
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
IPPROTO_ICMPV6
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
IPPROTO_IDP
xns idp
IPPROTO_IGMP
group mgmt protocol
IPPROTO_IP
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
IPPROTO_IPIP
for compatibility
IPPROTO_IPV6
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
IPPROTO_MPTCP
Multipath TCP
IPPROTO_NONE
IP6 no next header
IPPROTO_PIM
Protocol indep. multicast
IPPROTO_PUP
pup
IPPROTO_RAW
raw IP packet
IPPROTO_ROUTING
IP6 routing header
IPPROTO_RSVP
resource reservation
IPPROTO_SCTP
SCTP
IPPROTO_TCP
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
IPPROTO_TP
tp-4 w/ class negotiation
IPPROTO_UDP
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
IPPROTO_UDPLITE
IPV6_CHECKSUM
IPV6_DONTFRAG
IPV6_DSTOPTS
IPV6_HOPLIMIT
IPV6_HOPOPTS
IPV6_JOIN_GROUP
<netinet/in.h> join/leave and routing-header type. libc omits them on linux-gnu.
IPV6_LEAVE_GROUP
IPV6_MULTICAST_HOPS
IPV6_MULTICAST_IF
IPV6_MULTICAST_LOOP
IPV6_NEXTHOP
IPV6_PATHMTU
IPV6_PKTINFO
IPV6_RECVDSTOPTS
IPV6_RECVHOPLIMIT
IPV6_RECVHOPOPTS
IPV6_RECVPATHMTU
IPV6_RECVPKTINFO
IPV6_RECVRTHDR
IPV6_RECVTCLASS
IPV6_RTHDR
IPV6_RTHDRDSTOPTS
IPV6_RTHDR_TYPE_0
IPV6_TCLASS
IPV6_UNICAST_HOPS
IPV6_V6ONLY
IP_ADD_MEMBERSHIP
IP_DEFAULT_MULTICAST_LOOP
IP_DROP_MEMBERSHIP
IP_HDRINCL
IP_MULTICAST_IF
IP_MULTICAST_LOOP
IP_MULTICAST_TTL
IP_OPTIONS
IP_RECVOPTS
IP_RECVTOS
IP_RETOPTS
IP_TOS
IP_TRANSPARENT
IP_TTL
J1939_IDLE_ADDR
J1939_MAX_UNICAST_ADDR
J1939_NLA_BYTES_ACKED
J1939_NLA_PAD
J1939_NO_ADDR
J1939_NO_NAME
J1939_NO_PGN
J1939_PGN_ADDRESS_CLAIMED
J1939_PGN_ADDRESS_COMMANDED
J1939_PGN_MAX
J1939_PGN_PDU1_MAX
J1939_PGN_REQUEST
MSG_CMSG_CLOEXEC
MSG_CONFIRM
MSG_CTRUNC
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
MSG_DONTROUTE
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
MSG_DONTWAIT
MSG_EOR
MSG_ERRQUEUE
MSG_FASTOPEN
MSG_MORE
MSG_NOSIGNAL
MSG_OOB
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
MSG_PEEK
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
MSG_TRUNC
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
MSG_WAITALL
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
NETLINK_CRYPTO
NETLINK_DNRTMSG
NETLINK_FIREWALL
NETLINK_IP6_FW
NETLINK_NFLOG
NETLINK_ROUTE
NETLINK_USERSOCK
NETLINK_XFRM
NI_DGRAM
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
NI_MAXHOST
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
NI_MAXSERV
POSIX <netdb.h> NI_MAXSERV. libc omits it on linux-gnu.
NI_NAMEREQD
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
NI_NOFQDN
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
NI_NUMERICHOST
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
NI_NUMERICSERV
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
PF_CAN
PF_PACKET
PF_RDS
SCM_CREDENTIALS
SCM_J1939_DEST_ADDR
SCM_J1939_DEST_NAME
SCM_J1939_ERRQUEUE
SCM_J1939_PRIO
SCM_RIGHTS
SHUT_RD
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
SHUT_RDWR
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
SHUT_WR
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
SOCK_CLOEXEC
SOCK_DGRAM
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
SOCK_NONBLOCK
SOCK_RAW
SOCK_RDM
SOCK_SEQPACKET
SOCK_STREAM
SOL_ALG
SOL_CAN_BASE
SOL_CAN_RAW
SOL_IP
SOL_RDS
SOL_SOCKET
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
SOL_TIPC
SOL_UDP
SOMAXCONN
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
SO_ACCEPTCONN
SO_BINDTODEVICE
SO_BROADCAST
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
SO_DEBUG
SO_DOMAIN
SO_DONTROUTE
SO_ERROR
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
SO_J1939_ERRQUEUE
SO_J1939_FILTER
SO_J1939_PROMISC
SO_J1939_SEND_PRIO
SO_KEEPALIVE
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
SO_LINGER
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
SO_MARK
SO_OOBINLINE
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
SO_PASSCRED
SO_PASSSEC
SO_PEERCRED
SO_PEERSEC
SO_PRIORITY
SO_PROTOCOL
SO_RCVBUF
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
SO_RCVLOWAT
SO_RCVTIMEO
SO_REUSEADDR
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
SO_REUSEPORT
SO_SNDBUF
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
SO_SNDLOWAT
SO_SNDTIMEO
SO_TYPE
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
SO_VM_SOCKETS_BUFFER_MAX_SIZE
SO_VM_SOCKETS_BUFFER_MIN_SIZE
SO_VM_SOCKETS_BUFFER_SIZE
linux/vm_sockets.h. libc does not bind the vsock sockopt / cid names.
TCP_CONGESTION
TCP_CORK
TCP_DEFER_ACCEPT
TCP_FASTOPEN
TCP_INFO
TCP_KEEPCNT
TCP_KEEPIDLE
TCP_KEEPINTVL
TCP_LINGER2
TCP_MAXSEG
TCP_NODELAY
Integer names the VM published from libc as c on unix. Windows already takes the overlapping set from this module.
TCP_QUICKACK
TCP_SYNCNT
TCP_USER_TIMEOUT
TCP_WINDOW_CLAMP
UDPLITE_RECV_CSCOV
UDPLITE_SEND_CSCOV
netinet/udplite.h. libc does not bind the coverage sockopts.
VMADDR_CID_ANY
VMADDR_CID_HOST
VMADDR_PORT_ANY
VM_SOCKETS_INVALID_VERSION

Functions§

checked_cmsg_len
checked_cmsg_space
close_socket_ignore_connreset
gai_error_string
getsockopt_bytes
getsockopt_int
h_error_string
hostname
Returns the system’s hostname.
if_indextoname_checked
if_nameindex
if_nametoindex_checked
mac_address
Returns a universally administered MAC address when available, otherwise the first locally administered address, or None when lookup fails.
pack_ancillary_messages
parse_ancillary_messages
recvmsg
sendmsg_afalg
sethostname
Set the system’s hostname from its filesystem-encoded bytes.
setsockopt_bytes
setsockopt_int
setsockopt_none

Type Aliases§

SocketAddressBytes
sa_family_t
socklen_t