wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
Loading...
Searching...
No Matches
ackpolicy.h
1#ifndef QUIC_RECOVERY_ACKPOLICY_H
2#define QUIC_RECOVERY_ACKPOLICY_H
3
5
6/* RFC 9000 13.2.1 / 13.2.2: an endpoint sends an ACK on receiving an
7 * ack-eliciting packet, within its advertised max_ack_delay. As a recommended
8 * policy it acknowledges immediately after receiving two ack-eliciting packets
9 * without yet acking; otherwise it may delay until max_ack_delay elapses since
10 * the oldest unacked ack-eliciting packet. Time is abstracted as a monotonic
11 * tick count; max_ack_delay is expressed in the same unit. */
12
18
19void quic_ackpolicy_init(quic_ackpolicy* p);
20
21/* Record receipt of an ack-eliciting packet at the given tick. */
22void quic_ackpolicy_on_eliciting(quic_ackpolicy* p, u64 tick);
23
24/* Whether an ACK should be sent now: true once two or more ack-eliciting
25 * packets are pending, or once max_ack_delay has elapsed since the oldest. */
26int quic_ackpolicy_should_ack(
27 const quic_ackpolicy* p, u64 now, u64 max_ack_delay);
28
29/* Clear pending state after an ACK has been sent. */
30void quic_ackpolicy_on_ack_sent(quic_ackpolicy* p);
31
32#endif
Delayed-ACK timer state for one packet number space.
Definition ackpolicy.h:14
u64 since_tick
tick of the oldest currently-pending packet
Definition ackpolicy.h:16
u64 pending
unacked ack-eliciting packets received
Definition ackpolicy.h:15
x86_64 Linux direct syscalls.
unsigned long u64
unsigned 64-bit integer
Definition syscall.h:12