wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
Loading...
Searching...
No Matches
wired_srvrun_opt Struct Reference

Opt-in polling-driver knobs, both off (0) by default so wired_server_run's behavior is unchanged. More...

#include <srvrun.h>

Data Fields

int busy_poll
 1: MSG_DONTWAIT spin loop instead of blocking poll(2)
int so_busy_poll_us
 >0: also enable SO_BUSY_POLL (microseconds).
wired_wt_on_datagram wt_on_datagram
 draft-ietf-webtrans-http3-15 SS4: app-facing WebTransport datagram delivery, 0 to disable (the default) — a 0 callback makes the per-step drain of received QUIC DATAGRAMs a no-op consume (the queue still empties, nothing is delivered).
void * wt_datagram_ctx
 opaque ctx passed to wt_on_datagram
wired_wt_on_stream_data wt_on_stream_data
 draft-ietf-webtrans-http3-15 4.3: app-facing WebTransport bidi/uni stream-data delivery, 0 to disable (the default) — a 0 callback makes the per-step delta-delivery of reassembled WT stream bytes a no-op (reassembly and offer_stream association still happen, nothing is delivered).
void * wt_stream_data_ctx
 opaque ctx passed to wt_on_stream_data
int so_prefer_busy_poll
 0 = disabled (default); 1 = also enable SO_PREFER_BUSY_POLL (requires so_busy_poll_us > 0 to have kernel effect, see srvrun.c's guard).
int so_busy_poll_budget
int incoming_cpu
 SET direction only.
wired_srvxdp * xdp
 0 (the default) = unchanged UDP socket path; non-0 = an already-open AF_XDP driver (wired_srvxdp_open), routing recv and send through it instead.
int no_signal_handlers
 0 (the default) = install SIGTERM/SIGHUP as wired_server_run always has; 1 = skip signal installation entirely.
int core_id
 AF_XDP multi-queue core-routing: -1 = disabled (the default, a dedicated sentinel like incoming_cpu since core 0 is itself valid).
const char * wt_protocols
 WebTransport subprotocol negotiation (draft-ietf-webtrans-http3-15 SS3.4): the server's own supported subprotocols as a space-separated string, 0 to disable (the default) – with 0, an Extended CONNECT's wt-available-protocols offer is ignored and the 2xx carries no wt-protocol header, exactly the pre-negotiation behavior.
wired_wt_on_session wt_on_session
 Session-established notification, 0 to disable (the default) – called once per accepted Extended CONNECT, after its 2xx response is built, with the session's :path and the negotiated subprotocol (empty span when none was negotiated).
void * wt_session_ctx
 opaque ctx passed to wt_on_session
int force_retry
 RFC 9000 8.1.2: 1 = answer every tokenless Initial with a stateless Retry and only accept Initials presenting a valid Retry token (the quic-interop-runner retry testcase's server mode).
wired_wt_resource_check wt_resource_check
 draft-ietf-webtrans-http3-16 SS3.2: app-facing :authority/:path resource lookup, 0 to disable (the default) – with 0, every recognized WebTransport Extended CONNECT proceeds straight to Origin verification/ session establishment, exactly the pre-callback behavior (WTH3-016's 405 and WTH3-018's 3xx are both opt-in through this callback).
void * wt_resource_ctx
 opaque ctx passed to wt_resource_check
wired_wt_on_stream_reset wt_on_stream_reset
 draft-ietf-webtrans-http3-15 4.4 (WTH3-040): app-facing WT stream-reset delivery, 0 to disable (the default) – a 0 callback makes a received RESET_STREAM/STOP_SENDING on a WT bidi/uni stream a no-op consume (the stream's slot is still torn down, nothing is delivered).
void * wt_stream_reset_ctx
 opaque ctx passed to wt_on_stream_reset
wired_wt_on_session_close wt_on_session_close
 Session-ended notification, 0 to disable (the default) – called once per WT session when it ends server-side (CONNECT stream close, flow violation, WT_CLOSE_SESSION, or whole-connection teardown).
void * wt_session_close_ctx
 opaque ctx passed to wt_on_session_close
wired_srvrun_on_step on_step
 Per-step application hook, 0 to disable (the default): called once per event-loop step after that step's receive/serve work, with the loop's own monotonic clock (ms).
void * on_step_ctx
 opaque ctx passed to on_step
int(* wt_origin_check )(void *ctx, wired_span origin, wired_span authority)
 draft-ietf-webtrans-http3-15 SS3.1 / RFC 6454: app-facing Origin verdict for one WebTransport Extended CONNECT, 0 to disable (the default, which accepts every well-formed Origin).
void * wt_origin_ctx
 opaque ctx passed to wt_origin_check
wired_wt_on_session_draining wt_on_session_draining
 Peer WT_DRAIN_SESSION notification, 0 to disable (the default, which consumes the capsule silently).
void * wt_session_draining_ctx
 opaque ctx passed to it
wired_rawq_on_session raw_on_session
 Raw-QUIC implicit-session notification, 0 to disable (the default).
void * raw_session_ctx
 opaque ctx passed to raw_on_session

Detailed Description

Opt-in polling-driver knobs, both off (0) by default so wired_server_run's behavior is unchanged.

Field Documentation

◆ core_id

int wired_srvrun_opt::core_id

AF_XDP multi-queue core-routing: -1 = disabled (the default, a dedicated sentinel like incoming_cpu since core 0 is itself valid).

>= 0, only when xdp is also set: this worker's own core/queue index, packed into the leading byte of every SCID this worker generates (ncid_worker_encode, bits=8) so a BPF filter can route by CID instead of NIC queue after a connection migrates. Ignored when xdp is 0 (SO_REUSEPORT/plain UDP mode never embeds a core id).

◆ force_retry

int wired_srvrun_opt::force_retry

RFC 9000 8.1.2: 1 = answer every tokenless Initial with a stateless Retry and only accept Initials presenting a valid Retry token (the quic-interop-runner retry testcase's server mode).

0 (the default) = accept directly, never send Retry – the RFC's own recommendation (Retry costs every client a round trip; use it under load). The default is safe against a spoofed source address even with 0-RTT (RFC 9001 4.6.1): no 1-RTT response byte leaves before the client's Finished verifies, which per RFC 9000 8.1 validates the address, and everything sent before that (the boot flight) is bound by the 3x anti-amplification budget.

◆ incoming_cpu

int wired_srvrun_opt::incoming_cpu

SET direction only.

-1 = disabled (the default) – a dedicated sentinel, not 0, because CPU 0 is itself a valid target and there is no natural "0 means off" value here (unlike so_busy_poll_us/ so_busy_poll_budget, where 0 already means "no budget"). >= 0: also enable SO_INCOMING_CPU with this CPU number.

◆ no_signal_handlers

int wired_srvrun_opt::no_signal_handlers

0 (the default) = install SIGTERM/SIGHUP as wired_server_run always has; 1 = skip signal installation entirely.

Set this when running more than one wired_srvrun_serve_env instance in the same process (e.g. one per thread) – only one of them may own the process-wide signal handlers.

◆ on_step

wired_srvrun_on_step wired_srvrun_opt::on_step

Per-step application hook, 0 to disable (the default): called once per event-loop step after that step's receive/serve work, with the loop's own monotonic clock (ms).

Runs inside the loop, so every wired_server_wt_* send API may be called from it. While a hook is registered the loop never blocks without a timeout: it keeps the bounded SRVRUN_PTO_MS poll cadence, so the hook fires at least every SRVRUN_PTO_MS (25 ms) whether or not any connection is live or any traffic flows.

◆ raw_on_session

wired_rawq_on_session wired_srvrun_opt::raw_on_session

Raw-QUIC implicit-session notification, 0 to disable (the default).

See wired_rawq_on_session. Only fires for connections whose ALPN came from wired_srvboot_id.raw_alpns.

◆ so_busy_poll_budget

int wired_srvrun_opt::so_busy_poll_budget

0: also enable SO_BUSY_POLL_BUDGET with this packet budget; 0 = disabled (default).

◆ so_busy_poll_us

int wired_srvrun_opt::so_busy_poll_us

>0: also enable SO_BUSY_POLL (microseconds).

Independent of busy_poll; a no-op on a kernel/driver without CONFIG_NET_RX_BUSY_POLL support.

◆ wt_on_session_close

wired_wt_on_session_close wired_srvrun_opt::wt_on_session_close

Session-ended notification, 0 to disable (the default) – called once per WT session when it ends server-side (CONNECT stream close, flow violation, WT_CLOSE_SESSION, or whole-connection teardown).

See wired_wt_on_session_close's doc for the pointer-reuse hazard this exists to close.

◆ wt_on_session_draining

wired_wt_on_session_draining wired_srvrun_opt::wt_on_session_draining

Peer WT_DRAIN_SESSION notification, 0 to disable (the default, which consumes the capsule silently).

See wired_wt_on_session_draining.

◆ wt_origin_check

int(* wired_srvrun_opt::wt_origin_check) (void *ctx, wired_span origin, wired_span authority)

draft-ietf-webtrans-http3-15 SS3.1 / RFC 6454: app-facing Origin verdict for one WebTransport Extended CONNECT, 0 to disable (the default, which accepts every well-formed Origin).

Called after wt_resource_check accepted and before the session is established: return 1 to proceed, 0 to answer 403 with no session. origin is the request's origin header (an empty span when the CONNECT carries none); authority is its :authority. Both are views not valid past the call.

◆ xdp

wired_srvxdp* wired_srvrun_opt::xdp

0 (the default) = unchanged UDP socket path; non-0 = an already-open AF_XDP driver (wired_srvxdp_open), routing recv and send through it instead.

The UDP socket from port is still bound (port reservation + PASS-frame absorption via the BPF filter's fallback), so cfg->fd stays valid either way.


The documentation for this struct was generated from the following file: