wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
Loading...
Searching...
No Matches
ncid.h
1#ifndef FRAME_NCID_H
2#define FRAME_NCID_H
3
5
8
9#define FRAME_NEW_CID 0x18
10#define NCID_TOKEN 16
11#define NCID_MAX_LEN 20
12
14typedef struct {
22 u8 cid[NCID_MAX_LEN];
24 u8 token[NCID_TOKEN];
26
27/* Encode into buf of cap bytes. Returns bytes written, or 0 on overflow /
28 * invalid (cid_len out of range, or retire_prior_to > seq). */
29usz ncid_encode(u8* buf, usz cap, const ncid_frame* f);
30
31/* Decode at buf (n readable, type byte 0x18 at buf[0]). Returns bytes
32 * consumed, or 0 on malformed / truncated input. */
33usz ncid_decode(const u8* buf, usz n, ncid_frame* f);
34
35#endif
One NEW_CONNECTION_ID frame's fields.
Definition ncid.h:14
u8 cid[NCID_MAX_LEN]
The connection ID.
Definition ncid.h:22
u8 cid_len
Bytes used in cid.
Definition ncid.h:20
u64 retire_prior_to
Retire Prior To: IDs numbered below it are to be retired.
Definition ncid.h:18
u64 seq
Sequence number.
Definition ncid.h:16
u8 token[NCID_TOKEN]
Stateless reset token.
Definition ncid.h:24
Linux direct syscalls.
u64 usz
unsigned size (size_t equivalent)
Definition types.h:20
unsigned char u8
unsigned 8-bit integer / byte
Definition types.h:18
unsigned long u64
unsigned 64-bit integer
Definition types.h:13