ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
quic_tp.h File Reference

QUIC transport parameters (RFC 9000 sec 18) carried in the TLS quic_transport_parameters extension (RFC 9001 sec 8.2). More...

Go to the source code of this file.

Classes

struct  QuicTransportParams
 The transport parameters we encode / decode, with RFC 9000 sec 18.2 defaults applied. More...
 
struct  QuicTpNs
 Dispatch table. Addressed by offset, so the layout is asserted below. More...
 

Macros

#define QUIC_TP_ORIGINAL_DCID   0x00
 Transport parameter identifiers (RFC 9000 sec 18.2 / Table 7).
 
#define QUIC_TP_MAX_IDLE_TIMEOUT   0x01
 varint, milliseconds (0 = disabled)
 
#define QUIC_TP_STATELESS_RESET_TOKEN   0x02
 16 bytes (server only)
 
#define QUIC_TP_MAX_UDP_PAYLOAD_SIZE   0x03
 varint, default 65527, min 1200
 
#define QUIC_TP_INITIAL_MAX_DATA   0x04
 varint, connection flow-control window
 
#define QUIC_TP_INITIAL_MAX_SD_BIDI_LOCAL   0x05
 varint
 
#define QUIC_TP_INITIAL_MAX_SD_BIDI_REMOTE   0x06
 varint
 
#define QUIC_TP_INITIAL_MAX_SD_UNI   0x07
 varint
 
#define QUIC_TP_INITIAL_MAX_STREAMS_BIDI   0x08
 varint
 
#define QUIC_TP_INITIAL_MAX_STREAMS_UNI   0x09
 varint
 
#define QUIC_TP_ACK_DELAY_EXPONENT   0x0a
 varint, default 3, max 20
 
#define QUIC_TP_MAX_ACK_DELAY   0x0b
 varint, default 25, < 2^14
 
#define QUIC_TP_DISABLE_ACTIVE_MIGRATION   0x0c
 zero-length flag
 
#define QUIC_TP_ACTIVE_CID_LIMIT   0x0e
 varint, default 2, min 2
 
#define QUIC_TP_INITIAL_SCID   0x0f
 SCID of this endpoint's first Initial.
 
#define QUIC_TP_RETRY_SCID   0x10
 server: SCID of a Retry it sent
 

Functions

 PROTOCORE_NS_LAYOUT (QuicTpNs, defaults, encode, parse)
 
void protocore_quic_tp_defaults (uint8_t *work, QuicTransportParams *tp)
 Fill tp with the RFC 9000 sec 18.2 default values (all connection .
 
size_t protocore_quic_tp_encode (uint8_t *work, const QuicTransportParams *tp, uint8_t *out, size_t cap)
 Encode the server's transport parameters into out. Emits, in .
 
proto_bool protocore_quic_tp_parse (uint8_t *work, const uint8_t *buf, size_t len, QuicTransportParams *tp)
 Parse a peer's transport parameters (starting from the spec .
 

Variables

PROTOCORE_NS QuicTpNs QuicTp PROTOCORE_UNUSED
 Module namespace.
 

Detailed Description

QUIC transport parameters (RFC 9000 sec 18) carried in the TLS quic_transport_parameters extension (RFC 9001 sec 8.2).

Each endpoint states its transport limits (flow-control windows, stream limits, idle timeout, and the connection IDs used during the handshake) as a sequence of ID (varint) | Length (varint) | Value parameters. The server carries its parameters in the EncryptedExtensions message and reads the client's from the ClientHello. This module encodes the set a minimal server advertises and parses a peer's, applying the RFC 9000 sec 18.2 defaults and rejecting malformed or illegal values (bad varints, oversized connection IDs, a duplicated parameter, out-of-range limits).

Pure, zero heap, host-tested (round-trip + the spec defaults + malformed-input rejection).

work is bytes the CALLER holds. This module reads none of them: it carries nothing between calls, so there is no state to keep and nothing to wipe. The parameter is there so a caller drives every namespace the same way.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file quic_tp.h.

Macro Definition Documentation

◆ QUIC_TP_ORIGINAL_DCID

#define QUIC_TP_ORIGINAL_DCID   0x00

Transport parameter identifiers (RFC 9000 sec 18.2 / Table 7).

server: DCID of the client's first Initial

Definition at line 39 of file quic_tp.h.

◆ QUIC_TP_MAX_IDLE_TIMEOUT

#define QUIC_TP_MAX_IDLE_TIMEOUT   0x01

varint, milliseconds (0 = disabled)

Definition at line 40 of file quic_tp.h.

◆ QUIC_TP_STATELESS_RESET_TOKEN

#define QUIC_TP_STATELESS_RESET_TOKEN   0x02

16 bytes (server only)

Definition at line 41 of file quic_tp.h.

◆ QUIC_TP_MAX_UDP_PAYLOAD_SIZE

#define QUIC_TP_MAX_UDP_PAYLOAD_SIZE   0x03

varint, default 65527, min 1200

Definition at line 42 of file quic_tp.h.

◆ QUIC_TP_INITIAL_MAX_DATA

#define QUIC_TP_INITIAL_MAX_DATA   0x04

varint, connection flow-control window

Definition at line 43 of file quic_tp.h.

◆ QUIC_TP_INITIAL_MAX_SD_BIDI_LOCAL

#define QUIC_TP_INITIAL_MAX_SD_BIDI_LOCAL   0x05

varint

Definition at line 44 of file quic_tp.h.

◆ QUIC_TP_INITIAL_MAX_SD_BIDI_REMOTE

#define QUIC_TP_INITIAL_MAX_SD_BIDI_REMOTE   0x06

varint

Definition at line 45 of file quic_tp.h.

◆ QUIC_TP_INITIAL_MAX_SD_UNI

#define QUIC_TP_INITIAL_MAX_SD_UNI   0x07

varint

Definition at line 46 of file quic_tp.h.

◆ QUIC_TP_INITIAL_MAX_STREAMS_BIDI

#define QUIC_TP_INITIAL_MAX_STREAMS_BIDI   0x08

varint

Definition at line 47 of file quic_tp.h.

◆ QUIC_TP_INITIAL_MAX_STREAMS_UNI

#define QUIC_TP_INITIAL_MAX_STREAMS_UNI   0x09

varint

Definition at line 48 of file quic_tp.h.

◆ QUIC_TP_ACK_DELAY_EXPONENT

#define QUIC_TP_ACK_DELAY_EXPONENT   0x0a

varint, default 3, max 20

Definition at line 49 of file quic_tp.h.

◆ QUIC_TP_MAX_ACK_DELAY

#define QUIC_TP_MAX_ACK_DELAY   0x0b

varint, default 25, < 2^14

Definition at line 50 of file quic_tp.h.

◆ QUIC_TP_DISABLE_ACTIVE_MIGRATION

#define QUIC_TP_DISABLE_ACTIVE_MIGRATION   0x0c

zero-length flag

Definition at line 51 of file quic_tp.h.

◆ QUIC_TP_ACTIVE_CID_LIMIT

#define QUIC_TP_ACTIVE_CID_LIMIT   0x0e

varint, default 2, min 2

Definition at line 52 of file quic_tp.h.

◆ QUIC_TP_INITIAL_SCID

#define QUIC_TP_INITIAL_SCID   0x0f

SCID of this endpoint's first Initial.

Definition at line 53 of file quic_tp.h.

◆ QUIC_TP_RETRY_SCID

#define QUIC_TP_RETRY_SCID   0x10

server: SCID of a Retry it sent

Definition at line 54 of file quic_tp.h.

Function Documentation

◆ PROTOCORE_NS_LAYOUT()

PROTOCORE_NS_LAYOUT ( QuicTpNs  ,
defaults  ,
encode  ,
parse   
)

◆ protocore_quic_tp_defaults()

void protocore_quic_tp_defaults ( uint8_t *  work,
QuicTransportParams *  tp 
)

Fill tp with the RFC 9000 sec 18.2 default values (all connection .

Parameters
workPROTOCORE_QUIC_TP_BORROW bytes the caller took. Not held past the call.
tpTp

◆ protocore_quic_tp_encode()

size_t protocore_quic_tp_encode ( uint8_t *  work,
const QuicTransportParams *  tp,
uint8_t *  out,
size_t  cap 
)

Encode the server's transport parameters into out. Emits, in .

Parameters
workPROTOCORE_QUIC_TP_BORROW bytes the caller took. Not held past the call.
tpTp
outOut
capCap
Returns
The size_t.

◆ protocore_quic_tp_parse()

proto_bool protocore_quic_tp_parse ( uint8_t *  work,
const uint8_t *  buf,
size_t  len,
QuicTransportParams *  tp 
)

Parse a peer's transport parameters (starting from the spec .

Parameters
workPROTOCORE_QUIC_TP_BORROW bytes the caller took. Not held past the call.
bufBuf
lenLen
tpTp
Returns
PROTO_TRUE on success.

Variable Documentation

◆ PROTOCORE_UNUSED

PROTOCORE_NS QuicTpNs QuicTp PROTOCORE_UNUSED
Initial value:
= {
size_t protocore_quic_tp_encode(uint8_t *work, const QuicTransportParams *tp, uint8_t *out, size_t cap)
Encode the server's transport parameters into out. Emits, in .
proto_bool protocore_quic_tp_parse(uint8_t *work, const uint8_t *buf, size_t len, QuicTransportParams *tp)
Parse a peer's transport parameters (starting from the spec .
void protocore_quic_tp_defaults(uint8_t *work, QuicTransportParams *tp)
Fill tp with the RFC 9000 sec 18.2 default values (all connection .

Module namespace.

Definition at line 118 of file quic_tp.h.