From b46aad6df449445a9fc4aa7b32bd40005438e3f7 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 14:18:05 +0200 Subject: Adding upstream version 2.9.5. Signed-off-by: Daniel Baumann --- src/quic_cc.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/quic_cc.c (limited to 'src/quic_cc.c') 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 + * + * 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 + +struct quic_cc_algo *default_quic_cc_algo = &quic_cc_algo_cubic; + +/* + * Initialize congestion control with as algorithm depending on + * 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 event to 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); +} -- cgit v1.2.3