]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Define a common section name struct, and use pointers to those structs
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 26 May 2024 03:07:38 +0000 (23:07 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 26 May 2024 03:31:05 +0000 (23:31 -0400)
Will allow slightly faster comparisons in some cases, and allow common module method names to be defined

78 files changed:
src/lib/server/libfreeradius-server.mk
src/lib/server/module.h
src/lib/server/module_method.c
src/lib/server/module_method.h
src/lib/server/module_rlm.c
src/lib/server/module_rlm.h
src/lib/server/process.h
src/lib/server/section.h [new file with mode: 0644]
src/lib/server/virtual_servers.c
src/lib/server/virtual_servers.h
src/lib/unlang/compile.c
src/lib/unlang/module.h
src/modules/rlm_always/rlm_always.c
src/modules/rlm_attr_filter/rlm_attr_filter.c
src/modules/rlm_cache/rlm_cache.c
src/modules/rlm_chap/rlm_chap.c
src/modules/rlm_client/rlm_client.c
src/modules/rlm_couchbase/rlm_couchbase.c
src/modules/rlm_csv/rlm_csv.c
src/modules/rlm_delay/rlm_delay.c
src/modules/rlm_detail/rlm_detail.c
src/modules/rlm_dhcpv4/rlm_dhcpv4.c
src/modules/rlm_digest/rlm_digest.c
src/modules/rlm_eap/rlm_eap.c
src/modules/rlm_exec/rlm_exec.c
src/modules/rlm_files/rlm_files.c
src/modules/rlm_imap/rlm_imap.c
src/modules/rlm_isc_dhcp/rlm_isc_dhcp.c
src/modules/rlm_krb5/rlm_krb5.c
src/modules/rlm_ldap/rlm_ldap.c
src/modules/rlm_linelog/rlm_linelog.c
src/modules/rlm_logtee/rlm_logtee.c
src/modules/rlm_lua/rlm_lua.c
src/modules/rlm_mruby/rlm_mruby.c
src/modules/rlm_mschap/rlm_mschap.c
src/modules/rlm_opendirectory/rlm_opendirectory.c
src/modules/rlm_pam/rlm_pam.c
src/modules/rlm_pap/rlm_pap.c
src/modules/rlm_passwd/rlm_passwd.c
src/modules/rlm_perl/rlm_perl.c
src/modules/rlm_python/rlm_python.c
src/modules/rlm_radius/rlm_radius.c
src/modules/rlm_radutmp/rlm_radutmp.c
src/modules/rlm_redis_ippool/rlm_redis_ippool.c
src/modules/rlm_rediswho/rlm_rediswho.c
src/modules/rlm_rest/rlm_rest.c
src/modules/rlm_securid/rlm_securid.c
src/modules/rlm_sigtran/rlm_sigtran.c
src/modules/rlm_smtp/rlm_smtp.c
src/modules/rlm_sometimes/rlm_sometimes.c
src/modules/rlm_sql/rlm_sql.c
src/modules/rlm_sqlcounter/rlm_sqlcounter.c
src/modules/rlm_sqlippool/rlm_sqlippool.c
src/modules/rlm_stats/rlm_stats.c
src/modules/rlm_tacacs/rlm_tacacs.c
src/modules/rlm_test/rlm_test.c
src/modules/rlm_totp/rlm_totp.c
src/modules/rlm_unix/rlm_unix.c
src/modules/rlm_utf8/rlm_utf8.c
src/modules/rlm_wimax/rlm_wimax.c
src/modules/rlm_winbind/rlm_winbind.c
src/modules/rlm_yubikey/rlm_yubikey.c
src/process/arp/base.c
src/process/bfd/base.c
src/process/dhcpv4/base.c
src/process/dhcpv6/base.c
src/process/dns/base.c
src/process/eap_aka/base.c
src/process/eap_aka_prime/base.c
src/process/eap_sim/base.c
src/process/ldap_sync/base.c
src/process/radius/base.c
src/process/tacacs/base.c
src/process/test/base.c
src/process/tls/base.c
src/process/ttls/base.c
src/process/vmps/base.c
src/tests/modules/test/section_names.unlang

index bfc785e602d93809a90d34463e876ef083f9383e..4bed684a717c74312455ac636dc0295bb473ace2 100644 (file)
@@ -22,6 +22,7 @@ SOURCES       := \
        map_async.c \
        map_proc.c \
        module.c \
+       module_method.c \
        module_rlm.c \
        packet.c \
        paircmp.c \
index 2971ed41186d1428196dc1e1a8d9c4e25d1aeb52..d15ecc6ae8858af3f67760a17cc66127268eb40a 100644 (file)
@@ -32,7 +32,7 @@ extern "C" {
 
 typedef struct module_s                                module_t;
 typedef struct module_state_func_table_s       module_state_func_table_t;
-typedef struct module_method_name_s            module_method_name_t;
+typedef struct module_method_binding_s         module_method_binding_t;
 typedef struct module_instance_s               module_instance_t;
 typedef struct module_thread_instance_s                module_thread_instance_t;
 typedef struct module_list_type_s              module_list_type_t;
@@ -129,6 +129,7 @@ typedef int (*module_thread_detach_t)(module_thread_inst_ctx_t const *mctx);
 #include <freeradius-devel/server/exfile.h>
 #include <freeradius-devel/server/pool.h>
 #include <freeradius-devel/server/request.h>
+#include <freeradius-devel/server/section.h>
 
 #include <freeradius-devel/unlang/action.h>
 #include <freeradius-devel/unlang/call_env.h>
@@ -144,18 +145,21 @@ extern "C" {
  */
 #define MODULE_INSTANCE_LEN_MAX 256
 
+/** Terminate a module binding list
+ */
+#define MODULE_BINDING_TERMINATOR { .section = NULL }
+
 /** Named methods exported by a module
  *
  */
-struct module_method_name_s {
-       char const                      *name1;                 //!< i.e. "recv", "send", "process"
-       char const                      *name2;                 //!< The packet type i.e Access-Request, Access-Reject.
+struct module_method_binding_s {
+       fr_dict_t const                         **proto;                //!< Only allow this method to be called in this namespace.
 
-       module_method_t                 method;                 //!< Module method to call
-       call_env_method_t const * const method_env;             //!< Call specific conf parsing.
-};
+       section_name_t const                    *section;               //!< Identifier for a section.
 
-#define MODULE_NAME_TERMINATOR { NULL }
+       module_method_t                         method;                 //!< Module method to call
+       call_env_method_t const * const         method_env;             //!< Call specific conf parsing.
+};
 
 /** Struct exported by a rlm_* module
  *
index 8c3c3e27faf209f710ec00315f482147013cbb49..8aa2667e4130556cea62548ed30d447c7209df0a 100644 (file)
@@ -18,7 +18,7 @@
  * $Id$
  *
  * @file src/lib/server/module_method.c
- * @brief Central module_method_name_t definitions
+ * @brief Central module_method_binding_t definitions
  *
  * This file contains common module_method_t structures which may be
  * referenced within a #virtual_server_compile_t and a #module_t.
  *
  * @copyright 2022 Arran Cudbard-Bell (a.cudbardb@freeradius.org)
  */
-typedef struct {
-       fr_dict_t const         **proto;        //!< If none-null, restrict matches to this protocol.
-                                               ///< i.e. if both the virtual server module_method_name
-                                                ///< and the module method have non-null proto pointers
-                                                ///< then *proto must be equal for the method name to
-                                                ///< match.
+#include <freeradius-devel/server/module_method.h>
 
-       char const              *name1;         //!< module method name1 which is allowed in this section
-       char const              *name2;         //!< module method name2 which is allowed in this section
-} module_method_name_t;
-
-module_method_name_t module_method_ippool_allocate = {
+section_name_t module_method_ippool_allocate = {
        .name1 = "ippool",
        .name2 = "allocate"
 };
 
-module_method_name_t module_method_ippool_extend = {
+section_name_t module_method_ippool_extend = {
        .name1 = "ippool",
        .name2 = "extend"
 };
 
-module_method_name_t module_method_ippool_mark = {
+section_name_t module_method_ippool_mark = {
        .name1 = "ippool",
        .name2 = "mark"
 };
 
-module_method_name_t module_method_ippool_release = {
+section_name_t module_method_ippool_release = {
        .name1 = "ippool",
        .name2 = "release"
 };
index 3d0b1c4e42aac74190d176196ec2e069bdcafb54..5b69f481bb4019a8b370debb4c5f6e0d69296d27 100644 (file)
@@ -29,36 +29,15 @@ RCSIDH(module_method_h, "$Id$")
 extern "C" {
 #endif
 
-#include <freeradius-devel/util/dict.h>
+#include <freeradius-devel/server/virtual_servers.h>
 
-/** Specifies a module method identifier
- *
- * These are used in module definitions and by virtual servers to find mutually
- * acceptable module methods to call between a virtual server section and the
- * module that's calling it.
- *
- * For example, a `send Access-Accept` compilation structure may also have a
- * `ippool alloc` method associated with it, to instruct any ippool modules to
- * allocate an IP address.
- */
-typedef struct {
-       fr_dict_t const         **proto;        //!< If none-null, restrict matches to this protocol.
-                                               ///< i.e. if both the virtual server module_method_name
-                                                ///< and the module method have non-null proto pointers
-                                                ///< then *proto must be equal for the method name to
-                                                ///< match.
-
-       char const              *name1;         //!< module method name1 which is allowed in this section
-       char const              *name2;         //!< module method name2 which is allowed in this section
-} module_method_name_t;
-
-extern module_method_name_t module_method_ippool_allocate;
+extern section_name_t module_method_ippool_allocate;
 
-extern module_method_name_t module_method_ippool_extend;
+extern section_name_t module_method_ippool_extend;
 
-extern module_method_name_t module_method_ippool_mark;
+extern section_name_t module_method_ippool_mark;
 
-extern module_method_name_t module_method_ippool_release;
+extern section_name_t module_method_ippool_release;
 
 #ifdef __cplusplus
 }
index 2782312ffd6b3317cdc07fcbec7e68609141d6f0..ee1ee1b5d3b759a9ea451bce73a5393405d42bac 100644 (file)
@@ -448,7 +448,7 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, call_e
        size_t                          len;
        int                             j;
        module_instance_t               *mi;
-       module_method_name_t const      *methods;
+       module_method_binding_t const   *methods;
        char const                      *method_name1, *method_name2;
        module_rlm_t const              *mrlm;
 
@@ -470,7 +470,7 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, call_e
         */
        mi = module_rlm_static_by_name(NULL, name);
        if (mi) {
-               virtual_server_method_t const   *allowed_list;
+               section_name_t const    **allowed_list;
 
                if (!method) return mi;
 
@@ -481,20 +481,20 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, call_e
                 *      module has no named methods.  Try to return a
                 *      method based on the component.
                 */
-               if (!method_name1 || !mrlm->method_names) goto return_component;
+               if (!method_name1 || !mrlm->bindings) goto return_component;
 
                /*
                 *      Walk through the module, finding a matching
                 *      method.
                 */
-               for (j = 0; mrlm->method_names[j].name1 != NULL; j++) {
-                       methods = &mrlm->method_names[j];
+               for (j = 0; mrlm->bindings[j].section; j++) {
+                       methods = &mrlm->bindings[j];
 
                        /*
                         *      Wildcard match name1, we're
                         *      done.
                         */
-                       if (methods->name1 == CF_IDENT_ANY) {
+                       if (methods->section->name1 == CF_IDENT_ANY) {
                        found:
                                *method = methods->method;
                                if (method_env) *method_env = methods->method_env;
@@ -506,26 +506,26 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, call_e
                        /*
                         *      If name1 doesn't match, skip it.
                         */
-                       if (strcasecmp(methods->name1, method_name1) != 0) continue;
+                       if (strcasecmp(methods->section->name1, method_name1) != 0) continue;
 
                        /*
                         *      The module can declare a
                         *      wildcard for name2, in which
                         *      case it's a match.
                         */
-                       if (methods->name2 == CF_IDENT_ANY) goto found;
+                       if (methods->section->name2 == CF_IDENT_ANY) goto found;
 
                        /*
                         *      No name2 is also a match to no name2.
                         */
-                       if (!methods->name2 && !method_name2) goto found;
+                       if (!methods->section->name2 && !method_name2) goto found;
 
                        /*
                         *      Don't do strcmp on NULLs
                         */
-                       if (!methods->name2 || !method_name2) continue;
+                       if (!methods->section->name2 || !method_name2) continue;
 
-                       if (strcasecmp(methods->name2, method_name2) == 0) goto found;
+                       if (strcasecmp(methods->section->name2, method_name2) == 0) goto found;
                }
 
                if (!vs) goto skip_section_method;
@@ -558,22 +558,22 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, call_e
                 *      then any module method would match, which is
                 *      bad.
                 */
-               for (j = 0; allowed_list[j].name1 != NULL; j++) {
+               for (j = 0; allowed_list[j]; j++) {
                        int k;
-                       virtual_server_method_t const *allowed = &allowed_list[j];
+                       section_name_t const *allowed = allowed_list[j];
 
-                       for (k = 0; mrlm->method_names[k].name1 != NULL; k++) {
-                               methods = &mrlm->method_names[k];
+                       for (k = 0; mrlm->bindings[k].section; k++) {
+                               methods = &mrlm->bindings[k];
 
-                               fr_assert(methods->name1 != CF_IDENT_ANY); /* should have been caught above */
+                               fr_assert(methods->section->name1 != CF_IDENT_ANY); /* should have been caught above */
 
-                               if (strcasecmp(methods->name1, allowed->name1) != 0) continue;
+                               if (strcasecmp(methods->section->name1, allowed->name1) != 0) continue;
 
                                /*
                                 *      The module matches "recv *",
                                 *      call this method.
                                 */
-                               if (methods->name2 == CF_IDENT_ANY) {
+                               if (methods->section->name2 == CF_IDENT_ANY) {
                                found_allowed:
                                        *method = methods->method;
                                        return mi;
@@ -582,14 +582,14 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, call_e
                                /*
                                 *      No name2 is also a match to no name2.
                                 */
-                               if (!methods->name2 && !allowed->name2) goto found_allowed;
+                               if (!methods->section->name2 && !allowed->name2) goto found_allowed;
 
                                /*
                                 *      Don't do strcasecmp on NULLs
                                 */
-                               if (!methods->name2 || !allowed->name2) continue;
+                               if (!methods->section->name2 || !allowed->name2) continue;
 
-                               if (strcasecmp(methods->name2, allowed->name2) == 0) goto found_allowed;
+                               if (strcasecmp(methods->section->name2, allowed->name2) == 0) goto found_allowed;
                        }
                }
 
@@ -663,7 +663,7 @@ skip_section_method:
        /*
         *      We've found the module, but it has no named methods.
         */
-       if (!mrlm->method_names) {
+       if (!mrlm->bindings) {
                *name1 = name + (p - inst_name);
                *name2 = NULL;
                goto finish;
@@ -675,24 +675,24 @@ skip_section_method:
         *      matches anything else.
         */
        if (!q) {
-               for (j = 0; mrlm->method_names[j].name1 != NULL; j++) {
-                       methods = &mrlm->method_names[j];
+               for (j = 0; mrlm->bindings[j].section; j++) {
+                       methods = &mrlm->bindings[j];
 
                        /*
                         *      If we do not have the second $method, then ignore it!
                         */
-                       if (methods->name2 && (methods->name2 != CF_IDENT_ANY)) continue;
+                       if (methods->section->name2 && (methods->section->name2 != CF_IDENT_ANY)) continue;
 
                        /*
                         *      Wildcard match name1, we're
                         *      done.
                         */
-                       if (!methods->name1 || (methods->name1 == CF_IDENT_ANY)) goto found_name1;
+                       if (!methods->section->name1 || (methods->section->name1 == CF_IDENT_ANY)) goto found_name1;
 
                        /*
                         *      If name1 doesn't match, skip it.
                         */
-                       if (strcasecmp(methods->name1, p) != 0) continue;
+                       if (strcasecmp(methods->section->name1, p) != 0) continue;
 
                found_name1:
                        /*
@@ -729,41 +729,41 @@ skip_section_method:
         *
         *      Loop over the method names, seeing if we have a match.
         */
-       for (j = 0; mrlm->method_names[j].name1 != NULL; j++) {
-               methods = &mrlm->method_names[j];
+       for (j = 0; mrlm->bindings[j].section; j++) {
+               methods = &mrlm->bindings[j];
 
                /*
                 *      If name1 doesn't match, skip it.
                 */
-               if (strncasecmp(methods->name1, p, len) != 0) continue;
+               if (strncasecmp(methods->section->name1, p, len) != 0) continue;
 
                /*
                 *      It may have been a partial match, like "rec",
                 *      instead of "recv".  In which case check if it
                 *      was a FULL match.
                 */
-               if (strlen(methods->name1) != len) continue;
+               if (strlen(methods->section->name1) != len) continue;
 
                /*
                 *      The module can declare a
                 *      wildcard for name2, in which
                 *      case it's a match.
                 */
-               if (!methods->name2 || (methods->name2 == CF_IDENT_ANY)) goto found_name2;
+               if (!methods->section->name2 || (methods->section->name2 == CF_IDENT_ANY)) goto found_name2;
 
                /*
                 *      Don't do strcmp on NULLs
                 */
-               if (!methods->name2) continue;
+               if (!methods->section->name2) continue;
 
-               if (strcasecmp(methods->name2, q) != 0) continue;
+               if (strcasecmp(methods->section->name2, q) != 0) continue;
 
        found_name2:
                /*
                 *      Update name1/name2 with the methods
                 *      that were found.
                 */
-               *name1 = methods->name1;
+               *name1 = methods->section->name1;
                *name2 = name + (q - inst_name);
                *method = methods->method;
                if (method_env) *method_env = methods->method_env;
index c6d44802ecd1bdc06ded944f8ae830798875617d..221960141e3fd35dc2cb91c4be181c61f3a5a181 100644 (file)
@@ -34,8 +34,7 @@ extern "C" {
 
 typedef struct {
        module_t                        common;                 //!< Common fields presented by all modules.
-       module_method_name_t const      *method_names;          //!< named methods
-       fr_dict_t const                 **dict;                 //!< pointer to local fr_dict_t*
+       module_method_binding_t const   *bindings;              //!< named methods
 } module_rlm_t;
 
 /** Cast a module_t to a module_rlm_t
index 22311f3b8794e6b12759e86579bf31ec8eff8ed4..fbc25f14ffc516a442b8668ad2398b4853f72ee2 100644 (file)
@@ -467,20 +467,17 @@ static inline unlang_action_t new_client(rlm_rcode_t *p_result, module_ctx_t con
 
 #define DYNAMIC_CLIENT_SECTIONS \
        { \
-               .name1 = "new", \
-               .name2 = "client", \
+               .section = SECTION_NAME("new", "client"), \
                .actions = &mod_actions_authorize, \
                .offset = PROCESS_CONF_OFFSET(new_client), \
        }, \
        { \
-               .name1 = "add", \
-               .name2 = "client", \
+               .section = SECTION_NAME("add", "client"), \
                .actions = &mod_actions_authorize, \
                .offset = PROCESS_CONF_OFFSET(add_client), \
        }, \
        { \
-               .name1 = "deny", \
-               .name2 = "client", \
+               .section = SECTION_NAME("deny", "client"), \
                .actions = &mod_actions_authorize, \
                .offset = PROCESS_CONF_OFFSET(deny_client), \
        }
diff --git a/src/lib/server/section.h b/src/lib/server/section.h
new file mode 100644 (file)
index 0000000..14cc91f
--- /dev/null
@@ -0,0 +1,48 @@
+#pragma once
+/*
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/**
+ * $Id$
+ *
+ * @file lib/server/section.h
+ * @brief Structures which identify sections
+ *
+ * @copyright 2024 Arran Cudbard-Bell (a.cudbardb@freeradius.org)
+ */
+RCSIDH(section_h, "$Id$")
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Define a section name consisting of a verb and a noun
+ *
+ * @param[in] _name1           verb name.
+ * @param[in] _name2           noun name.
+ */
+#define SECTION_NAME(_name1, _name2) &(section_name_t){ .name1 = _name1, .name2 = _name2 }
+
+/** Section name identifier
+ */
+typedef struct {
+       char const *name1;              //!< First section name.  Usually a verb like 'recv', 'send', etc...
+       char const *name2;              //!< Second section name.  Usually a packet type like 'access-request', 'access-accept', etc...
+} section_name_t;
+
+#ifdef __cplusplus
+}
+#endif
index 1ff92d94dd86df1c4d27cb24ac17f9c1bf356fc7..d51403d093dbd5735c8a50d4dffc19fd30cb5830 100644 (file)
@@ -308,12 +308,12 @@ int add_compile_list(virtual_server_t *vs, CONF_SECTION *cs, virtual_server_comp
 
        if (!compile_list) return 0;
 
-       for (i = 0; list[i].name1 != NULL; i++) {
-               if (list[i].name1 == CF_IDENT_ANY) continue;
+       for (i = 0; list[i].section; i++) {
+               if (list[i].section->name1 == CF_IDENT_ANY) continue;
 
                if (virtual_server_section_register(vs, &list[i]) < 0) {
                        cf_log_err(cs, "Failed registering processing section name %s for %s",
-                                  list[i].name1, name);
+                                  list[i].section->name1, name);
                        return -1;
                }
        }
@@ -912,7 +912,7 @@ int virtual_server_compile_sections(virtual_server_t const *vs, tmpl_rules_t con
         *      looks.  It's not O(n^2), but O(n logn).  But it could
         *      still be improved.
         */
-       for (i = 0; list[i].name1 != NULL; i++) {
+       for (i = 0; list[i].section; i++) {
                int rcode;
                CONF_SECTION *bad;
 
@@ -921,13 +921,13 @@ int virtual_server_compile_sections(virtual_server_t const *vs, tmpl_rules_t con
                 *      Warn if it isn't found, or compile it if
                 *      found.
                 */
-               if (list[i].name2 != CF_IDENT_ANY) {
+               if (list[i].section->name2 != CF_IDENT_ANY) {
                        void *instruction = NULL;
 
-                       subcs = cf_section_find(server, list[i].name1, list[i].name2);
+                       subcs = cf_section_find(server, list[i].section->name1, list[i].section->name2);
                        if (!subcs) {
                                DEBUG3("Warning: Skipping %s %s { ... } as it was not found.",
-                                      list[i].name1, list[i].name2);
+                                      list[i].section->name1, list[i].section->name2);
                                /*
                                 *      Initialise CONF_SECTION pointer for missing section
                                 */
@@ -940,7 +940,7 @@ int virtual_server_compile_sections(virtual_server_t const *vs, tmpl_rules_t con
                        /*
                         *      Duplicate sections are forbidden.
                         */
-                       bad = cf_section_find_next(server, subcs, list[i].name1, list[i].name2);
+                       bad = cf_section_find_next(server, subcs, list[i].section->name1, list[i].section->name2);
                        if (bad) {
                        forbidden:
                                cf_log_err(bad, "Duplicate sections are forbidden.");
@@ -978,19 +978,19 @@ int virtual_server_compile_sections(virtual_server_t const *vs, tmpl_rules_t con
                 *      Find all subsections with the given first name
                 *      and compile them.
                 */
-               while ((subcs = cf_section_find_next(server, subcs, list[i].name1, CF_IDENT_ANY))) {
+               while ((subcs = cf_section_find_next(server, subcs, list[i].section->name1, CF_IDENT_ANY))) {
                        char const      *name2;
 
                        name2 = cf_section_name2(subcs);
                        if (!name2) {
-                               cf_log_err(subcs, "Invalid '%s { ... }' section, it must have a name", list[i].name1);
+                               cf_log_err(subcs, "Invalid '%s { ... }' section, it must have a name", list[i].section->name1);
                                return -1;
                        }
 
                        /*
                         *      Duplicate sections are forbidden.
                         */
-                       bad = cf_section_find_next(server, subcs, list[i].name1, name2);
+                       bad = cf_section_find_next(server, subcs, list[i].section->name1, name2);
                        if (bad) goto forbidden;
 
                        rcode = unlang_compile(vs, subcs, list[i].actions, rules, NULL);
@@ -1016,15 +1016,15 @@ static int8_t server_section_name_cmp(void const *one, void const *two)
        virtual_server_compile_t const *b = two;
        int ret;
 
-       ret = strcmp(a->name1, b->name1);
+       ret = strcmp(a->section->name1, b->section->name1);
        ret = CMP(ret, 0);
        if (ret != 0) return ret;
 
-       if (a->name2 == b->name2) return 0;
-       if ((a->name2 == CF_IDENT_ANY) && (b->name2 != CF_IDENT_ANY)) return -1;
-       if ((a->name2 != CF_IDENT_ANY) && (b->name2 == CF_IDENT_ANY)) return +1;
+       if (a->section->name2 == b->section->name2) return 0;
+       if ((a->section->name2 == CF_IDENT_ANY) && (b->section->name2 != CF_IDENT_ANY)) return -1;
+       if ((a->section->name2 != CF_IDENT_ANY) && (b->section->name2 == CF_IDENT_ANY)) return +1;
 
-       ret = strcmp(a->name2, b->name2);
+       ret = strcmp(a->section->name2, b->section->name2);
        return CMP(ret, 0);
 }
 
@@ -1052,15 +1052,15 @@ int virtual_server_section_register(virtual_server_t *vs, virtual_server_compile
        if (entry->methods) {
                int i;
 
-               for (i = 0; entry->methods[i].name1 != NULL; i++) {
-                       if (entry->methods[i].name1 == CF_IDENT_ANY) {
+               for (i = 0; entry->methods[i]; i++) {
+                       if (entry->methods[i]->name1 == CF_IDENT_ANY) {
                                ERROR("Processing sections cannot allow \"*\"");
                                return -1;
                        }
 
-                       if (entry->methods[i].name2 == CF_IDENT_ANY) {
+                       if (entry->methods[i]->name2 == CF_IDENT_ANY) {
                                ERROR("Processing sections cannot allow \"%s *\"",
-                                       entry->methods[i].name1);
+                                       entry->methods[i]->name1);
                                return -1;
                        }
                }
@@ -1078,7 +1078,7 @@ int virtual_server_section_register(virtual_server_t *vs, virtual_server_compile
 /** Find the component for a section
  *
  */
-virtual_server_method_t const *virtual_server_section_methods(virtual_server_t const *vs, char const *name1, char const *name2)
+section_name_t const **virtual_server_section_methods(virtual_server_t const *vs, char const *name1, char const *name2)
 {
        virtual_server_compile_t *entry;
 
@@ -1089,8 +1089,7 @@ virtual_server_method_t const *virtual_server_section_methods(virtual_server_t c
        if (name2 != CF_IDENT_ANY) {
                entry = fr_rb_find(vs->sections,
                                   &(virtual_server_compile_t) {
-                                       .name1 = name1,
-                                       .name2 = name2,
+                                       .section = SECTION_NAME(name1, name2)
                                   });
                if (entry) return entry->methods;
        }
@@ -1100,8 +1099,7 @@ virtual_server_method_t const *virtual_server_section_methods(virtual_server_t c
         */
        entry = fr_rb_find(vs->sections,
                           &(virtual_server_compile_t) {
-                               .name1 = name1,
-                               .name2 = CF_IDENT_ANY,
+                               .section = SECTION_NAME(name1, CF_IDENT_ANY)
                           });
        if (!entry) return NULL;
 
index 9a19ad13dfe959de3bdc2634b0c41910c5d469fc..7c9d570c6bcad747e5afce1a84068f5581b3eb5d 100644 (file)
@@ -94,36 +94,27 @@ int                 virtual_server_cf_parse(TALLOC_CTX *ctx, void *out, void *parent,
 fr_listen_t *                  listen_find_any(fr_listen_t *li) CC_HINT(nonnull);
 bool                   listen_record(fr_listen_t *li) CC_HINT(nonnull);
 
-
-/** Module methods which are allowed in virtual servers.
- *
- */
-typedef struct {
-       char const                      *name1;         //!< module method name1 which is allowed in this section
-       char const                      *name2;         //!< module method name2 which is allowed in this section
-} virtual_server_method_t;
-
 /** Processing sections which are allowed in this virtual server.
  *
  */
 typedef struct {
-       char const                      *name1;         //!< Name of the processing section, such as "recv" or "send"
-       char const                      *name2;         //!< Second name, such as "Access-Request"
-       size_t                          offset;         //!< where the CONF_SECTION pointer is written
-       bool                            dont_cache;     //!< If true, the CONF_SECTION pointer won't be written
-                                                       ///< and the offset will be ignored.
-       size_t                          instruction;    //!< where the instruction pointer is written
-       unlang_mod_actions_t const      *actions;       //!< Default actions for this section.
-       virtual_server_method_t const   *methods;       //!< list of module methods which are allowed in this section
+       section_name_t const                    *section;       //!< Identifier for the section.
+       size_t                                  offset;         //!< where the CONF_SECTION pointer is written
+       bool                                    dont_cache;     //!< If true, the CONF_SECTION pointer won't be written
+                                                               ///< and the offset will be ignored.
+       size_t                                  instruction;    //!< where the instruction pointer is written
+       unlang_mod_actions_t const              *actions;       //!< Default actions for this section.
+       section_name_t const                    **methods;      //!< list of auxilliary module methods which are allowed in
+                                                               ///< if the main name doesn't match.
 } virtual_server_compile_t;
 
-#define COMPILE_TERMINATOR { .name1 = NULL, .name2 = NULL }
+#define COMPILE_TERMINATOR { .section = NULL }
 
 int            virtual_server_section_register(virtual_server_t *vs, virtual_server_compile_t const *entry) CC_HINT(nonnull);
 
 int            virtual_server_compile_sections(virtual_server_t const *vs, tmpl_rules_t const *rules) CC_HINT(nonnull);
 
-virtual_server_method_t const *virtual_server_section_methods(virtual_server_t const *vs, char const *name1, char const *name2) CC_HINT(nonnull(1));
+section_name_t const **virtual_server_section_methods(virtual_server_t const *vs, char const *name1, char const *name2) CC_HINT(nonnull(1));
 
 unlang_action_t        virtual_server_push(request_t *request, CONF_SECTION *server_cs, bool top_frame) CC_HINT(nonnull);
 
index 747830934584f93e9c205158c35ac57d9417f68a..e1137a0cf5b62a53f6c6b5bbdc0606badf1fd520 100644 (file)
@@ -4424,23 +4424,9 @@ static unlang_t *compile_module(unlang_t *parent, unlang_compile_t *unlang_ctx,
                                CONF_ITEM *ci, module_instance_t *inst, module_method_t method,
                                call_env_method_t const *method_env, char const *realname)
 {
-       module_rlm_t const *mrlm = module_rlm_from_module(inst->exported);
        unlang_t *c;
        unlang_module_t *single;
 
-       /*
-        *      Can't use "chap" in "dhcp".
-        */
-       if (mrlm->dict && *mrlm->dict && unlang_ctx->rules && unlang_ctx->rules->attr.dict_def &&
-           (unlang_ctx->rules->attr.dict_def != fr_dict_internal()) &&
-           !fr_dict_compatible(*(mrlm->dict), unlang_ctx->rules->attr.dict_def)) {
-               cf_log_err(ci, "The \"%s\" module can only be used with 'namespace = %s'.  It cannot be used with 'namespace = %s'.",
-                          inst->module->exported->name,
-                          fr_dict_root(*mrlm->dict)->name,
-                          fr_dict_root(unlang_ctx->rules->attr.dict_def)->name);
-               return NULL;
-       }
-
        /*
         *      Check if the module in question has the necessary
         *      component.
index 929f3725556da79bb51bf820a62180981c06a9d4..c7f7a72cea7a653ac4bb12446e837c56656725e5 100644 (file)
@@ -30,6 +30,7 @@
 extern "C" {
 #endif
 
+#include <freeradius-devel/server/module.h>
 #include <freeradius-devel/server/module_rlm.h>
 #include <freeradius-devel/server/rcode.h>
 #include <freeradius-devel/unlang/subrequest.h>
index 03e2887f6639846e75463d1a7dc13266cec8291f..a80f04cc02bd20105c83cfb3161fd630e9aef2f6 100644 (file)
@@ -191,8 +191,8 @@ module_rlm_t rlm_always = {
                .instantiate    = mod_instantiate,
                .detach         = mod_detach
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = CF_IDENT_ANY, .name2 = CF_IDENT_ANY,         .method = mod_always_return     },
-               MODULE_NAME_TERMINATOR
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME(CF_IDENT_ANY, CF_IDENT_ANY), .method = mod_always_return },
+               MODULE_BINDING_TERMINATOR
        }
 };
index bfccfcd1d0a99275761c0dbaaaeff596980eaf83..df3c6da5e40c39f572ac9439db626d06278cde94 100644 (file)
@@ -380,16 +380,16 @@ module_rlm_t rlm_attr_filter = {
                .config         = module_config,
                .instantiate    = mod_instantiate,
        },
-       .method_names = (module_method_name_t[]){
+       .bindings = (module_method_binding_t[]){
                /*
                 *      Hack to support old configurations
                 */
-               { .name1 = "authorize",         .name2 = CF_IDENT_ANY,          .method = mod_authorize         },
+               { .section = SECTION_NAME("authorize", CF_IDENT_ANY),           .method = mod_authorize         },
 
-               { .name1 = "recv",              .name2 = "accounting-request",  .method = mod_preacct           },
-               { .name1 = "recv",              .name2 = CF_IDENT_ANY,          .method = mod_authorize         },
-               { .name1 = "accounting",        .name2 = CF_IDENT_ANY,          .method = mod_accounting        },
-               { .name1 = "send",              .name2 = CF_IDENT_ANY,          .method = mod_post_auth         },
-               MODULE_NAME_TERMINATOR
+               { .section = SECTION_NAME("recv", "accounting-request"),        .method = mod_preacct           },
+               { .section = SECTION_NAME("recv", CF_IDENT_ANY),                .method = mod_authorize         },
+               { .section = SECTION_NAME("accounting", CF_IDENT_ANY),          .method = mod_accounting        },
+               { .section = SECTION_NAME("send", CF_IDENT_ANY),                .method = mod_post_auth         },
+               MODULE_BINDING_TERMINATOR
        }
 };
index 3a7cb076bc545c7eed5bdd1005b6386a9a7dff25..235a1c31d38287b07dc1a15ed63c5073b22ec644 100644 (file)
@@ -1516,14 +1516,14 @@ module_rlm_t rlm_cache = {
                .instantiate    = mod_instantiate,
                .detach         = mod_detach
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = "status", .name2 = CF_IDENT_ANY,             .method = mod_method_status,    .method_env = &cache_method_env },
-               { .name1 = "load", .name2 = CF_IDENT_ANY,               .method = mod_method_load,      .method_env = &cache_method_env },
-               { .name1 = "update", .name2 = CF_IDENT_ANY,             .method = mod_method_update,    .method_env = &cache_method_env },
-               { .name1 = "store", .name2 = CF_IDENT_ANY,              .method = mod_method_store,     .method_env = &cache_method_env },
-               { .name1 = "clear", .name2 = CF_IDENT_ANY,              .method = mod_method_clear,     .method_env = &cache_method_env },
-               { .name1 = "ttl", .name2 = CF_IDENT_ANY,                .method = mod_method_ttl,       .method_env = &cache_method_env },
-               { .name1 = CF_IDENT_ANY, .name2 = CF_IDENT_ANY,         .method = mod_cache_it,         .method_env = &cache_method_env },
-               MODULE_NAME_TERMINATOR
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME("status", CF_IDENT_ANY),              .method = mod_method_status,    .method_env = &cache_method_env },
+               { .section = SECTION_NAME("load", CF_IDENT_ANY),                .method = mod_method_load,      .method_env = &cache_method_env },
+               { .section = SECTION_NAME("update", CF_IDENT_ANY),              .method = mod_method_update,    .method_env = &cache_method_env },
+               { .section = SECTION_NAME("store", CF_IDENT_ANY),               .method = mod_method_store,     .method_env = &cache_method_env },
+               { .section = SECTION_NAME("clear", CF_IDENT_ANY),               .method = mod_method_clear,     .method_env = &cache_method_env },
+               { .section = SECTION_NAME("ttl", CF_IDENT_ANY),         .method = mod_method_ttl,       .method_env = &cache_method_env },
+               { .section = SECTION_NAME(CF_IDENT_ANY, CF_IDENT_ANY),          .method = mod_cache_it,         .method_env = &cache_method_env },
+               MODULE_BINDING_TERMINATOR
        }
 };
index 7db176f6316d54e8e3d3adda6aad15aeb6378842..334d0a2d1bad2b2f98fac9659895e4f1d235298a 100644 (file)
@@ -388,11 +388,11 @@ module_rlm_t rlm_chap = {
                .config         = module_config,
                .instantiate    = mod_instantiate
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = "recv",              .name2 = "access-request",      .method = mod_authorize,
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME("recv", "access-request"),    .method = mod_authorize,
                  .method_env = &chap_autz_method_env   },
-               { .name1 = "authenticate",      .name2 = CF_IDENT_ANY,          .method = mod_authenticate,
+               { .section = SECTION_NAME("authenticate", CF_IDENT_ANY),                .method = mod_authenticate,
                  .method_env = &chap_auth_method_env   },
-               MODULE_NAME_TERMINATOR
+               MODULE_BINDING_TERMINATOR
        }
 };
index 6f91236ca10ba4feae57345dc813efa804864e61..3db525376b21c966843aaa8834917e5b5c2fe2af 100644 (file)
@@ -385,8 +385,8 @@ module_rlm_t rlm_client = {
                .onload         = mod_load,
                .unload         = mod_unload
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = CF_IDENT_ANY, .name2 = CF_IDENT_ANY,         .method = mod_authorize   },
-               MODULE_NAME_TERMINATOR
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME(CF_IDENT_ANY, CF_IDENT_ANY),          .method = mod_authorize   },
+               MODULE_BINDING_TERMINATOR
        }
 };
index 67f739196158537c1ca03109b1e370a1938f58c3..a3240e4fdb4e48963fa53d77f583d05e91418789 100644 (file)
@@ -555,9 +555,9 @@ module_rlm_t rlm_couchbase = {
                .instantiate    = mod_instantiate,
                .detach         = mod_detach
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = "recv", .name2 = CF_IDENT_ANY,               .method = mod_authorize   },
-               { .name1 = "accounting", .name2 = CF_IDENT_ANY,         .method = mod_accounting   },
-               MODULE_NAME_TERMINATOR
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME("recv", CF_IDENT_ANY),                .method = mod_authorize   },
+               { .section = SECTION_NAME("accounting", CF_IDENT_ANY),          .method = mod_accounting   },
+               MODULE_BINDING_TERMINATOR
        }
 };
index d5e7de9a2717b5cfa66bdf2cffbd7f515e857a87..b6542d2194b3e2c5430df472726809970a59ab15 100644 (file)
@@ -1058,8 +1058,8 @@ module_rlm_t rlm_csv = {
                .bootstrap      = mod_bootstrap,
                .instantiate    = mod_instantiate,
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = CF_IDENT_ANY,        .name2 = CF_IDENT_ANY,  .method = mod_process },
-               MODULE_NAME_TERMINATOR
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME(CF_IDENT_ANY, CF_IDENT_ANY),  .method = mod_process },
+               MODULE_BINDING_TERMINATOR
        }
 };
index c15b3e12e8da39cf748403d6f99c89f12f1d0c6f..d37ec641b7cad9a36976a4ba2fb343fbaa03c1a4 100644 (file)
@@ -279,8 +279,8 @@ module_rlm_t rlm_delay = {
                .config         = module_config,
                .bootstrap      = mod_bootstrap
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = CF_IDENT_ANY,        .name2 = CF_IDENT_ANY,  .method = mod_delay },
-               MODULE_NAME_TERMINATOR
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME(CF_IDENT_ANY, CF_IDENT_ANY),  .method = mod_delay },
+               MODULE_BINDING_TERMINATOR
        }
 };
index 4fce50280fad6a4e4d0d1370a9b22fea93fac79d..1cc1b8b72cb5d727cfbfc8d1dd3233d963efef39 100644 (file)
@@ -508,15 +508,15 @@ module_rlm_t rlm_detail = {
                .config         = module_config,
                .instantiate    = mod_instantiate
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = "recv",              .name2 = "accounting-request",  .method = mod_accounting,
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME("recv", "accounting-request"),        .method = mod_accounting,
                  .method_env = &method_env },
-               { .name1 = "recv",              .name2 = CF_IDENT_ANY,          .method = mod_authorize,
+               { .section = SECTION_NAME("recv", CF_IDENT_ANY),                .method = mod_authorize,
                  .method_env = &method_env },
-               { .name1 = "accounting",        .name2 = CF_IDENT_ANY,          .method = mod_accounting,
+               { .section = SECTION_NAME("accounting", CF_IDENT_ANY),          .method = mod_accounting,
                  .method_env = &method_env },
-               { .name1 = "send",              .name2 = CF_IDENT_ANY,          .method = mod_post_auth,
+               { .section = SECTION_NAME("send", CF_IDENT_ANY),                .method = mod_post_auth,
                  .method_env = &method_env },
-               MODULE_NAME_TERMINATOR
+               MODULE_BINDING_TERMINATOR
        }
 };
index 8a0bbe6c8a30bb54ade301ba11a2cecd76307f9b..bb3b065e3f92f485a9654e06613ea58d41d28591 100644 (file)
@@ -333,8 +333,8 @@ module_rlm_t rlm_dhcpv4 = {
                .thread_inst_type       = "rlm_dhcpv4_thread_t",
                .thread_instantiate     = mod_thread_instantiate
        },
-        .method_names = (module_method_name_t[]){
-                { .name1 = CF_IDENT_ANY,       .name2 = CF_IDENT_ANY,  .method = mod_process },
-                MODULE_NAME_TERMINATOR
+        .bindings = (module_method_binding_t[]){
+                { .section = SECTION_NAME(CF_IDENT_ANY, CF_IDENT_ANY), .method = mod_process },
+                MODULE_BINDING_TERMINATOR
         },
 };
index cc714a31808f3b0f850fd3444a8fed0cab3375b0..e832859ba147a32468f9945013186f559dd5b244 100644 (file)
@@ -480,10 +480,9 @@ module_rlm_t rlm_digest = {
                .inst_size      = sizeof(rlm_digest_t),
                .instantiate    = mod_instantiate,
        },
-       .dict           = &dict_radius,
-        .method_names = (module_method_name_t[]){
-                { .name1 = "recv",             .name2 = "access-request",      .method = mod_authorize },
-                { .name1 = "authenticate",     .name2 = CF_IDENT_ANY,          .method = mod_authenticate },
-                MODULE_NAME_TERMINATOR
+        .bindings = (module_method_binding_t[]){
+                { .proto = &dict_radius,       .section = SECTION_NAME("recv", "access-request"),      .method = mod_authorize },
+                { .proto = &dict_radius,       .section = SECTION_NAME("authenticate", CF_IDENT_ANY),          .method = mod_authenticate },
+                MODULE_BINDING_TERMINATOR
         },
 };
index f5361020acdff8198881e47e1ff4f137b74c07da..ded2843ebd1465add575c598d003352d665dfe99 100644 (file)
@@ -1196,10 +1196,10 @@ module_rlm_t rlm_eap = {
                .unload         = mod_unload,
                .instantiate    = mod_instantiate,
        },
-        .method_names = (module_method_name_t[]){
-                { .name1 = "recv",             .name2 = "access-request",      .method = mod_authorize },
-                { .name1 = "authenticate",     .name2 = CF_IDENT_ANY,          .method = mod_authenticate },
-                { .name1 = "send",             .name2 = CF_IDENT_ANY,          .method = mod_post_auth },
-                MODULE_NAME_TERMINATOR
+        .bindings = (module_method_binding_t[]){
+                { .section = SECTION_NAME("recv", "access-request"),   .method = mod_authorize },
+                { .section = SECTION_NAME("authenticate", CF_IDENT_ANY),               .method = mod_authenticate },
+                { .section = SECTION_NAME("send", CF_IDENT_ANY),               .method = mod_post_auth },
+                MODULE_BINDING_TERMINATOR
         }
 };
index a2eca0836593cdba9dfaa95b8c5e2a10d21f52eb..7cbe9ab59cbe1086a65b717975e69f46a9b659a8 100644 (file)
@@ -531,9 +531,9 @@ module_rlm_t rlm_exec = {
                .bootstrap      = mod_bootstrap,
                .instantiate    = mob_instantiate
        },
-        .method_names = (module_method_name_t[]){
-                { .name1 = CF_IDENT_ANY,       .name2 = CF_IDENT_ANY,          .method = mod_exec_dispatch_oneshot,
+        .bindings = (module_method_binding_t[]){
+                { .section = SECTION_NAME(CF_IDENT_ANY, CF_IDENT_ANY),         .method = mod_exec_dispatch_oneshot,
                  .method_env = &exec_method_env },
-                MODULE_NAME_TERMINATOR
+                MODULE_BINDING_TERMINATOR
         }
 };
index bdc7379f8ac82a3e1b8c6187f8c93125bc8bd394..61e81d95e2410f6acddcfd3009c9fe2fc292031c 100644 (file)
@@ -675,10 +675,10 @@ module_rlm_t rlm_files = {
                .inst_size      = sizeof(rlm_files_t),
                .config         = module_config,
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = CF_IDENT_ANY,        .name2 = CF_IDENT_ANY,          .method = mod_files,
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME(CF_IDENT_ANY, CF_IDENT_ANY),          .method = mod_files,
                  .method_env = &method_env     },
-               MODULE_NAME_TERMINATOR
+               MODULE_BINDING_TERMINATOR
        }
 
 };
index 9d0b6318e481c7b8fcec00a930015f993bd0280e..86b9344c09a25e0e59289399be1d88af5861bd94 100644 (file)
@@ -292,8 +292,8 @@ module_rlm_t rlm_imap = {
                .thread_instantiate     = mod_thread_instantiate,
                .thread_detach          = mod_thread_detach,
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = "authenticate",      .name2 = CF_IDENT_ANY,          .method = mod_authenticate },
-               MODULE_NAME_TERMINATOR
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME("authenticate", CF_IDENT_ANY),                .method = mod_authenticate },
+               MODULE_BINDING_TERMINATOR
        }
 };
index bd98b393bed70a2269772c57f91e0a046ca4844a..a1677232768f25c161f8f236898e86446b4eb3f1 100644 (file)
@@ -2240,9 +2240,9 @@ module_rlm_t rlm_isc_dhcp = {
                .config         = module_config,
                .instantiate    = mod_instantiate
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = "recv",              .name2 = CF_IDENT_ANY,          .method = mod_authorize },
-               { .name1 = "send",              .name2 = CF_IDENT_ANY,          .method = mod_post_auth },
-               MODULE_NAME_TERMINATOR
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME("recv", CF_IDENT_ANY),                .method = mod_authorize },
+               { .section = SECTION_NAME("send", CF_IDENT_ANY),                .method = mod_post_auth },
+               MODULE_BINDING_TERMINATOR
        }
 };
index 29fb67184f99c8924fc6de07b7017a48d984a9b1..720975fed2a980402ae9dd92f52a4abdc935d163 100644 (file)
@@ -504,8 +504,8 @@ module_rlm_t rlm_krb5 = {
                .instantiate    = mod_instantiate,
                .detach         = mod_detach
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = "authenticate",      .name2 = CF_IDENT_ANY,          .method = mod_authenticate },
-               MODULE_NAME_TERMINATOR
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME("authenticate", CF_IDENT_ANY),                .method = mod_authenticate },
+               MODULE_BINDING_TERMINATOR
        }
 };
index 49e631f1bc96e32291ca04c1b58bc0a841c4a973..150272bc3effc49153a5dd6dfe129947b22d51fc 100644 (file)
@@ -2730,21 +2730,21 @@ module_rlm_t rlm_ldap = {
                .thread_instantiate     = mod_thread_instantiate,
                .thread_detach          = mod_thread_detach,
        },
-       .method_names = (module_method_name_t[]){
+       .bindings = (module_method_binding_t[]){
                /*
                 *      Hack to support old configurations
                 */
-               { .name1 = "authorize",         .name2 = CF_IDENT_ANY,          .method = mod_authorize,
+               { .section = SECTION_NAME("authorize", CF_IDENT_ANY),           .method = mod_authorize,
                  .method_env = &authorize_method_env           },
 
-               { .name1 = "recv",              .name2 = CF_IDENT_ANY,          .method = mod_authorize,
+               { .section = SECTION_NAME("recv", CF_IDENT_ANY),                .method = mod_authorize,
                  .method_env = &authorize_method_env           },
-               { .name1 = "accounting",        .name2 = CF_IDENT_ANY,          .method = mod_accounting,
+               { .section = SECTION_NAME("accounting", CF_IDENT_ANY),          .method = mod_accounting,
                  .method_env = &usermod_method_env             },
-               { .name1 = "authenticate",      .name2 = CF_IDENT_ANY,          .method = mod_authenticate,
+               { .section = SECTION_NAME("authenticate", CF_IDENT_ANY),                .method = mod_authenticate,
                  .method_env = &authenticate_method_env        },
-               { .name1 = "send",              .name2 = CF_IDENT_ANY,          .method = mod_post_auth,
+               { .section = SECTION_NAME("send", CF_IDENT_ANY),                .method = mod_post_auth,
                  .method_env = &usermod_method_env             },
-               MODULE_NAME_TERMINATOR
+               MODULE_BINDING_TERMINATOR
        }
 };
index cb1a017c601fa0cca3ce79a81f2609acd97344ee..a76b2dd4f75416c807faa0d0438c37e73d1a1169 100644 (file)
@@ -1061,8 +1061,8 @@ module_rlm_t rlm_linelog = {
                .instantiate    = mod_instantiate,
                .detach         = mod_detach
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = CF_IDENT_ANY, .name2 = CF_IDENT_ANY, .method = mod_do_linelog, .method_env = &linelog_method_env },
-               MODULE_NAME_TERMINATOR
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME(CF_IDENT_ANY, CF_IDENT_ANY), .method = mod_do_linelog, .method_env = &linelog_method_env },
+               MODULE_BINDING_TERMINATOR
        }
 };
index 4fd7ac90f714176ee4b7ec0a96a0c20e2cc9de0d..ac69954b40a1fc4a92ec90111e548aa8182b5a7f 100644 (file)
@@ -665,8 +665,8 @@ module_rlm_t rlm_logtee = {
                .instantiate            = mod_instantiate,
                .thread_instantiate     = mod_thread_instantiate,
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = CF_IDENT_ANY,        .name2 = CF_IDENT_ANY,          .method = mod_insert_logtee },
-               MODULE_NAME_TERMINATOR
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME(CF_IDENT_ANY, CF_IDENT_ANY),          .method = mod_insert_logtee },
+               MODULE_BINDING_TERMINATOR
        }
 };
index d0eacde4f263ec4545dbc34abd3095cf962f5a4f..c1c3ec2b86c734f11cb108bfd030cd2d10e08b1a 100644 (file)
@@ -180,17 +180,17 @@ module_rlm_t rlm_lua = {
                .detach                 = mod_detach,
                .thread_detach          = mod_thread_detach
        },
-       .method_names = (module_method_name_t[]){
+       .bindings = (module_method_binding_t[]){
                /*
                 *      Hack to support old configurations
                 */
-               { .name1 = "authorize",         .name2 = CF_IDENT_ANY,          .method = mod_authorize         },
-
-               { .name1 = "recv",              .name2 = "accounting-request",  .method = mod_preacct           },
-               { .name1 = "recv",              .name2 = CF_IDENT_ANY,          .method = mod_authorize         },
-               { .name1 = "accounting",        .name2 = CF_IDENT_ANY,          .method = mod_accounting        },
-               { .name1 = "authenticate",      .name2 = CF_IDENT_ANY,          .method = mod_authenticate      },
-               { .name1 = "send",              .name2 = CF_IDENT_ANY,          .method = mod_post_auth         },
-               MODULE_NAME_TERMINATOR
+               { .section = SECTION_NAME("authorize", CF_IDENT_ANY),           .method = mod_authorize         },
+
+               { .section = SECTION_NAME("recv", "accounting-request"),        .method = mod_preacct           },
+               { .section = SECTION_NAME("recv", CF_IDENT_ANY),                .method = mod_authorize         },
+               { .section = SECTION_NAME("accounting", CF_IDENT_ANY),          .method = mod_accounting        },
+               { .section = SECTION_NAME("authenticate", CF_IDENT_ANY),                .method = mod_authenticate      },
+               { .section = SECTION_NAME("send", CF_IDENT_ANY),                .method = mod_post_auth         },
+               MODULE_BINDING_TERMINATOR
        }
 };
index 27c4b62c112610b085e9ce987aac919e3d80e541..e5181373badb893e563d92e3fe67ddcd51feb532 100644 (file)
@@ -517,17 +517,17 @@ module_rlm_t rlm_mruby = {
                .instantiate    = mod_instantiate,
                .detach         = mod_detach,
        },
-       .method_names = (module_method_name_t[]){
+       .bindings = (module_method_binding_t[]){
                /*
                 *      Hack to support old configurations
                 */
-               { .name1 = "authorize",         .name2 = CF_IDENT_ANY,          .method = mod_authorize         },
-
-               { .name1 = "recv",              .name2 = "accounting-request",  .method = mod_preacct           },
-               { .name1 = "recv",              .name2 = CF_IDENT_ANY,          .method = mod_authorize         },
-               { .name1 = "accounting",        .name2 = CF_IDENT_ANY,          .method = mod_accounting        },
-               { .name1 = "authenticate",      .name2 = CF_IDENT_ANY,          .method = mod_authenticate      },
-               { .name1 = "send",              .name2 = CF_IDENT_ANY,          .method = mod_post_auth         },
-               MODULE_NAME_TERMINATOR
+               { .section = SECTION_NAME("authorize", CF_IDENT_ANY),           .method = mod_authorize         },
+
+               { .section = SECTION_NAME("recv", "accounting-request"),        .method = mod_preacct           },
+               { .section = SECTION_NAME("recv", CF_IDENT_ANY),                .method = mod_authorize         },
+               { .section = SECTION_NAME("accounting", CF_IDENT_ANY),          .method = mod_accounting        },
+               { .section = SECTION_NAME("authenticate", CF_IDENT_ANY),                .method = mod_authenticate      },
+               { .section = SECTION_NAME("send", CF_IDENT_ANY),                .method = mod_post_auth         },
+               MODULE_BINDING_TERMINATOR
        }
 };
index ce8fa3e3d487772ba5ea013512b8ba5009e8339d..cb060f0e3a76c5d6b807822cb3f6a8eafefd5f6a 100644 (file)
@@ -2527,11 +2527,11 @@ module_rlm_t rlm_mschap = {
                .instantiate    = mod_instantiate,
                .detach         = mod_detach
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = "recv",              .name2 = CF_IDENT_ANY,          .method = mod_authorize,
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME("recv", CF_IDENT_ANY),                .method = mod_authorize,
                  .method_env = &mschap_autz_method_env },
-               { .name1 = "authenticate",      .name2 = CF_IDENT_ANY,          .method = mod_authenticate,
+               { .section = SECTION_NAME("authenticate", CF_IDENT_ANY),                .method = mod_authenticate,
                  .method_env = &mschap_auth_method_env },
-               MODULE_NAME_TERMINATOR
+               MODULE_BINDING_TERMINATOR
        }
 };
index 255992fb65d9385fe84047b5e488846531441a5e..a75f02ced2df9ed20179c210fab5d7baabaca4c6 100644 (file)
@@ -536,9 +536,9 @@ module_rlm_t rlm_opendirectory = {
                .inst_size      = sizeof(rlm_opendirectory_t),
                .instantiate    = mod_instantiate
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = "recv",              .name2 = CF_IDENT_ANY,          .method = mod_authorize },
-               { .name1 = "authenticate",      .name2 = CF_IDENT_ANY,          .method = mod_authenticate },
-               MODULE_NAME_TERMINATOR
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME("recv", CF_IDENT_ANY),                .method = mod_authorize },
+               { .section = SECTION_NAME("authenticate", CF_IDENT_ANY),                .method = mod_authenticate },
+               MODULE_BINDING_TERMINATOR
        }
 };
index e3c8d069b4d38fb0220c483e68da02ede2ef1ec9..83bb4a55bfc7f8103d85f5734ef05ed10d7c69ff 100644 (file)
@@ -277,8 +277,8 @@ module_rlm_t rlm_pam = {
                .config         = module_config,
                .instantiate    = mod_instantiate
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = "authenticate",      .name2 = CF_IDENT_ANY,          .method = mod_authenticate },
-               MODULE_NAME_TERMINATOR
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME("authenticate", CF_IDENT_ANY),                .method = mod_authenticate },
+               MODULE_BINDING_TERMINATOR
        }
 };
index bc7abd5c76cfbbda6c129e26c0b53ce77fda29ba..085aa02324a5bc2b8e37433aea6d0bcc0b142ee1 100644 (file)
@@ -1063,17 +1063,17 @@ module_rlm_t rlm_pap = {
                .config         = module_config,
                .instantiate    = mod_instantiate
        },
-       .method_names = (module_method_name_t[]){
+       .bindings = (module_method_binding_t[]){
                /*
                 *      Hack to support old configurations
                 */
-               { .name1 = "authorize",         .name2 = CF_IDENT_ANY,          .method = mod_authorize,
+               { .section = SECTION_NAME("authorize", CF_IDENT_ANY),           .method = mod_authorize,
                  .method_env = &pap_method_env         },
 
-               { .name1 = "authenticate",      .name2 = CF_IDENT_ANY,          .method = mod_authenticate,
+               { .section = SECTION_NAME("authenticate", CF_IDENT_ANY),                .method = mod_authenticate,
                  .method_env = &pap_method_env         },
-               { .name1 = CF_IDENT_ANY,        .name2 = CF_IDENT_ANY,          .method = mod_authorize,
+               { .section = SECTION_NAME(CF_IDENT_ANY, CF_IDENT_ANY),          .method = mod_authorize,
                  .method_env = &pap_method_env         },
-               MODULE_NAME_TERMINATOR
+               MODULE_BINDING_TERMINATOR
        }
 };
index 935ba94ff7be032358f8712f7fda2555c1f7f0e9..ac3e1a1e4074924c11f5493809cd41a7d0577852 100644 (file)
@@ -616,9 +616,9 @@ module_rlm_t rlm_passwd = {
                .instantiate    = mod_instantiate,
                .detach         = mod_detach
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = CF_IDENT_ANY,        .name2 = CF_IDENT_ANY,          .method = mod_passwd_map },
-               MODULE_NAME_TERMINATOR
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME(CF_IDENT_ANY, CF_IDENT_ANY),          .method = mod_passwd_map },
+               MODULE_BINDING_TERMINATOR
        }
 };
 #endif /* TEST */
index c48cfc8f53993e2057b8bf54f8f554806d94fe97..f87d05fb086876f2fe7dc191a8bd26fea480009b 100644 (file)
@@ -1182,17 +1182,17 @@ module_rlm_t rlm_perl = {
                .thread_instantiate     = mod_thread_instantiate,
                .thread_detach          = mod_thread_detach,
        },
-       .method_names = (module_method_name_t[]){
+       .bindings = (module_method_binding_t[]){
                /*
                 *      Hack to support old configurations
                 */
-               { .name1 = "authorize",         .name2 = CF_IDENT_ANY,          .method = mod_authorize         },
-
-               { .name1 = "recv",              .name2 = "accounting-request",  .method = mod_preacct           },
-               { .name1 = "recv",              .name2 = CF_IDENT_ANY,          .method = mod_authorize         },
-               { .name1 = "accounting",        .name2 = CF_IDENT_ANY,          .method = mod_accounting        },
-               { .name1 = "authenticate",      .name2 = CF_IDENT_ANY,          .method = mod_authenticate      },
-               { .name1 = "send",              .name2 = CF_IDENT_ANY,          .method = mod_post_auth         },
-               MODULE_NAME_TERMINATOR
+               { .section = SECTION_NAME("authorize", CF_IDENT_ANY),           .method = mod_authorize         },
+
+               { .section = SECTION_NAME("recv", "accounting-request"),        .method = mod_preacct           },
+               { .section = SECTION_NAME("recv", CF_IDENT_ANY),                .method = mod_authorize         },
+               { .section = SECTION_NAME("accounting", CF_IDENT_ANY),          .method = mod_accounting        },
+               { .section = SECTION_NAME("authenticate", CF_IDENT_ANY),                .method = mod_authenticate      },
+               { .section = SECTION_NAME("send", CF_IDENT_ANY),                .method = mod_post_auth         },
+               MODULE_BINDING_TERMINATOR
        }
 };
index 51710fb00378fd89ae16c8596d9b265aed67571b..48e65f84eaefcdc55116c9eeb5d594f6a027152f 100644 (file)
@@ -1182,17 +1182,17 @@ module_rlm_t rlm_python = {
                .thread_instantiate     = mod_thread_instantiate,
                .thread_detach          = mod_thread_detach
        },
-       .method_names = (module_method_name_t[]){
+       .bindings = (module_method_binding_t[]){
                /*
                 *      Hack to support old configurations
                 */
-               { .name1 = "authorize",         .name2 = CF_IDENT_ANY,          .method = mod_authorize         },
-
-               { .name1 = "recv",              .name2 = "accounting-request",  .method = mod_preacct           },
-               { .name1 = "recv",              .name2 = CF_IDENT_ANY,          .method = mod_authorize         },
-               { .name1 = "accounting",        .name2 = CF_IDENT_ANY,          .method = mod_accounting        },
-               { .name1 = "authenticate",      .name2 = CF_IDENT_ANY,          .method = mod_authenticate      },
-               { .name1 = "send",              .name2 = CF_IDENT_ANY,          .method = mod_post_auth         },
-               MODULE_NAME_TERMINATOR
+               { .section = SECTION_NAME("authorize", CF_IDENT_ANY),           .method = mod_authorize         },
+
+               { .section = SECTION_NAME("recv", "accounting-request"),        .method = mod_preacct           },
+               { .section = SECTION_NAME("recv", CF_IDENT_ANY),                .method = mod_authorize         },
+               { .section = SECTION_NAME("accounting", CF_IDENT_ANY),          .method = mod_accounting        },
+               { .section = SECTION_NAME("authenticate", CF_IDENT_ANY),                .method = mod_authenticate      },
+               { .section = SECTION_NAME("send", CF_IDENT_ANY),                .method = mod_post_auth         },
+               MODULE_BINDING_TERMINATOR
        }
 };
index 86f4a78e3fb4a15551f570a0cb26c82ff0cf2044..6a98629c201d02697bdfa262b3bf2de49770080e 100644 (file)
@@ -663,8 +663,8 @@ module_rlm_t rlm_radius = {
 
                .instantiate    = mod_instantiate,
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = CF_IDENT_ANY,        .name2 = CF_IDENT_ANY,  .method = mod_process },
-               MODULE_NAME_TERMINATOR
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME(CF_IDENT_ANY, CF_IDENT_ANY),  .method = mod_process },
+               MODULE_BINDING_TERMINATOR
        },
 };
index b0174cdb0a9b47754e02facae567fb601ffb4c8e..5437a15c18271baa3c8cf374bb1ef1a497faa0af 100644 (file)
@@ -586,9 +586,9 @@ module_rlm_t rlm_radutmp = {
                .instantiate    = mod_instantiate,
                .detach         = mod_detach
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = "accounting",        .name2 = CF_IDENT_ANY,          .method = mod_accounting,
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME("accounting", CF_IDENT_ANY),          .method = mod_accounting,
                  .method_env = &method_env },
-               MODULE_NAME_TERMINATOR
+               MODULE_BINDING_TERMINATOR
        }
 };
index 74bebba45f565698fc0de186c1ca0d4a84667920..217cc713f9d6028c662a80be7e0346cecde95788 100644 (file)
@@ -1291,60 +1291,60 @@ module_rlm_t rlm_redis_ippool = {
                .onload         = mod_load,
                .instantiate    = mod_instantiate
        },
-       .method_names = (module_method_name_t[]){
+       .bindings = (module_method_binding_t[]){
                /*
                 *      RADIUS specific
                 */
-               { .name1 = "recv",              .name2 = "access-request",      .method = mod_alloc,
+               { .section = SECTION_NAME("recv", "access-request"),    .method = mod_alloc,
                  .method_env = &redis_ippool_alloc_method_env },
-               { .name1 = "accounting",        .name2 = "start",               .method = mod_update,
+               { .section = SECTION_NAME("accounting", "start"),               .method = mod_update,
                  .method_env = &redis_ippool_update_method_env },
-               { .name1 = "accounting",        .name2 = "interim-update",      .method = mod_update,
+               { .section = SECTION_NAME("accounting", "interim-update"),      .method = mod_update,
                  .method_env = &redis_ippool_update_method_env },
-               { .name1 = "accounting",        .name2 = "stop",                .method = mod_release,
+               { .section = SECTION_NAME("accounting", "stop"),                .method = mod_release,
                  .method_env = &redis_ippool_release_method_env },
-               { .name1 = "accounting",        .name2 = "accounting-on",       .method = mod_bulk_release,
+               { .section = SECTION_NAME("accounting", "accounting-on"),       .method = mod_bulk_release,
                  .method_env = &redis_ippool_bulk_release_method_env },
-               { .name1 = "accounting",        .name2 = "accounting-off",      .method = mod_bulk_release,
+               { .section = SECTION_NAME("accounting", "accounting-off"),      .method = mod_bulk_release,
                  .method_env = &redis_ippool_bulk_release_method_env },
 
                /*
                 *      DHCPv4
                 */
-               { .name1 = "recv",              .name2 = "discover",            .method = mod_alloc,
+               { .section = SECTION_NAME("recv", "discover"),          .method = mod_alloc,
                  .method_env = &redis_ippool_alloc_method_env },
-               { .name1 = "recv",              .name2 = "release",             .method = mod_release,
+               { .section = SECTION_NAME("recv", "release"),           .method = mod_release,
                  .method_env = &redis_ippool_release_method_env },
-               { .name1 = "send",              .name2 = "ack",                 .method = mod_update,
+               { .section = SECTION_NAME("send", "ack"),                       .method = mod_update,
                  .method_env = &redis_ippool_update_method_env },
 
                /*
                 *      DHCPv6
                 */
-               { .name1 = "recv",              .name2 = "solicit",             .method = mod_alloc,
+               { .section = SECTION_NAME("recv", "solicit"),           .method = mod_alloc,
                  .method_env = &redis_ippool_alloc_method_env },
 
                /*
                 *      Generic
                 */
-               { .name1 = "recv",              .name2 = CF_IDENT_ANY,          .method = mod_update,
+               { .section = SECTION_NAME("recv", CF_IDENT_ANY),                .method = mod_update,
                  .method_env = &redis_ippool_update_method_env },
-               { .name1 = "send",              .name2 = CF_IDENT_ANY,          .method = mod_alloc,
+               { .section = SECTION_NAME("send", CF_IDENT_ANY),                .method = mod_alloc,
                  .method_env = &redis_ippool_alloc_method_env },
 
                /*
                 *      Named methods matching module operations
                 */
-               { .name1 = "allocate",          .name2 = CF_IDENT_ANY,          .method = mod_alloc,
+               { .section = SECTION_NAME("allocate", CF_IDENT_ANY),            .method = mod_alloc,
                  .method_env = &redis_ippool_alloc_method_env },
-               { .name1 = "update",            .name2 = CF_IDENT_ANY,          .method = mod_update,
+               { .section = SECTION_NAME("update", CF_IDENT_ANY),              .method = mod_update,
                  .method_env = &redis_ippool_update_method_env },
-               { .name1 = "renew",             .name2 = CF_IDENT_ANY,          .method = mod_update,
+               { .section = SECTION_NAME("renew", CF_IDENT_ANY),               .method = mod_update,
                  .method_env = &redis_ippool_update_method_env },
-               { .name1 = "release",           .name2 = CF_IDENT_ANY,          .method = mod_release,
+               { .section = SECTION_NAME("release", CF_IDENT_ANY),             .method = mod_release,
                  .method_env = &redis_ippool_release_method_env },
-               { .name1 = "bulk-release",      .name2 = CF_IDENT_ANY,          .method = mod_bulk_release,
+               { .section = SECTION_NAME("bulk-release", CF_IDENT_ANY),                .method = mod_bulk_release,
                  .method_env = &redis_ippool_bulk_release_method_env },
-               MODULE_NAME_TERMINATOR
+               MODULE_BINDING_TERMINATOR
        }
 };
index 4139e74943150abe1df84b7df540d47a9c25d01c..42c19d274fb8f2ffa09402435441910b6008a11d 100644 (file)
@@ -257,8 +257,8 @@ module_rlm_t rlm_rediswho = {
                .onload         = mod_load,
                .instantiate    = mod_instantiate
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = "accounting",        .name2 = CF_IDENT_ANY,          .method = mod_accounting },
-               MODULE_NAME_TERMINATOR
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME("accounting", CF_IDENT_ANY),          .method = mod_accounting },
+               MODULE_BINDING_TERMINATOR
        }
 };
index 0c26ea850791c4aa389feb8501902d048153cf82..3482463dcc9915d0f744cba44b9bd450aa7a62ef 100644 (file)
@@ -1418,17 +1418,17 @@ module_rlm_t rlm_rest = {
                .thread_instantiate     = mod_thread_instantiate,
                .thread_detach          = mod_thread_detach
        },
-       .method_names = (module_method_name_t[]){
+       .bindings = (module_method_binding_t[]){
                /*
                 *      Hack to support old configurations
                 */
-               { .name1 = "authorize",         .name2 = CF_IDENT_ANY,          .method = mod_authorize,        .method_env = &rest_call_env_authorize          },
-
-               { .name1 = "recv",              .name2 = "accounting-request",  .method = mod_accounting,       .method_env = &rest_call_env_accounting         },
-               { .name1 = "recv",              .name2 = CF_IDENT_ANY,          .method = mod_authorize,        .method_env = &rest_call_env_authorize          },
-               { .name1 = "accounting",        .name2 = CF_IDENT_ANY,          .method = mod_accounting,       .method_env = &rest_call_env_accounting         },
-               { .name1 = "authenticate",      .name2 = CF_IDENT_ANY,          .method = mod_authenticate,     .method_env = &rest_call_env_authenticate       },
-               { .name1 = "send",              .name2 = CF_IDENT_ANY,          .method = mod_post_auth,        .method_env = &rest_call_env_post_auth          },
-               MODULE_NAME_TERMINATOR
+               { .section = SECTION_NAME("authorize", CF_IDENT_ANY),           .method = mod_authorize,        .method_env = &rest_call_env_authorize          },
+
+               { .section = SECTION_NAME("recv", "accounting-request"),        .method = mod_accounting,       .method_env = &rest_call_env_accounting         },
+               { .section = SECTION_NAME("recv", CF_IDENT_ANY),                .method = mod_authorize,        .method_env = &rest_call_env_authorize          },
+               { .section = SECTION_NAME("accounting", CF_IDENT_ANY),          .method = mod_accounting,       .method_env = &rest_call_env_accounting         },
+               { .section = SECTION_NAME("authenticate", CF_IDENT_ANY),                .method = mod_authenticate,     .method_env = &rest_call_env_authenticate       },
+               { .section = SECTION_NAME("send", CF_IDENT_ANY),                .method = mod_post_auth,        .method_env = &rest_call_env_post_auth          },
+               MODULE_BINDING_TERMINATOR
        }
 };
index e4dad5ca7fc00a4f7786a7c5aa44a2ef2c4148ae..a2a597e68a580d1758b208f9a928dfdc6badb982 100644 (file)
@@ -560,8 +560,8 @@ module_rlm_t rlm_securid = {
                .instantiate    = mod_instantiate,
                .detach         = mod_detach
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = "authenticate",      .name2 = CF_IDENT_ANY,          .method = mod_authenticate },
-               MODULE_NAME_TERMINATOR
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME("authenticate", CF_IDENT_ANY),                .method = mod_authenticate },
+               MODULE_BINDING_TERMINATOR
        }
 };
index bc1403226169653928e0e677737dde78453428c9..044ed5f341dc16d6444a492ff3aaa988364b3bff 100644 (file)
@@ -434,8 +434,8 @@ module_rlm_t rlm_sigtran = {
                .thread_instantiate     = mod_thread_instantiate,
                .thread_detach          = mod_thread_detach
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = CF_IDENT_ANY,        .name2 = CF_IDENT_ANY,          .method = mod_authorize },
-               MODULE_NAME_TERMINATOR
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME(CF_IDENT_ANY, CF_IDENT_ANY),          .method = mod_authorize },
+               MODULE_BINDING_TERMINATOR
        }
 };
index 376a522b7ab47e5a1c53a3d8feee4849436fe38a..3fa33fe8605e5d228f2651acde42acfc1d654368 100644 (file)
@@ -1050,11 +1050,11 @@ module_rlm_t rlm_smtp = {
                .thread_instantiate     = mod_thread_instantiate,
                .thread_detach          = mod_thread_detach,
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = "mail",              .name2 = CF_IDENT_ANY,          .method = mod_mail,
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME("mail", CF_IDENT_ANY),                .method = mod_mail,
                  .method_env = &method_env },
-               { .name1 = "authenticate",      .name2 = CF_IDENT_ANY,          .method = mod_authenticate,
+               { .section = SECTION_NAME("authenticate", CF_IDENT_ANY),                .method = mod_authenticate,
                  .method_env = &auth_env },
-               MODULE_NAME_TERMINATOR
+               MODULE_BINDING_TERMINATOR
        }
 };
index c0b190f22711eccb9192f8fcc007e849f74c181b..3046186dac90bb83f7a14f9b2bbdfb0837a28850 100644 (file)
@@ -161,9 +161,9 @@ module_rlm_t rlm_sometimes = {
                .config         = module_config,
                .instantiate    = mod_instantiate
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = "send",              .name2 = CF_IDENT_ANY,          .method = mod_sometimes_reply },
-               { .name1 = CF_IDENT_ANY,        .name2 = CF_IDENT_ANY,          .method = mod_sometimes_packet },
-               MODULE_NAME_TERMINATOR
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME("send", CF_IDENT_ANY),                .method = mod_sometimes_reply },
+               { .section = SECTION_NAME(CF_IDENT_ANY, CF_IDENT_ANY),          .method = mod_sometimes_packet },
+               MODULE_BINDING_TERMINATOR
        }
 };
index a565718900d6e451fd64eefb6954504287596f3f..10298f1b22cccceeddcbcf247727061d3df1ceae 100644 (file)
@@ -1994,19 +1994,19 @@ module_rlm_t rlm_sql = {
                .instantiate    = mod_instantiate,
                .detach         = mod_detach
        },
-       .method_names = (module_method_name_t[]){
+       .bindings = (module_method_binding_t[]){
                /*
                 *      Hack to support old configurations
                 */
-               { .name1 = "authorize",         .name2 = CF_IDENT_ANY,          .method = mod_authorize,
+               { .section = SECTION_NAME("authorize", CF_IDENT_ANY),           .method = mod_authorize,
                  .method_env = &authorize_method_env   },
 
-               { .name1 = "recv",              .name2 = CF_IDENT_ANY,          .method = mod_authorize,
+               { .section = SECTION_NAME("recv", CF_IDENT_ANY),                .method = mod_authorize,
                  .method_env = &authorize_method_env   },
-               { .name1 = "accounting",        .name2 = CF_IDENT_ANY,          .method = mod_sql_redundant,
+               { .section = SECTION_NAME("accounting", CF_IDENT_ANY),          .method = mod_sql_redundant,
                  .method_env = &accounting_method_env  },
-               { .name1 = "send",              .name2 = CF_IDENT_ANY,          .method = mod_sql_redundant,
+               { .section = SECTION_NAME("send", CF_IDENT_ANY),                .method = mod_sql_redundant,
                  .method_env = &send_method_env        },
-               MODULE_NAME_TERMINATOR
+               MODULE_BINDING_TERMINATOR
        }
 };
index c9162239e9795caa0d52c797ae1226e756af13c3..d68c28ec7fdc9ff2c88d068a288a8568f431ffa6 100644 (file)
@@ -584,9 +584,9 @@ module_rlm_t rlm_sqlcounter = {
                .bootstrap      = mod_bootstrap,
                .instantiate    = mod_instantiate,
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = CF_IDENT_ANY,        .name2 = CF_IDENT_ANY,          .method = mod_authorize,
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME(CF_IDENT_ANY, CF_IDENT_ANY),          .method = mod_authorize,
                  .method_env = &sqlcounter_call_env },
-               MODULE_NAME_TERMINATOR
+               MODULE_BINDING_TERMINATOR
        }
 };
index 5e4926827954167f557af2205fe8fdca3bc6c9b7..08d572cf702b651e791652f15afe6efdfdca47e7 100644 (file)
@@ -710,66 +710,66 @@ module_rlm_t rlm_sqlippool = {
                .config         = module_config,
                .instantiate    = mod_instantiate
        },
-       .method_names = (module_method_name_t[]){
+       .bindings = (module_method_binding_t[]){
                /*
                 *      RADIUS specific
                 */
-               { .name1 = "recv",              .name2 = "access-request",      .method = mod_alloc,
+               { .section = SECTION_NAME("recv", "access-request"),    .method = mod_alloc,
                  .method_env = &sqlippool_alloc_method_env },
-               { .name1 = "accounting",        .name2 = "start",               .method = mod_common,
+               { .section = SECTION_NAME("accounting", "start"),               .method = mod_common,
                  .method_env = &sqlippool_update_method_env },
-               { .name1 = "accounting",        .name2 = "alive",               .method = mod_common,
+               { .section = SECTION_NAME("accounting", "alive"),               .method = mod_common,
                  .method_env = &sqlippool_update_method_env },
-               { .name1 = "accounting",        .name2 = "stop",                .method = mod_common,
+               { .section = SECTION_NAME("accounting", "stop"),                .method = mod_common,
                  .method_env = &sqlippool_release_method_env },
-               { .name1 = "accounting",        .name2 = "accounting-on",       .method = mod_common,
+               { .section = SECTION_NAME("accounting", "accounting-on"),       .method = mod_common,
                  .method_env = &sqlippool_bulk_release_method_env },
-               { .name1 = "accounting",        .name2 = "accounting-off",      .method = mod_common,
+               { .section = SECTION_NAME("accounting", "accounting-off"),      .method = mod_common,
                  .method_env = &sqlippool_bulk_release_method_env },
 
                /*
                 *      DHCPv4
                 */
-               { .name1 = "recv",              .name2 = "Discover",            .method = mod_alloc,
+               { .section = SECTION_NAME("recv", "Discover"),          .method = mod_alloc,
                  .method_env = &sqlippool_alloc_method_env },
-               { .name1 = "recv",              .name2 = "Request",             .method = mod_common,
+               { .section = SECTION_NAME("recv", "Request"),           .method = mod_common,
                  .method_env = &sqlippool_update_method_env },
-               { .name1 = "recv",              .name2 = "Confirm",             .method = mod_common,
+               { .section = SECTION_NAME("recv", "Confirm"),           .method = mod_common,
                  .method_env = &sqlippool_update_method_env },
-               { .name1 = "recv",              .name2 = "Rebind",              .method = mod_common,
+               { .section = SECTION_NAME("recv", "Rebind"),            .method = mod_common,
                  .method_env = &sqlippool_update_method_env },
-               { .name1 = "recv",              .name2 = "Renew",               .method = mod_common,
+               { .section = SECTION_NAME("recv", "Renew"),             .method = mod_common,
                  .method_env = &sqlippool_update_method_env },
-               { .name1 = "recv",              .name2 = "Release",             .method = mod_common,
+               { .section = SECTION_NAME("recv", "Release"),           .method = mod_common,
                  .method_env = &sqlippool_release_method_env },
-               { .name1 = "recv",              .name2 = "Decline",             .method = mod_common,
+               { .section = SECTION_NAME("recv", "Decline"),           .method = mod_common,
                  .method_env = &sqlippool_mark_method_env },
 
                /*
                 *      Generic
                 */
-               { .name1 = "recv",              .name2 = CF_IDENT_ANY,          .method = mod_common,
+               { .section = SECTION_NAME("recv", CF_IDENT_ANY),                .method = mod_common,
                  .method_env = &sqlippool_update_method_env },
-               { .name1 = "send",              .name2 = CF_IDENT_ANY,          .method = mod_alloc,
+               { .section = SECTION_NAME("send", CF_IDENT_ANY),                .method = mod_alloc,
                  .method_env = &sqlippool_alloc_method_env },
 
                /*
                 *      Named methods matching module operations
                 */
-               { .name1 = "allocate",          .name2 = CF_IDENT_ANY,          .method = mod_alloc,
+               { .section = SECTION_NAME("allocate", CF_IDENT_ANY),            .method = mod_alloc,
                  .method_env = &sqlippool_alloc_method_env },
-               { .name1 = "update",            .name2 = CF_IDENT_ANY,          .method = mod_common,
+               { .section = SECTION_NAME("update", CF_IDENT_ANY),              .method = mod_common,
                  .method_env = &sqlippool_update_method_env },
-               { .name1 = "renew",             .name2 = CF_IDENT_ANY,          .method = mod_common,
+               { .section = SECTION_NAME("renew", CF_IDENT_ANY),               .method = mod_common,
                  .method_env = &sqlippool_update_method_env },
-               { .name1 = "release",           .name2 = CF_IDENT_ANY,          .method = mod_common,
+               { .section = SECTION_NAME("release", CF_IDENT_ANY),             .method = mod_common,
                  .method_env = &sqlippool_release_method_env },
-               { .name1 = "bulk-release",      .name2 = CF_IDENT_ANY,          .method = mod_common,
+               { .section = SECTION_NAME("bulk-release", CF_IDENT_ANY),                .method = mod_common,
                  .method_env = &sqlippool_bulk_release_method_env },
-               { .name1 = "mark",              .name2 = CF_IDENT_ANY,          .method = mod_common,
+               { .section = SECTION_NAME("mark", CF_IDENT_ANY),                .method = mod_common,
                  .method_env = &sqlippool_mark_method_env },
 
-               MODULE_NAME_TERMINATOR
+               MODULE_BINDING_TERMINATOR
        }
 
 };
index 34ad9fb064d4342bdf1058260a075cb50851e9a3..4d0f78db79fcab1b5b8af6538c08a048b5a4a732 100644 (file)
@@ -458,8 +458,8 @@ module_rlm_t rlm_stats = {
                .thread_instantiate     = mod_thread_instantiate,
                .thread_detach          = mod_thread_detach
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = CF_IDENT_ANY,        .name2 = CF_IDENT_ANY,          .method = mod_stats },
-               MODULE_NAME_TERMINATOR
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME(CF_IDENT_ANY, CF_IDENT_ANY),          .method = mod_stats },
+               MODULE_BINDING_TERMINATOR
        }
 };
index 7dfca808ff2da60cdf48618d2eee56544fe54729..9ea0f6c2f533b9dfbb3f1d7706bda4f5438a039c 100644 (file)
@@ -264,8 +264,8 @@ module_rlm_t rlm_tacacs = {
 
                .instantiate    = mod_instantiate,
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = CF_IDENT_ANY,        .name2 = CF_IDENT_ANY,  .method = mod_process },
-               MODULE_NAME_TERMINATOR
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME(CF_IDENT_ANY, CF_IDENT_ANY),  .method = mod_process },
+               MODULE_BINDING_TERMINATOR
        },
 };
index 8b889734025f192db5298fbaf1fd266bd377d326..ba3f1354ec4afca94ef9c3b92093641ce7e97706 100644 (file)
@@ -528,19 +528,19 @@ module_rlm_t rlm_test = {
                .thread_instantiate     = mod_thread_instantiate,
                .thread_detach          = mod_thread_detach
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = "authorize",         .name2 = CF_IDENT_ANY,          .method = mod_authorize },
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME("authorize", CF_IDENT_ANY),           .method = mod_authorize },
 
-               { .name1 = "recv",              .name2 = "accounting-request",  .method = mod_preacct },
-               { .name1 = "recv",              .name2 = CF_IDENT_ANY,          .method = mod_authorize },
-               { .name1 = "accounting",        .name2 = CF_IDENT_ANY,          .method = mod_accounting },
-               { .name1 = "authenticate",      .name2 = CF_IDENT_ANY,          .method = mod_authenticate },
+               { .section = SECTION_NAME("recv", "accounting-request"),        .method = mod_preacct },
+               { .section = SECTION_NAME("recv", CF_IDENT_ANY),                .method = mod_authorize },
+               { .section = SECTION_NAME("accounting", CF_IDENT_ANY),          .method = mod_accounting },
+               { .section = SECTION_NAME("authenticate", CF_IDENT_ANY),        .method = mod_authenticate },
 
-               { .name1 = "recv",              .name2 = "access-challenge",    .method = mod_return },
-               { .name1 = "name1_null",        .name2 = NULL,                  .method = mod_return },
-               { .name1 = "send",              .name2 = CF_IDENT_ANY,          .method = mod_return },
-               { .name1 = "retry",             .name2 = NULL,                  .method = mod_retry },
+               { .section = SECTION_NAME("recv", "access-challenge"),          .method = mod_return },
+               { .section = SECTION_NAME("name1_null", NULL),                  .method = mod_return },
+               { .section = SECTION_NAME("send", CF_IDENT_ANY),                .method = mod_return },
+               { .section = SECTION_NAME("retry", NULL),                       .method = mod_retry },
 
-               MODULE_NAME_TERMINATOR
+               MODULE_BINDING_TERMINATOR
        }
 };
index 8d465c466397a6c82957456fd1c604ed3c67d493..4946b442eb6bb6c2513ae181a987dc2a4646ea1f 100644 (file)
@@ -181,8 +181,8 @@ module_rlm_t rlm_totp = {
                .config         = module_config,
                .instantiate    = mod_instantiate
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = "authenticate",      .name2 = CF_IDENT_ANY,          .method = mod_authenticate,     .method_env = &method_env },
-               MODULE_NAME_TERMINATOR
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME("authenticate", CF_IDENT_ANY),                .method = mod_authenticate,     .method_env = &method_env },
+               MODULE_BINDING_TERMINATOR
        }
 };
index c31a6eec9a6d16bad191bb940a586da992606fba..a1762977dd09b7eb0c1592c519b6fe5dc303a4eb 100644 (file)
@@ -560,10 +560,10 @@ module_rlm_t rlm_unix = {
                .config         = module_config,
                .bootstrap      = mod_bootstrap
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = "recv",              .name2 = "access-request",      .method = mod_authorize },
-               { .name1 = "send",              .name2 = "accounting-response", .method = mod_accounting },     /* Backwards compatibility */
-               { .name1 = "accounting",        .name2 = CF_IDENT_ANY,          .method = mod_accounting },
-               MODULE_NAME_TERMINATOR
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME("recv", "access-request"),    .method = mod_authorize },
+               { .section = SECTION_NAME("send", "accounting-response"),       .method = mod_accounting },     /* Backwards compatibility */
+               { .section = SECTION_NAME("accounting", CF_IDENT_ANY),          .method = mod_accounting },
+               MODULE_BINDING_TERMINATOR
        }
 };
index b59086176735cf8a07c7adb34afac21239a5dfeb..969122c48f672e04805d744ab1279a0a1047e37c 100644 (file)
@@ -60,8 +60,8 @@ module_rlm_t rlm_utf8 = {
                .magic          = MODULE_MAGIC_INIT,
                .name           = "utf8"
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = CF_IDENT_ANY,        .name2 = CF_IDENT_ANY,          .method = mod_utf8_clean },
-               MODULE_NAME_TERMINATOR
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME(CF_IDENT_ANY, CF_IDENT_ANY),          .method = mod_utf8_clean },
+               MODULE_BINDING_TERMINATOR
        }
 };
index cd7a285c05c7af91b497c5ec4da9f83f1a652172..1343e422d255ff9064a2960868ee6dc3ee0702cc 100644 (file)
@@ -460,11 +460,10 @@ module_rlm_t rlm_wimax = {
                .inst_size      = sizeof(rlm_wimax_t),
                .config         = module_config,
        },
-       .dict           = &dict_radius,
-       .method_names = (module_method_name_t[]){
-               { .name1 = "recv",              .name2 = "accounting-request",  .method = mod_preacct },
-               { .name1 = "recv",              .name2 = CF_IDENT_ANY,          .method = mod_authorize },
-               { .name1 = "send",              .name2 = CF_IDENT_ANY,          .method = mod_post_auth },
-               MODULE_NAME_TERMINATOR
+       .bindings = (module_method_binding_t[]){
+               { .proto = &dict_radius,        .section = SECTION_NAME("recv", "accounting-request"),  .method = mod_preacct },
+               { .proto = &dict_radius,        .section = SECTION_NAME("recv", CF_IDENT_ANY),          .method = mod_authorize },
+               { .proto = &dict_radius,        .section = SECTION_NAME("send", CF_IDENT_ANY),          .method = mod_post_auth },
+               MODULE_BINDING_TERMINATOR
        }
 };
index 8c7d9de02bafb9d86cb77b7cbe5b88bf794cabb0..09e03f08a8626586e52afb0696ccbd665dea72e7 100644 (file)
@@ -577,11 +577,11 @@ module_rlm_t rlm_winbind = {
                .bootstrap      = mod_bootstrap,
                .detach         = mod_detach
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = "recv",              .name2 = CF_IDENT_ANY,          .method = mod_authorize,
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME("recv", CF_IDENT_ANY),                .method = mod_authorize,
                  .method_env = &winbind_autz_method_env },
-               { .name1 = "authenticate",      .name2 = CF_IDENT_ANY,          .method = mod_authenticate,
+               { .section = SECTION_NAME("authenticate", CF_IDENT_ANY),                .method = mod_authenticate,
                  .method_env = &winbind_auth_method_env },
-               MODULE_NAME_TERMINATOR
+               MODULE_BINDING_TERMINATOR
        }
 };
index 75cd09a56bc8185ebea80c40bda4c8b8606daae6..42c71a6117ad034470f11d508d11ce6e3ab3a648 100644 (file)
@@ -468,9 +468,9 @@ module_rlm_t rlm_yubikey = {
                .detach         = mod_detach,
 #endif
        },
-       .method_names = (module_method_name_t[]){
-               { .name1 = "recv",              .name2 = "access-request",      .method = mod_authorize },
-               { .name1 = "authenticate",      .name2 = CF_IDENT_ANY,          .method = mod_authenticate },
-               MODULE_NAME_TERMINATOR
+       .bindings = (module_method_binding_t[]){
+               { .section = SECTION_NAME("recv", "access-request"),    .method = mod_authorize },
+               { .section = SECTION_NAME("authenticate", CF_IDENT_ANY),                .method = mod_authenticate },
+               MODULE_BINDING_TERMINATOR
        }
 };
index 758ed62e3cad963651b12f05cef29c10211c53ee..c2b8cabf9d1562138cd5a1b5f668746c2857100d 100644 (file)
@@ -204,43 +204,35 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc
 
 static const virtual_server_compile_t compile_list[] = {
        {
-               .name1 = "recv",
-               .name2 = "Request",
+               .section = SECTION_NAME("recv", "Request"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(request),
        },
        {
-               .name1 = "send",
-               .name2 = "Reply",
+               .section = SECTION_NAME("send", "Reply"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(reply),
        },
        {                       /* we can listen for others ARP replies, too */
-               .name1 = "recv",
-               .name2 = "Reply",
+               .section = SECTION_NAME("recv", "Reply"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(recv_reply),
        },
        {
-               .name1 = "recv",
-               .name2 = "Reverse-Request",
+               .section = SECTION_NAME("recv", "Reverse-Request"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(reverse_request),
        },
-
        {
-               .name1 = "send",
-               .name2 = "Reverse-Reply",
+               .section = SECTION_NAME("send", "Reverse-Reply"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(reverse_reply),
        },
        {
-               .name1 = "send",
-               .name2 = "Do-Not-Respond",
+               .section = SECTION_NAME("send", "Do-Not-Respond"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(do_not_respond),
        },
-
        COMPILE_TERMINATOR
 };
 
index eb1b463eb94d68ade38533582bce1bc16c5e014e..1e63dbf0a51538de406cfde701fbcc1d640356ca 100644 (file)
@@ -272,14 +272,12 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc
  */
 #define SEND_RECV(_x, _y) \
        { \
-               .name1 = "recv", \
-               .name2 = _x, \
+               .section = SECTION_NAME("recv", _x), \
                .actions = &mod_actions_postauth, \
                .offset = PROCESS_CONF_OFFSET(recv_ ## _y), \
        }, \
        { \
-               .name1 = "send", \
-               .name2 = _x, \
+               .section = SECTION_NAME("send", _x), \
                .actions = &mod_actions_postauth, \
                .offset = PROCESS_CONF_OFFSET(send_ ## _y), \
        }
index f2cdd091011f0f7b4304e979f04328d3a3d54326..104d1181c94ac0a171e4b14f6587df38c8ecd62b 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <freeradius-devel/io/application.h>
 #include <freeradius-devel/server/protocol.h>
+#include <freeradius-devel/server/module_method.h>
 #include <freeradius-devel/util/dict.h>
 #include <freeradius-devel/util/debug.h>
 #include <freeradius-devel/dhcpv4/dhcpv4.h>
@@ -419,116 +420,91 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc
 
 static const virtual_server_compile_t compile_list[] = {
        {
-               .name1 = "recv",
-               .name2 = "Discover",
+               .section = SECTION_NAME("recv", "Discover"),
                .actions = &mod_actions_postauth,
 
-               .methods = (const virtual_server_method_t[]) {
-                       {
-                               .name1 = "ippool",
-                               .name2 = "allocate",
-                       },
-                       COMPILE_TERMINATOR
+               .methods = (const section_name_t *[]) {
+                       &module_method_ippool_allocate,
+                       NULL
                },
                .offset = PROCESS_CONF_OFFSET(discover),
        },
        {
-               .name1 = "send",
-               .name2 = "Offer",
+               .section = SECTION_NAME("send", "Offer"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(offer),
        },
        {
-               .name1 = "recv",
-               .name2 = "Request",
+               .section = SECTION_NAME("recv", "Request"),
                .actions = &mod_actions_postauth,
 
-               .methods = (const virtual_server_method_t[]) {
-                       {
-                               .name1 = "ippool",
-                               .name2 = "extend",
-                       },
-                       COMPILE_TERMINATOR
+               .methods = (const section_name_t *[]) {
+                       &module_method_ippool_extend,
+                       NULL
                },
                .offset = PROCESS_CONF_OFFSET(request),
        },
 
        {
-               .name1 = "send",
-               .name2 = "Ack",
+               .section = SECTION_NAME("send", "Ack"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(ack),
        },
        {
-               .name1 = "send",
-               .name2 = "NAK",
+               .section = SECTION_NAME("send", "NAK"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(nak),
        },
        {
-               .name1 = "recv",
-               .name2 = "Decline",
+               .section = SECTION_NAME("recv", "Decline"),
                .actions = &mod_actions_postauth,
 
-               .methods = (const virtual_server_method_t[]) {
-                       {
-                               .name1 = "ippool",
-                               .name2 = "mark",
-                       },
-                       COMPILE_TERMINATOR
+               .methods = (const section_name_t *[]) {
+                       &module_method_ippool_mark,
+                       NULL
                },
                .offset = PROCESS_CONF_OFFSET(decline),
        },
 
        {
-               .name1 = "recv",
-               .name2 = "Release",
+               .section = SECTION_NAME("recv", "Release"),
                .actions = &mod_actions_postauth,
 
-               .methods = (const virtual_server_method_t[]) {
-                       {
-                               .name1 = "ippool",
-                               .name2 = "release",
-                       },
-                       COMPILE_TERMINATOR
+               .methods = (const section_name_t *[]) {
+                       &module_method_ippool_release,
+                       NULL
                },
                .offset = PROCESS_CONF_OFFSET(release),
        },
        {
-               .name1 = "recv",
-               .name2 = "Inform",
+               .section = SECTION_NAME("recv", "Inform"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(inform),
        },
 
        {
-               .name1 = "recv",
-               .name2 = "Lease-Query",
+               .section = SECTION_NAME("recv", "Lease-Query"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(lease_query),
        },
        {
-               .name1 = "send",
-               .name2 = "Lease-Unassigned",
+               .section = SECTION_NAME("send", "Lease-Unassigned"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(lease_unassigned),
        },
        {
-               .name1 = "send",
-               .name2 = "Lease-Unknown",
+               .section = SECTION_NAME("send", "Lease-Unknown"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(lease_unknown),
        },
        {
-               .name1 = "send",
-               .name2 = "Lease-Active",
+               .section = SECTION_NAME("send", "Lease-Active"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(lease_active),
        },
 
        {
-               .name1 = "send",
-               .name2 = "Do-Not-Respond",
+               .section = SECTION_NAME("send", "Do-Not-Respond"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(do_not_respond),
        },
index d457766e69db7faaa5087fb9d32e9d2f5037f933..fd2117bb6f0e1b583bcfb8001e454a82ef1cd4af 100644 (file)
@@ -194,87 +194,73 @@ static conf_parser_t dhcpv6_process_config[] = {
 
 static const virtual_server_compile_t compile_list[] = {
        {
-               .name1 = "recv",
-               .name2 = "Solicit",
+               .section = SECTION_NAME("recv", "Solicit"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(recv_solicit)
        },
        {
-               .name1 = "recv",
-               .name2 = "Request",
+               .section = SECTION_NAME("recv", "Request"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(recv_request)
        },
        {
-               .name1 = "recv",
-               .name2 = "Confirm",
+               .section = SECTION_NAME("recv", "Confirm"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(recv_confirm)
        },
        {
-               .name1 = "recv",
-               .name2 = "Renew",
+               .section = SECTION_NAME("recv", "Renew"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(recv_renew)
        },
        {
-               .name1 = "recv",
-               .name2 = "Rebind",
+               .section = SECTION_NAME("recv", "Rebind"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(recv_rebind)
        },
        {
-               .name1 = "recv",
-               .name2 = "Release",
+               .section = SECTION_NAME("recv", "Release"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(recv_release)
        },
        {
-               .name1 = "recv",
-               .name2 = "Decline",
+               .section = SECTION_NAME("recv", "Decline"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(recv_decline)
        },
        {
-               .name1 = "recv",
-               .name2 = "Reconfigure",
+               .section = SECTION_NAME("recv", "Reconfigure"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(recv_reconfigure)
        },
        {
-               .name1 = "recv",
-               .name2 = "Information-Request",
+               .section = SECTION_NAME("recv", "Information-Request"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(recv_information_request)
        },
        {
-               .name1 = "recv",
-               .name2 = "Relay-Forward",
+               .section = SECTION_NAME("recv", "Relay-Forward"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(recv_relay_forward)
        },
 
        {
-               .name1 = "send",
-               .name2 = "Advertise",
+               .section = SECTION_NAME("send", "Advertise"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(send_advertise)
        },
        {
-               .name1 = "send",
-               .name2 = "Reply",
+               .section = SECTION_NAME("send", "Reply"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(send_reply)
        },
        {
-               .name1 = "send",
-               .name2 = "Relay-Reply",
+               .section = SECTION_NAME("send", "Relay-Reply"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(send_relay_reply)
        },
        {
-               .name1 = "send",
-               .name2 = "Do-Not-Respond",
+               .section = SECTION_NAME("send", "Do-Not-Respond"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(do_not_respond)
        },
index 2ea52b6f3e95e7e3437a200c78e4310b1b50dff6..95990c7207d888aacdc41dceb3c3ba4296c3d3c6 100644 (file)
@@ -130,76 +130,64 @@ typedef struct {
 
 static const virtual_server_compile_t compile_list[] = {
        {
-               .name1 = "recv",
-               .name2 = "Query",
+               .section = SECTION_NAME("recv", "Query"),
                .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(query),
        },
        {
-               .name1 = "send",
-               .name2 = "Query-Response",
+               .section = SECTION_NAME("send", "Query-Response"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(query_response),
        },
        {
-               .name1 = "recv",
-               .name2 = "Inverse-Query",
+               .section = SECTION_NAME("recv", "Inverse-Query"),
                .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(inverse_query),
        },
        {
-               .name1 = "send",
-               .name2 = "Inverse-Query-Response",
+               .section = SECTION_NAME("send", "Inverse-Query-Response"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(inverse_query_response),
        },
        {
-               .name1 = "recv",
-               .name2 = "Status",
+               .section = SECTION_NAME("recv", "Status"),
                .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(status),
        },
        {
-               .name1 = "send",
-               .name2 = "Status-Response",
+               .section = SECTION_NAME("send", "Status-Response"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(status_response),
        },
        {
-               .name1 = "recv",
-               .name2 = "Update",
+               .section = SECTION_NAME("recv", "Update"),
                .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(update),
        },
        {
-               .name1 = "send",
-               .name2 = "Update-Response",
+               .section = SECTION_NAME("send", "Update-Response"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(update_response),
        },
        {
-               .name1 = "recv",
-               .name2 = "Stateful-Operation",
+               .section = SECTION_NAME("recv", "Stateful-Operation"),
                .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(stateful_operation),
        },
        {
-               .name1 = "send",
-               .name2 = "Stateful-Operation-Response",
+               .section = SECTION_NAME("send", "Stateful-Operation-Response"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(stateful_operation_response),
        },
        {
-               .name1 = "send",
-               .name2 = "Do-Not-Respond",
+               .section = SECTION_NAME("send", "Do-Dot-Respond"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(do_not_respond),
        },
 
 #define ERROR_SECTION(_name, _number) \
        { \
-               .name1 = "error", \
-               .name2 = _name, \
+               .section = SECTION_NAME("error", _name), \
                .actions = &mod_actions_postauth, \
                .offset = PROCESS_CONF_OFFSET(rcode[_number]), \
        }
index d3422644f6cef45fe0e6fa06a0200b17ea2ca39d..f6bcf01a3ac2175b90b20bda6d9a53164a11d5a2 100644 (file)
@@ -54,14 +54,12 @@ static virtual_server_compile_t const compile_list[] = {
         *      identities.
         */
        {
-               .name1 = "recv",
-               .name2 = "Identity-Response",
+               .section = SECTION_NAME("recv", "Identity-Response"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_identity_response)
        },
        {
-               .name1 = "send",
-               .name2 = "Identity-Request",
+               .section = SECTION_NAME("send", "Identity-Request"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_common_identity_request)
        },
@@ -72,14 +70,12 @@ static virtual_server_compile_t const compile_list[] = {
         *      request/response rounds.
         */
        {
-               .name1 = "send",
-               .name2 = "AKA-Identity-Request",
+               .section = SECTION_NAME("send", "AKA-Identity-Request"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_aka_identity_request)
        },
        {
-               .name1 = "recv",
-               .name2 = "AKA-Identity-Response",
+               .section = SECTION_NAME("recv", "AKA-Identity-Response"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_aka_identity_response)
        },
@@ -88,14 +84,12 @@ static virtual_server_compile_t const compile_list[] = {
         *      Full-Authentication
         */
        {
-               .name1 = "send",
-               .name2 = "Challenge-Request",
+               .section = SECTION_NAME("send", "Challenge-Request"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_aka_challenge_request)
        },
        {
-               .name1 = "recv",
-               .name2 = "Challenge-Response",
+               .section = SECTION_NAME("recv", "Challenge-Response"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_aka_challenge_response)
        },
@@ -104,14 +98,12 @@ static virtual_server_compile_t const compile_list[] = {
         *      Fast-Re-Authentication
         */
        {
-               .name1 = "send",
-               .name2 = "Reauthentication-Request",
+               .section = SECTION_NAME("send", "Reauthentication-Request"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_common_reauthentication_request)
        },
        {
-               .name1 = "recv",
-               .name2 = "Reauthentication-Response",
+               .section = SECTION_NAME("recv", "Reauthentication-Response"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_reauthentication_response)
        },
@@ -120,20 +112,17 @@ static virtual_server_compile_t const compile_list[] = {
         *      Failures originating from the supplicant
         */
        {
-               .name1 = "recv",
-               .name2 = "Client-Error",
+               .section = SECTION_NAME("recv", "Client-Error"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_client_error)
        },
        {
-               .name1 = "recv",
-               .name2 = "Authentication-Reject",
+               .section = SECTION_NAME("recv", "Authentication-Reject"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_aka_authentication_reject)
        },
        {
-               .name1 = "recv",
-               .name2 = "Synchronization-Failure",
+               .section = SECTION_NAME("recv", "Synchronization-Failure"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_aka_synchronization_failure)
        },
@@ -142,14 +131,12 @@ static virtual_server_compile_t const compile_list[] = {
         *      Failure originating from the server
         */
        {
-               .name1 = "send",
-               .name2 = "Failure-Notification",
+               .section = SECTION_NAME("send", "Failure-Notification"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_common_failure_notification)
        },
        {
-               .name1 = "recv",
-               .name2 = "Failure-Notification-ACK",
+               .section = SECTION_NAME("recv", "Failure-Notification-ACK"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_failure_notification_ack)
        },
@@ -158,14 +145,12 @@ static virtual_server_compile_t const compile_list[] = {
         *      Protected success indication
         */
        {
-               .name1 = "send",
-               .name2 = "Success-Notification",
+               .section = SECTION_NAME("send", "Success-Notification"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_common_success_notification)
        },
        {
-               .name1 = "recv",
-               .name2 = "Success-Notification-ACK",
+               .section = SECTION_NAME("recv", "Success-Notification-ACK"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_success_notification_ack)
        },
@@ -174,14 +159,12 @@ static virtual_server_compile_t const compile_list[] = {
         *      Final EAP-Success and EAP-Failure messages
         */
        {
-               .name1 = "send",
-               .name2 = "EAP-Success",
+               .section = SECTION_NAME("send", "EAP-Success"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_eap_success)
        },
        {
-               .name1 = "send",
-               .name2 = "EAP-Failure",
+               .section = SECTION_NAME("send", "EAP-Failure"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_eap_failure)
        },
@@ -190,20 +173,17 @@ static virtual_server_compile_t const compile_list[] = {
         *      Fast-Reauth vectors
         */
        {
-               .name1 = "store",
-               .name2 = "session",
+               .section = SECTION_NAME("store", "session"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.store_session)
        },
        {
-               .name1 = "load",
-               .name2 = "session",
+               .section = SECTION_NAME("load", "session"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.load_session)
        },
        {
-               .name1 = "clear",
-               .name2 = "session",
+               .section = SECTION_NAME("clear", "session"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.clear_session)
        },
@@ -212,20 +192,17 @@ static virtual_server_compile_t const compile_list[] = {
         *      Pseudonym processing
         */
        {
-               .name1 = "store",
-               .name2 = "pseudonym",
+               .section = SECTION_NAME("store", "pseudonym"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.store_pseudonym)
        },
        {
-               .name1 = "load",
-               .name2 = "pseudonym",
+               .section = SECTION_NAME("load", "pseudonym"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.load_pseudonym)
        },
        {
-               .name1 = "clear",
-               .name2 = "pseudonym",
+               .section = SECTION_NAME("clear", "pseudonym"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.clear_pseudonym)
        },
index 949fcfc987d33863354f51efdd6a40b806b4e183..32385ac29a96a31bff23d5b7e5d31cf7543fca2b 100644 (file)
@@ -55,14 +55,12 @@ static virtual_server_compile_t const compile_list[] = {
         *      identities.
         */
        {
-               .name1 = "recv",
-               .name2 = "Identity-Response",
+               .section = SECTION_NAME("recv", "Identity-Response"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_identity_response)
        },
        {
-               .name1 = "send",
-               .name2 = "Identity-Request",
+               .section = SECTION_NAME("send", "Identity-Request"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_common_identity_request)
        },
@@ -73,14 +71,12 @@ static virtual_server_compile_t const compile_list[] = {
         *      request/response rounds.
         */
        {
-               .name1 = "send",
-               .name2 = "AKA-Identity-Request",
+               .section = SECTION_NAME("send", "AKA-Identity-Request"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_aka_identity_request)
        },
        {
-               .name1 = "recv",
-               .name2 = "AKA-Identity-Response",
+               .section = SECTION_NAME("recv", "AKA-Identity-Response"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_aka_identity_response)
        },
@@ -89,14 +85,12 @@ static virtual_server_compile_t const compile_list[] = {
         *      Full-Authentication
         */
        {
-               .name1 = "send",
-               .name2 = "Challenge-Request",
+               .section = SECTION_NAME("send", "Challenge-Request"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_aka_challenge_request)
        },
        {
-               .name1 = "recv",
-               .name2 = "Challenge-Response",
+               .section = SECTION_NAME("recv", "Challenge-Response"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_aka_challenge_response)
        },
@@ -105,14 +99,12 @@ static virtual_server_compile_t const compile_list[] = {
         *      Fast-Re-Authentication
         */
        {
-               .name1 = "send",
-               .name2 = "Reauthentication-Request",
+               .section = SECTION_NAME("send", "Reauthentication-Request"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_common_reauthentication_request)
        },
        {
-               .name1 = "recv",
-               .name2 = "Reauthentication-Response",
+               .section = SECTION_NAME("recv", "Reauthentication-Response"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_reauthentication_response)
        },
@@ -121,20 +113,17 @@ static virtual_server_compile_t const compile_list[] = {
         *      Failures originating from the supplicant
         */
        {
-               .name1 = "recv",
-               .name2 = "Client-Error",
+               .section = SECTION_NAME("recv", "Client-Error"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_client_error)
        },
        {
-               .name1 = "recv",
-               .name2 = "Authentication-Reject",
+               .section = SECTION_NAME("recv", "Authentication-Reject"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_aka_authentication_reject)
        },
        {
-               .name1 = "recv",
-               .name2 = "Synchronization-Failure",
+               .section = SECTION_NAME("recv", "Synchronization-Failure"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_aka_synchronization_failure)
        },
@@ -143,14 +132,12 @@ static virtual_server_compile_t const compile_list[] = {
         *      Failure originating from the server
         */
        {
-               .name1 = "send",
-               .name2 = "Failure-Notification",
+               .section = SECTION_NAME("send", "Failure-Notification"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_common_failure_notification)
        },
        {
-               .name1 = "recv",
-               .name2 = "Failure-Notification-ACK",
+               .section = SECTION_NAME("recv", "Failure-Notification-ACK"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_failure_notification_ack)
        },
@@ -159,14 +146,12 @@ static virtual_server_compile_t const compile_list[] = {
         *      Protected success indication
         */
        {
-               .name1 = "send",
-               .name2 = "Success-Notification",
+               .section = SECTION_NAME("send", "Success-Notification"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_common_success_notification)
        },
        {
-               .name1 = "recv",
-               .name2 = "Success-Notification-ACK",
+               .section = SECTION_NAME("recv", "Success-Notification-ACK"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_success_notification_ack)
        },
@@ -175,14 +160,12 @@ static virtual_server_compile_t const compile_list[] = {
         *      Final EAP-Success and EAP-Failure messages
         */
        {
-               .name1 = "send",
-               .name2 = "EAP-Success",
+               .section = SECTION_NAME("send", "EAP-Success"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_eap_success)
        },
        {
-               .name1 = "send",
-               .name2 = "EAP-Failure",
+               .section = SECTION_NAME("send", "EAP-Failure"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_eap_failure)
        },
@@ -191,20 +174,17 @@ static virtual_server_compile_t const compile_list[] = {
         *      Fast-Reauth vectors
         */
        {
-               .name1 = "store",
-               .name2 = "session",
+               .section = SECTION_NAME("store", "session"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.store_session)
        },
        {
-               .name1 = "load",
-               .name2 = "session",
+               .section = SECTION_NAME("load", "session"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.load_session)
        },
        {
-               .name1 = "clear",
-               .name2 = "session",
+               .section = SECTION_NAME("clear", "session"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.clear_session)
        },
@@ -213,20 +193,17 @@ static virtual_server_compile_t const compile_list[] = {
         *      Pseudonym processing
         */
        {
-               .name1 = "store",
-               .name2 = "pseudonym",
+               .section = SECTION_NAME("store", "pseudonym"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.store_pseudonym)
        },
        {
-               .name1 = "load",
-               .name2 = "pseudonym",
+               .section = SECTION_NAME("load", "pseudonym"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.load_pseudonym)
        },
        {
-               .name1 = "clear",
-               .name2 = "pseudonym",
+               .section = SECTION_NAME("clear", "pseudonym"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.clear_pseudonym)
        },
index 5f2083d0792253c9803c764a4d1fe09e6dd35776..1f920fe6ace7f57f57e6aab2d91158ec23853754 100644 (file)
@@ -54,14 +54,12 @@ static virtual_server_compile_t compile_list[] = {
         *      identities.
         */
        {
-               .name1 = "recv",
-               .name2 = "Identity-Response",
+               .section = SECTION_NAME("recv", "Identity-Response"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_identity_response)
        },
        {
-               .name1 = "send",
-               .name2 = "Identity-Request",
+               .section = SECTION_NAME("send", "Identity-Request"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_common_identity_request)
        },
@@ -72,14 +70,12 @@ static virtual_server_compile_t compile_list[] = {
         *      request/response rounds.
         */
        {
-               .name1 = "send",
-               .name2 = "Start-Request",
+               .section = SECTION_NAME("send", "Start-Request"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_sim_start_request)
        },
        {
-               .name1 = "recv",
-               .name2 = "Start-Response",
+               .section = SECTION_NAME("recv", "Start-Response"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_sim_start_response)
        },
@@ -88,14 +84,12 @@ static virtual_server_compile_t compile_list[] = {
         *      Full-Authentication
         */
        {
-               .name1 = "send",
-               .name2 = "Challenge-Request",
+               .section = SECTION_NAME("send", "Challenge-Request"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_sim_challenge_request)
        },
        {
-               .name1 = "recv",
-               .name2 = "Challenge-Response",
+               .section = SECTION_NAME("recv", "Challenge-Response"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_sim_challenge_response)
        },
@@ -104,14 +98,12 @@ static virtual_server_compile_t compile_list[] = {
         *      Fast-Re-Authentication
         */
        {
-               .name1 = "send",
-               .name2 = "Reauthentication-Request",
+               .section = SECTION_NAME("send", "Reauthentication-Request"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_common_reauthentication_request)
        },
        {
-               .name1 = "recv",
-               .name2 = "Reauthentication-Response",
+               .section = SECTION_NAME("recv", "Reauthentication-Response"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_reauthentication_response)
        },
@@ -120,8 +112,7 @@ static virtual_server_compile_t compile_list[] = {
         *      Failures originating from the supplicant
         */
        {
-               .name1 = "recv",
-               .name2 = "Client-Error",
+               .section = SECTION_NAME("recv", "Client-Error"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_client_error)
        },
@@ -130,14 +121,12 @@ static virtual_server_compile_t compile_list[] = {
         *      Failure originating from the server
         */
        {
-               .name1 = "send",
-               .name2 = "Failure-Notification",
+               .section = SECTION_NAME("send", "Failure-Notification"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_common_failure_notification)
        },
        {
-               .name1 = "recv",
-               .name2 = "Failure-Notification-ACK",
+               .section = SECTION_NAME("recv", "Failure-Notification-ACK"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_failure_notification_ack)
        },
@@ -146,14 +135,12 @@ static virtual_server_compile_t compile_list[] = {
         *      Protected success indication
         */
        {
-               .name1 = "send",
-               .name2 = "Success-Notification",
+               .section = SECTION_NAME("send", "Success-Notification"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_common_success_notification)
        },
        {
-               .name1 = "recv",
-               .name2 = "Success-Notification-ACK",
+               .section = SECTION_NAME("recv", "Success-Notification-ACK"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.recv_common_success_notification_ack)
        },
@@ -162,14 +149,12 @@ static virtual_server_compile_t compile_list[] = {
         *      Final EAP-Success and EAP-Failure messages
         */
        {
-               .name1 = "send",
-               .name2 = "EAP-Success",
+               .section = SECTION_NAME("send", "EAP-Success"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_eap_success)
        },
        {
-               .name1 = "send",
-               .name2 = "EAP-Failure",
+               .section = SECTION_NAME("send", "EAP-Failure"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.send_eap_failure)
        },
@@ -178,20 +163,17 @@ static virtual_server_compile_t compile_list[] = {
         *      Fast-Reauth vectors
         */
        {
-               .name1 = "store",
-               .name2 = "session",
+               .section = SECTION_NAME("store", "session"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.store_session)
        },
        {
-               .name1 = "load",
-               .name2 = "session",
+               .section = SECTION_NAME("load", "session"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.load_session)
        },
        {
-               .name1 = "clear",
-               .name2 = "session",
+               .section = SECTION_NAME("clear", "session"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.clear_session)
        },
@@ -200,20 +182,17 @@ static virtual_server_compile_t compile_list[] = {
         *      Pseudonym processing
         */
        {
-               .name1 = "store",
-               .name2 = "pseudonym",
+               .section = SECTION_NAME("store", "pseudonym"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.store_pseudonym)
        },
        {
-               .name1 = "load",
-               .name2 = "pseudonym",
+               .section = SECTION_NAME("load", "pseudonym"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.load_pseudonym)
        },
        {
-               .name1 = "clear",
-               .name2 = "pseudonym",
+               .section = SECTION_NAME("clear", "pseudonym"),
                .actions = &mod_actions_authorize,
                .offset = offsetof(eap_aka_sim_process_conf_t, actions.clear_pseudonym)
        },
index 0ca25aa1757f45ee836e9088b1fc01daa97e9157..9d12db58e54501b5d96b3bfef31d9e8819126705 100644 (file)
@@ -195,38 +195,32 @@ static fr_process_state_t const process_state[] = {
 
 static virtual_server_compile_t const compile_list[] = {
        {
-               .name1 = "load",
-               .name2 = "Cookie",
+               .section = SECTION_NAME("load", "Cookie"),
                .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(load_cookie)
        },
        {
-               .name1 = "store",
-               .name2 = "Cookie",
+               .section = SECTION_NAME("store", "Cookie"),
                .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(store_cookie)
        },
        {
-               .name1 = "recv",
-               .name2 = "Add",
+               .section = SECTION_NAME("recv", "Add"),
                .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(recv_add)
        },
        {
-               .name1 = "recv",
-               .name2 = "Present",
+               .section = SECTION_NAME("recv", "Present"),
                .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(recv_present)
        },
        {
-               .name1 = "recv",
-               .name2 = "Delete",
+               .section = SECTION_NAME("recv", "Delete"),
                .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(recv_delete)
        },
        {
-               .name1 = "recv",
-               .name2 = "Modify",
+               .section = SECTION_NAME("recv", "Modify"),
                .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(recv_modify)
        },
index cdea6986770d5170227f3e1f10383d8769c2136f..244f5ff36cef0f1745c2f77c1dae01ea39102602 100644 (file)
@@ -1098,104 +1098,88 @@ static fr_process_state_t const process_state[] = {
 
 static virtual_server_compile_t const compile_list[] = {
        {
-               .name1 = "recv",
-               .name2 = "Access-Request",
+               .section = SECTION_NAME("recv", "Access-Request"),
                .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(access_request),
        },
        {
-               .name1 = "send",
-               .name2 = "Access-Accept",
+               .section = SECTION_NAME("send", "Access-Accept"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(access_accept),
        },
        {
-               .name1 = "send",
-               .name2 = "Access-Challenge",
+               .section = SECTION_NAME("send", "Access-Challenge"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(access_challenge),
        },
        {
-               .name1 = "send",
-               .name2 = "Access-Reject",
+               .section = SECTION_NAME("send", "Access-Reject"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(access_reject),
        },
 
        {
-               .name1 = "recv",
-               .name2 = "Accounting-Request",
+               .section = SECTION_NAME("recv", "Accounting-Request"),
                .actions = &mod_actions_preacct,
                .offset = PROCESS_CONF_OFFSET(accounting_request),
        },
        {
-               .name1 = "send",
-               .name2 = "Accounting-Response",
+               .section = SECTION_NAME("send", "Accounting-Response"),
                .actions = &mod_actions_accounting,
                .offset = PROCESS_CONF_OFFSET(accounting_response),
        },
 
        {
-               .name1 = "recv",
-               .name2 = "Status-Server",
+               .section = SECTION_NAME("recv", "Status-Server"),
                .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(status_server),
        },
        {
-               .name1 = "recv",
-               .name2 = "CoA-Request",
+               .section = SECTION_NAME("recv", "CoA-Request"),
                .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(coa_request),
        },
        {
-               .name1 = "send",
-               .name2 = "CoA-ACK",
+               .section = SECTION_NAME("send", "CoA-ACK"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(coa_ack),
        },
        {
-               .name1 = "send",.name2 = "CoA-NAK",
+               .section = SECTION_NAME("send", "CoA-NAK"),
                .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(coa_nak),
        },
        {
-               .name1 = "recv",
-               .name2 = "Disconnect-Request",
+               .section = SECTION_NAME("recv", "Disconnect-Request"),
                .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(disconnect_request),
        },
        {
-               .name1 = "send",
-               .name2 = "Disconnect-ACK",
+               .section = SECTION_NAME("send", "Disconnect-ACK"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(disconnect_ack),
        },
        {
-               .name1 = "send",
-               .name2 = "Disconnect-NAK",
+               .section = SECTION_NAME("send", "Disconnect-NAK"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(disconnect_nak),
        },
        {
-               .name1 = "send",
-               .name2 = "Protocol-Error",
+               .section = SECTION_NAME("send", "Protocol-Error"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(protocol_error),
        },
        {
-               .name1 = "send",
-               .name2 = "Do-Not-Respond",
+               .section = SECTION_NAME("send", "Do-Not-Respond"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(do_not_respond),
        },
        {
-               .name1 = "authenticate",
-               .name2 = CF_IDENT_ANY,
+               .section = SECTION_NAME("authenticate", CF_IDENT_ANY),
                .actions = &mod_actions_authenticate
        },
        {
-               .name1 = "accounting",
-               .name2 = CF_IDENT_ANY,
+               .section = SECTION_NAME("accounting", CF_IDENT_ANY),
                .actions = &mod_actions_authenticate
        },
 
index 5992df75f798102aac849f588ec8b541e7f8310e..6f36a73888e56e8cc0d7104edff8391b818c10e6 100644 (file)
@@ -1322,101 +1322,85 @@ static virtual_server_compile_t compile_list[] = {
         *      protocol.  Pretty much everything they did was wrong.
         */
        {
-               .name1 = "recv",
-               .name2 = "Authentication-Start",
+               .section = SECTION_NAME("recv", "Authentication-Start"),
                .actions = &mod_actions_authenticate,
                .offset = PROCESS_CONF_OFFSET(auth_start),
        },
        {
-               .name1 = "send",
-               .name2 = "Authentication-Pass",
+               .section = SECTION_NAME("send", "Authentication-Pass"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(auth_pass),
        },
        {
-               .name1 = "send",
-               .name2 = "Authentication-Fail",
+               .section = SECTION_NAME("send", "Authentication-Fail"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(auth_fail),
        },
        {
-               .name1 = "send",
-               .name2 = "Authentication-GetData",
+               .section = SECTION_NAME("send", "Authentication-GetData"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(auth_getdata),
        },
        {
-               .name1 = "send",
-               .name2 = "Authentication-GetUser",
+               .section = SECTION_NAME("send", "Authentication-GetUser"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(auth_getuser),
        },
        {
-               .name1 = "send",
-               .name2 = "Authentication-GetPass",
+               .section = SECTION_NAME("send", "Authentication-GetPass"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(auth_getpass),
        },
        {
-               .name1 = "send",
-               .name2 = "Authentication-Restart",
+               .section = SECTION_NAME("send", "Authentication-Restart"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(auth_restart),
        },
        {
-               .name1 = "send",
-               .name2 = "Authentication-Error",
+               .section = SECTION_NAME("send", "Authentication-Error"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(auth_error),
        },
        {
-               .name1 = "recv",
-               .name2 = "Authentication-Continue",
+               .section = SECTION_NAME("recv", "Authentication-Continue"),
                .actions = &mod_actions_authenticate,
                .offset = PROCESS_CONF_OFFSET(auth_cont),
        },
        {
-               .name1 = "recv",
-               .name2 = "Authentication-Continue-Abort",
+               .section = SECTION_NAME("recv", "Authentication-Continue-Abort"),
                .actions = &mod_actions_authenticate,
                .offset = PROCESS_CONF_OFFSET(auth_cont_abort),
        },
 
        {
-               .name1 = "authenticate",
-               .name2 = CF_IDENT_ANY,
+               .section = SECTION_NAME("authenticate", CF_IDENT_ANY),
                .actions = &mod_actions_authenticate,
        },
 
        /* authorization */
 
        {
-               .name1 = "recv",
-               .name2 = "Authorization-Request",
+               .section = SECTION_NAME("recv", "Authorization-Request"),
                .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(autz_request),
        },
        {
-               .name1 = "send",
-               .name2 = "Authorization-Pass-Add",
+               .section = SECTION_NAME("send", "Authorization-Pass-Add"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(autz_pass_add),
        },
        {
-               .name1 = "send",
-               .name2 = "Authorization-Pass-Replace",
+               .section = SECTION_NAME("send", "Authorization-Pass-Replace"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(autz_pass_replace),
        },
        {
-               .name1 = "send",
-               .name2 = "Authorization-Fail",
+               .section = SECTION_NAME("send", "Authorization-Fail"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(autz_fail),
        },
        {
-               .name1 = "send",
-               .name2 = "Authorization-Error",
+               .section = SECTION_NAME("send", "Authorization-Error"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(autz_error),
        },
@@ -1424,33 +1408,28 @@ static virtual_server_compile_t compile_list[] = {
        /* accounting */
 
        {
-               .name1 = "recv",
-               .name2 = "Accounting-Request",
+               .section = SECTION_NAME("recv", "Accounting-Request"),
                .actions = &mod_actions_accounting,
                .offset = PROCESS_CONF_OFFSET(acct_request),
        },
        {
-               .name1 = "send",
-               .name2 = "Accounting-Success",
+               .section = SECTION_NAME("send", "Accounting-Success"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(acct_success),
        },
        {
-               .name1 = "send",
-               .name2 = "Accounting-Error",
+               .section = SECTION_NAME("send", "Accounting-Error"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(acct_error),
        },
 
        {
-               .name1 = "accounting",
-               .name2 = CF_IDENT_ANY,
+               .section = SECTION_NAME("accounting", CF_IDENT_ANY),
                .actions = &mod_actions_accounting,
        },
 
        {
-               .name1 = "send",
-               .name2 = "Do-Not-Respond",
+               .section = SECTION_NAME("send", "Do-Not-Respond"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(do_not_respond),
        },
index fc80193f053dd6de4af6da751bada6d652ce856c..f4793ccc83e38fc74cffb181ace7151704e5a616 100644 (file)
@@ -105,14 +105,12 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc
 
 static const virtual_server_compile_t compile_list[] = {
        {
-               .name1 = "recv",
-               .name2 = "Request",
+               .section = SECTION_NAME("recv", "Request"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(recv_request),
        },
        {
-               .name1 = "send",
-               .name2 = "Reply",
+               .section = SECTION_NAME("send", "Reply"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(send_reply),
        },
index e71a8acf3aee51414dbc5c5d3ae219df8a35f56d..dae4e9f1aa52c43da9b6e695203765d755ff207a 100644 (file)
@@ -152,26 +152,22 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc
 
 static const virtual_server_compile_t compile_list[] = {
        {
-               .name1 = "store",
-               .name2 = "session",
+               .section = SECTION_NAME("store", "session"),
                .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(store_session)
        },
        {
-               .name1 = "load",
-               .name2 = "session",
+               .section = SECTION_NAME("load", "session"),
                .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(load_session)
        },
        {
-               .name1 = "clear",
-               .name2 = "session",
+               .section = SECTION_NAME("clear", "session"),
                .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(clear_session)
        },
        {
-               .name1 = "verify",
-               .name2 = "certificate",
+               .section = SECTION_NAME("verify", "certificate"),
                .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(verify_certificate)
        },
index b99733249ea971835989a54a2f109681542af3b2..cb0dcbfc38de1331d02d83a20ffa17c2b63c98a1 100644 (file)
@@ -620,45 +620,38 @@ static fr_process_state_t const process_state[] = {
 
 static virtual_server_compile_t const compile_list[] = {
        {
-               .name1 = "recv",
-               .name2 = "Access-Request",
+               .section = SECTION_NAME("recv", "Access-Request"),
                .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(access_request),
        },
        {
-               .name1 = "send",
-               .name2 = "Access-Accept",
+               .section = SECTION_NAME("send", "Access-Accept"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(access_accept),
        },
        {
-               .name1 = "send",
-               .name2 = "Access-Challenge",
+               .section = SECTION_NAME("send", "Access-Challenge"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(access_challenge),
        },
        {
-               .name1 = "send",
-               .name2 = "Access-Reject",
+               .section = SECTION_NAME("send", "Access-Reject"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(access_reject),
        },
 
        {
-               .name1 = "send",
-               .name2 = "Protocol-Error",
+               .section = SECTION_NAME("send", "Protocol-Error"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(protocol_error),
        },
        {
-               .name1 = "send",
-               .name2 = "Do-Not-Respond",
+               .section = SECTION_NAME("send", "Do-Not-Respond"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(do_not_respond),
        },
        {
-               .name1 = "authenticate",
-               .name2 = CF_IDENT_ANY,
+               .section = SECTION_NAME("authenticate", CF_IDENT_ANY),
                .actions = &mod_actions_authenticate
        },
        COMPILE_TERMINATOR
index 9e767f130948174dc96b19c715fd5530df62305f..8947eee3063fef9c9ba85f85d68087aba05e02b5 100644 (file)
@@ -228,32 +228,27 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc
 
 static const virtual_server_compile_t compile_list[] = {
        {
-               .name1 = "recv",
-               .name2 = "Join-Request",
+               .section = SECTION_NAME("recv", "Join-Request"),
                .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(join_request),
        },
        {
-               .name1 = "send",
-               .name2 = "Join-Response",
+               .section = SECTION_NAME("send", "Join-Response"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(join_response),
        },
        {
-               .name1 = "recv",
-               .name2 = "Reconfirm-Request",
+               .section = SECTION_NAME("recv", "Reconfirm-Request"),
                .actions = &mod_actions_authorize,
                .offset = PROCESS_CONF_OFFSET(reconfirm_request),
        },
        {
-               .name1 = "send",
-               .name2 = "Reconfirm-Response",
+               .section = SECTION_NAME("send", "Reconfirm-Response"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(reconfirm_response),
        },
        {
-               .name1 = "send",
-               .name2 = "Do-Not-Respond",
+               .section = SECTION_NAME("send", "Do-Not-Respond"),
                .actions = &mod_actions_postauth,
                .offset = PROCESS_CONF_OFFSET(do_not_respond),
        },
index 3a02a35ea61fdf7de5b004f5dc1985e63b01220a..e4270a299eb4bf46f880fb9492e2ad8207085779 100644 (file)
@@ -1,10 +1,10 @@
-#      .method_names = (module_method_name_t[]){
-#              { .name1 = "recv",              .name2 = "Access-Challenge",    .method = mod_return },
-#              { .name1 = "name1_null",        .name2 = NULL,                  .method = mod_return },
-#              { .name1 = "send",              .name2 = CF_IDENT_ANY,          .method = mod_return },
-#              { .name1 = "retry",             .name2 = NULL,                  .method = mod_retry },
+#      .bindings = (module_method_binding_t[]){
+#              { .section = SECTION_NAME("recv", "Access-Challenge"),          .method = mod_return },
+#              { .section = SECTION_NAME("name1_null", NULL),                  .method = mod_return },
+#              { .section = SECTION_NAME("send", CF_IDENT_ANY),                .method = mod_return },
+#              { .section = SECTION_NAME("retry", NULL),                       .method = mod_retry },
 #
-#              MODULE_NAME_TERMINATOR
+#              MODULE_BINDING_TERMINATOR
 #      }
 
 noop