wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
Loading...
Searching...
No Matches
dec_stream.h
1#ifndef QPACKDYN_DEC_STREAM_H
2#define QPACKDYN_DEC_STREAM_H
3
5
6/* RFC 9204 4.4. What this decoder owes the peer's encoder on its decoder
7 * stream: Section Acknowledgments (4.4.1) queued as sections decode, and an
8 * Insert Count Increment (4.4.3) for every insert no acknowledgment already
9 * covered, and Stream Cancellations (4.4.2) for streams abandoned before
10 * their sections were processed. */
11
16#define QDYN_DEC_ACKS_MAX 512
18#define QDYN_DEC_OUT_MAX (QDYN_DEC_ACKS_MAX + 10)
19
21typedef struct {
22 u8 acks[QDYN_DEC_ACKS_MAX];
25} qdyn_dec;
26
27/* RFC 9204 4.4.1: queue a Section Acknowledgment for stream_id when its
28 * section's Required Insert Count ric is non-zero. ponytail: the queue only
29 * fills if the decoder stream's 64 KB send ring stays full for a step -- a
30 * peer granting it no credit; the ack is then dropped (the peer's encoder
31 * only keeps those entries pinned). A larger queue if that ever matters. */
32void qdyn_dec_section_ack(qdyn_dec* d, u64 stream_id, u64 ric);
33
34/* RFC 9204 4.4.2 / 2.2.2.2: queue a Stream Cancellation for stream_id -- a
35 * stream reset or abandoned before its field sections were all processed
36 * (same queue and full-queue ceiling as qdyn_dec_section_ack). */
37void qdyn_dec_stream_cancel(qdyn_dec* d, u64 stream_id);
38
39/* RFC 9204 4.4: write the owed bytes -- queued acks, then an Insert Count
40 * Increment up to `inserts` (the table's total insert count) -- into out.
41 * Consumes nothing; returns out->len. */
42usz qdyn_dec_pending(const qdyn_dec* d, u64 inserts, wired_obuf* out);
43
44/* The bytes qdyn_dec_pending produced for `inserts` were sent. */
45void qdyn_dec_sent(qdyn_dec* d, u64 inserts);
46
47#endif
Value-type views that fold the SDK's recurring argument shapes into single parameters,...
RFC 9204 4.4.
Definition dec_stream.h:21
u8 acks[QDYN_DEC_ACKS_MAX]
encoded, unsent acks/cancellations
Definition dec_stream.h:22
usz acks_len
bytes used in acks
Definition dec_stream.h:23
u64 acked
Known Received Count once acks and increments land.
Definition dec_stream.h:24
Growing output buffer view for variable-length results.
Definition span.h:54
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