wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
Loading...
Searching...
No Matches
wired.h
Go to the documentation of this file.
1#ifndef WIRED_H
2#define WIRED_H
3
11
17#include "app/http3/server/srvloop/respond.h"
29#include "app/webtransport/errmap/errmap/errmap.h"
31#include "common/arch/arch.h"
34#include "common/fmt/fmt.h"
36#include "common/platform/clock/clock.h"
48
49/* A binary that supplies its own _start (-nostdlib) must also define the
50 * libc-named memcpy/memset the compiler emits for struct/array copies. Define
51 * WIRED_MAIN in the single application translation unit to emit them here,
52 * forwarding to the SDK's bytes_memcpy/bytes_memset. */
53#ifdef WIRED_MAIN
54void* memcpy(void* dst, const void* src, usz n) {
55 return bytes_memcpy(dst, src, n);
56}
57void* memset(void* dst, int c, usz n) { return bytes_memset(dst, c, n); }
58
59/* Freestanding entry point (-nostdlib). Each application TU that defines
60 * WIRED_MAIN must also define `int wired_main(int argc, char** argv)`
61 * (non-static, so this can link to it) as its own main. The architecture
62 * specifics -- recovering argc/argv from the kernel-built initial stack,
63 * aligning the stack for the calling convention, exiting with wired_main's
64 * return value -- live in the arch adapter's WIRED_ARCH_START_ASM. */
65int wired_main(int argc, char** argv);
66
67__attribute__((naked)) void _start(void) { WIRED_ARCH_START_ASM(wired_main); }
68#endif
69
70#endif
Architecture selection facade.
Cursor byte-copy helpers shared by the frame codecs.
static void * bytes_memcpy(void *dst, const void *src, usz n)
Freestanding byte copy.
Definition bytes.h:65
static void * bytes_memset(void *dst, int c, usz n)
Freestanding byte fill.
Definition bytes.h:100
Load (or reload) a server's certificate chain and P-256 signing key from a cert.pem (fullchain,...
Parse already-materialized argc/argv for named flags of the form --flag value.
Minimal libc-free tracing for freestanding binaries: write to stderr and format a decimal,...
P-256 private-key extraction from the two DER shapes tools emit: SEC1 ECPrivateKey (RFC 5915 3) and P...
Read environment variables without libc.
Process termination, separate from common/platform/debug (which owns log output only).
Whole-file read via raw Linux syscalls (openat/read/close).
libc-free printf-compatible formatter.
RFC 9000 17.
Small conveniences for a wired_http_handler filling its exchange.
Infer an HTTP Content-Type from a static file's path, by its extension (the substring after the last ...
Monotonic elapsed-time clock (CLOCK_MONOTONIC), for measuring intervals such as connection idle age (...
draft-ietf-moq-transport-18/19/22 data-plane (draft-19 sections; the wire is byte-identical in all th...
draft-ietf-moq-transport-18/19/22 datagram plane: OBJECT_DATAGRAM codec (18/19 11....
One wired_moqt_io table that serves both MoQT transports, so the hub never branches on transport for ...
draft-ietf-moq-transport-18/19/22 hub relay (section numbers are draft-19's unless a draft is named; ...
Fragmented-MP4 top-level layout (ISO/IEC 14496-12 box structure): the init segment (ftyp through moov...
RFC 7468 2-3: textual (PEM) encoding of DER structures.
RFC 9001 5 / 5.1: seal server-direction outbound packets.
RFC 9001 4 / 4.1.2, RFC 8446 4 / 4.4.4, RFC 9000 7: server-side handshake orchestrator,...
RFC 9000 17.2 / RFC 9001 5 / RFC 8446 4.4: cold-start a server connection from a client Initial datag...
A fixed, deterministic server identity for samples and tests: the key bytes are a counting pattern,...
Selects and runs one of this SDK's four server drivers (single-process, multi-process fork,...
RFC 9001 4 / 5 / RFC 9000 17.2: the socket-free core of the server wire loop.
The complete server event loop: the sanctioned socket-owning layer over the socket-free srvboot/srvlo...
Resolve an HTTP request path into a document-root-relative file path for static file serving (quiche-...
Small text helpers for application code: compare a byte view with a C string, copy a view out as a C ...
u64 usz
unsigned size (size_t equivalent)
Definition types.h:20
UDP via direct x86_64 syscalls, dual-stack (one AF_INET6 socket serves IPv6 natively and IPv4 as v4-m...
draft-ietf-webtrans-http3-15 SS4.2/SS5.6: the WebTransport-specific capsule types layered on top of t...
WebTransport wire-format helpers (pure functions, no state).
RFC 7748 X25519: scalar multiplication on Curve25519 for ECDHE.
#define WIRED_ARCH_START_ASM(entry)
Body of a freestanding _start (to be used inside a naked function): Linux enters with RSP%16==0 and n...
Definition x8664.h:139