#endif
#ifdef USE_QUIC
struct quic_transport_params quic_params; /* QUIC transport parameters. */
- struct quic_cc_algo *quic_cc_algo; /* QUIC control congestion algorithm */
+ const struct quic_cc_algo *quic_cc_algo; /* QUIC control congestion algorithm */
size_t max_cwnd; /* QUIC maximumu congestion control window size (kB) */
enum quic_sock_mode quic_mode; /* QUIC socket allocation strategy */
#endif
#define QUIC_CC_INFINITE_SSTHESH ((uint32_t)-1)
-extern struct quic_cc_algo quic_cc_algo_nr;
-extern struct quic_cc_algo quic_cc_algo_cubic;
-extern struct quic_cc_algo quic_cc_algo_bbr;
-extern struct quic_cc_algo *default_quic_cc_algo;
+extern const struct quic_cc_algo quic_cc_algo_nr;
+extern const struct quic_cc_algo quic_cc_algo_cubic;
+extern const struct quic_cc_algo quic_cc_algo_bbr;
+extern const struct quic_cc_algo *default_quic_cc_algo;
/* Fake algorithm with its fixed window */
-extern struct quic_cc_algo quic_cc_algo_nocc;
+extern const struct quic_cc_algo quic_cc_algo_nocc;
extern unsigned long long last_ts;
struct quic_cc {
/* <conn> is there only for debugging purpose. */
struct quic_conn *qc;
- struct quic_cc_algo *algo;
+ const struct quic_cc_algo *algo;
uint32_t priv[144];
};
#include <haproxy/quic_loss.h>
#include <haproxy/thread.h>
-void quic_cc_init(struct quic_cc *cc, struct quic_cc_algo *algo, struct quic_conn *qc);
+void quic_cc_init(struct quic_cc *cc, const struct quic_cc_algo *algo, struct quic_conn *qc);
void quic_cc_event(struct quic_cc *cc, struct quic_cc_event *ev);
void quic_cc_state_trace(struct buffer *buf, const struct quic_cc *cc);
* which is true for an IPv4 path, if not false for an IPv6 path.
*/
static inline void quic_cc_path_init(struct quic_cc_path *path, int ipv4, unsigned long max_cwnd,
- struct quic_cc_algo *algo,
+ const struct quic_cc_algo *algo,
struct quic_conn *qc)
{
unsigned int max_dgram_sz;
static int bind_parse_quic_cc_algo(char **args, int cur_arg, struct proxy *px,
struct bind_conf *conf, char **err)
{
- struct quic_cc_algo *cc_algo;
+ const struct quic_cc_algo *cc_algo;
const char *algo = NULL;
struct ist algo_ist, arg_ist;
char *arg;
#include <haproxy/quic_tune.h>
#include <haproxy/thread.h>
-struct quic_cc_algo *default_quic_cc_algo = &quic_cc_algo_cubic;
+const 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)
+ const struct quic_cc_algo *algo, struct quic_conn *qc)
{
cc->qc = qc;
cc->algo = algo;
(ull)bbr->bw, (ull)p->send_quantum, (ull)bbr->pacing_rate);
}
-struct quic_cc_algo quic_cc_algo_bbr = {
+const struct quic_cc_algo quic_cc_algo_bbr = {
.type = QUIC_CC_ALGO_TP_BBR,
.init = bbr_init,
.pacing_inter = bbr_pacing_inter,
(long long)(path->cwnd - c->last_w_max));
}
-struct quic_cc_algo quic_cc_algo_cubic = {
+const struct quic_cc_algo quic_cc_algo_cubic = {
.type = QUIC_CC_ALGO_TP_CUBIC,
.flags = QUIC_CC_ALGO_FL_OPT_PACING,
.init = quic_cc_cubic_init,
return quic_cc_nr_state_cbs[nr->state](cc, ev);
}
-struct quic_cc_algo quic_cc_algo_nr = {
+const struct quic_cc_algo quic_cc_algo_nr = {
.type = QUIC_CC_ALGO_TP_NEWRENO,
.flags = QUIC_CC_ALGO_FL_OPT_PACING,
.init = quic_cc_nr_init,
return quic_cc_nocc_state_cbs[QUIC_CC_ST_SS](cc, ev);
}
-struct quic_cc_algo quic_cc_algo_nocc = {
+const struct quic_cc_algo quic_cc_algo_nocc = {
.type = QUIC_CC_ALGO_TP_NOCC,
.flags = QUIC_CC_ALGO_FL_OPT_PACING,
.init = quic_cc_nocc_init,
struct listener *l = objt_listener(target);
struct server *srv = objt_server(target);
struct proxy *prx = l ? l->bind_conf->frontend : __objt_server(target)->proxy;
- struct quic_cc_algo *cc_algo = NULL;
+ const struct quic_cc_algo *cc_algo = NULL;
unsigned int next_actconn = 0, next_sslconn = 0, next_handshake = 0;
TRACE_ENTER(QUIC_EV_CONN_INIT);