wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
Loading...
Searching...
No Matches
errmap.h
1
#ifndef WTERRMAP_H
2
#define WTERRMAP_H
3
4
#include "
common/platform/sys/syscall.h
"
5
6
/* WebTransport application error code <-> HTTP/3-level error code mapping
7
* (draft-ietf-webtrans-http3-15 8.2). An application error code n (any u32)
8
* is packed into a reserved HTTP/3 error-code range [first, last] so it
9
* survives being carried in an HTTP/3-level error-code field, skipping the
10
* codepoints reserved for greasing (RFC 9114 7.2.9 style: every 0x1f-th
11
* value starting at 0x21 relative to first is reserved). */
12
13
/* Forward: application error code -> HTTP/3-level error code. n may be any
14
* u32 value; the whole domain maps into [first, last]. */
15
u64
wired_wterrmap_to_http3(
u32
n);
16
17
/* Reverse: HTTP/3-level error code -> application error code. Returns 1 and
18
* sets *n_out on success. Returns 0 if h falls outside [first, last] or
19
* lands on a reserved codepoint (defends against arbitrary/adversarial h
20
* values arriving from the wire; a value produced by
21
* wired_wterrmap_to_http3 never triggers this rejection). */
22
int
wired_wterrmap_from_http3(
u64
h,
u32
* n_out);
23
24
/* draft-ietf-webtrans-http3-16 9.5/6: named WebTransport-defined HTTP/3
25
* error codes. All five below are registered in the IANA "HTTP/3 Error
26
* Code" registry (SS9.5) and are protocol-level codes sent RAW on the wire,
27
* never through wired_wterrmap_to_http3 -- that function is only for
28
* WebTransport APPLICATION error codes (arbitrary u32 values an app chooses),
29
* which is a disjoint concern. Defined here (rather than at each event site)
30
* because most do not yet have a live trigger in this SDK:
31
*
32
* - WT_BUFFERED_STREAM_REJECTED: reset a stream that arrived before session
33
* establishment and found the pre-establishment buffer full (session/
34
* session.h wired_wt_session_offer_stream documents this on its 0 return).
35
* Live: srvrun.c's srvrun_reject_wt_slot.
36
* - WT_SESSION_GONE: a stream/datagram referenced an already-closed session,
37
* or signals the endpoint stopped reading the CONNECT stream. Live:
38
* srvrun.c's srvrun_close_wt_session_slot callers.
39
* - WT_FLOW_CONTROL_ERROR: a WebTransport-level flow-control violation.
40
* - WT_ALPN_ERROR: application-protocol negotiation over WebTransport
41
* failed. Dormant: WT-Available-Protocols/WT-Protocol negotiation is out
42
* of scope.
43
* - WT_REQUIREMENTS_NOT_MET: the peer's SETTINGS/transport parameters did
44
* not actually satisfy WebTransport's requirements. Dormant: SETTINGS/
45
* transport-parameter completeness checking is not implemented.
46
*/
47
#define WTERR_BUFFERED_STREAM_REJECTED 0x3994bd84u
48
#define WTERR_SESSION_GONE 0x170d7b68u
49
#define WTERR_FLOW_CONTROL_ERROR 0x045d4487u
50
#define WTERR_ALPN_ERROR 0x0817b3ddu
51
#define WTERR_REQUIREMENTS_NOT_MET 0x212c0d48u
52
53
#endif
syscall.h
Linux direct syscalls.
u32
unsigned int u32
unsigned 32-bit integer
Definition
types.h:15
u64
unsigned long u64
unsigned 64-bit integer
Definition
types.h:13
app
webtransport
errmap
errmap
errmap.h
Generated by
1.16.1