From 42e5ec6519f502cf46626ab6ad870862c4304773 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Thu, 31 Jul 2025 17:14:40 +0200 Subject: [PATCH] MINOR: quic: prepare support for options on FE/BE side A major reorganization of QUIC settings is going to be performed. One of its objective is to clearly define options which can be separately configured on frontend and backend proxy sides. To implement this, quic_tune structure is extended to support fe and be options. A set of macros/functions is also defined : it allows to retrieve an option defined on both sides with unified code, based on proxy side of a quic_conn/connection instance. --- include/haproxy/quic_tune-t.h | 8 ++++++++ include/haproxy/quic_tune.h | 23 +++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/include/haproxy/quic_tune-t.h b/include/haproxy/quic_tune-t.h index 04bd38b66..931248bbf 100644 --- a/include/haproxy/quic_tune-t.h +++ b/include/haproxy/quic_tune-t.h @@ -12,6 +12,14 @@ #define QUIC_TUNE_CC_HYSTART 0x00000008 struct quic_tune { + struct { + uint fb_opts; /* QUIC_TUNE_FB_* options shared by both side */ + } fe; + + struct { + uint fb_opts; /* QUIC_TUNE_FB_* options shared by both side */ + } be; + uint options; }; diff --git a/include/haproxy/quic_tune.h b/include/haproxy/quic_tune.h index 7177a9dcb..47b162c0e 100644 --- a/include/haproxy/quic_tune.h +++ b/include/haproxy/quic_tune.h @@ -8,8 +8,31 @@ #include +#include +#include +#include +#include + extern struct quic_tune quic_tune; +#define QUIC_TUNE_FB_GET(opt, qc) \ + (!((qc)->flags & QUIC_FL_CONN_IS_BACK) ? quic_tune.fe. opt : quic_tune.be. opt) + +static inline int quic_tune_test(int opt, const struct quic_conn *qc) +{ + return !(qc->flags & QUIC_FL_CONN_IS_BACK) ? + quic_tune.fe.fb_opts & opt : quic_tune.be.fb_opts & opt; +} + +#define QUIC_TUNE_FB_CONN_GET(opt, conn) \ + (!(conn_is_back(conn)) ? quic_tune.fe. opt : quic_tune.be. opt) + +static inline int quic_tune_conn_test(int opt, const struct connection *conn) +{ + return !(conn_is_back(conn)) ? + quic_tune.fe.fb_opts & opt : quic_tune.be.fb_opts & opt; +} + #endif /* USE_QUIC */ #endif /* _HAPROXY_QUIC_TUNE_H */