wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
Loading...
Searching...
No Matches
moqraw.h File Reference

MoQT-over-raw-QUIC Setup Option policy. More...

Go to the source code of this file.

Data Structures

struct  moqraw_policy
 The application's optional say over well-formed PATH/AUTHORITY values on raw QUIC. More...

Macros

#define MOQRAW_CLOSE_INVALID_PATH   0x8
 -18/-19 10.3.1.2, -22 9.1.2: PATH over WebTransport or naming an unsupported path.
#define MOQRAW_CLOSE_MALFORMED_PATH   0x9
 -18/-19 10.3.1.2, -22 9.1.2: PATH not RFC 3986 path-abempty [?query].
#define MOQRAW_CLOSE_INVALID_AUTHORITY   0x19
 -18/-19 10.3.1.1, -22 9.1.1: AUTHORITY over WebTransport or naming an unsupported authority.
#define MOQRAW_CLOSE_MALFORMED_AUTHORITY   0x1A
 -18/-19 10.3.1.1, -22 9.1.1: AUTHORITY not an RFC 3986 authority with a non-empty host.

Functions

int moqraw_path_ok (wired_span path)
 RFC 3986 3.3/3.4 subset for the PATH option: 1 when path is empty, or starts with "/" and continues with pchar / "/" segments, optionally followed by "?" and query characters; every "%" must be followed by two hex digits.
int moqraw_authority_ok (wired_span authority)
 RFC 3986 3.2 subset for the AUTHORITY option: [userinfo "@"] host [":" port], where host is a non-empty reg-name, an IPv4 address, or a bracketed IP literal ("[" ... "]"), and port is zero or more digits whose value is at most 65535 (an empty port after ":" is allowed by RFC 3986 3.2.3).
u32 moqraw_setup_verdict (int raw, const moqctl_setup *m, const moqraw_policy *pol)
 The close code a decoded client SETUP calls for, 0 to accept.

Detailed Description

MoQT-over-raw-QUIC Setup Option policy.

On native QUIC there is no Extended CONNECT, so the client carries its URI's authority and path-abempty [?query] in the AUTHORITY (0x05) and PATH (0x01) Setup Options (draft-ietf-moq-transport-18 3.1.4/10.3.1.1-2, -19 3.1.5/ 10.3.1.1-2, -22 6.2.2/9.1.1-2). Both are client-only and native-QUIC-only: over WebTransport their presence is itself a close. This module decides the session-termination code (draft-ietf-moq-transport-19 3.5, -22 6.6 / 12.2) one client SETUP calls for.

Function Documentation

◆ moqraw_authority_ok()

int moqraw_authority_ok ( wired_span authority)

RFC 3986 3.2 subset for the AUTHORITY option: [userinfo "@"] host [":" port], where host is a non-empty reg-name, an IPv4 address, or a bracketed IP literal ("[" ... "]"), and port is zero or more digits whose value is at most 65535 (an empty port after ":" is allowed by RFC 3986 3.2.3).

An empty host is malformed (-22 6.1).

Parameters
authoritythe AUTHORITY option value
Returns
1 well-formed, 0 malformed

◆ moqraw_path_ok()

int moqraw_path_ok ( wired_span path)

RFC 3986 3.3/3.4 subset for the PATH option: 1 when path is empty, or starts with "/" and continues with pchar / "/" segments, optionally followed by "?" and query characters; every "%" must be followed by two hex digits.

"#", space, control bytes and non-ASCII bytes are malformed.

Parameters
paththe PATH option value
Returns
1 well-formed, 0 malformed

◆ moqraw_setup_verdict()

u32 moqraw_setup_verdict ( int raw,
const moqctl_setup * m,
const moqraw_policy * pol )

The close code a decoded client SETUP calls for, 0 to accept.

PATH is judged before AUTHORITY, so a SETUP bad in both closes on the PATH code. raw == 0 (WebTransport): PATH present -> MOQRAW_CLOSE_INVALID_PATH, else AUTHORITY present -> MOQRAW_CLOSE_INVALID_AUTHORITY, exactly the hub's pre-raw behavior. raw == 1: each present option must pass its syntax check (else MALFORMED_PATH / MALFORMED_AUTHORITY), then the policy hook (else INVALID_PATH / INVALID_AUTHORITY). Absent options and unknown options (not surfaced by moqctl_setup_take) never close.

Parameters
raw1 for a raw-QUIC session, 0 for WebTransport
mthe decoded client SETUP
polthe application policy, or 0 to accept every well-formed value
Returns
0 accept, else the session termination code