wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
Loading...
Searching...
No Matches
header.h
Go to the documentation of this file.
1#ifndef WIRED_PACKET_HEADER_H
2#define WIRED_PACKET_HEADER_H
3
5
8
10#define WIRED_FORM_LONG 1
12#define WIRED_FORM_SHORT 0
13
15#define WIRED_LP_INITIAL 0x0
17#define WIRED_LP_0RTT 0x1
19#define WIRED_LP_HANDSHAKE 0x2
21#define WIRED_LP_RETRY 0x3
22
24#define WIRED_MAX_CID_LEN 20
25
36
45
52
53#endif
usz wired_header_parse(const u8 *buf, usz n, wired_header *h)
Parse the invariant (version-independent) part of a packet header.
usz wired_header_build_long(u8 *buf, usz cap, const wired_header *h)
Build the invariant part of a long header into buf (cap bytes).
#define WIRED_MAX_CID_LEN
RFC 9000 17.2: longest connection id in a version 1 long header.
Definition header.h:24
Parsed invariant (version-independent) packet header fields.
Definition header.h:27
u32 version
valid when form == long
Definition header.h:30
u8 scid[WIRED_MAX_CID_LEN]
source connection id (long header)
Definition header.h:34
u8 form
WIRED_FORM_LONG / WIRED_FORM_SHORT.
Definition header.h:28
u8 long_type
valid when form == long
Definition header.h:29
u8 scid_len
valid when form == long
Definition header.h:33
u8 dcid_len
destination connection id length in bytes
Definition header.h:31
u8 dcid[WIRED_MAX_CID_LEN]
destination connection id
Definition header.h:32
x86_64 Linux direct syscalls.
unsigned int u32
unsigned 32-bit integer
Definition syscall.h:14
u64 usz
unsigned size (size_t equivalent)
Definition syscall.h:19
unsigned char u8
unsigned 8-bit integer / byte
Definition syscall.h:17