wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
Loading...
Searching...
No Matches
ackrange.h
1#ifndef QUIC_ACKGEN_ACKRANGE_H
2#define QUIC_ACKGEN_ACKRANGE_H
3
5
7typedef struct {
8 const u64* p;
9 usz n;
11
13typedef struct {
14 u64* p;
18
19/* RFC 9000 19.3: an ACK frame reports the Largest Acknowledged packet number
20 * and a descending list of contiguous ranges separated by gaps. This builds
21 * those ranges from an ascending, deduplicated array of received packet
22 * numbers (received_pns).
23 *
24 * Output layout (descending, matching wire order), written into ranges->p:
25 * largest = highest received packet number
26 * ranges->p[0] = First ACK Range length (count-1 of the top block)
27 * ranges->p[2k-1] = Gap to the next block (RFC 19.3.1 encoding)
28 * ranges->p[2k] = ACK Range Length of block k (count-1)
29 * ranges->len = number of u64 values written
30 *
31 * ranges->cap bounds the write. Returns 1 on success, 0 if received_pns is
32 * empty or ranges->cap is too small. */
33int quic_ackgen_build_ranges(
34 quic_u64view received_pns, u64* largest, quic_u64obuf* ranges);
35
36#endif
A fixed-capacity u64 output buffer; the callee fills *len.
Definition ackrange.h:13
u64 * p
destination buffer
Definition ackrange.h:14
usz len
out: elements actually written
Definition ackrange.h:16
usz cap
capacity in elements
Definition ackrange.h:15
A read-only view of a u64 array.
Definition ackrange.h:7
const u64 * p
pointer to the first element
Definition ackrange.h:8
usz n
element count
Definition ackrange.h:9
x86_64 Linux direct syscalls.
u64 usz
unsigned size (size_t equivalent)
Definition syscall.h:19
unsigned long u64
unsigned 64-bit integer
Definition syscall.h:12