blob: deaa13ffe175f86771dda2404d8d5492ffc9af07 [file] [log] [blame]
Amaury Denoyellec8b4ce42022-01-11 11:54:59 +01001#include <haproxy/api.h>
Amaury Denoyelle97e84c62022-04-19 18:26:55 +02002#include <haproxy/cfgparse.h>
3#include <haproxy/global-t.h>
Amaury Denoyellec8b4ce42022-01-11 11:54:59 +01004#include <haproxy/listener.h>
5#include <haproxy/proxy-t.h>
Amaury Denoyelle97e84c62022-04-19 18:26:55 +02006#include <haproxy/tools.h>
Amaury Denoyellec8b4ce42022-01-11 11:54:59 +01007
Amaury Denoyelleb76ae692022-01-11 14:16:37 +01008static int bind_parse_quic_force_retry(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err)
9{
10 conf->quic_force_retry = 1;
11 return 0;
12}
13
Amaury Denoyellec8b4ce42022-01-11 11:54:59 +010014static struct bind_kw_list bind_kws = { "QUIC", { }, {
Amaury Denoyelleb76ae692022-01-11 14:16:37 +010015 { "quic-force-retry", bind_parse_quic_force_retry, 0 },
Amaury Denoyellec8b4ce42022-01-11 11:54:59 +010016 { NULL, NULL, 0 },
17}};
18
19INITCALL1(STG_REGISTER, bind_register_keywords, &bind_kws);
Amaury Denoyelle97e84c62022-04-19 18:26:55 +020020
21static int cfg_parse_quic_conn_buf_limit(char **args, int section_type,
22 struct proxy *curpx,
23 const struct proxy *defpx,
24 const char *file, int line, char **err)
25{
26 unsigned int arg = 0;
27
28 if (too_many_args(1, args, err, NULL))
29 return -1;
30
31 if (*(args[1]) != 0)
32 arg = atoi(args[1]);
33
34 if (arg < 1) {
35 memprintf(err, "'%s' expects a positive integer.", args[0]);
36 return -1;
37 }
38
39 global.tune.quic_streams_buf = arg;
40
41 return 0;
42}
43
44static struct cfg_kw_list cfg_kws = {ILH, {
45 { CFG_GLOBAL, "tune.quic.conn-buf-limit", cfg_parse_quic_conn_buf_limit },
46 { 0, NULL, NULL }
47}};
48
49INITCALL1(STG_REGISTER, cfg_register_keywords, &cfg_kws);