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

RFC 9000 19.6 / 7.5: reassemble CRYPTO frames received in a Handshake (or Initial) packet payload into a single in-order byte stream of TLS handshake messages. More...

Go to the source code of this file.

Data Structures

struct  quic_crecv
 CRYPTO stream reassembly state. More...

Macros

#define QUIC_CRECV_BUF   2048
 Reassembly buffer capacity in bytes.

Functions

void quic_crecv_init (quic_crecv *s)
 Start with an empty reassembly buffer.
int quic_crecv_collect (quic_crecv *s, const u8 *frames, usz len)
 Walk a payload, write every CRYPTO frame at its offset, ignore other frames.

Detailed Description

RFC 9000 19.6 / 7.5: reassemble CRYPTO frames received in a Handshake (or Initial) packet payload into a single in-order byte stream of TLS handshake messages.

Out-of-order and split frames are placed at their offset; only the contiguous prefix from offset 0 is exposed to TLS. Fixed buffer, no alloc.

Function Documentation

◆ quic_crecv_collect()

int quic_crecv_collect ( quic_crecv * s,
const u8 * frames,
usz len )

Walk a payload, write every CRYPTO frame at its offset, ignore other frames.

Updates the contiguous prefix.

Parameters
sreassembly state
framesthe packet payload to walk
lenlength of frames in bytes
Returns
1, or 0 if a CRYPTO frame falls outside the buffer (RFC 9000 19.6).

◆ quic_crecv_init()

void quic_crecv_init ( quic_crecv * s)

Start with an empty reassembly buffer.

Parameters
sreassembly state to initialize