diff --git a/include/haproxy/quic_cc-t.h b/include/haproxy/quic_cc-t.h index a4a43cadc3..173e0fb684 100644 --- a/include/haproxy/quic_cc-t.h +++ b/include/haproxy/quic_cc-t.h @@ -31,6 +31,7 @@ #include #include +#include #define QUIC_CC_INFINITE_SSTHESH ((uint32_t)-1) @@ -136,6 +137,16 @@ struct quic_cc_algo { /* Defined only if pacing is used. */ uint (*pacing_rate)(const struct quic_cc *cc); uint (*pacing_burst)(const struct quic_cc *cc); + + struct quic_cc_drs *(*get_drs)(struct quic_cc *cc); + void (*on_transmit)(struct quic_cc *cc); + void (*drs_on_transmit)(struct quic_cc *cc, struct quic_tx_packet *pkt); + void (*on_ack_rcvd)(struct quic_cc *cc, uint32_t acked, uint32_t delivered, + uint32_t ack_rtt, uint32_t bytes_lost, + unsigned int largest_pkt_sent_ts); + void (*on_pkt_lost)(struct quic_cc *cc, + struct quic_tx_packet *pkt, uint32_t lost_bytes); + void (*congestion_event)(struct quic_cc *cc, uint32_t ts); }; #endif /* USE_QUIC */ diff --git a/src/quic_cc.c b/src/quic_cc.c index b6bfa86a77..9c5a8f6937 100644 --- a/src/quic_cc.c +++ b/src/quic_cc.c @@ -21,6 +21,7 @@ */ #include +#include struct quic_cc_algo *default_quic_cc_algo = &quic_cc_algo_cubic; @@ -40,7 +41,8 @@ void quic_cc_init(struct quic_cc *cc, /* Send event to congestion controller. */ void quic_cc_event(struct quic_cc *cc, struct quic_cc_event *ev) { - cc->algo->event(cc, ev); + if (cc->algo->event) + cc->algo->event(cc, ev); } void quic_cc_state_trace(struct buffer *buf, const struct quic_cc *cc)