diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:35:11 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:35:11 +0000 |
commit | da76459dc21b5af2449af2d36eb95226cb186ce2 (patch) | |
tree | 542ebb3c1e796fac2742495b8437331727bbbfa0 /src/quic_cc.c | |
parent | Initial commit. (diff) | |
download | haproxy-upstream.tar.xz haproxy-upstream.zip |
Adding upstream version 2.6.12.upstream/2.6.12upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/quic_cc.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/quic_cc.c b/src/quic_cc.c new file mode 100644 index 0000000..8fd99d3 --- /dev/null +++ b/src/quic_cc.c @@ -0,0 +1,49 @@ +/* + * Congestion controller handling. + * + * This file contains definitions for QUIC congestion control. + * + * Copyright 2019 HAProxy Technologies, Frederic Lecaille <flecaille@haproxy.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, version 2.1 + * exclusively. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <haproxy/quic_cc.h> + +struct quic_cc_algo *default_quic_cc_algo = &quic_cc_algo_cubic; + +/* + * Initialize <cc> congestion control with <algo> as algorithm depending on <ipv4> + * a boolean which is true for an IPv4 path. + */ +void quic_cc_init(struct quic_cc *cc, + struct quic_cc_algo *algo, struct quic_conn *qc) +{ + cc->qc = qc; + cc->algo = algo; + if (cc->algo->init) + (cc->algo->init(cc)); +} + +/* Send <ev> event to <cc> congestion controller. */ +void quic_cc_event(struct quic_cc *cc, struct quic_cc_event *ev) +{ + cc->algo->event(cc, ev); +} + +void quic_cc_state_trace(struct buffer *buf, const struct quic_cc *cc) +{ + cc->algo->state_trace(buf, cc); +} |