From b4f1f1c1d7e2e6054e6422ee7e51d01d4cd95382 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Wed, 30 Apr 2025 15:05:41 -0400 Subject: [PATCH] rename "proto = detail" to "handler = detail" "proto" is still accepted for compatibility. However, it was too generic / conflicting, and was therefore confusing. Similarly, there were comments saying "listen load" would use name2 to open the "load" module. But name2 is now used for something else, and the code was deleted a long time ago. --- .../pages/raddb/sites-available/detail.adoc | 22 ++++++++++++++----- .../pages/raddb/sites-available/load.adoc | 5 ++--- raddb/sites-available/detail | 22 ++++++++++--------- raddb/sites-available/load | 5 ++--- src/lib/server/virtual_servers.c | 10 +++++---- 5 files changed, 38 insertions(+), 26 deletions(-) diff --git a/doc/antora/modules/reference/pages/raddb/sites-available/detail.adoc b/doc/antora/modules/reference/pages/raddb/sites-available/detail.adoc index b8f8aab0b8..9275eea32f 100644 --- a/doc/antora/modules/reference/pages/raddb/sites-available/detail.adoc +++ b/doc/antora/modules/reference/pages/raddb/sites-available/detail.adoc @@ -27,19 +27,29 @@ following directory. ``` -The "listen" section MUST have a second name here, which -says "load the detail file processor, and not the typical -RADIUS UDP / TCP socket IO. +This is the detail file listener. ``` listen detail { ``` -Overrides the default transport prefix set by -namespace and loads the detail reader code. +A special-case over-ride for detail files. We are +in the RADIUS namespace, but we load a special +"detail" handler, instead of the generic RADIUS udp +/ tcp transports. + +This configuration also enables "transport = file", +which is not normally allowed for RADIUS. + +``` + handler = detail + +``` + +We read from files ``` - proto = detail + transport = file ``` diff --git a/doc/antora/modules/reference/pages/raddb/sites-available/load.adoc b/doc/antora/modules/reference/pages/raddb/sites-available/load.adoc index dafc6b6a04..b759c3540b 100644 --- a/doc/antora/modules/reference/pages/raddb/sites-available/load.adoc +++ b/doc/antora/modules/reference/pages/raddb/sites-available/load.adoc @@ -12,8 +12,7 @@ server load { ``` -Use `listen load { ... }` in any virtual server to do load -testing against that server. +This is the load testing listener. ``` listen load { @@ -23,7 +22,7 @@ The main module is the proto module, even though we're operating in the RADIUS namespace. ``` - proto = load + handler = load ``` diff --git a/raddb/sites-available/detail b/raddb/sites-available/detail index 76f170ee86..09515c8eae 100644 --- a/raddb/sites-available/detail +++ b/raddb/sites-available/detail @@ -23,22 +23,24 @@ server detail { directory = ${radacctdir}/detail # - # The "listen" section MUST have a second name here, which - # says "load the detail file processor, and not the typical - # RADIUS UDP / TCP socket IO. + # This is the detail file listener. # - listen detail { + listen detail { # - # We read from files + # A special-case over-ride for detail files. We are + # in the RADIUS namespace, but we load a special + # "detail" handler, instead of the generic RADIUS udp + # / tcp transports. # - transport = file + # This configuration also enables "transport = file", + # which is not normally allowed for RADIUS. + # + handler = detail # - # A special-case over-ride for detail files. We are in the - # RADIUS namespace, but we load a special handler for the detail - # file + # We read from files # - proto = detail + transport = file # # Types of packets we are reading. diff --git a/raddb/sites-available/load b/raddb/sites-available/load index f55be4dae0..9d49cf2478 100644 --- a/raddb/sites-available/load +++ b/raddb/sites-available/load @@ -13,15 +13,14 @@ server load { namespace = radius # - # Use `listen load { ... }` in any virtual server to do load - # testing against that server. + # This is the load testing listener. # listen load { # # The main module is the proto module, even though we're # operating in the RADIUS namespace. # - proto = load + handler = load # # This is a valid Packet-Type for the current `namespace` diff --git a/src/lib/server/virtual_servers.c b/src/lib/server/virtual_servers.c index 8dace15829..3a991b5d3a 100644 --- a/src/lib/server/virtual_servers.c +++ b/src/lib/server/virtual_servers.c @@ -402,12 +402,13 @@ static int listen_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_IT * listen section has one else it comes from the * namespace of the virtual server. * - * The following results in proto_radius being loaded: + * The following results in proto_radius and proto_radius_udp being loaded: * * server foo { * namespace = radius * listen { - * + * transport = udp + * ... * } * } * @@ -416,7 +417,7 @@ static int listen_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_IT * server foo { * namespace = radius * listen { - * proto = load + * handler = load * * } * } @@ -426,7 +427,8 @@ static int listen_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_IT * to be included in the server. * */ - cp = cf_pair_find(listener_cs, "proto"); + cp = cf_pair_find(listener_cs, "handler"); + if (!cp) cp = cf_pair_find(listener_cs, "proto"); if (cp) { protocol = cf_pair_value(cp); if (!protocol) { -- 2.47.2