wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
Loading...
Searching...
No Matches
recv_spaces.h
1#ifndef QUIC_PNSPACES_RECV_SPACES_H
2#define QUIC_PNSPACES_RECV_SPACES_H
3
5#include "transport/conn/lifecycle/conn/pnspace.h"
6#include "transport/conn/pnspace/recvpn/recvpn.h"
7#include "transport/recovery/detect/ackgen/ackrange.h"
8
9/* RFC 9000 13.1: each packet number space independently records the packet
10 * numbers it has received and builds its own ACK ranges from them. */
11
12/* Holds largest + the window below it, so at most window+1 received PNs feed
13 * the ACK-range builder. */
14#define QUIC_PNSPACES_ACK_CAP (QUIC_RECVPN_WINDOW + 1)
15
18typedef struct {
20 r[QUIC_PNS_COUNT];
22
23void quic_pnspaces_recv_init(quic_pnspaces_recv* s);
24
25/* Record packet number pn as received in `space` only. */
26void quic_pnspaces_on_recv(quic_pnspaces_recv* s, int space, u64 pn);
27
34
35/* Build the ACK ranges for `space` from its received PNs (layout per
36 * quic_ackgen_build_ranges / RFC 9000 19.3). Returns 1 on success, 0 if the
37 * space has received nothing or cap is too small. */
38int quic_pnspaces_ack_ranges(
39 const quic_pnspaces_recv* s, int space, const quic_pnspaces_ack_out* out);
40
41#endif
Where quic_pnspaces_ack_ranges writes the largest acked and the ranges.
Definition recv_spaces.h:29
quic_u64obuf * ranges
out: encoded ACK ranges, see quic_ackgen_build_ranges
Definition recv_spaces.h:32
u64 * largest
out: highest received packet number in space
Definition recv_spaces.h:30
Per-space received-packet-number tracking (quic_recvpn), one per QUIC_PNS_*.
Definition recv_spaces.h:18
quic_recvpn r[QUIC_PNS_COUNT]
indexed by QUIC_PNS_INITIAL/HANDSHAKE/APP
Definition recv_spaces.h:20
Sliding window of received packet numbers for one packet number space.
Definition recvpn.h:15
A fixed-capacity u64 output buffer; the callee fills *len.
Definition ackrange.h:13
x86_64 Linux direct syscalls.
unsigned long u64
unsigned 64-bit integer
Definition syscall.h:12