diff --git a/include/types/listener.h b/include/types/listener.h index f21a28d6c..fda7cea80 100644 --- a/include/types/listener.h +++ b/include/types/listener.h @@ -173,9 +173,10 @@ struct bind_kw { * A keyword list. It is a NULL-terminated array of keywords. It embeds a * struct list in order to be linked to other lists, allowing it to easily * be declared where it is needed, and linked without duplicating data nor - * allocating memory. + * allocating memory. It is also possible to indicate a scope for the keywords. */ struct bind_kw_list { + const char *scope; struct list list; struct bind_kw kw[VAR_ARRAY]; }; diff --git a/src/listener.c b/src/listener.c index 2667fd4fd..09a025745 100644 --- a/src/listener.c +++ b/src/listener.c @@ -469,9 +469,11 @@ void bind_dump_kws(char **out) for (index = 0; kwl->kw[index].kw != NULL; index++) { if (kwl->kw[index].parse || bind_find_kw(kwl->kw[index].kw) == &kwl->kw[index]) { - memprintf(out, "%s%s %s\n", *out ? *out : "", + memprintf(out, "%s[%4s] %s%s%s\n", *out ? *out : "", + kwl->scope, kwl->kw[index].kw, - kwl->kw[index].parse ? "" : "(not supported)"); + kwl->kw[index].skip ? " " : "", + kwl->kw[index].parse ? "" : " (not supported)"); } } } @@ -662,7 +664,7 @@ static struct acl_kw_list acl_kws = {{ },{ * the config parser can report an appropriate error when a known keyword was * not enabled. */ -static struct bind_kw_list bind_kws = {{ },{ +static struct bind_kw_list bind_kws = { "ALL", { }, { { "accept-proxy", bind_parse_accept_proxy, 0 }, /* enable PROXY protocol */ { "backlog", bind_parse_backlog, 1 }, /* set backlog of listening socket */ { "id", bind_parse_id, 1 }, /* set id of listening socket */ diff --git a/src/proto_tcp.c b/src/proto_tcp.c index fe89569c2..6b1b15ed6 100644 --- a/src/proto_tcp.c +++ b/src/proto_tcp.c @@ -1842,7 +1842,7 @@ static struct sample_fetch_kw_list sample_fetch_keywords = {{ },{ * the config parser can report an appropriate error when a known keyword was * not enabled. */ -static struct bind_kw_list bind_kws = {{ },{ +static struct bind_kw_list bind_kws = { "TCP", { }, { #ifdef TCP_DEFER_ACCEPT { "defer-accept", bind_parse_defer_accept, 0 }, /* wait for some data for 1 second max before doing accept */ #endif diff --git a/src/proto_uxst.c b/src/proto_uxst.c index 3ea468f45..5f56ad51c 100644 --- a/src/proto_uxst.c +++ b/src/proto_uxst.c @@ -493,7 +493,7 @@ static int bind_parse_user(char **args, int cur_arg, struct proxy *px, struct li * the config parser can report an appropriate error when a known keyword was * not enabled. */ -static struct bind_kw_list bind_kws = {{ },{ +static struct bind_kw_list bind_kws = { "UNIX", { }, { { "gid", bind_parse_gid, 1 }, /* set the socket's gid */ { "group", bind_parse_group, 1 }, /* set the socket's gid from the group name */ { "mode", bind_parse_mode, 1 }, /* set the socket's mode (eg: 0644)*/ diff --git a/src/ssl_sock.c b/src/ssl_sock.c index 4d78f6d6e..2d5e6663b 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -903,7 +903,7 @@ static struct acl_kw_list acl_kws = {{ },{ * the config parser can report an appropriate error when a known keyword was * not enabled. */ -static struct bind_kw_list bind_kws = {{ },{ +static struct bind_kw_list bind_kws = { "SSL", { }, { { "ciphers", bind_parse_ciphers, 1 }, /* set SSL cipher suite */ { "crt", bind_parse_crt, 1 }, /* load SSL certificates from this location */ { "nosslv3", bind_parse_nosslv3, 0 }, /* disable SSLv3 */