Modules

Socket

moduleSource

Available on macOS, Linux, Windows, Wasm

#import "Socket";

Network sockets for TCP, UDP and Unix-domain use: Berkeley sockets on Unix, Winsock on Windows.

The native calls (socket, bind, listen, connect, send, recv, select, ...) keep their system signatures. Around them are portable helpers: socket_init, set_blocking, set_keepalive, close_and_reset, bind and accept overloads that take a text address, FD_SET and friends, and to_string for addresses. For HTTP, TLS or an event loop use Extensions/Http, Extensions/Tls and Extensions/Io.

A call fails the way the system's does: it returns -1 (or INVALID_SOCKET) and get_last_socket_error() has the code. Close every socket you create or accept with close_and_reset. Sockets start blocking; after set_blocking(s, false), calls return at once with SOCKET_WOULDBLOCK and reads and writes may move fewer bytes than asked. Call socket_init first on Windows. Ports in sockaddr_in are in network order (htons); the bind helpers take host order. to_string allocates with context.allocator.

Example
assert(socket_init());

listener := socket(AF_INET, .SOCK_STREAM, .TCP);
defer close_and_reset(*listener);

// Port 0 lets the OS choose; getsockname tells which one it was.
assert(bind(listener, "127.0.0.1", 0) == 0);
assert(listen(listener, 4) == 0);

address: sockaddr_in;
length: socklen_t = size_of(sockaddr_in);
assert(getsockname(listener, cast(*sockaddr) *address, *length) == 0);

client := socket(AF_INET, .SOCK_STREAM, .TCP);
defer close_and_reset(*client);
assert(connect(client, cast(*sockaddr) *address, length) == 0);

server, peer := accept(listener);
defer close_and_reset(*server);

assert(send(client, "ping".data, 4, cast(MSG) 0) == 4);

buffer: [16] u8;
got := recv(server, buffer.data, buffer.count, cast(MSG) 0);
assert(got == 4 && string.{got, buffer.data} == "ping");

Doesn't run in the browser (skipped on wasm).

Procedures#

Socket#

(builder: *String_Builder, address: u32)
(builder: *String_Builder, address: [16] u8)

Appends an IPv4 address to builder as dotted decimal, such as 127.0.0.1.

builder: String_Builder;
defer free_buffers(*builder);

append_address(*builder, htonl(INADDR_LOOPBACK));
text := builder_to_string(*builder);
defer free(text);

assert(text == "127.0.0.1");

Doesn't run in the browser (skipped on wasm).

to_string2 overloadsSource
(addr: sockaddr_in) -> string
(addr: sockaddr_in6) -> string

Formats an IPv4 endpoint as address:port, such as 127.0.0.1:8080.

address: sockaddr_in;
address.sin_family = AF_INET;
address.sin_port = htons(8080);

#if OS == .WINDOWS address.sin_addr.S_un.S_addr = htonl(INADDR_LOOPBACK);
else address.sin_addr.s_addr = htonl(INADDR_LOOPBACK);

text := to_string(address);
defer free(text);

assert(text == "127.0.0.1:8080");

// An all-zero record is the unspecified address on port 0.
empty: sockaddr_in;
zero := to_string(empty);
defer free(zero);

assert(zero == "0.0.0.0:0");

Doesn't run in the browser (skipped on wasm).

accept6 overloadsSource
(s: SOCKET, addr: *sockaddr, addrlen: *s32) -> SOCKET
(fd: s32, address: *sockaddr, length: *socklen_t) -> s32
(unknown0: s32, unknown1: *sockaddr, unknown2: *socklen_t) -> s32
(__fd: s32, __addr: *sockaddr, __addr_len: *socklen_t) -> s32
(__fd: s32, __addr: *sockaddr, __addr_length: *socklen_t) -> s32

Takes the next pending connection from the listening socket s and returns it with the peer's IPv4 address.

assert(socket_init());

listener := socket(AF_INET, .SOCK_STREAM, .TCP);
defer close_and_reset(*listener);

assert(bind(listener, "127.0.0.1", 0) == 0);
assert(listen(listener, 4) == 0);

local: sockaddr_in;
length: socklen_t = size_of(sockaddr_in);
assert(getsockname(listener, cast(*sockaddr) *local, *length) == 0);

client := socket(AF_INET, .SOCK_STREAM, .TCP);
defer close_and_reset(*client);
assert(connect(client, cast(*sockaddr) *local, length) == 0);

peer, from := accept(listener);
defer close_and_reset(*peer);

assert(peer != INVALID_SOCKET);
assert(from.sin_family == AF_INET);

Doesn't run in the browser (skipped on wasm).

The IPv6 form of accept: takes the next pending connection from s and returns it with the peer's IPv6 address.

assert(socket_init());

listener := socket(AF_INET6, .SOCK_STREAM, .TCP);

// Hosts without IPv6 or without ::1 have nothing to show.
if listener != INVALID_SOCKET {
    defer close_and_reset(*listener);

    if bind(listener, "::1", 0, AF_INET6) == 0 {
        assert(listen(listener, 4) == 0);

        local: sockaddr_in6;
        length: socklen_t = size_of(sockaddr_in6);
        assert(getsockname(listener, cast(*sockaddr) *local, *length) == 0);

        client := socket(AF_INET6, .SOCK_STREAM, .TCP);
        defer close_and_reset(*client);
        assert(connect(client, cast(*sockaddr) *local, length) == 0);

        peer, from := accept_v6(listener);
        defer close_and_reset(*peer);

        assert(peer != INVALID_SOCKET);
        assert(from.sin6_family == AF_INET6);
    }
}

Doesn't run in the browser (skipped on wasm).

bind8 overloadsSource
(s: Socket, address: string, port: u16, family: type_of(sockaddr_in.sin_family) = AF_INET) -> s32
(s: Socket, address: u32, port: u16) -> s32
(s: Socket, address: [16] u8, port: u16) -> s32
(s: SOCKET, name: *sockaddr, namelen: s32) -> s32
(fd: s32, address: *sockaddr, length: socklen_t) -> s32
(unknown0: s32, unknown1: *sockaddr, unknown2: socklen_t) -> s32
(__fd: s32, __addr: *sockaddr, __len: socklen_t) -> s32
(__fd: s32, __addr: *sockaddr, __addr_length: socklen_t) -> s32

Binds s to a numeric address written as text and a port, and returns 0 on success.

assert(socket_init());

s := socket(AF_INET, .SOCK_STREAM, .TCP);
defer close_and_reset(*s);

assert(bind(s, "127.0.0.1", 0) == 0);
assert(bind(s, "not an address", 0) == -1);
assert(bind(s, "::1", 0) == -1);

Doesn't run in the browser (skipped on wasm).

Winsock control#

(x: u8, y: u8, $T: Type) -> s32

Builds a Winsock ioctlsocket control code from a group character, a command number and the type of its argument.

Socket Windows#

() -> bool
() -> bool
() -> bool

Starts Winsock 2.2 and returns whether it is ready.

assert(socket_init());

Doesn't run in the browser (skipped on wasm).

() -> Wasi.OS_Error_Code

The error code of the last failed socket call on this thread: WSAGetLastError on Windows, errno on Unix.

assert(socket_init());
s := socket(AF_INET, .SOCK_STREAM, .TCP);
defer close_and_reset(*s);

// Nothing listens on port 1, so the connection is refused.
address: sockaddr_in;
address.sin_family = AF_INET;
address.sin_port = htons(1);
#if OS == .WINDOWS address.sin_addr.S_un.S_addr = htonl(INADDR_LOOPBACK);
else address.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
length: socklen_t = size_of(sockaddr_in);
assert(connect(s, cast(*sockaddr) *address, length) != 0);
assert(get_last_socket_error() != 0);

Doesn't run in the browser (skipped on wasm).

(s: Socket, keepalive: bool, idle_seconds_before_keepalive: s32 = 0, keepalive_interval_seconds: s32 = 0, num_keepalive_attempts: s32 = 0) -> bool
(s: Socket, keepalive: bool, idle_seconds_before_keepalive: s32 = 0, keepalive_interval_seconds: s32 = 0, num_keepalive_attempts: s32 = 0) -> bool
(s: Socket, keepalive: bool, idle_seconds_before_keepalive: s32 = 0, keepalive_interval_seconds: s32 = 0, num_keepalive_attempts: s32 = 0) -> bool

Turns TCP keep-alive probes on s on or off and returns whether it worked.

assert(socket_init());

s := socket(AF_INET, .SOCK_STREAM, .TCP);
defer close_and_reset(*s);

assert(set_keepalive(s, true));
assert(set_keepalive(s, true, 30, 5, 4));
assert(set_keepalive(s, false));

Doesn't run in the browser (skipped on wasm).

(s: *Socket, loc := #caller_location)
(s: *Socket, loc := #caller_location)
(s: *Socket, loc := #caller_location)

Closes the socket s points to and sets it to INVALID_SOCKET.

assert(socket_init());

s := socket(AF_INET, .SOCK_STREAM, .TCP);
assert(s != INVALID_SOCKET);

close_and_reset(*s);
assert(s == INVALID_SOCKET);
close_and_reset(*s);  // safe to repeat

Doesn't run in the browser (skipped on wasm).

FD_SET3 overloadsSource
(fd: Socket, set: *fd_set)
(fd: s32, set: *fd_set)
(fd: s32, set: *fd_set)

Adds fd to set. A socket already in the set is not added twice, and a full set (fd_array.count sockets, 64 by default) ignores further sockets without an error.

assert(socket_init());
s := socket(AF_INET, .SOCK_STREAM, .TCP);
defer close_and_reset(*s);

set: fd_set;
FD_SET(s, *set);
assert(FD_ISSET(s, *set) != 0);

Doesn't run in the browser (skipped on wasm).

Socket fields Windows#

Socket wasm#

Socket cmsg#

(mhdr: *msghdr) -> *cmsghdr

Returns the first control message of message, or null when its control buffer is smaller than one header.

message: msghdr;
assert(CMSG_FIRSTHDR(*message) == null);

buffer: [64] u8;
message.msg_control = buffer.data;
message.msg_controllen = xx buffer.count;
assert(cast(*u8) CMSG_FIRSTHDR(*message) == buffer.data);

Doesn't run in the browser (only on linux, macos).

(cmsg: *cmsghdr) -> *u8

Returns the payload of control message cmsg: the first byte after its header, rounded up to the platform's alignment.

(size: int) -> int

Rounds size up to the alignment of control message data: 4 bytes on macOS, 8 elsewhere. A negative size, or one too large to round, fails an assertion.

assert(CMSG_ALIGN(0) == 0);
assert(CMSG_ALIGN(1) % 4 == 0);
assert(CMSG_ALIGN(CMSG_ALIGN(5)) == CMSG_ALIGN(5));

Doesn't run in the browser (only on linux, macos).

(size: int) -> u32

The value for a control message's cmsg_len when its payload is size bytes: the aligned header plus size, without padding after the payload. Fails an assertion for a negative size or one that does not fit in a u32.

// A descriptor-passing message carries one s32.
assert(CMSG_LEN(size_of(s32)) == cast(u32) (CMSG_ALIGN(size_of(cmsghdr)) + size_of(s32)));

Doesn't run in the browser (only on linux, macos).

(size: int) -> u32

The buffer space one control message with a size-byte payload needs: the aligned header plus the aligned payload. Use it for msg_controllen and for sizing the buffer. Fails an assertion for a negative size or one that does not fit.

assert(CMSG_SIZE(0) >= cast(u32) size_of(cmsghdr));
assert(CMSG_SIZE(size_of(s32)) >= CMSG_LEN(size_of(s32)));

Doesn't run in the browser (only on linux, macos).

Socket fields macOS#

(fields: tcphdr) -> u32

Reads the header length of a TCP header, in 32-bit words (4 bits) from fields.

(fields: *tcphdr, value: u32)

Sets the header length of a TCP header, in 32-bit words (4 bits) in fields, keeping the other bits.

(fields: tcphdr) -> u32

Reads the 4 reserved bits of a TCP header, which are zero in valid segments from fields.

(fields: *tcphdr, value: u32)

Sets the 4 reserved bits of a TCP header, which are zero in valid segments in fields, keeping the other bits.

(fields: *tcp_connection_info, value: u32)

Sets the padding bits at the end of the connection info, which carry no information in fields, keeping the other bits.

Socket fields TCP Unix#

(fields: *tcphdr, value: u16)

Sets the first group of reserved bits of a TCP header, which are zero in valid segments in fields, keeping the other bits.

(fields: *tcphdr, value: u16)

Sets the second group of reserved bits of a TCP header, which are zero in valid segments in fields, keeping the other bits.

(fields: *tcphdr, value: u8)

Sets the 4 reserved bits of a TCP header, which are zero in valid segments in fields, keeping the other bits.

(fields: *tcp_info, value: u8)

Sets the window scale shift the connection uses for what it receives in fields, keeping the other bits.

(fields: *tcp_info, value: u8)

Sets the window scale shift the connection uses for what it sends in fields, keeping the other bits.

Socket ABI Windows#

getnameinfoforeign4 overloadsSource
(pSockaddr: *SOCKADDR, SockaddrLength: socklen_t, pNodeBuffer: *u8, NodeBufferSize: u32, pServiceBuffer: *u8, ServiceBufferSize: u32, Flags: s32) -> s32
(unknown0: *sockaddr, unknown1: socklen_t, unknown2: *u8, unknown3: socklen_t, unknown4: *u8, unknown5: socklen_t, unknown6: s32) -> s32
(__sa: *sockaddr, __salen: socklen_t, __host: *u8, __hostlen: socklen_t, __serv: *u8, __servlen: socklen_t, __flags: s32) -> s32
(__sa: *sockaddr, __sa_length: socklen_t, __host: *u8, __host_length: u64, __service: *u8, __service_length: u64, __flags: s32) -> s32
(pSockaddr: *SOCKADDR, SockaddrLength: socklen_t, pNodeBuffer: *s16, NodeBufferSize: u32, pServiceBuffer: *s16, ServiceBufferSize: u32, Flags: s32) -> s32
getsockoptforeign5 overloadsSource
(s: SOCKET, level: s32, optname: s32, optval: *u8, optlen: *s32) -> s32
(fd: s32, level: s32, name: s32, value: *void, length: *socklen_t) -> s32
(unknown0: s32, unknown1: s32, unknown2: s32, unknown3: *void, unknown4: *socklen_t) -> s32
(__fd: s32, __level: s32, __optname: s32, __optval: *void, __optlen: *socklen_t) -> s32
(__fd: s32, __level: s32, __option: s32, __value: *void, __value_length: *socklen_t) -> s32
htonlforeign5 overloadsSource
(hostlong: u32) -> u32
(value: u32) -> u32
(hostlong: u32) -> u32
(__hostlong: u32) -> u32
(hostlong: u32) -> u32
htonsforeign5 overloadsSource
(hostshort: u16) -> u16
(value: u16) -> u16
(hostshort: u16) -> u16
(__hostshort: u16) -> u16
(hostshort: u16) -> u16
inet_ntopforeign4 overloadsSource
(Family: s32, pAddr: *void, pStringBuf: *u8, StringBufSize: u64) -> *u8
(unknown0: s32, unknown1: *void, unknown2: *u8, unknown3: socklen_t) -> *u8
(__af: s32, __cp: *void, __buf: *u8, __len: socklen_t) -> *u8
(__af: s32, __src: *void, __dst: *u8, __size: socklen_t) -> *u8
inet_ptonforeign5 overloadsSource
(Family: s32, pszAddrString: *u8, pAddrBuf: *void) -> s32
(family: s32, source: *u8, destination: *void) -> s32
(unknown0: s32, unknown1: *u8, unknown2: *void) -> s32
(__af: s32, __cp: *u8, __buf: *void) -> s32
(__af: s32, __src: *u8, __dst: *void) -> s32
(Family: s32, pAddr: *void, pStringBuf: *s16, StringBufSize: u64) -> *s16
(Family: s32, pszAddrString: *s16, pAddrBuf: *void) -> s32
listenforeign5 overloadsSource
(s: SOCKET, backlog: s32) -> s32
(fd: s32, backlog: s32) -> s32
(unknown0: s32, unknown1: s32) -> s32
(__fd: s32, __n: s32) -> s32
(__fd: s32, __backlog: s32) -> s32
ntohlforeign5 overloadsSource
(netlong: u32) -> u32
(value: u32) -> u32
(netlong: u32) -> u32
(__netlong: u32) -> u32
(netlong: u32) -> u32
ntohsforeign5 overloadsSource
(netshort: u16) -> u16
(value: u16) -> u16
(netshort: u16) -> u16
(__netshort: u16) -> u16
(netshort: u16) -> u16
recvforeign5 overloadsSource
(s: SOCKET, buf: *u8, len: s32, flags: MSG) -> s32
(fd: s32, buffer: *void, count: u64, flags: MSG) -> s64
(unknown0: s32, unknown1: *void, unknown2: u64, unknown3: MSG) -> s64
(__fd: s32, __buf: *void, __n: u64, __flags: MSG) -> s64
(__fd: s32, __buf: *void, __n: u64, __flags: MSG) -> s64
recvfromforeign5 overloadsSource
(s: SOCKET, buf: *u8, len: s32, flags: MSG, from: *sockaddr, fromlen: *s32) -> s32
(fd: s32, buffer: *void, count: u64, flags: MSG, address: *sockaddr, length: *socklen_t) -> s64
(unknown0: s32, unknown1: *void, unknown2: u64, unknown3: MSG, unknown4: *sockaddr, unknown5: *socklen_t) -> s64
(__fd: s32, __buf: *void, __n: u64, __flags: MSG, __addr: *sockaddr, __addr_len: *socklen_t) -> s64
(__fd: s32, __buf: *void, __n: u64, __flags: MSG, __src_addr: *sockaddr, __src_addr_length: *socklen_t) -> s64
selectforeign6 overloadsSource
(nfds: s32, readfds: *fd_set, writefds: *fd_set, exceptfds: *fd_set, timeout: *TIMEVAL) -> s32
(count: s32, readers: *fd_set, writers: *fd_set, failures: *fd_set, timeout: *timeval) -> s32
(nfds: s32, readfds: *fd_set, writefds: *fd_set, exceptfds: *fd_set, timeout: *TIMEVAL) -> s32
(nfds: s32, readfds: *fd_set, writefds: *fd_set, exceptfds: *fd_set, timeout: *TIMEVAL) -> s32
(__nfds: s32, __readfds: *fd_set, __writefds: *fd_set, __exceptfds: *fd_set, __timeout: *TIMEVAL) -> s32
(__max_fd_plus_one: s32, __read_fds: *fd_set, __write_fds: *fd_set, __exception_fds: *fd_set, __timeout: *TIMEVAL) -> s32
sendforeign5 overloadsSource
(s: SOCKET, buf: *u8, len: s32, flags: MSG) -> s32
(fd: s32, buffer: *void, count: u64, flags: MSG) -> s64
(unknown0: s32, unknown1: *void, unknown2: u64, unknown3: MSG) -> s64
(__fd: s32, __buf: *void, __n: u64, __flags: MSG) -> s64
(__fd: s32, __buf: *void, __n: u64, __flags: MSG) -> s64
sendtoforeign5 overloadsSource
(s: SOCKET, buf: *u8, len: s32, flags: MSG, to: *sockaddr, tolen: s32) -> s32
(fd: s32, buffer: *void, count: u64, flags: MSG, address: *sockaddr, length: socklen_t) -> s64
(unknown0: s32, unknown1: *void, unknown2: u64, unknown3: MSG, unknown4: *sockaddr, unknown5: socklen_t) -> s64
(__fd: s32, __buf: *void, __n: u64, __flags: MSG, __addr: *sockaddr, __addr_len: socklen_t) -> s64
(__fd: s32, __buf: *void, __n: u64, __flags: MSG, __dst_addr: *sockaddr, __dst_addr_length: socklen_t) -> s64
setsockoptforeign5 overloadsSource
(s: SOCKET, level: s32, optname: s32, optval: *u8, optlen: s32) -> s32
(fd: s32, level: s32, name: s32, value: *void, length: socklen_t) -> s32
(unknown0: s32, unknown1: s32, unknown2: s32, unknown3: *void, unknown4: socklen_t) -> s32
(__fd: s32, __level: s32, __optname: s32, __optval: *void, __optlen: socklen_t) -> s32
(__fd: s32, __level: s32, __option: s32, __value: *void, __value_length: socklen_t) -> s32
shutdownforeign5 overloadsSource
(s: SOCKET, how: s32) -> s32
(fd: s32, how: SHUT) -> s32
(unknown0: s32, unknown1: SHUT) -> s32
(__fd: s32, __how: SHUT) -> s32
(__fd: s32, __how: SHUT) -> s32
(hLookup: HANDLE, dwControlCode: u32, lpvInBuffer: *void, cbInBuffer: u32, lpvOutBuffer: *void, cbOutBuffer: u32, lpcbBytesReturned: *u32, lpCompletion: *WSACOMPLETION) -> s32
(pSockaddr: *SOCKADDR, SockaddrLength: socklen_t, pNodeBuffer: *u8, NodeBufferSize: u32, pServiceBuffer: *u8, ServiceBufferSize: u32, Flags: s32) -> s32
(pSockaddr: *SOCKADDR, SockaddrLength: socklen_t, pNodeBuffer: *u8, NodeBufferSize: u32, pServiceBuffer: *u8, ServiceBufferSize: u32, Flags: s32) -> s32
(Family: s32, pAddr: *void, pStringBuf: *u8, StringBufSize: u64) -> *u8
(Family: s32, pAddr: *void, pStringBuf: *u8, StringBufSize: u64) -> *u8
(Family: s32, pszAddrString: *u8, pAddrBuf: *void) -> s32
(Family: s32, pszAddrString: *u8, pAddrBuf: *void) -> s32

Socket ABI macOS#

(unknown0: s32, unknown1: *void, unknown2: s32, unknown3: *u8) -> *u8
(unknown0: s32, unknown1: *u8, unknown2: *void) -> s32
gai_strerrorforeign3 overloadsSource
(unknown0: s32) -> *u8
(__ecode: s32) -> *u8
(__error: s32) -> *u8
getnetgrentforeign2 overloadsSource
(unknown0: **u8, unknown1: **u8, unknown2: **u8) -> s32
(__hostp: **u8, __userp: **u8, __domainp: **u8) -> s32
herrorforeign3 overloadsSource
(unknown0: *u8) -> void
(__str: *u8) -> void
(__s: *u8) -> void
hstrerrorforeign3 overloadsSource
(unknown0: s32) -> *u8
(__err_num: s32) -> *u8
(__error: s32) -> *u8
if_indextonameforeign3 overloadsSource
(unknown0: u32, unknown1: *u8) -> *u8
(__ifindex: u32, __ifname: *u8) -> *u8
(__index: u32, __buf: *u8) -> *u8
if_nametoindexforeign3 overloadsSource
(unknown0: *u8) -> u32
(__ifname: *u8) -> u32
(__name: *u8) -> u32
inet6_opt_appendforeign2 overloadsSource
(unknown0: *void, unknown1: socklen_t, unknown2: s32, unknown3: u8, unknown4: socklen_t, unknown5: u8, unknown6: **void) -> s32
(__extbuf: *void, __extlen: socklen_t, __offset: s32, __type: u8, __len: socklen_t, __align: u8, __databufp: **void) -> s32
inet6_rth_initforeign2 overloadsSource
(unknown0: *void, unknown1: socklen_t, unknown2: s32, unknown3: s32) -> *void
(__bp: *void, __bp_len: socklen_t, __type: s32, __segments: s32) -> *void
inet6_rth_reverseforeign2 overloadsSource
(unknown0: *void, unknown1: *void) -> s32
(__in: *void, __out: *void) -> s32
(unknown0: s32, unknown1: *void, unknown2: s32, unknown3: *u8, unknown4: u64) -> *u8
(unknown0: s32, unknown1: *u8, unknown2: *void, unknown3: u64) -> s32
inet_nsap_addrforeign3 overloadsSource
(unknown0: *u8, unknown1: *u8, unknown2: s32) -> u32
(__cp: *u8, __buf: *u8, __len: s32) -> u32
(__ascii: *u8, __binary: *u8, __n: s32) -> u32
inet_nsap_ntoaforeign3 overloadsSource
(unknown0: s32, unknown1: *u8, unknown2: *u8) -> *u8
(__len: s32, __cp: *u8, __buf: *u8) -> *u8
(__binary_length: s32, __binary: *u8, __ascii: *u8) -> *u8
innetgrforeign2 overloadsSource
(unknown0: *u8, unknown1: *u8, unknown2: *u8, unknown3: *u8) -> s32
(__netgroup: *u8, __host: *u8, __user: *u8, __domain: *u8) -> s32
(unknown0: s32, unknown1: s32, unknown2: s64, unknown3: *s64, unknown4: *sf_hdtr, unknown5: s32) -> s32
sethostentforeign3 overloadsSource
(unknown0: s32) -> void
(__stay_open: s32) -> void
(__stay_open: s32) -> void
setnetentforeign3 overloadsSource
(unknown0: s32) -> void
(__stay_open: s32) -> void
(__stay_open: s32) -> void
setnetgrentforeign2 overloadsSource
(unknown0: *u8) -> void
(__netgroup: *u8) -> s32
setprotoentforeign3 overloadsSource
(unknown0: s32) -> void
(__stay_open: s32) -> void
(__stay_open: s32) -> void
setserventforeign3 overloadsSource
(unknown0: s32) -> void
(__stay_open: s32) -> void
(__stay_open: s32) -> void
socketpairforeign3 overloadsSource
(unknown0: s32, unknown1: SOCK, unknown2: IPPROTO, unknown3: *[2] s32) -> s32
(__domain: s32, __type: SOCK, __protocol: IPPROTO, __fds: *[2] s32) -> s32
(__af: s32, __type: SOCK, __protocol: IPPROTO, __fds: *[2] s32) -> s32

Socket ABI Linux#

gethostbyaddr_rforeign2 overloadsSource
(__addr: *void, __len: u32, __type: s32, __result_buf: *hostent, __buf: *u8, __buflen: u64, __result: **hostent, __h_errnop: *s32) -> s32
(__addr: *void, __length: socklen_t, __type: s32, __ret: *hostent, __buf: *u8, __buf_size: u64, __result: **hostent, __h_errno_ptr: *s32) -> s32
gethostbyname2_rforeign2 overloadsSource
(__name: *u8, __af: s32, __result_buf: *hostent, __buf: *u8, __buflen: u64, __result: **hostent, __h_errnop: *s32) -> s32
(__name: *u8, __af: s32, __ret: *hostent, __buf: *u8, __buf_size: u64, __result: **hostent, __h_errno_ptr: *s32) -> s32
gethostbyname_rforeign2 overloadsSource
(__name: *u8, __result_buf: *hostent, __buf: *u8, __buflen: u64, __result: **hostent, __h_errnop: *s32) -> s32
(__name: *u8, __ret: *hostent, __buf: *u8, __buf_size: u64, __result: **hostent, __h_errno_ptr: *s32) -> s32
(__hostp: **u8, __userp: **u8, __domainp: **u8, __buffer: *u8, __buflen: u64) -> s32
(__raddr: u32, __suser: s32, __remuser: *u8, __locuser: *u8) -> s32
rcmdforeignSource
(__ahost: **u8, __rport: u16, __locuser: *u8, __remuser: *u8, __cmd: *u8, __fd2p: *s32) -> s32
(__ahost: **u8, __rport: u16, __locuser: *u8, __remuser: *u8, __cmd: *u8, __fd2p: *s32, __af: sa_family_t) -> s32
(__ahost: **u8, __rport: s32, __name: *u8, __pass: *u8, __cmd: *u8, __fd2p: *s32) -> s32
(__ahost: **u8, __rport: s32, __name: *u8, __pass: *u8, __cmd: *u8, __fd2p: *s32, __af: sa_family_t) -> s32
(__rhost: *u8, __suser: s32, __remuser: *u8, __locuser: *u8) -> s32
sendmmsgforeign2 overloadsSource
(__fd: s32, __vmessages: *mmsghdr, __vlen: u32, __flags: MSG) -> s32
(__fd: s32, __msgs: *mmsghdr, __msg_count: u32, __flags: MSG) -> s32

Socket ABI android#

Foreign#

getnameinfoforeign4 overloadsSource
(pSockaddr: *SOCKADDR, SockaddrLength: socklen_t, pNodeBuffer: *u8, NodeBufferSize: u32, pServiceBuffer: *u8, ServiceBufferSize: u32, Flags: s32) -> s32
(unknown0: *sockaddr, unknown1: socklen_t, unknown2: *u8, unknown3: socklen_t, unknown4: *u8, unknown5: socklen_t, unknown6: s32) -> s32
(__sa: *sockaddr, __salen: socklen_t, __host: *u8, __hostlen: socklen_t, __serv: *u8, __servlen: socklen_t, __flags: s32) -> s32
(__sa: *sockaddr, __sa_length: socklen_t, __host: *u8, __host_length: u64, __service: *u8, __service_length: u64, __flags: s32) -> s32
(pSockaddr: *SOCKADDR, SockaddrLength: socklen_t, pNodeBuffer: *s16, NodeBufferSize: u32, pServiceBuffer: *s16, ServiceBufferSize: u32, Flags: s32) -> s32
getsockoptforeign5 overloadsSource
(s: SOCKET, level: s32, optname: s32, optval: *u8, optlen: *s32) -> s32
(fd: s32, level: s32, name: s32, value: *void, length: *socklen_t) -> s32
(unknown0: s32, unknown1: s32, unknown2: s32, unknown3: *void, unknown4: *socklen_t) -> s32
(__fd: s32, __level: s32, __optname: s32, __optval: *void, __optlen: *socklen_t) -> s32
(__fd: s32, __level: s32, __option: s32, __value: *void, __value_length: *socklen_t) -> s32
htonlforeign5 overloadsSource
(hostlong: u32) -> u32
(value: u32) -> u32
(hostlong: u32) -> u32
(__hostlong: u32) -> u32
(hostlong: u32) -> u32
htonsforeign5 overloadsSource
(hostshort: u16) -> u16
(value: u16) -> u16
(hostshort: u16) -> u16
(__hostshort: u16) -> u16
(hostshort: u16) -> u16
inet_ntopforeign4 overloadsSource
(Family: s32, pAddr: *void, pStringBuf: *u8, StringBufSize: u64) -> *u8
(unknown0: s32, unknown1: *void, unknown2: *u8, unknown3: socklen_t) -> *u8
(__af: s32, __cp: *void, __buf: *u8, __len: socklen_t) -> *u8
(__af: s32, __src: *void, __dst: *u8, __size: socklen_t) -> *u8
inet_ptonforeign5 overloadsSource
(Family: s32, pszAddrString: *u8, pAddrBuf: *void) -> s32
(family: s32, source: *u8, destination: *void) -> s32
(unknown0: s32, unknown1: *u8, unknown2: *void) -> s32
(__af: s32, __cp: *u8, __buf: *void) -> s32
(__af: s32, __src: *u8, __dst: *void) -> s32
(Family: s32, pAddr: *void, pStringBuf: *s16, StringBufSize: u64) -> *s16
(Family: s32, pszAddrString: *s16, pAddrBuf: *void) -> s32
listenforeign5 overloadsSource
(s: SOCKET, backlog: s32) -> s32
(fd: s32, backlog: s32) -> s32
(unknown0: s32, unknown1: s32) -> s32
(__fd: s32, __n: s32) -> s32
(__fd: s32, __backlog: s32) -> s32
ntohlforeign5 overloadsSource
(netlong: u32) -> u32
(value: u32) -> u32
(netlong: u32) -> u32
(__netlong: u32) -> u32
(netlong: u32) -> u32
ntohsforeign5 overloadsSource
(netshort: u16) -> u16
(value: u16) -> u16
(netshort: u16) -> u16
(__netshort: u16) -> u16
(netshort: u16) -> u16
recvforeign5 overloadsSource
(s: SOCKET, buf: *u8, len: s32, flags: MSG) -> s32
(fd: s32, buffer: *void, count: u64, flags: MSG) -> s64
(unknown0: s32, unknown1: *void, unknown2: u64, unknown3: MSG) -> s64
(__fd: s32, __buf: *void, __n: u64, __flags: MSG) -> s64
(__fd: s32, __buf: *void, __n: u64, __flags: MSG) -> s64
recvfromforeign5 overloadsSource
(s: SOCKET, buf: *u8, len: s32, flags: MSG, from: *sockaddr, fromlen: *s32) -> s32
(fd: s32, buffer: *void, count: u64, flags: MSG, address: *sockaddr, length: *socklen_t) -> s64
(unknown0: s32, unknown1: *void, unknown2: u64, unknown3: MSG, unknown4: *sockaddr, unknown5: *socklen_t) -> s64
(__fd: s32, __buf: *void, __n: u64, __flags: MSG, __addr: *sockaddr, __addr_len: *socklen_t) -> s64
(__fd: s32, __buf: *void, __n: u64, __flags: MSG, __src_addr: *sockaddr, __src_addr_length: *socklen_t) -> s64
selectforeign6 overloadsSource
(nfds: s32, readfds: *fd_set, writefds: *fd_set, exceptfds: *fd_set, timeout: *TIMEVAL) -> s32
(count: s32, readers: *fd_set, writers: *fd_set, failures: *fd_set, timeout: *timeval) -> s32
(nfds: s32, readfds: *fd_set, writefds: *fd_set, exceptfds: *fd_set, timeout: *TIMEVAL) -> s32
(nfds: s32, readfds: *fd_set, writefds: *fd_set, exceptfds: *fd_set, timeout: *TIMEVAL) -> s32
(__nfds: s32, __readfds: *fd_set, __writefds: *fd_set, __exceptfds: *fd_set, __timeout: *TIMEVAL) -> s32
(__max_fd_plus_one: s32, __read_fds: *fd_set, __write_fds: *fd_set, __exception_fds: *fd_set, __timeout: *TIMEVAL) -> s32
sendforeign5 overloadsSource
(s: SOCKET, buf: *u8, len: s32, flags: MSG) -> s32
(fd: s32, buffer: *void, count: u64, flags: MSG) -> s64
(unknown0: s32, unknown1: *void, unknown2: u64, unknown3: MSG) -> s64
(__fd: s32, __buf: *void, __n: u64, __flags: MSG) -> s64
(__fd: s32, __buf: *void, __n: u64, __flags: MSG) -> s64
sendtoforeign5 overloadsSource
(s: SOCKET, buf: *u8, len: s32, flags: MSG, to: *sockaddr, tolen: s32) -> s32
(fd: s32, buffer: *void, count: u64, flags: MSG, address: *sockaddr, length: socklen_t) -> s64
(unknown0: s32, unknown1: *void, unknown2: u64, unknown3: MSG, unknown4: *sockaddr, unknown5: socklen_t) -> s64
(__fd: s32, __buf: *void, __n: u64, __flags: MSG, __addr: *sockaddr, __addr_len: socklen_t) -> s64
(__fd: s32, __buf: *void, __n: u64, __flags: MSG, __dst_addr: *sockaddr, __dst_addr_length: socklen_t) -> s64
setsockoptforeign5 overloadsSource
(s: SOCKET, level: s32, optname: s32, optval: *u8, optlen: s32) -> s32
(fd: s32, level: s32, name: s32, value: *void, length: socklen_t) -> s32
(unknown0: s32, unknown1: s32, unknown2: s32, unknown3: *void, unknown4: socklen_t) -> s32
(__fd: s32, __level: s32, __optname: s32, __optval: *void, __optlen: socklen_t) -> s32
(__fd: s32, __level: s32, __option: s32, __value: *void, __value_length: socklen_t) -> s32
shutdownforeign5 overloadsSource
(s: SOCKET, how: s32) -> s32
(fd: s32, how: SHUT) -> s32
(unknown0: s32, unknown1: SHUT) -> s32
(__fd: s32, __how: SHUT) -> s32
(__fd: s32, __how: SHUT) -> s32
(hLookup: HANDLE, dwControlCode: u32, lpvInBuffer: *void, cbInBuffer: u32, lpvOutBuffer: *void, cbOutBuffer: u32, lpcbBytesReturned: *u32, lpCompletion: *WSACOMPLETION) -> s32
(pSockaddr: *SOCKADDR, SockaddrLength: socklen_t, pNodeBuffer: *u8, NodeBufferSize: u32, pServiceBuffer: *u8, ServiceBufferSize: u32, Flags: s32) -> s32
(pSockaddr: *SOCKADDR, SockaddrLength: socklen_t, pNodeBuffer: *u8, NodeBufferSize: u32, pServiceBuffer: *u8, ServiceBufferSize: u32, Flags: s32) -> s32
(Family: s32, pAddr: *void, pStringBuf: *u8, StringBufSize: u64) -> *u8
(Family: s32, pAddr: *void, pStringBuf: *u8, StringBufSize: u64) -> *u8
(Family: s32, pszAddrString: *u8, pAddrBuf: *void) -> s32
(Family: s32, pszAddrString: *u8, pAddrBuf: *void) -> s32
(unknown0: s32, unknown1: *void, unknown2: s32, unknown3: *u8) -> *u8
(unknown0: s32, unknown1: *u8, unknown2: *void) -> s32
gai_strerrorforeign3 overloadsSource
(unknown0: s32) -> *u8
(__ecode: s32) -> *u8
(__error: s32) -> *u8
getnetgrentforeign2 overloadsSource
(unknown0: **u8, unknown1: **u8, unknown2: **u8) -> s32
(__hostp: **u8, __userp: **u8, __domainp: **u8) -> s32
herrorforeign3 overloadsSource
(unknown0: *u8) -> void
(__str: *u8) -> void
(__s: *u8) -> void
hstrerrorforeign3 overloadsSource
(unknown0: s32) -> *u8
(__err_num: s32) -> *u8
(__error: s32) -> *u8
if_indextonameforeign3 overloadsSource
(unknown0: u32, unknown1: *u8) -> *u8
(__ifindex: u32, __ifname: *u8) -> *u8
(__index: u32, __buf: *u8) -> *u8
if_nametoindexforeign3 overloadsSource
(unknown0: *u8) -> u32
(__ifname: *u8) -> u32
(__name: *u8) -> u32
inet6_opt_appendforeign2 overloadsSource
(unknown0: *void, unknown1: socklen_t, unknown2: s32, unknown3: u8, unknown4: socklen_t, unknown5: u8, unknown6: **void) -> s32
(__extbuf: *void, __extlen: socklen_t, __offset: s32, __type: u8, __len: socklen_t, __align: u8, __databufp: **void) -> s32
inet6_rth_initforeign2 overloadsSource
(unknown0: *void, unknown1: socklen_t, unknown2: s32, unknown3: s32) -> *void
(__bp: *void, __bp_len: socklen_t, __type: s32, __segments: s32) -> *void
inet6_rth_reverseforeign2 overloadsSource
(unknown0: *void, unknown1: *void) -> s32
(__in: *void, __out: *void) -> s32
(unknown0: s32, unknown1: *void, unknown2: s32, unknown3: *u8, unknown4: u64) -> *u8
(unknown0: s32, unknown1: *u8, unknown2: *void, unknown3: u64) -> s32
inet_nsap_addrforeign3 overloadsSource
(unknown0: *u8, unknown1: *u8, unknown2: s32) -> u32
(__cp: *u8, __buf: *u8, __len: s32) -> u32
(__ascii: *u8, __binary: *u8, __n: s32) -> u32
inet_nsap_ntoaforeign3 overloadsSource
(unknown0: s32, unknown1: *u8, unknown2: *u8) -> *u8
(__len: s32, __cp: *u8, __buf: *u8) -> *u8
(__binary_length: s32, __binary: *u8, __ascii: *u8) -> *u8
innetgrforeign2 overloadsSource
(unknown0: *u8, unknown1: *u8, unknown2: *u8, unknown3: *u8) -> s32
(__netgroup: *u8, __host: *u8, __user: *u8, __domain: *u8) -> s32
(unknown0: s32, unknown1: s32, unknown2: s64, unknown3: *s64, unknown4: *sf_hdtr, unknown5: s32) -> s32
sethostentforeign3 overloadsSource
(unknown0: s32) -> void
(__stay_open: s32) -> void
(__stay_open: s32) -> void
setnetentforeign3 overloadsSource
(unknown0: s32) -> void
(__stay_open: s32) -> void
(__stay_open: s32) -> void
setnetgrentforeign2 overloadsSource
(unknown0: *u8) -> void
(__netgroup: *u8) -> s32
setprotoentforeign3 overloadsSource
(unknown0: s32) -> void
(__stay_open: s32) -> void
(__stay_open: s32) -> void
setserventforeign3 overloadsSource
(unknown0: s32) -> void
(__stay_open: s32) -> void
(__stay_open: s32) -> void
socketpairforeign3 overloadsSource
(unknown0: s32, unknown1: SOCK, unknown2: IPPROTO, unknown3: *[2] s32) -> s32
(__domain: s32, __type: SOCK, __protocol: IPPROTO, __fds: *[2] s32) -> s32
(__af: s32, __type: SOCK, __protocol: IPPROTO, __fds: *[2] s32) -> s32
gethostbyaddr_rforeign2 overloadsSource
(__addr: *void, __len: u32, __type: s32, __result_buf: *hostent, __buf: *u8, __buflen: u64, __result: **hostent, __h_errnop: *s32) -> s32
(__addr: *void, __length: socklen_t, __type: s32, __ret: *hostent, __buf: *u8, __buf_size: u64, __result: **hostent, __h_errno_ptr: *s32) -> s32
gethostbyname2_rforeign2 overloadsSource
(__name: *u8, __af: s32, __result_buf: *hostent, __buf: *u8, __buflen: u64, __result: **hostent, __h_errnop: *s32) -> s32
(__name: *u8, __af: s32, __ret: *hostent, __buf: *u8, __buf_size: u64, __result: **hostent, __h_errno_ptr: *s32) -> s32
gethostbyname_rforeign2 overloadsSource
(__name: *u8, __result_buf: *hostent, __buf: *u8, __buflen: u64, __result: **hostent, __h_errnop: *s32) -> s32
(__name: *u8, __ret: *hostent, __buf: *u8, __buf_size: u64, __result: **hostent, __h_errno_ptr: *s32) -> s32
(__hostp: **u8, __userp: **u8, __domainp: **u8, __buffer: *u8, __buflen: u64) -> s32
(__raddr: u32, __suser: s32, __remuser: *u8, __locuser: *u8) -> s32
rcmdforeignSource
(__ahost: **u8, __rport: u16, __locuser: *u8, __remuser: *u8, __cmd: *u8, __fd2p: *s32) -> s32
(__ahost: **u8, __rport: u16, __locuser: *u8, __remuser: *u8, __cmd: *u8, __fd2p: *s32, __af: sa_family_t) -> s32
(__ahost: **u8, __rport: s32, __name: *u8, __pass: *u8, __cmd: *u8, __fd2p: *s32) -> s32
(__ahost: **u8, __rport: s32, __name: *u8, __pass: *u8, __cmd: *u8, __fd2p: *s32, __af: sa_family_t) -> s32
(__rhost: *u8, __suser: s32, __remuser: *u8, __locuser: *u8) -> s32
sendmmsgforeign2 overloadsSource
(__fd: s32, __vmessages: *mmsghdr, __vlen: u32, __flags: MSG) -> s32
(__fd: s32, __msgs: *mmsghdr, __msg_count: u32, __flags: MSG) -> s32

Types#

addrinfoex3structsince 0.31.0Source
:: struct
ai_flags: AI
ai_family: s32
ai_socktype: SOCK
ai_protocol: IPPROTO
ai_addrlen: u64
ai_canonname: *s16
ai_addr: *sockaddr
ai_blob: *void
ai_bloblen: u64
ai_provider: *GUID
ai_next: *addrinfoex3
ai_version: s32
ai_fqdn: *s16
ai_interfaceindex: s32
addrinfoex4structsince 0.31.0Source
:: struct
ai_flags: AI
ai_family: s32
ai_socktype: SOCK
ai_protocol: IPPROTO
ai_addrlen: u64
ai_canonname: *s16
ai_addr: *sockaddr
ai_blob: *void
ai_bloblen: u64
ai_provider: *GUID
ai_next: *addrinfoex4
ai_version: s32
ai_fqdn: *s16
ai_interfaceindex: s32
ai_resolutionhandle: HANDLE
addrinfoex5structsince 0.31.0Source
:: struct
ai_flags: AI
ai_family: s32
ai_socktype: SOCK
ai_protocol: IPPROTO
ai_addrlen: u64
ai_canonname: *s16
ai_addr: *sockaddr
ai_blob: *void
ai_bloblen: u64
ai_provider: *GUID
ai_next: *addrinfoex5
ai_version: s32
ai_fqdn: *s16
ai_interfaceindex: s32
ai_resolutionhandle: HANDLE
ai_ttl: u32
addrinfoex6structsince 0.31.0Source
:: struct
ai_flags: AI
ai_family: s32
ai_socktype: SOCK
ai_protocol: IPPROTO
ai_addrlen: u64
ai_canonname: *s16
ai_addr: *sockaddr
ai_blob: *void
ai_bloblen: u64
ai_provider: *GUID
ai_next: *addrinfoex5
ai_version: s32
ai_fqdn: *s16
ai_interfaceindex: s32
ai_resolutionhandle: HANDLE
ai_ttl: u32
ai_numservers: u32
ai_servers: *ADDRINFO_DNS_SERVER
ai_responseflags: u64
addrinfoex7structsince 0.31.0Source
:: struct
ai_flags: AI
ai_family: s32
ai_socktype: SOCK
ai_protocol: IPPROTO
ai_addrlen: u64
ai_canonname: *s16
ai_addr: *sockaddr
ai_blob: *void
ai_bloblen: u64
ai_provider: *GUID
ai_next: *addrinfoex7
ai_version: s32
ai_fqdn: *s16
ai_interfaceindex: s32
ai_resolutionhandle: HANDLE
ai_ttl: u32
ai_numservers: u32
ai_servers: *ADDRINFO_DNS_SERVER
ai_responseflags: u64
ai_extraflags: u64
AIenum flagssince 0.31.0Source
:: enum_flags
PASSIVE
CANONNAME
NUMERICHOST
NUMERICSERV
DNS_ONLY
FORCE_CLEAR_TEXT
BYPASS_DNS_CACHE
RETURN_TTL
ALL
ADDRCONFIG
V4MAPPED
NON_AUTHORITATIVE
SECURE
RETURN_PREFERRED_NAMES
FQDN
FILESERVER
DISABLE_IDN_ENCODING
SECURE_WITH_FALLBACK
EXCLUSIVE_CUSTOM_SERVERS
RETURN_RESPONSE_FLAGS
REQUIRE_SECURE
RESOLUTION_HANDLE
EXTENDED
DNS_SERVER_TYPE_UDP
DNS_SERVER_TYPE_DOH
DNS_SERVER_TYPE_DOT
DNS_SERVER_UDP_FALLBACK
DNS_RESPONSE_SECURE
DNS_RESPONSE_HOSTFILE
EXTRA_DNSSEC_REQUIRED
AI_PASSIVE
AI_CANONNAME
AI_NUMERICHOST
AI_NUMERICSERV
AI_DNS_ONLY
AI_FORCE_CLEAR_TEXT
AI_BYPASS_DNS_CACHE
AI_RETURN_TTL
AI_ALL
AI_ADDRCONFIG
AI_V4MAPPED
AI_NON_AUTHORITATIVE
AI_SECURE
AI_RETURN_PREFERRED_NAMES
AI_FQDN
AI_FILESERVER
AI_DISABLE_IDN_ENCODING
AI_SECURE_WITH_FALLBACK
AI_EXCLUSIVE_CUSTOM_SERVERS
AI_RETURN_RESPONSE_FLAGS
AI_REQUIRE_SECURE
AI_RESOLUTION_HANDLE
AI_EXTENDED
AI_DNS_SERVER_TYPE_UDP
AI_DNS_SERVER_TYPE_DOH
AI_DNS_SERVER_TYPE_DOT
AI_DNS_SERVER_UDP_FALLBACK
AI_DNS_RESPONSE_SECURE
AI_DNS_RESPONSE_HOSTFILE
AI_EXTRA_DNSSEC_REQUIRED
BLOBstructsince 0.31.0Source
:: struct
cbSize: u32
pBlobData: *u8
:: enum
INVALID
SOFTWARE_SLOT_ALLOCATED
HARDWARE_SLOT_ALLOCATED
POLICY_ERROR
SYSTEM_ERROR
TRANSPORT_DISCONNECTED
SERVICE_UNAVAILABLE
CONTROL_CHANNEL_TRIGGER_STATUS_INVALID
CONTROL_CHANNEL_TRIGGER_STATUS_SOFTWARE_SLOT_ALLOCATED
CONTROL_CHANNEL_TRIGGER_STATUS_HARDWARE_SLOT_ALLOCATED
CONTROL_CHANNEL_TRIGGER_STATUS_POLICY_ERROR
CONTROL_CHANNEL_TRIGGER_STATUS_SYSTEM_ERROR
CONTROL_CHANNEL_TRIGGER_STATUS_TRANSPORT_DISCONNECTED
CONTROL_CHANNEL_TRIGGER_STATUS_SERVICE_UNAVAILABLE
flowspecstructsince 0.31.0Source
:: struct
TokenRate: u32
TokenBucketSize: u32
PeakBandwidth: u32
Latency: u32
DelayVariation: u32
ServiceType: SERVICETYPE
MaxSduSize: u32
MinimumPolicedSize: u32
hostentstructsince 0.31.0Source
:: struct
h_name: *u8
h_aliases: **u8
h_addrtype: s16
h_length: s16
h_addr_list: **u8
in6_addrstructsince 0.31.0Source
:: struct
u: struct { Byte: [16] u8; #overlay (Byte) Word: [8] u16; }
:: struct
S_un: struct { S_un_b: struct { s_b1: u8; s_b2: u8; s_b3: u8; s_b4: u8; }; #overlay (S_un_b) S_un_w: struct { s_w1: u16; s_w2: u16; }; #overlay (S_un_b) S_addr: u32; }
IPPROTOenumsince 0.31.0Source
:: enum
HOPOPTS
ICMP
IGMP
GGP
IPV4
ST
TCP
CBT
EGP
IGP
PUP
UDP
IDP
RDP
IPV6
ROUTING
FRAGMENT
ESP
AH
ICMPV6
NONE
DSTOPTS
ND
ICLFXBM
PIM
PGM
L2TP
SCTP
RAW
MAX
RESERVED_RAW
RESERVED_IPSEC
RESERVED_IPSECOFFLOAD
RESERVED_WNV
RESERVED_MAX
IPPROTO_HOPOPTS
IPPROTO_ICMP
IPPROTO_IGMP
IPPROTO_GGP
IPPROTO_IPV4
IPPROTO_ST
IPPROTO_TCP
IPPROTO_CBT
IPPROTO_EGP
IPPROTO_IGP
IPPROTO_PUP
IPPROTO_UDP
IPPROTO_IDP
IPPROTO_RDP
IPPROTO_IPV6
IPPROTO_ROUTING
IPPROTO_FRAGMENT
IPPROTO_ESP
IPPROTO_AH
IPPROTO_ICMPV6
IPPROTO_NONE
IPPROTO_DSTOPTS
IPPROTO_ND
IPPROTO_ICLFXBM
IPPROTO_PIM
IPPROTO_PGM
IPPROTO_L2TP
IPPROTO_SCTP
IPPROTO_RAW
IPPROTO_MAX
IPPROTO_RESERVED_RAW
IPPROTO_RESERVED_IPSEC
IPPROTO_RESERVED_IPSECOFFLOAD
IPPROTO_RESERVED_WNV
IPPROTO_RESERVED_MAX
MSGenum flagssince 0.31.0Source
:: enum_flags
TRUNC
CTRUNC
BCAST
MCAST
ERRQUEUE
OOB
PEEK
DONTROUTE
WAITALL
PUSH_IMMEDIATE
PARTIAL
INTERRUPT
MAXIOVLEN
MSG_TRUNC
MSG_CTRUNC
MSG_BCAST
MSG_MCAST
MSG_ERRQUEUE
MSG_OOB
MSG_PEEK
MSG_DONTROUTE
MSG_WAITALL
MSG_PUSH_IMMEDIATE
MSG_PARTIAL
MSG_INTERRUPT
MSG_MAXIOVLEN
netentstructsince 0.31.0Source
:: struct
n_name: *u8
n_aliases: **u8
n_addrtype: s16
n_net: u32
PMTUD_STATEenumsince 0.31.0Source
:: enum
NOT_SET
DO
DONT
PROBE
MAX
IP_PMTUDISC_NOT_SET
IP_PMTUDISC_DO
IP_PMTUDISC_DONT
IP_PMTUDISC_PROBE
IP_PMTUDISC_MAX
protoentstructsince 0.31.0Source
:: struct
p_name: *u8
p_aliases: **u8
p_proto: s16
RCVALL_VALUEenumsince 0.31.0Source
:: enum
OFF
ON
SOCKETLEVELONLY
IPLEVEL
RCVALL_OFF
RCVALL_ON
RCVALL_SOCKETLEVELONLY
RCVALL_IPLEVEL
SCOPE_LEVELenumsince 0.31.0Source
:: enum
Interface
Link
Subnet
Admin
Site
Organization
Global
Count
ScopeLevelInterface
ScopeLevelLink
ScopeLevelSubnet
ScopeLevelAdmin
ScopeLevelSite
ScopeLevelOrganization
ScopeLevelGlobal
ScopeLevelCount
serventstructsince 0.31.0Source
:: struct
s_name: *u8
s_aliases: **u8
s_proto: *u8
s_port: s16
SOCKenumsince 0.31.0Source
:: enum
STREAM
DGRAM
RAW
RDM
SEQPACKET
SOCK_STREAM
SOCK_DGRAM
SOCK_RAW
SOCK_RDM
SOCK_SEQPACKET
:: enum
PriorityHintVeryLow
PriorityHintLow
PriorityHintNormal
MaximumPriorityHintType
SocketPriorityHintVeryLow
SocketPriorityHintLow
SocketPriorityHintNormal
SocketMaximumPriorityHintType
:: enum
DEFAULT
IPSEC
IPSEC2
INVALID
SOCKET_SECURITY_PROTOCOL_DEFAULT
SOCKET_SECURITY_PROTOCOL_IPSEC
SOCKET_SECURITY_PROTOCOL_IPSEC2
SOCKET_SECURITY_PROTOCOL_INVALID
sockprotostructsince 0.31.0Source
:: struct
sp_family: u16
sp_protocol: u16
TCP_ICW_LEVELenumsince 0.31.0Source
:: enum
DEFAULT
HIGH
VERY_HIGH
AGGRESSIVE
EXPERIMENTAL
COMPAT
MAX
TCP_ICW_LEVEL_DEFAULT
TCP_ICW_LEVEL_HIGH
TCP_ICW_LEVEL_VERY_HIGH
TCP_ICW_LEVEL_AGGRESSIVE
TCP_ICW_LEVEL_EXPERIMENTAL
TCP_ICW_LEVEL_COMPAT
TCP_ICW_LEVEL_MAX
TCP_INFO_v0structsince 0.31.0Source
:: struct
State: TCPSTATE
Mss: u32
ConnectionTimeMs: u64
TimestampsEnabled: BOOLEAN
RttUs: u32
MinRttUs: u32
BytesInFlight: u32
Cwnd: u32
SndWnd: u32
RcvWnd: u32
RcvBuf: u32
BytesOut: u64
BytesIn: u64
BytesReordered: u32
BytesRetrans: u32
FastRetrans: u32
DupAcksIn: u32
TimeoutEpisodes: u32
SynRetrans: u8
TCP_INFO_v1structsince 0.31.0Source
:: struct
State: TCPSTATE
Mss: u32
ConnectionTimeMs: u64
TimestampsEnabled: BOOLEAN
RttUs: u32
MinRttUs: u32
BytesInFlight: u32
Cwnd: u32
SndWnd: u32
RcvWnd: u32
RcvBuf: u32
BytesOut: u64
BytesIn: u64
BytesReordered: u32
BytesRetrans: u32
FastRetrans: u32
DupAcksIn: u32
TimeoutEpisodes: u32
SynRetrans: u8
SndLimTransRwin: u32
SndLimTimeRwin: u32
SndLimBytesRwin: u64
SndLimTransCwnd: u32
SndLimTimeCwnd: u32
SndLimBytesCwnd: u64
SndLimTransSnd: u32
SndLimTimeSnd: u32
SndLimBytesSnd: u64
TCP_INFO_v2structsince 0.31.0Source
:: struct
State: TCPSTATE
Mss: u32
ConnectionTimeMs: u64
TimestampsEnabled: BOOLEAN
RttUs: u32
MinRttUs: u32
BytesInFlight: u32
Cwnd: u32
SndWnd: u32
RcvWnd: u32
RcvBuf: u32
BytesOut: u64
BytesIn: u64
BytesReordered: u32
BytesRetrans: u32
FastRetrans: u32
DupAcksIn: u32
TimeoutEpisodes: u32
SynRetrans: u8
SndLimTransRwin: u32
SndLimTimeRwin: u32
SndLimBytesRwin: u64
SndLimTransCwnd: u32
SndLimTimeCwnd: u32
SndLimBytesCwnd: u64
SndLimTransSnd: u32
SndLimTimeSnd: u32
SndLimBytesSnd: u64
OutOfOrderPktsIn: u32
EcnNegotiated: BOOLEAN
EceAcksIn: u32
PtoEpisodes: u32
tcp_keepalivestructsince 0.31.0Source
:: struct
onoff: u32
keepalivetime: u32
keepaliveinterval: u32
TCPSTATEenumsince 0.31.0Source
:: enum
CLOSED
LISTEN
SYN_SENT
SYN_RCVD
ESTABLISHED
FIN_WAIT_1
FIN_WAIT_2
CLOSE_WAIT
CLOSING
LAST_ACK
TIME_WAIT
MAX
TCPSTATE_CLOSED
TCPSTATE_LISTEN
TCPSTATE_SYN_SENT
TCPSTATE_SYN_RCVD
TCPSTATE_ESTABLISHED
TCPSTATE_FIN_WAIT_1
TCPSTATE_FIN_WAIT_2
TCPSTATE_CLOSE_WAIT
TCPSTATE_CLOSING
TCPSTATE_LAST_ACK
TCPSTATE_TIME_WAIT
TCPSTATE_MAX
timevalstructsince 0.31.0Source
:: struct
tv_sec: s32
tv_usec: s32
WSABUFstructsince 0.31.0Source
:: struct
len: u32
buf: *u8
WSACOMPLETIONTYPEenumsince 0.31.0Source
:: enum
IMMEDIATELY
HWND
EVENT
PORT
APC
NSP_NOTIFY_IMMEDIATELY
NSP_NOTIFY_HWND
NSP_NOTIFY_EVENT
NSP_NOTIFY_PORT
NSP_NOTIFY_APC
WSADatastructsince 0.31.0Source
:: struct
wVersion: u16
wHighVersion: u16
iMaxSockets: u16
iMaxUdpDg: u16
lpVendorInfo: *u8
szDescription: [257] u8
szSystemStatus: [129] u8
WSAESETSERVICEOPenumsince 0.31.0Source
:: enum
REGISTER
DEREGISTER
DELETE
RNRSERVICE_REGISTER
RNRSERVICE_DEREGISTER
RNRSERVICE_DELETE
WSANSClassInfoAstructsince 0.31.0Source
:: struct
lpszName: *u8
dwNameSpace: u32
dwValueType: u32
dwValueSize: u32
lpValue: *void
WSANSClassInfoWstructsince 0.31.0Source
:: struct
lpszName: *s16
dwNameSpace: u32
dwValueType: u32
dwValueSize: u32
lpValue: *void
WSAPROTOCOL_INFOAstructsince 0.31.0Source
:: struct
dwServiceFlags1: u32
dwServiceFlags2: u32
dwServiceFlags3: u32
dwServiceFlags4: u32
dwProviderFlags: u32
ProviderId: GUID
dwCatalogEntryId: u32
ProtocolChain: WSAPROTOCOLCHAIN
iVersion: s32
iAddressFamily: s32
iMaxSockAddr: s32
iMinSockAddr: s32
iSocketType: s32
iProtocol: s32
iProtocolMaxOffset: s32
iNetworkByteOrder: s32
iSecurityScheme: s32
dwMessageSize: u32
dwProviderReserved: u32
szProtocol: [256] u8
WSAPROTOCOL_INFOWstructsince 0.31.0Source
:: struct
dwServiceFlags1: u32
dwServiceFlags2: u32
dwServiceFlags3: u32
dwServiceFlags4: u32
dwProviderFlags: u32
ProviderId: GUID
dwCatalogEntryId: u32
ProtocolChain: WSAPROTOCOLCHAIN
iVersion: s32
iAddressFamily: s32
iMaxSockAddr: s32
iMinSockAddr: s32
iSocketType: s32
iProtocol: s32
iProtocolMaxOffset: s32
iNetworkByteOrder: s32
iSecurityScheme: s32
dwMessageSize: u32
dwProviderReserved: u32
szProtocol: [256] s16
ADDRINFOEX3structsince 0.31.0Source
:: struct
ai_flags: AI
ai_family: s32
ai_socktype: SOCK
ai_protocol: IPPROTO
ai_addrlen: u64
ai_canonname: *s16
ai_addr: *sockaddr
ai_blob: *void
ai_bloblen: u64
ai_provider: *GUID
ai_next: *addrinfoex3
ai_version: s32
ai_fqdn: *s16
ai_interfaceindex: s32
ADDRINFOEX4structsince 0.31.0Source
:: struct
ai_flags: AI
ai_family: s32
ai_socktype: SOCK
ai_protocol: IPPROTO
ai_addrlen: u64
ai_canonname: *s16
ai_addr: *sockaddr
ai_blob: *void
ai_bloblen: u64
ai_provider: *GUID
ai_next: *addrinfoex4
ai_version: s32
ai_fqdn: *s16
ai_interfaceindex: s32
ai_resolutionhandle: HANDLE
ADDRINFOEX5structsince 0.31.0Source
:: struct
ai_flags: AI
ai_family: s32
ai_socktype: SOCK
ai_protocol: IPPROTO
ai_addrlen: u64
ai_canonname: *s16
ai_addr: *sockaddr
ai_blob: *void
ai_bloblen: u64
ai_provider: *GUID
ai_next: *addrinfoex5
ai_version: s32
ai_fqdn: *s16
ai_interfaceindex: s32
ai_resolutionhandle: HANDLE
ai_ttl: u32
ADDRINFOEX6structsince 0.31.0Source
:: struct
ai_flags: AI
ai_family: s32
ai_socktype: SOCK
ai_protocol: IPPROTO
ai_addrlen: u64
ai_canonname: *s16
ai_addr: *sockaddr
ai_blob: *void
ai_bloblen: u64
ai_provider: *GUID
ai_next: *addrinfoex5
ai_version: s32
ai_fqdn: *s16
ai_interfaceindex: s32
ai_resolutionhandle: HANDLE
ai_ttl: u32
ai_numservers: u32
ai_servers: *ADDRINFO_DNS_SERVER
ai_responseflags: u64
ADDRINFOEX7structsince 0.31.0Source
:: struct
ai_flags: AI
ai_family: s32
ai_socktype: SOCK
ai_protocol: IPPROTO
ai_addrlen: u64
ai_canonname: *s16
ai_addr: *sockaddr
ai_blob: *void
ai_bloblen: u64
ai_provider: *GUID
ai_next: *addrinfoex7
ai_version: s32
ai_fqdn: *s16
ai_interfaceindex: s32
ai_resolutionhandle: HANDLE
ai_ttl: u32
ai_numservers: u32
ai_servers: *ADDRINFO_DNS_SERVER
ai_responseflags: u64
ai_extraflags: u64
FLOWSPECstructsince 0.31.0Source
:: struct
TokenRate: u32
TokenBucketSize: u32
PeakBandwidth: u32
Latency: u32
DelayVariation: u32
ServiceType: SERVICETYPE
MaxSduSize: u32
MinimumPolicedSize: u32
HOSTENTstructsince 0.31.0Source
:: struct
h_name: *u8
h_aliases: **u8
h_addrtype: s16
h_length: s16
h_addr_list: **u8
IN6_ADDRstructsince 0.31.0Source
:: struct
u: struct { Byte: [16] u8; #overlay (Byte) Word: [8] u16; }
IN_ADDRstructsince 0.31.0Source
:: struct
S_un: struct { S_un_b: struct { s_b1: u8; s_b2: u8; s_b3: u8; s_b4: u8; }; #overlay (S_un_b) S_un_w: struct { s_w1: u16; s_w2: u16; }; #overlay (S_un_b) S_addr: u32; }
in_addr6structsince 0.31.0Source
:: struct
u: struct { Byte: [16] u8; #overlay (Byte) Word: [8] u16; }
LINGERstructsince 0.31.0Source
:: struct
l_onoff: u16
l_linger: u16
PROTOENTstructsince 0.31.0Source
:: struct
p_name: *u8
p_aliases: **u8
p_proto: s16
SERVENTstructsince 0.31.0Source
:: struct
s_name: *u8
s_aliases: **u8
s_proto: *u8
s_port: s16
TIMEVALstructsince 0.31.0Source
:: struct
tv_sec: s32
tv_usec: s32
WSADATAstructsince 0.31.0Source
:: struct
wVersion: u16
wHighVersion: u16
iMaxSockets: u16
iMaxUdpDg: u16
lpVendorInfo: *u8
szDescription: [257] u8
szSystemStatus: [129] u8
WSANSCLASSINFOstructsince 0.31.0Source
:: struct
lpszName: *u8
dwNameSpace: u32
dwValueType: u32
dwValueSize: u32
lpValue: *void
WSANSCLASSINFOAstructsince 0.31.0Source
:: struct
lpszName: *u8
dwNameSpace: u32
dwValueType: u32
dwValueSize: u32
lpValue: *void
WSANSCLASSINFOWstructsince 0.31.0Source
:: struct
lpszName: *s16
dwNameSpace: u32
dwValueType: u32
dwValueSize: u32
lpValue: *void
WSAPROTOCOL_INFOstructsince 0.31.0Source
:: struct
dwServiceFlags1: u32
dwServiceFlags2: u32
dwServiceFlags3: u32
dwServiceFlags4: u32
dwProviderFlags: u32
ProviderId: GUID
dwCatalogEntryId: u32
ProtocolChain: WSAPROTOCOLCHAIN
iVersion: s32
iAddressFamily: s32
iMaxSockAddr: s32
iMinSockAddr: s32
iSocketType: s32
iProtocol: s32
iProtocolMaxOffset: s32
iNetworkByteOrder: s32
iSecurityScheme: s32
dwMessageSize: u32
dwProviderReserved: u32
szProtocol: [256] u8
:: enum

The directions shutdown can close: RD stops receiving, WR stops sending and RDWR closes both.

RD
WR
RDWR
SHUT_RD
SHUT_WR
SHUT_RDWR
:: struct

The IP_ADD_MEMBERSHIP option value that names the interface by index: the multicast group, the local address and the interface number.

imr_multiaddr: in_addr
imr_address: in_addr
imr_ifindex: s32
if_clonereqstructsince 0.31.0Source
:: struct
ifcr_total: s32
ifcr_count: s32
ifcr_buffer: *u8
if_datastructsince 0.31.0Source
:: struct
ifi_type: u8
ifi_typelen: u8
ifi_physical: u8
ifi_addrlen: u8
ifi_hdrlen: u8
ifi_recvquota: u8
ifi_xmitquota: u8
ifi_unused1: u8
ifi_mtu: u32
ifi_metric: u32
ifi_baudrate: u32
ifi_ipackets: u32
ifi_ierrors: u32
ifi_opackets: u32
ifi_oerrors: u32
ifi_collisions: u32
ifi_ibytes: u32
ifi_obytes: u32
ifi_imcasts: u32
ifi_omcasts: u32
ifi_iqdrops: u32
ifi_noproto: u32
ifi_recvtiming: u32
ifi_xmittiming: u32
ifi_lastchange: timeval32
ifi_unused2: u32
ifi_hwassist: u32
ifi_reserved1: u32
ifi_reserved2: u32
if_data64structsince 0.31.0Source
:: struct
ifi_type: u8
ifi_typelen: u8
ifi_physical: u8
ifi_addrlen: u8
ifi_hdrlen: u8
ifi_recvquota: u8
ifi_xmitquota: u8
ifi_unused1: u8
ifi_mtu: u32
ifi_metric: u32
ifi_baudrate: u64
ifi_ipackets: u64
ifi_ierrors: u64
ifi_opackets: u64
ifi_oerrors: u64
ifi_collisions: u64
ifi_ibytes: u64
ifi_obytes: u64
ifi_imcasts: u64
ifi_omcasts: u64
ifi_iqdrops: u64
ifi_noproto: u64
ifi_recvtiming: u32
ifi_xmittiming: u32
ifi_lastchange: timeval32
if_msghdrstructsince 0.31.0Source
:: struct
ifm_msglen: u16
ifm_version: u8
ifm_type: u8
ifm_addrs: s32
ifm_flags: s32
ifm_index: u16
ifm_data: if_data
if_msghdr2structsince 0.31.0Source
:: struct
ifm_msglen: u16
ifm_version: u8
ifm_type: u8
ifm_addrs: s32
ifm_flags: s32
ifm_index: u16
ifm_snd_len: s32
ifm_snd_maxlen: s32
ifm_snd_drops: s32
ifm_timer: s32
ifm_data: if_data64
ifa_msghdrstructsince 0.31.0Source
:: struct
ifam_msglen: u16
ifam_version: u8
ifam_type: u8
ifam_addrs: s32
ifam_flags: s32
ifam_index: u16
ifam_metric: s32
ifconfstructsince 0.31.0Source
:: struct
ifc_len: s32
ifc_ifcu: struct { ifcu_buf: *u8 #align 4; #overlay (ifcu_buf) ifcu_req: *ifreq #align 4; }
ifdevmtustructsince 0.31.0Source
:: struct
ifdm_current: s32
ifdm_min: s32
ifdm_max: s32
ifdrvstructsince 0.31.0Source
:: struct
ifd_name: [16] u8
ifd_cmd: u64
ifd_len: u64
ifd_data: *void
IFFenumsince 0.31.0Source
:: enum
UP
BROADCAST
DEBUG
LOOPBACK
POINTOPOINT
NOTRAILERS
RUNNING
NOARP
PROMISC
ALLMULTI
OACTIVE
SIMPLEX
LINK0
LINK1
LINK2
ALTPHYS
MULTICAST
IFF_UP
IFF_BROADCAST
IFF_DEBUG
IFF_LOOPBACK
IFF_POINTOPOINT
IFF_NOTRAILERS
IFF_RUNNING
IFF_NOARP
IFF_PROMISC
IFF_ALLMULTI
IFF_OACTIVE
IFF_SIMPLEX
IFF_LINK0
IFF_LINK1
IFF_LINK2
IFF_ALTPHYS
IFF_MULTICAST
ifkpistructsince 0.31.0Source
:: struct
ifk_module_id: u32
ifk_type: u32
ifk_data: struct { ifk_ptr: *void #align 4; #overlay (ifk_ptr) ifk_value: s32; }
ifma_msghdrstructsince 0.31.0Source
:: struct
ifmam_msglen: u16
ifmam_version: u8
ifmam_type: u8
ifmam_addrs: s32
ifmam_flags: s32
ifmam_index: u16
ifma_msghdr2structsince 0.31.0Source
:: struct
ifmam_msglen: u16
ifmam_version: u8
ifmam_type: u8
ifmam_addrs: s32
ifmam_flags: s32
ifmam_index: u16
ifmam_refcount: s32
ifmediareqstructsince 0.31.0Source
:: struct
ifm_name: [16] u8
ifm_current: s32
ifm_mask: s32
ifm_status: s32
ifm_active: s32
ifm_count: s32
ifm_ulist: *s32
ifqueuestructsince 0.31.0Source
:: struct
ifq_head: *void
ifq_tail: *void
ifq_len: s32
ifq_maxlen: s32
ifq_drops: s32
ifreqstructsince 0.31.0Source
:: struct
ifr_name: [16] u8
ifr_ifru: struct { ifru_addr: sockaddr; #overlay (ifru_addr) ifru_dstaddr: sockaddr; #overlay (ifru_addr) ifru_broadaddr: sockaddr; #overlay (ifru_addr) ifru_flags: s16; #overlay (ifru_addr) ifru_metric: s32; #overlay (ifru_addr) ifru_mtu: s32; #overlay (ifru_addr) ifru_phys: s32; #overlay (ifru_addr) ifru_media: s32; #overlay (ifru_addr) ifru_intval: s32; #overlay (ifru_addr) ifru_data: *u8; #overlay (ifru_addr) ifru_devmtu: ifdevmtu; #overlay (ifru_addr) ifru_kpi: ifkpi; #overlay (ifru_addr) ifru_wake_flags: u32; #overlay (ifru_addr) ifru_route_refcnt: u32; #overlay (ifru_addr) ifru_cap: [2] s32; #overlay (ifru_addr) ifru_functional_type: u32; }
ifstatstructsince 0.31.0Source
:: struct
ifs_name: [16] u8
ascii: [801] u8
rpcentstructsince 0.31.0Source
:: struct
r_name: *u8
r_aliases: **u8
r_number: s32
SCMenumsince 0.31.0Source
:: enum
RIGHTS
TIMESTAMP
CREDS
TIMESTAMP_MONOTONIC
SCM_RIGHTS
SCM_TIMESTAMP
SCM_CREDS
SCM_TIMESTAMP_MONOTONIC
tcp_connection_infostructsince 0.31.0Source
:: struct
tcpi_state: u8
tcpi_snd_wscale: u8
tcpi_rcv_wscale: u8
__pad1: u8
tcpi_options: u32
tcpi_flags: u32
tcpi_rto: u32
tcpi_maxseg: u32
tcpi_snd_ssthresh: u32
tcpi_snd_cwnd: u32
tcpi_snd_wnd: u32
tcpi_snd_sbbytes: u32
tcpi_rcv_wnd: u32
tcpi_rttcur: u32
tcpi_srtt: u32
tcpi_rttvar: u32
__bitfield: u32
tcpi_txpackets: u64
tcpi_txbytes: u64
tcpi_txretransmitbytes: u64
tcpi_rxpackets: u64
tcpi_rxbytes: u64
tcpi_rxoutoforderbytes: u64
tcpi_txretransmitpackets: u64
tcphdrstructsince 0.31.0Source
:: struct
th_sport: u16
th_dport: u16
th_seq: tcp_seq
th_ack: tcp_seq
__bitfield: u8
th_flags: u8
th_win: u16
th_sum: u16
th_urp: u16
tcp6hdrstructsince 0.31.0Source
:: struct
th_sport: u16
th_dport: u16
th_seq: tcp_seq
th_ack: tcp_seq
__bitfield: u8
th_flags: u8
th_win: u16
th_sum: u16
th_urp: u16
gaicbstructsince 0.31.0Source
:: struct
ar_name: *u8
ar_service: *u8
ar_request: *addrinfo
ar_result: *addrinfo
__return: s32
__glibc_reserved: [5] s32
ifmapstructsince 0.31.0Source
:: struct
mem_start: u64
mem_end: u64
base_addr: u16
irq: u8
dma: u8
port: u8
IPPORTenumsince 0.31.0Source
:: enum
ECHO
DISCARD
SYSTAT
DAYTIME
NETSTAT
FTP
TELNET
SMTP
TIMESERVER
NAMESERVER
WHOIS
MTP
TFTP
RJE
FINGER
TTYLINK
SUPDUP
EXECSERVER
LOGINSERVER
CMDSERVER
EFSSERVER
BIFFUDP
WHOSERVER
ROUTESERVER
RESERVED
USERRESERVED
IPPORT_ECHO
IPPORT_DISCARD
IPPORT_SYSTAT
IPPORT_DAYTIME
IPPORT_NETSTAT
IPPORT_FTP
IPPORT_TELNET
IPPORT_SMTP
IPPORT_TIMESERVER
IPPORT_NAMESERVER
IPPORT_WHOIS
IPPORT_MTP
IPPORT_TFTP
IPPORT_RJE
IPPORT_FINGER
IPPORT_TTYLINK
IPPORT_SUPDUP
IPPORT_EXECSERVER
IPPORT_LOGINSERVER
IPPORT_CMDSERVER
IPPORT_EFSSERVER
IPPORT_BIFFUDP
IPPORT_WHOSERVER
IPPORT_ROUTESERVER
IPPORT_RESERVED
IPPORT_USERRESERVED
IPPROTO_1enumsince 0.31.0Source
:: enum
HOPOPTS
ROUTING
FRAGMENT
ICMPV6
NONE
DSTOPTS
MH
IPPROTO_HOPOPTS
IPPROTO_ROUTING
IPPROTO_FRAGMENT
IPPROTO_ICMPV6
IPPROTO_NONE
IPPROTO_DSTOPTS
IPPROTO_MH
TCPenumsince 0.31.0Source
:: enum
ESTABLISHED
SYN_SENT
SYN_RECV
FIN_WAIT1
FIN_WAIT2
TIME_WAIT
CLOSE
CLOSE_WAIT
LAST_ACK
LISTEN
CLOSING
TCP_ESTABLISHED
TCP_SYN_SENT
TCP_SYN_RECV
TCP_FIN_WAIT1
TCP_FIN_WAIT2
TCP_TIME_WAIT
TCP_CLOSE
TCP_CLOSE_WAIT
TCP_LAST_ACK
TCP_LISTEN
TCP_CLOSING
TCP_1enumsince 0.31.0Source
:: enum
NO_QUEUE
RECV_QUEUE
SEND_QUEUE
QUEUES_NR
TCP_NO_QUEUE
TCP_RECV_QUEUE
TCP_SEND_QUEUE
TCP_QUEUES_NR
tcp_ca_stateenumsince 0.31.0Source
:: enum
Open
Disorder
CWR
Recovery
Loss
TCP_CA_Open
TCP_CA_Disorder
TCP_CA_CWR
TCP_CA_Recovery
TCP_CA_Loss
tcp_infostructsince 0.31.0Source
:: struct
tcpi_state: u8
tcpi_ca_state: u8
tcpi_retransmits: u8
tcpi_probes: u8
tcpi_backoff: u8
tcpi_options: u8
__bitfield: u8
tcpi_rto: u32
tcpi_ato: u32
tcpi_snd_mss: u32
tcpi_rcv_mss: u32
tcpi_unacked: u32
tcpi_sacked: u32
tcpi_lost: u32
tcpi_retrans: u32
tcpi_fackets: u32
tcpi_last_data_sent: u32
tcpi_last_ack_sent: u32
tcpi_last_data_recv: u32
tcpi_last_ack_recv: u32
tcpi_pmtu: u32
tcpi_rcv_ssthresh: u32
tcpi_rtt: u32
tcpi_rttvar: u32
tcpi_snd_ssthresh: u32
tcpi_snd_cwnd: u32
tcpi_advmss: u32
tcpi_reordering: u32
tcpi_rcv_rtt: u32
tcpi_rcv_space: u32
tcpi_total_retrans: u32
tcp_repair_windowstructsince 0.31.0Source
:: struct
snd_wl1: u32
snd_wnd: u32
max_window: u32
rcv_wnd: u32
rcv_wup: u32
in6_flowlabel_reqstructsince 0.31.0Source
:: struct
flr_dst: in6_addr
flr_label: u32
flr_action: u8
flr_share: u8
flr_flags: u16
flr_expires: u16
flr_linger: u16
__flr_pad: u32
TCP_2enumsince 0.31.0Source
:: enum
ESTABLISHED
SYN_SENT
SYN_RECV
FIN_WAIT1
FIN_WAIT2
TIME_WAIT
CLOSE
CLOSE_WAIT
LAST_ACK
LISTEN
CLOSING
TCP_ESTABLISHED
TCP_SYN_SENT
TCP_SYN_RECV
TCP_FIN_WAIT1
TCP_FIN_WAIT2
TCP_TIME_WAIT
TCP_CLOSE
TCP_CLOSE_WAIT
TCP_LAST_ACK
TCP_LISTEN
TCP_CLOSING

Constants#

A socket handle: Winsock's SOCKET here, an s32 file descriptor on Unix. Compare against INVALID_SOCKET, never a number.

s: Socket = INVALID_SOCKET;
assert(s == INVALID_SOCKET);

Doesn't run in the browser (skipped on wasm).

:: #run IOW(102, 126, u32)

Official Winsock2 FIONBIO encoding; the character literal form is incomplete.

:: cast(Wasi.OS_Error_Code) Wasi.ENOSYS

The error every call that cannot exist on WASI reports.