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  crecv
 CRYPTO stream reassembly state. More...

Macros

#define CRECV_BUF   2048
 Reassembly buffer capacity in bytes.

Functions

void crecv_init (crecv *s)
 Start with an empty reassembly buffer.
int crecv_collect (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

◆ crecv_collect()

int crecv_collect ( 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).

◆ crecv_init()

void crecv_init ( crecv * s)

Start with an empty reassembly buffer.

Parameters
sreassembly state to initialize