12#define WIRED_AF_INET 2
14#define WIRED_AF_INET6 10
16#define WIRED_SOCK_DGRAM 2
88#define WIRED_GSO_CMSG_SPACE 24
Value-type views that fold the SDK's recurring argument shapes into single parameters,...
One slot of a recvmmsg() batch: caller-owned receive buffer and source address, filled in by wired_ud...
Definition udp.h:130
quic_sockaddr src
out: datagram's source address
Definition udp.h:132
u8 ecn
out: RFC 3168 ECN codepoint of the received IP header (0 = Not-ECT, 1 = ECT(1), 2 = ECT(0),...
Definition udp.h:141
u32 len
out: bytes received into buf.p
Definition udp.h:133
quic_mspan buf
in: destination buffer; unused bytes untouched
Definition udp.h:131
Mutable view of a byte range.
Definition span.h:42
A sockaddr_in6 laid out for the kernel (big-endian port; a 16-byte address that is either native IPv6...
Definition udp.h:22
u16 family
WIRED_AF_INET6.
Definition udp.h:23
u8 addr[16]
native IPv6, or v4-mapped ::ffff:a.b.c.d
Definition udp.h:26
u32 scope_id
sin6_scope_id, zeroed
Definition udp.h:27
u32 flowinfo
sin6_flowinfo, zeroed
Definition udp.h:25
u16 port_be
network byte order
Definition udp.h:24
Read-only view of a byte range.
Definition span.h:30
x86_64 Linux direct syscalls.
unsigned int u32
unsigned 32-bit integer
Definition syscall.h:14
long i64
signed 64-bit integer
Definition syscall.h:13
u64 usz
unsigned size (size_t equivalent)
Definition syscall.h:19
unsigned short u16
unsigned 16-bit integer
Definition syscall.h:16
unsigned char u8
unsigned 8-bit integer / byte
Definition syscall.h:17
i64 wired_udp_bind(i64 fd, const quic_sockaddr *sa)
Bind fd to sa.
void wired_udp_addr(quic_sockaddr *sa, u16 port, const u8 octets[4])
Build an address from host-order port and IPv4 octets[0..3] = a.b.c.d, as the v4-mapped ::ffff:a....
i64 wired_udp_recvmmsg(i64 fd, quic_mmsg_buf *bufs, usz count)
Receive up to count datagrams in one recvmmsg() syscall (Linux GRO-style batched receive,...
i64 wired_udp_gso_enable(i64 fd, u16 segsize)
Enable UDP GSO on fd: kernel will split a large sendmsg() payload into segsize-byte datagrams (Linux ...
i64 wired_udp_recvmmsg_fallback(i64 fd, quic_mmsg_buf *bufs, usz count)
Receive up to count datagrams via a wired_udp_recvfrom() loop (one syscall per datagram),...
i64 wired_udp_send_gso(i64 fd, const quic_sockaddr *sa, quic_span buf, u16 segsize)
Send count back-to-back segsize-byte segments (the last may be shorter, total = buf....
i64 wired_udp_prefer_busy_poll_enable(i64 fd, int enable)
Enable/disable SO_PREFER_BUSY_POLL on fd: prefers busy-polling over interrupts for this socket.
#define WIRED_GSO_CMSG_SPACE
Byte length of a UDP_SEGMENT cmsg (header + u16 payload, 8-byte aligned).
Definition udp.h:88
i64 wired_udp_reuseport_enable(i64 fd)
Enable SO_REUSEPORT on fd so multiple sockets (e.g.
i64 wired_udp_busy_poll_enable(i64 fd, int microseconds)
Enable SO_BUSY_POLL on fd: the kernel spins the driver's poll routine for up to microseconds before s...
i64 wired_udp_pmtu_probe_enable(i64 fd)
Enable IP_MTU_DISCOVER=IP_PMTUDISC_DO on fd (Linux uapi in.h): the kernel always sets the IPv4 DF (Do...
static u32 wired_udp_addr4_be(const quic_sockaddr *sa)
Read a v4-mapped (or any) address's IPv4 bytes as a big-endian u32 — the accessor the IPv4-only paths...
Definition udp.h:43
i64 wired_udp_ect0_enable(i64 fd)
Enable ECT(0) marking (RFC 3168, RFC 9000 13.4.1) on every packet fd sends: sets the IPv4 TOS byte's ...
i64 wired_udp_recv(i64 fd, quic_mspan buf)
Receive up to buf.n bytes into buf.p.
i64 wired_udp_send_batch(i64 fd, const quic_sockaddr *sa, quic_span buf, u16 segsize)
Send count back-to-back segsize-byte segments to sa via one sendto() call per segment (no GSO).
i64 wired_udp_incoming_cpu_set(i64 fd, int cpu)
Set SO_INCOMING_CPU on fd: hints the kernel to steer this socket's incoming packets toward the given ...
i64 wired_udp_socket(void)
Create a dual-stack UDP socket: AF_INET6 with IPV6_V6ONLY disabled, so IPv4 peers arrive as v4-mapped...
i64 wired_udp_busy_poll_budget_set(i64 fd, int budget)
Set SO_BUSY_POLL_BUDGET on fd: caps how many packets a single busy-poll spin processes before yieldin...
i64 wired_udp_recvtos_enable(i64 fd)
Enable IP_RECVTOS on fd (Linux uapi in.h) so wired_udp_recvmmsg/ wired_udp_recvmmsg_nowait attach eac...
i64 wired_udp_close(i64 fd)
Close fd.
i64 wired_udp_send(i64 fd, const quic_sockaddr *sa, quic_span buf)
Send buf to sa.
void wired_udp_gso_cmsg_build(u8 out[WIRED_GSO_CMSG_SPACE], u16 segsize)
Build a UDP_SEGMENT cmsg buffer for sendmsg() into out[0..WIRED_GSO_CMSG_SPACE).
i64 wired_udp_recvfrom(i64 fd, quic_mspan buf, quic_sockaddr *src)
Receive up to buf.n bytes into buf.p and write the source address into src.
i64 wired_udp_recvmmsg_nowait(i64 fd, quic_mmsg_buf *bufs, usz count)
Same as wired_udp_recvmmsg but non-blocking (MSG_DONTWAIT): returns immediately with a negative errno...