From: Arran Cudbard-Bell Date: Wed, 29 Jun 2022 21:57:14 +0000 (-0500) Subject: Remove component based module methods X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2579c7dd4a50211302433364f685e8c814af5eb7;p=thirdparty%2Ffreeradius-server.git Remove component based module methods This moves us fully to the name based system of looking up modules --- diff --git a/src/lib/server/module_rlm.c b/src/lib/server/module_rlm.c index ac73a926f0b..7e0685c078e 100644 --- a/src/lib/server/module_rlm.c +++ b/src/lib/server/module_rlm.c @@ -428,14 +428,13 @@ bool module_rlm_section_type_set(request_t *request, fr_dict_attr_t const *type_ * * If the module exists but the method doesn't exist, then `method` is set to NULL. */ -module_instance_t *module_rlm_by_name_and_method(module_method_t *method, rlm_components_t *component, +module_instance_t *module_rlm_by_name_and_method(module_method_t *method, UNUSED rlm_components_t *component, char const **name1, char const **name2, char const *name) { char *p, *q, *inst_name; size_t len; int j; - rlm_components_t i; module_instance_t *mi; module_method_names_t const *methods; char const *method_name1, *method_name2; @@ -580,14 +579,6 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, rlm_co } return_component: - /* - * No matching method. Just return a method - * based on the component. - */ - if (component && mrlm->methods[*component]) { - *method = mrlm->methods[*component]; - } - /* * Didn't find a matching method. Just return * the module. @@ -651,37 +642,6 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, rlm_co */ p++; q = strchr(p, '.'); - - /* - * If there's only one component, look for it in the - * "authorize", etc. list first. - */ - if (!q) { - for (i = MOD_AUTHENTICATE; i < MOD_COUNT; i++) { - if (strcmp(section_type_value[i], p) != 0) continue; - - /* - * Tell the caller which component was - * referenced, and set the method to the found - * function. - */ - if (component) { - *component = i; - if (method) *method = mrlm->methods[*component]; - } - - /* - * The string matched. Return it. Also set the - * names so that the caller gets told the method - * name being used. - */ - *name1 = name + (p - inst_name); - *name2 = NULL; - talloc_free(inst_name); - return mi; - } - } - /* * We've found the module, but it has no named methods. */ diff --git a/src/lib/server/module_rlm.h b/src/lib/server/module_rlm.h index 0f86cc4397e..6b3641139b8 100644 --- a/src/lib/server/module_rlm.h +++ b/src/lib/server/module_rlm.h @@ -35,8 +35,6 @@ extern char const *section_type_value[MOD_COUNT]; typedef struct { module_t common; //!< Common fields presented by all modules. - - module_method_t methods[MOD_COUNT]; //!< Pointers to the various section callbacks. module_method_names_t const *method_names; //!< named methods fr_dict_t const **dict; //!< pointer to local fr_dict_t* } module_rlm_t; diff --git a/src/modules/rlm_always/rlm_always.c b/src/modules/rlm_always/rlm_always.c index da193967094..fdcdcd8e725 100644 --- a/src/modules/rlm_always/rlm_always.c +++ b/src/modules/rlm_always/rlm_always.c @@ -168,11 +168,8 @@ module_rlm_t rlm_always = { .bootstrap = mod_bootstrap, .instantiate = mod_instantiate, }, - .methods = { - [MOD_AUTHENTICATE] = mod_always_return, - [MOD_AUTHORIZE] = mod_always_return, - [MOD_PREACCT] = mod_always_return, - [MOD_ACCOUNTING] = mod_always_return, - [MOD_POST_AUTH] = mod_always_return, - }, + .method_names = (module_method_names_t[]){ + { .name1 = CF_IDENT_ANY, .name2 = CF_IDENT_ANY, .method = mod_always_return }, + MODULE_NAME_TERMINATOR + } }; diff --git a/src/modules/rlm_attr_filter/rlm_attr_filter.c b/src/modules/rlm_attr_filter/rlm_attr_filter.c index 10f54784713..bf12e4f2872 100644 --- a/src/modules/rlm_attr_filter/rlm_attr_filter.c +++ b/src/modules/rlm_attr_filter/rlm_attr_filter.c @@ -376,11 +376,16 @@ module_rlm_t rlm_attr_filter = { .config = module_config, .instantiate = mod_instantiate, }, - .methods = { - [MOD_AUTHORIZE] = mod_authorize, - [MOD_PREACCT] = mod_preacct, - [MOD_ACCOUNTING] = mod_accounting, - [MOD_POST_AUTH] = mod_post_auth, - }, -}; + .method_names = (module_method_names_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 = "send", .name2 = CF_IDENT_ANY, .method = mod_post_auth }, + MODULE_NAME_TERMINATOR + } +}; diff --git a/src/modules/rlm_cache/rlm_cache.c b/src/modules/rlm_cache/rlm_cache.c index 65383f71370..9792a4db7b6 100644 --- a/src/modules/rlm_cache/rlm_cache.c +++ b/src/modules/rlm_cache/rlm_cache.c @@ -1380,19 +1380,13 @@ module_rlm_t rlm_cache = { .instantiate = mod_instantiate, .detach = mod_detach }, - .methods = { - [MOD_AUTHORIZE] = mod_cache_it, - [MOD_PREACCT] = mod_cache_it, - [MOD_ACCOUNTING] = mod_cache_it, - [MOD_POST_AUTH] = mod_cache_it - }, .method_names = (module_method_names_t[]){ - { .name1 = "status", .name2 = CF_IDENT_ANY, .method = mod_method_status }, - { .name1 = "load", .name2 = CF_IDENT_ANY, .method = mod_method_load }, - { .name1 = "store", .name2 = CF_IDENT_ANY, .method = mod_method_store }, - { .name1 = "clear", .name2 = CF_IDENT_ANY, .method = mod_method_clear }, - { .name1 = "ttl", .name2 = CF_IDENT_ANY, .method = mod_method_ttl }, - + { .name1 = "status", .name2 = CF_IDENT_ANY, .method = mod_method_status }, + { .name1 = "load", .name2 = CF_IDENT_ANY, .method = mod_method_load }, + { .name1 = "store", .name2 = CF_IDENT_ANY, .method = mod_method_store }, + { .name1 = "clear", .name2 = CF_IDENT_ANY, .method = mod_method_clear }, + { .name1 = "ttl", .name2 = CF_IDENT_ANY, .method = mod_method_ttl }, + { .name1 = CF_IDENT_ANY, .name2 = CF_IDENT_ANY, .method = mod_cache_it }, MODULE_NAME_TERMINATOR } }; diff --git a/src/modules/rlm_chap/rlm_chap.c b/src/modules/rlm_chap/rlm_chap.c index e0541bc91e3..4e08c49b33b 100644 --- a/src/modules/rlm_chap/rlm_chap.c +++ b/src/modules/rlm_chap/rlm_chap.c @@ -324,8 +324,9 @@ module_rlm_t rlm_chap = { .instantiate = mod_instantiate }, .dict = &dict_radius, - .methods = { - [MOD_AUTHENTICATE] = mod_authenticate, - [MOD_AUTHORIZE] = mod_authorize, - }, + .method_names = (module_method_names_t[]){ + { .name1 = "recv", .name2 = "access-request", .method = mod_authorize }, + { .name1 = "authenticate", .name2 = CF_IDENT_ANY, .method = mod_authenticate }, + MODULE_NAME_TERMINATOR + } }; diff --git a/src/modules/rlm_client/rlm_client.c b/src/modules/rlm_client/rlm_client.c index 7a4b431be62..ced01386567 100644 --- a/src/modules/rlm_client/rlm_client.c +++ b/src/modules/rlm_client/rlm_client.c @@ -23,6 +23,7 @@ * @copyright 2008 Alan DeKok (aland@deployingradius.com) * @copyright 2016 Arran Cudbard-Bell (a.cudbardb@freeradius.org) */ +#include "lib/server/cf_util.h" RCSID("$Id$") #include @@ -383,7 +384,8 @@ module_rlm_t rlm_client = { .onload = mod_load, .unload = mod_unload }, - .methods = { - [MOD_AUTHORIZE] = mod_authorize - }, + .method_names = (module_method_names_t[]){ + { .name1 = CF_IDENT_ANY, .name2 = CF_IDENT_ANY, .method = mod_authorize }, + MODULE_NAME_TERMINATOR + } }; diff --git a/src/modules/rlm_couchbase/rlm_couchbase.c b/src/modules/rlm_couchbase/rlm_couchbase.c index 813d02b2031..93cdd62bd95 100644 --- a/src/modules/rlm_couchbase/rlm_couchbase.c +++ b/src/modules/rlm_couchbase/rlm_couchbase.c @@ -556,8 +556,9 @@ module_rlm_t rlm_couchbase = { .instantiate = mod_instantiate, .detach = mod_detach }, - .methods = { - [MOD_AUTHORIZE] = mod_authorize, - [MOD_ACCOUNTING] = mod_accounting, - }, + .method_names = (module_method_names_t[]){ + { .name1 = "recv", .name2 = CF_IDENT_ANY, .method = mod_authorize }, + { .name1 = "accounting", .name2 = CF_IDENT_ANY, .method = mod_accounting }, + MODULE_NAME_TERMINATOR + } }; diff --git a/src/modules/rlm_csv/rlm_csv.c b/src/modules/rlm_csv/rlm_csv.c index 8ca99f9c23e..0b0d820ea4d 100644 --- a/src/modules/rlm_csv/rlm_csv.c +++ b/src/modules/rlm_csv/rlm_csv.c @@ -1062,7 +1062,6 @@ module_rlm_t rlm_csv = { }, .method_names = (module_method_names_t[]){ { .name1 = CF_IDENT_ANY, .name2 = CF_IDENT_ANY, .method = mod_process }, - MODULE_NAME_TERMINATOR } }; diff --git a/src/modules/rlm_delay/rlm_delay.c b/src/modules/rlm_delay/rlm_delay.c index 18664a4da23..53d8501396e 100644 --- a/src/modules/rlm_delay/rlm_delay.c +++ b/src/modules/rlm_delay/rlm_delay.c @@ -280,9 +280,8 @@ module_rlm_t rlm_delay = { .config = module_config, .bootstrap = mod_bootstrap }, - .methods = { - [MOD_PREACCT] = mod_delay, - [MOD_AUTHORIZE] = mod_delay, - [MOD_POST_AUTH] = mod_delay, - }, + .method_names = (module_method_names_t[]){ + { .name1 = CF_IDENT_ANY, .name2 = CF_IDENT_ANY, .method = mod_delay }, + MODULE_NAME_TERMINATOR + } }; diff --git a/src/modules/rlm_detail/rlm_detail.c b/src/modules/rlm_detail/rlm_detail.c index be5b7afabc1..0c77049dae7 100644 --- a/src/modules/rlm_detail/rlm_detail.c +++ b/src/modules/rlm_detail/rlm_detail.c @@ -465,11 +465,11 @@ module_rlm_t rlm_detail = { .config = module_config, .instantiate = mod_instantiate }, - .methods = { - [MOD_AUTHORIZE] = mod_authorize, - [MOD_PREACCT] = mod_accounting, - [MOD_ACCOUNTING] = mod_accounting, - [MOD_POST_AUTH] = mod_post_auth, - }, + .method_names = (module_method_names_t[]){ + { .name1 = "recv", .name2 = "accounting-request", .method = mod_accounting }, + { .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 + } }; - diff --git a/src/modules/rlm_dhcpv4/rlm_dhcpv4.c b/src/modules/rlm_dhcpv4/rlm_dhcpv4.c index 70712eea040..5a1ab6d777f 100644 --- a/src/modules/rlm_dhcpv4/rlm_dhcpv4.c +++ b/src/modules/rlm_dhcpv4/rlm_dhcpv4.c @@ -328,10 +328,6 @@ module_rlm_t rlm_dhcpv4 = { .thread_inst_type = "rlm_dhcpv4_thread_t", .thread_instantiate = mod_thread_instantiate }, - .methods = { - [MOD_AUTHORIZE] = mod_process, - [MOD_POST_AUTH] = mod_process, - }, .method_names = (module_method_names_t[]){ { .name1 = CF_IDENT_ANY, .name2 = CF_IDENT_ANY, .method = mod_process }, MODULE_NAME_TERMINATOR diff --git a/src/modules/rlm_digest/rlm_digest.c b/src/modules/rlm_digest/rlm_digest.c index 649aafb1976..5007ed9910e 100644 --- a/src/modules/rlm_digest/rlm_digest.c +++ b/src/modules/rlm_digest/rlm_digest.c @@ -481,8 +481,9 @@ module_rlm_t rlm_digest = { .instantiate = mod_instantiate, }, .dict = &dict_radius, - .methods = { - [MOD_AUTHENTICATE] = mod_authenticate, - [MOD_AUTHORIZE] = mod_authorize - }, + .method_names = (module_method_names_t[]){ + { .name1 = "recv", .name2 = "access-request", .method = mod_authorize }, + { .name1 = "authenticate", .name2 = CF_IDENT_ANY, .method = mod_authenticate }, + MODULE_NAME_TERMINATOR + }, }; diff --git a/src/modules/rlm_eap/rlm_eap.c b/src/modules/rlm_eap/rlm_eap.c index febe5529fd5..04c206af7a8 100644 --- a/src/modules/rlm_eap/rlm_eap.c +++ b/src/modules/rlm_eap/rlm_eap.c @@ -1198,9 +1198,10 @@ module_rlm_t rlm_eap = { .bootstrap = mod_bootstrap, .instantiate = mod_instantiate, }, - .methods = { - [MOD_AUTHENTICATE] = mod_authenticate, - [MOD_AUTHORIZE] = mod_authorize, - [MOD_POST_AUTH] = mod_post_auth - }, + .method_names = (module_method_names_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 + } }; diff --git a/src/modules/rlm_exec/rlm_exec.c b/src/modules/rlm_exec/rlm_exec.c index e22687fe14c..1da167dc20c 100644 --- a/src/modules/rlm_exec/rlm_exec.c +++ b/src/modules/rlm_exec/rlm_exec.c @@ -481,11 +481,8 @@ module_rlm_t rlm_exec = { .bootstrap = mod_bootstrap, .instantiate = mod_instantiate }, - .methods = { - [MOD_AUTHENTICATE] = mod_exec_dispatch, - [MOD_AUTHORIZE] = mod_exec_dispatch, - [MOD_PREACCT] = mod_exec_dispatch, - [MOD_ACCOUNTING] = mod_exec_dispatch, - [MOD_POST_AUTH] = mod_exec_dispatch, - }, + .method_names = (module_method_names_t[]){ + { .name1 = CF_IDENT_ANY, .name2 = CF_IDENT_ANY, .method = mod_exec_dispatch }, + MODULE_NAME_TERMINATOR + } }; diff --git a/src/modules/rlm_files/rlm_files.c b/src/modules/rlm_files/rlm_files.c index 726f4e11854..72adeab0365 100644 --- a/src/modules/rlm_files/rlm_files.c +++ b/src/modules/rlm_files/rlm_files.c @@ -679,23 +679,16 @@ module_rlm_t rlm_files = { .config = module_config, .instantiate = mod_instantiate }, - .methods = { - [MOD_AUTHENTICATE] = mod_authenticate, - [MOD_AUTHORIZE] = mod_authorize, - [MOD_PREACCT] = mod_preacct, - [MOD_POST_AUTH] = mod_post_auth - }, .method_names = (module_method_names_t[]){ /* - * Use mod_authorize for all DHCP processing - for consistent - * use of data in the file referenced by "filename" + * Hack to support old configurations */ - { .name1 = "recv", .name2 = "Discover", .method = mod_authorize }, - { .name1 = "recv", .name2 = "Request", .method = mod_authorize }, - { .name1 = "recv", .name2 = "Inform", .method = mod_authorize }, - { .name1 = "recv", .name2 = "Release", .method = mod_authorize }, - { .name1 = "recv", .name2 = "Decline", .method = mod_authorize }, + { .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 = "authenticate", .name2 = CF_IDENT_ANY, .method = mod_authenticate }, + { .name1 = "send", .name2 = CF_IDENT_ANY, .method = mod_post_auth }, MODULE_NAME_TERMINATOR } diff --git a/src/modules/rlm_imap/rlm_imap.c b/src/modules/rlm_imap/rlm_imap.c index 312662edf88..79ffb4725c4 100644 --- a/src/modules/rlm_imap/rlm_imap.c +++ b/src/modules/rlm_imap/rlm_imap.c @@ -218,7 +218,8 @@ module_rlm_t rlm_imap = { .thread_instantiate = mod_thread_instantiate, .thread_detach = mod_thread_detach, }, - .methods = { - [MOD_AUTHENTICATE] = mod_authenticate, - }, + .method_names = (module_method_names_t[]){ + { .name1 = "authenticate", .name2 = CF_IDENT_ANY, .method = mod_authenticate }, + MODULE_NAME_TERMINATOR + } }; diff --git a/src/modules/rlm_isc_dhcp/rlm_isc_dhcp.c b/src/modules/rlm_isc_dhcp/rlm_isc_dhcp.c index 6e072f03ee7..c28da76b871 100644 --- a/src/modules/rlm_isc_dhcp/rlm_isc_dhcp.c +++ b/src/modules/rlm_isc_dhcp/rlm_isc_dhcp.c @@ -2239,9 +2239,9 @@ module_rlm_t rlm_isc_dhcp = { .config = module_config, .instantiate = mod_instantiate }, - - .methods = { - [MOD_AUTHORIZE] = mod_authorize, - [MOD_POST_AUTH] = mod_post_auth, - }, + .method_names = (module_method_names_t[]){ + { .name1 = "recv", .name2 = CF_IDENT_ANY, .method = mod_authorize }, + { .name1 = "send", .name2 = CF_IDENT_ANY, .method = mod_post_auth }, + MODULE_NAME_TERMINATOR + } }; diff --git a/src/modules/rlm_krb5/rlm_krb5.c b/src/modules/rlm_krb5/rlm_krb5.c index 16cc5ef1a0c..ab8e7e9d49d 100644 --- a/src/modules/rlm_krb5/rlm_krb5.c +++ b/src/modules/rlm_krb5/rlm_krb5.c @@ -503,7 +503,8 @@ module_rlm_t rlm_krb5 = { .instantiate = mod_instantiate, .detach = mod_detach }, - .methods = { - [MOD_AUTHENTICATE] = mod_authenticate - }, + .method_names = (module_method_names_t[]){ + { .name1 = "authenticate", .name2 = CF_IDENT_ANY, .method = mod_authenticate }, + MODULE_NAME_TERMINATOR + } }; diff --git a/src/modules/rlm_ldap/rlm_ldap.c b/src/modules/rlm_ldap/rlm_ldap.c index f6ff41c6971..88e332c2a5c 100644 --- a/src/modules/rlm_ldap/rlm_ldap.c +++ b/src/modules/rlm_ldap/rlm_ldap.c @@ -2031,10 +2031,16 @@ module_rlm_t rlm_ldap = { .thread_instantiate = mod_thread_instatiate, .thread_detach = mod_thread_detach, }, - .methods = { - [MOD_AUTHENTICATE] = mod_authenticate, - [MOD_AUTHORIZE] = mod_authorize, - [MOD_ACCOUNTING] = mod_accounting, - [MOD_POST_AUTH] = mod_post_auth - }, + .method_names = (module_method_names_t[]){ + /* + * Hack to support old configurations + */ + { .name1 = "authorize", .name2 = CF_IDENT_ANY, .method = mod_authorize }, + + { .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 + } }; diff --git a/src/modules/rlm_linelog/rlm_linelog.c b/src/modules/rlm_linelog/rlm_linelog.c index d7471e89e0d..02e09c46342 100644 --- a/src/modules/rlm_linelog/rlm_linelog.c +++ b/src/modules/rlm_linelog/rlm_linelog.c @@ -800,11 +800,8 @@ module_rlm_t rlm_linelog = { .instantiate = mod_instantiate, .detach = mod_detach }, - .methods = { - [MOD_AUTHENTICATE] = mod_do_linelog, - [MOD_AUTHORIZE] = mod_do_linelog, - [MOD_PREACCT] = mod_do_linelog, - [MOD_ACCOUNTING] = mod_do_linelog, - [MOD_POST_AUTH] = mod_do_linelog, - }, + .method_names = (module_method_names_t[]){ + { .name1 = CF_IDENT_ANY, .name2 = CF_IDENT_ANY, .method = mod_do_linelog }, + MODULE_NAME_TERMINATOR + } }; diff --git a/src/modules/rlm_logintime/rlm_logintime.c b/src/modules/rlm_logintime/rlm_logintime.c index b6f907dd7d5..636608d5a86 100644 --- a/src/modules/rlm_logintime/rlm_logintime.c +++ b/src/modules/rlm_logintime/rlm_logintime.c @@ -269,8 +269,8 @@ module_rlm_t rlm_logintime = { .config = module_config, .instantiate = mod_instantiate }, - .methods = { - [MOD_AUTHORIZE] = mod_authorize, - [MOD_POST_AUTH] = mod_authorize - }, + .method_names = (module_method_names_t[]){ + { .name1 = CF_IDENT_ANY, .name2 = CF_IDENT_ANY, .method = mod_authorize }, + MODULE_NAME_TERMINATOR + } }; diff --git a/src/modules/rlm_logtee/rlm_logtee.c b/src/modules/rlm_logtee/rlm_logtee.c index ef4db27d9e1..797a9d5b6df 100644 --- a/src/modules/rlm_logtee/rlm_logtee.c +++ b/src/modules/rlm_logtee/rlm_logtee.c @@ -665,11 +665,8 @@ module_rlm_t rlm_logtee = { .instantiate = mod_instantiate, .thread_instantiate = mod_thread_instantiate, }, - .methods = { - [MOD_AUTHENTICATE] = mod_insert_logtee, - [MOD_AUTHORIZE] = mod_insert_logtee, - [MOD_PREACCT] = mod_insert_logtee, - [MOD_ACCOUNTING] = mod_insert_logtee, - [MOD_POST_AUTH] = mod_insert_logtee, - }, + .method_names = (module_method_names_t[]){ + { .name1 = CF_IDENT_ANY, .name2 = CF_IDENT_ANY, .method = mod_insert_logtee }, + MODULE_NAME_TERMINATOR + } }; diff --git a/src/modules/rlm_lua/rlm_lua.c b/src/modules/rlm_lua/rlm_lua.c index 8d274aeb30a..8a02e54e9a6 100644 --- a/src/modules/rlm_lua/rlm_lua.c +++ b/src/modules/rlm_lua/rlm_lua.c @@ -181,11 +181,17 @@ module_rlm_t rlm_lua = { .detach = mod_detach, .thread_detach = mod_thread_detach }, - .methods = { - [MOD_AUTHENTICATE] = mod_authenticate, - [MOD_AUTHORIZE] = mod_authorize, - [MOD_PREACCT] = mod_preacct, - [MOD_ACCOUNTING] = mod_accounting, - [MOD_POST_AUTH] = mod_post_auth + .method_names = (module_method_names_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 } }; diff --git a/src/modules/rlm_mruby/rlm_mruby.c b/src/modules/rlm_mruby/rlm_mruby.c index d16e9d26169..79d198f0273 100644 --- a/src/modules/rlm_mruby/rlm_mruby.c +++ b/src/modules/rlm_mruby/rlm_mruby.c @@ -517,11 +517,17 @@ module_rlm_t rlm_mruby = { .instantiate = mod_instantiate, .detach = mod_detach, }, - .methods = { - [MOD_AUTHENTICATE] = mod_authenticate, - [MOD_AUTHORIZE] = mod_authorize, - [MOD_POST_AUTH] = mod_post_auth, - [MOD_PREACCT] = mod_preacct, - [MOD_ACCOUNTING] = mod_accounting, - }, + .method_names = (module_method_names_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 + } }; diff --git a/src/modules/rlm_mschap/rlm_mschap.c b/src/modules/rlm_mschap/rlm_mschap.c index da0f58af0f6..feeb62e7edb 100644 --- a/src/modules/rlm_mschap/rlm_mschap.c +++ b/src/modules/rlm_mschap/rlm_mschap.c @@ -2313,8 +2313,9 @@ module_rlm_t rlm_mschap = { .instantiate = mod_instantiate, .detach = mod_detach }, - .methods = { - [MOD_AUTHENTICATE] = mod_authenticate, - [MOD_AUTHORIZE] = mod_authorize - }, + .method_names = (module_method_names_t[]){ + { .name1 = "recv", .name2 = CF_IDENT_ANY, .method = mod_authorize }, + { .name1 = "authenticate", .name2 = CF_IDENT_ANY, .method = mod_authenticate }, + MODULE_NAME_TERMINATOR + } }; diff --git a/src/modules/rlm_opendirectory/rlm_opendirectory.c b/src/modules/rlm_opendirectory/rlm_opendirectory.c index bb168ac7e1a..86f6a8474ae 100644 --- a/src/modules/rlm_opendirectory/rlm_opendirectory.c +++ b/src/modules/rlm_opendirectory/rlm_opendirectory.c @@ -537,8 +537,9 @@ module_rlm_t rlm_opendirectory = { .type = MODULE_TYPE_THREAD_SAFE, .instantiate = mod_instantiate }, - .methods = { - [MOD_AUTHENTICATE] = mod_authenticate, - [MOD_AUTHORIZE] = mod_authorize - }, + .method_names = (module_method_names_t[]){ + { .name1 = "recv", .name2 = CF_IDENT_ANY, .method = mod_authorize }, + { .name1 = "authenticate", .name2 = CF_IDENT_ANY, .method = mod_authenticate }, + MODULE_NAME_TERMINATOR + } }; diff --git a/src/modules/rlm_pam/rlm_pam.c b/src/modules/rlm_pam/rlm_pam.c index cd20b255654..85c5abb7961 100644 --- a/src/modules/rlm_pam/rlm_pam.c +++ b/src/modules/rlm_pam/rlm_pam.c @@ -277,8 +277,8 @@ module_rlm_t rlm_pam = { .config = module_config, .instantiate = mod_instantiate }, - .methods = { - [MOD_AUTHENTICATE] = mod_authenticate - }, + .method_names = (module_method_names_t[]){ + { .name1 = "authenticate", .name2 = CF_IDENT_ANY, .method = mod_authenticate }, + MODULE_NAME_TERMINATOR + } }; - diff --git a/src/modules/rlm_pap/rlm_pap.c b/src/modules/rlm_pap/rlm_pap.c index 102fbbb49a4..5ad3e2e57e2 100644 --- a/src/modules/rlm_pap/rlm_pap.c +++ b/src/modules/rlm_pap/rlm_pap.c @@ -1082,8 +1082,14 @@ module_rlm_t rlm_pap = { .config = module_config, .instantiate = mod_instantiate }, - .methods = { - [MOD_AUTHENTICATE] = mod_authenticate, - [MOD_AUTHORIZE] = mod_authorize - }, + .method_names = (module_method_names_t[]){ + /* + * Hack to support old configurations + */ + { .name1 = "authorize", .name2 = CF_IDENT_ANY, .method = mod_authorize }, + + { .name1 = "authenticate", .name2 = CF_IDENT_ANY, .method = mod_authenticate }, + { .name1 = CF_IDENT_ANY, .name2 = CF_IDENT_ANY, .method = mod_authorize }, + MODULE_NAME_TERMINATOR + } }; diff --git a/src/modules/rlm_passwd/rlm_passwd.c b/src/modules/rlm_passwd/rlm_passwd.c index 06ce2695e2e..7ee19cad362 100644 --- a/src/modules/rlm_passwd/rlm_passwd.c +++ b/src/modules/rlm_passwd/rlm_passwd.c @@ -618,10 +618,9 @@ module_rlm_t rlm_passwd = { .instantiate = mod_instantiate, .detach = mod_detach }, - .methods = { - [MOD_AUTHORIZE] = mod_passwd_map, - [MOD_ACCOUNTING] = mod_passwd_map, - [MOD_POST_AUTH] = mod_passwd_map, - }, + .method_names = (module_method_names_t[]){ + { .name1 = CF_IDENT_ANY, .name2 = CF_IDENT_ANY, .method = mod_passwd_map }, + MODULE_NAME_TERMINATOR + } }; #endif /* TEST */ diff --git a/src/modules/rlm_perl/rlm_perl.c b/src/modules/rlm_perl/rlm_perl.c index c4cedb4ed83..04081d754c0 100644 --- a/src/modules/rlm_perl/rlm_perl.c +++ b/src/modules/rlm_perl/rlm_perl.c @@ -1253,11 +1253,17 @@ module_rlm_t rlm_perl = { .thread_instantiate = mod_thread_instantiate, .thread_detach = mod_thread_detach, }, - .methods = { - [MOD_AUTHENTICATE] = mod_authenticate, - [MOD_AUTHORIZE] = mod_authorize, - [MOD_PREACCT] = mod_preacct, - [MOD_ACCOUNTING] = mod_accounting, - [MOD_POST_AUTH] = mod_post_auth, - }, + .method_names = (module_method_names_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 + } }; diff --git a/src/modules/rlm_python/rlm_python.c b/src/modules/rlm_python/rlm_python.c index 778c2718596..372cffc2b78 100644 --- a/src/modules/rlm_python/rlm_python.c +++ b/src/modules/rlm_python/rlm_python.c @@ -1146,11 +1146,17 @@ module_rlm_t rlm_python = { .thread_instantiate = mod_thread_instantiate, .thread_detach = mod_thread_detach }, - .methods = { - [MOD_AUTHENTICATE] = mod_authenticate, - [MOD_AUTHORIZE] = mod_authorize, - [MOD_PREACCT] = mod_preacct, - [MOD_ACCOUNTING] = mod_accounting, - [MOD_POST_AUTH] = mod_post_auth, + .method_names = (module_method_names_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 } }; diff --git a/src/modules/rlm_radius/rlm_radius.c b/src/modules/rlm_radius/rlm_radius.c index 98819eddbbc..3ed516ae27d 100644 --- a/src/modules/rlm_radius/rlm_radius.c +++ b/src/modules/rlm_radius/rlm_radius.c @@ -664,12 +664,6 @@ module_rlm_t rlm_radius = { .bootstrap = mod_bootstrap, }, - .methods = { - [MOD_PREACCT] = mod_process, - [MOD_ACCOUNTING] = mod_process, - [MOD_AUTHORIZE] = mod_process, - [MOD_AUTHENTICATE] = mod_process, - }, .method_names = (module_method_names_t[]){ { .name1 = CF_IDENT_ANY, .name2 = CF_IDENT_ANY, .method = mod_process }, MODULE_NAME_TERMINATOR diff --git a/src/modules/rlm_radutmp/rlm_radutmp.c b/src/modules/rlm_radutmp/rlm_radutmp.c index 2a43c878198..12f0069fbb4 100644 --- a/src/modules/rlm_radutmp/rlm_radutmp.c +++ b/src/modules/rlm_radutmp/rlm_radutmp.c @@ -566,8 +566,8 @@ module_rlm_t rlm_radutmp = { .inst_size = sizeof(rlm_radutmp_t), .config = module_config }, - .methods = { - [MOD_ACCOUNTING] = mod_accounting, - }, + .method_names = (module_method_names_t[]){ + { .name1 = "accounting", .name2 = CF_IDENT_ANY, .method = mod_accounting }, + MODULE_NAME_TERMINATOR + } }; - diff --git a/src/modules/rlm_redis_ippool/rlm_redis_ippool.c b/src/modules/rlm_redis_ippool/rlm_redis_ippool.c index f8f3bb6e451..58b0112e7e3 100644 --- a/src/modules/rlm_redis_ippool/rlm_redis_ippool.c +++ b/src/modules/rlm_redis_ippool/rlm_redis_ippool.c @@ -1437,17 +1437,24 @@ module_rlm_t rlm_redis_ippool = { .onload = mod_load, .instantiate = mod_instantiate }, - .methods = { - [MOD_ACCOUNTING] = mod_accounting, - [MOD_AUTHORIZE] = mod_authorize, - [MOD_POST_AUTH] = mod_post_auth, - }, - .method_names = (module_method_names_t[]) { - { .name1 = "recv", .name2 = "Request", .method = mod_request }, - { .name1 = "recv", .name2 = "Confirm", .method = mod_request }, - { .name1 = "recv", .name2 = "Renew", .method = mod_request }, - { .name1 = "recv", .name2 = "Rebind", .method = mod_request }, - { .name1 = "recv", .name2 = "Release", .method = mod_release }, + .method_names = (module_method_names_t[]){ + /* + * RADIUS specific + */ + { .name1 = "recv", .name2 = "access-request", .method = mod_authorize }, + { .name1 = "accounting", .name2 = "stop", .method = mod_release }, + + /* + * DHCPv4 + */ + { .name1 = "recv", .name2 = "release", .method = mod_release }, + + /* + * Generic + */ + { .name1 = "recv", .name2 = CF_IDENT_ANY, .method = mod_request }, + { .name1 = "accounting", .name2 = CF_IDENT_ANY, .method = mod_accounting }, + { .name1 = "send", .name2 = CF_IDENT_ANY, .method = mod_post_auth }, MODULE_NAME_TERMINATOR } }; diff --git a/src/modules/rlm_rediswho/rlm_rediswho.c b/src/modules/rlm_rediswho/rlm_rediswho.c index 6b159bb49e4..dacf70a5669 100644 --- a/src/modules/rlm_rediswho/rlm_rediswho.c +++ b/src/modules/rlm_rediswho/rlm_rediswho.c @@ -258,7 +258,8 @@ module_rlm_t rlm_rediswho = { .onload = mod_load, .instantiate = mod_instantiate }, - .methods = { - [MOD_ACCOUNTING] = mod_accounting - }, + .method_names = (module_method_names_t[]){ + { .name1 = "accounting", .name2 = CF_IDENT_ANY, .method = mod_accounting }, + MODULE_NAME_TERMINATOR + } }; diff --git a/src/modules/rlm_rest/rlm_rest.c b/src/modules/rlm_rest/rlm_rest.c index deee9f2919b..94af8d9f418 100644 --- a/src/modules/rlm_rest/rlm_rest.c +++ b/src/modules/rlm_rest/rlm_rest.c @@ -1246,10 +1246,17 @@ module_rlm_t rlm_rest = { .thread_instantiate = mod_thread_instantiate, .thread_detach = mod_thread_detach }, - .methods = { - [MOD_AUTHENTICATE] = mod_authenticate, - [MOD_AUTHORIZE] = mod_authorize, - [MOD_ACCOUNTING] = mod_accounting, - [MOD_POST_AUTH] = mod_post_auth - }, + .method_names = (module_method_names_t[]){ + /* + * Hack to support old configurations + */ + { .name1 = "authorize", .name2 = CF_IDENT_ANY, .method = mod_authorize }, + + { .name1 = "recv", .name2 = "accounting-request", .method = mod_accounting }, + { .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 + } }; diff --git a/src/modules/rlm_securid/rlm_securid.c b/src/modules/rlm_securid/rlm_securid.c index 4bb6791fdfa..636137ba933 100644 --- a/src/modules/rlm_securid/rlm_securid.c +++ b/src/modules/rlm_securid/rlm_securid.c @@ -560,7 +560,8 @@ module_rlm_t rlm_securid = { .instantiate = mod_instantiate, .detach = mod_detach }, - .methods = { - [MOD_AUTHENTICATE] = mod_authenticate - }, + .method_names = (module_method_names_t[]){ + { .name1 = "authenticate", .name2 = CF_IDENT_ANY, .method = mod_authenticate }, + MODULE_NAME_TERMINATOR + } }; diff --git a/src/modules/rlm_sigtran/rlm_sigtran.c b/src/modules/rlm_sigtran/rlm_sigtran.c index 6b5bb793404..3ca04a1e55a 100644 --- a/src/modules/rlm_sigtran/rlm_sigtran.c +++ b/src/modules/rlm_sigtran/rlm_sigtran.c @@ -435,7 +435,8 @@ module_rlm_t rlm_sigtran = { .thread_instantiate = mod_thread_instantiate, .thread_detach = mod_thread_detach }, - .methods = { - [MOD_AUTHORIZE] = mod_authorize, + .method_names = (module_method_names_t[]){ + { .name1 = CF_IDENT_ANY, .name2 = CF_IDENT_ANY, .method = mod_authorize }, + MODULE_NAME_TERMINATOR } }; diff --git a/src/modules/rlm_smtp/rlm_smtp.c b/src/modules/rlm_smtp/rlm_smtp.c index 661f1a28cf3..4a6ba85d971 100644 --- a/src/modules/rlm_smtp/rlm_smtp.c +++ b/src/modules/rlm_smtp/rlm_smtp.c @@ -1113,8 +1113,9 @@ module_rlm_t rlm_smtp = { .thread_instantiate = mod_thread_instantiate, .thread_detach = mod_thread_detach, }, - .methods = { - [MOD_AUTHENTICATE] = mod_authenticate, - [MOD_AUTHORIZE] = mod_authorize, - }, + .method_names = (module_method_names_t[]){ + { .name1 = "recv", .name2 = CF_IDENT_ANY, .method = mod_authorize }, + { .name1 = "authenticate", .name2 = CF_IDENT_ANY, .method = mod_authenticate }, + MODULE_NAME_TERMINATOR + } }; diff --git a/src/modules/rlm_soh/rlm_soh.c b/src/modules/rlm_soh/rlm_soh.c index 99d90055de9..ca3f6f4181f 100644 --- a/src/modules/rlm_soh/rlm_soh.c +++ b/src/modules/rlm_soh/rlm_soh.c @@ -303,8 +303,9 @@ module_rlm_t rlm_soh = { .unload = mod_unload, .bootstrap = mod_bootstrap }, - .methods = { - [MOD_AUTHORIZE] = mod_authorize, - [MOD_POST_AUTH] = mod_post_auth - }, + .method_names = (module_method_names_t[]){ + { .name1 = "recv", .name2 = CF_IDENT_ANY, .method = mod_authorize }, + { .name1 = "send", .name2 = CF_IDENT_ANY, .method = mod_post_auth }, + MODULE_NAME_TERMINATOR + } }; diff --git a/src/modules/rlm_sometimes/rlm_sometimes.c b/src/modules/rlm_sometimes/rlm_sometimes.c index 135a6fd6830..96a50783ee2 100644 --- a/src/modules/rlm_sometimes/rlm_sometimes.c +++ b/src/modules/rlm_sometimes/rlm_sometimes.c @@ -162,11 +162,9 @@ module_rlm_t rlm_sometimes = { .config = module_config, .instantiate = mod_instantiate }, - .methods = { - [MOD_AUTHENTICATE] = mod_sometimes_packet, - [MOD_AUTHORIZE] = mod_sometimes_packet, - [MOD_PREACCT] = mod_sometimes_packet, - [MOD_ACCOUNTING] = mod_sometimes_packet, - [MOD_POST_AUTH] = mod_sometimes_reply, - }, + .method_names = (module_method_names_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 + } }; diff --git a/src/modules/rlm_sql/rlm_sql.c b/src/modules/rlm_sql/rlm_sql.c index 48ae1c15bc8..9cab330efaf 100644 --- a/src/modules/rlm_sql/rlm_sql.c +++ b/src/modules/rlm_sql/rlm_sql.c @@ -1620,9 +1620,15 @@ module_rlm_t rlm_sql = { .instantiate = mod_instantiate, .detach = mod_detach }, - .methods = { - [MOD_AUTHORIZE] = mod_authorize, - [MOD_ACCOUNTING] = mod_accounting, - [MOD_POST_AUTH] = mod_post_auth - }, + .method_names = (module_method_names_t[]){ + /* + * Hack to support old configurations + */ + { .name1 = "authorize", .name2 = CF_IDENT_ANY, .method = mod_authorize }, + + { .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 + } }; diff --git a/src/modules/rlm_sqlcounter/rlm_sqlcounter.c b/src/modules/rlm_sqlcounter/rlm_sqlcounter.c index c68632c8d26..46eebccfe81 100644 --- a/src/modules/rlm_sqlcounter/rlm_sqlcounter.c +++ b/src/modules/rlm_sqlcounter/rlm_sqlcounter.c @@ -641,8 +641,8 @@ module_rlm_t rlm_sqlcounter = { .bootstrap = mod_bootstrap, .instantiate = mod_instantiate, }, - .methods = { - [MOD_AUTHORIZE] = mod_authorize - }, + .method_names = (module_method_names_t[]){ + { .name1 = CF_IDENT_ANY, .name2 = CF_IDENT_ANY, .method = mod_authorize}, + MODULE_NAME_TERMINATOR + } }; - diff --git a/src/modules/rlm_sqlippool/rlm_sqlippool.c b/src/modules/rlm_sqlippool/rlm_sqlippool.c index beaf70310d6..b8cd883fe15 100644 --- a/src/modules/rlm_sqlippool/rlm_sqlippool.c +++ b/src/modules/rlm_sqlippool/rlm_sqlippool.c @@ -865,24 +865,23 @@ module_rlm_t rlm_sqlippool = { .bootstrap = mod_bootstrap, .instantiate = mod_instantiate }, - .methods = { - [MOD_ACCOUNTING] = mod_accounting, - [MOD_POST_AUTH] = mod_alloc - }, .method_names = (module_method_names_t[]){ - { .name1 = "recv", .name2 = "Discover", .method = mod_alloc }, - { .name1 = "recv", .name2 = "Request", .method = mod_update }, - { .name1 = "recv", .name2 = "Confirm", .method = mod_update }, - { .name1 = "recv", .name2 = "Rebind", .method = mod_update }, - { .name1 = "recv", .name2 = "Renew", .method = mod_update }, - { .name1 = "recv", .name2 = "Release", .method = mod_release }, - { .name1 = "recv", .name2 = "Decline", .method = mod_mark }, - - { .name1 = "ippool", .name2 = "alloc", .method = mod_alloc }, - { .name1 = "ippool", .name2 = "update", .method = mod_update }, - { .name1 = "ippool", .name2 = "release", .method = mod_release }, - { .name1 = "ippool", .name2 = "bulk-release",.method = mod_bulk_release }, - { .name1 = "ippool", .name2 = "mark", .method = mod_mark }, + { .name1 = "accounting", .name2 = CF_IDENT_ANY, .method = mod_accounting }, + { .name1 = "send", .name2 = CF_IDENT_ANY, .method = mod_alloc }, + + { .name1 = "recv", .name2 = "Discover", .method = mod_alloc }, + { .name1 = "recv", .name2 = "Request", .method = mod_update }, + { .name1 = "recv", .name2 = "Confirm", .method = mod_update }, + { .name1 = "recv", .name2 = "Rebind", .method = mod_update }, + { .name1 = "recv", .name2 = "Renew", .method = mod_update }, + { .name1 = "recv", .name2 = "Release", .method = mod_release }, + { .name1 = "recv", .name2 = "Decline", .method = mod_mark }, + + { .name1 = "ippool", .name2 = "alloc", .method = mod_alloc }, + { .name1 = "ippool", .name2 = "update", .method = mod_update }, + { .name1 = "ippool", .name2 = "release", .method = mod_release }, + { .name1 = "ippool", .name2 = "bulk-release", .method = mod_bulk_release }, + { .name1 = "ippool", .name2 = "mark", .method = mod_mark }, MODULE_NAME_TERMINATOR } diff --git a/src/modules/rlm_stats/rlm_stats.c b/src/modules/rlm_stats/rlm_stats.c index fbdafef9f3c..87be64dbbed 100644 --- a/src/modules/rlm_stats/rlm_stats.c +++ b/src/modules/rlm_stats/rlm_stats.c @@ -446,9 +446,8 @@ module_rlm_t rlm_stats = { .thread_instantiate = mod_thread_instantiate, .thread_detach = mod_thread_detach }, - .methods = { - [MOD_AUTHORIZE] = mod_stats, /* @mod_stats_query */ - [MOD_POST_AUTH] = mod_stats, - [MOD_ACCOUNTING] = mod_stats, - }, + .method_names = (module_method_names_t[]){ + { .name1 = CF_IDENT_ANY, .name2 = CF_IDENT_ANY, .method = mod_stats }, + MODULE_NAME_TERMINATOR + } }; diff --git a/src/modules/rlm_test/rlm_test.c b/src/modules/rlm_test/rlm_test.c index 1469db485a7..1b3d0bd9477 100644 --- a/src/modules/rlm_test/rlm_test.c +++ b/src/modules/rlm_test/rlm_test.c @@ -519,14 +519,13 @@ module_rlm_t rlm_test = { .thread_instantiate = mod_thread_instantiate, .thread_detach = mod_thread_detach }, - .methods = { - [MOD_AUTHENTICATE] = mod_authenticate, - [MOD_AUTHORIZE] = mod_authorize, - [MOD_PREACCT] = mod_preacct, - [MOD_ACCOUNTING] = mod_accounting, - }, .method_names = (module_method_names_t[]){ - { .name1 = "recv", .name2 = "Access-Challenge", .method = mod_return }, + { .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 = "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 }, diff --git a/src/modules/rlm_totp/rlm_totp.c b/src/modules/rlm_totp/rlm_totp.c index 0c652162bb0..4a1f840c767 100644 --- a/src/modules/rlm_totp/rlm_totp.c +++ b/src/modules/rlm_totp/rlm_totp.c @@ -293,9 +293,10 @@ module_rlm_t rlm_totp = { .name = "totp", .type = MODULE_TYPE_THREAD_SAFE }, - .methods = { - [MOD_AUTHENTICATE] = mod_authenticate, - }, + .method_names = (module_method_names_t[]){ + { .name1 = "authenticate", .name2 = CF_IDENT_ANY, .method = mod_authenticate }, + MODULE_NAME_TERMINATOR + } }; #else /* TESTING */ diff --git a/src/modules/rlm_unix/rlm_unix.c b/src/modules/rlm_unix/rlm_unix.c index 8771c4d8d05..ffcc41f0141 100644 --- a/src/modules/rlm_unix/rlm_unix.c +++ b/src/modules/rlm_unix/rlm_unix.c @@ -516,8 +516,9 @@ module_rlm_t rlm_unix = { .config = module_config, .bootstrap = mod_bootstrap }, - .methods = { - [MOD_AUTHORIZE] = mod_authorize, - [MOD_ACCOUNTING] = mod_accounting - }, + .method_names = (module_method_names_t[]){ + { .name1 = "recv", .name2 = "access-request", .method = mod_authorize }, + { .name1 = "accounting", .name2 = CF_IDENT_ANY, .method = mod_accounting }, + MODULE_NAME_TERMINATOR + } }; diff --git a/src/modules/rlm_utf8/rlm_utf8.c b/src/modules/rlm_utf8/rlm_utf8.c index 87056ca4b8d..0f92f67b00a 100644 --- a/src/modules/rlm_utf8/rlm_utf8.c +++ b/src/modules/rlm_utf8/rlm_utf8.c @@ -64,8 +64,8 @@ module_rlm_t rlm_utf8 = { .name = "utf8", .type = MODULE_TYPE_THREAD_SAFE }, - .methods = { - [MOD_AUTHORIZE] = mod_utf8_clean, - [MOD_PREACCT] = mod_utf8_clean, - }, + .method_names = (module_method_names_t[]){ + { .name1 = CF_IDENT_ANY, .name2 = CF_IDENT_ANY, .method = mod_utf8_clean }, + MODULE_NAME_TERMINATOR + } }; diff --git a/src/modules/rlm_wimax/rlm_wimax.c b/src/modules/rlm_wimax/rlm_wimax.c index 5e4feb8d285..fa95b8f756f 100644 --- a/src/modules/rlm_wimax/rlm_wimax.c +++ b/src/modules/rlm_wimax/rlm_wimax.c @@ -463,9 +463,10 @@ module_rlm_t rlm_wimax = { .config = module_config, }, .dict = &dict_radius, - .methods = { - [MOD_AUTHORIZE] = mod_authorize, - [MOD_PREACCT] = mod_preacct, - [MOD_POST_AUTH] = mod_post_auth - }, + .method_names = (module_method_names_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 + } }; diff --git a/src/modules/rlm_winbind/rlm_winbind.c b/src/modules/rlm_winbind/rlm_winbind.c index 104cfbb76d5..82935620249 100644 --- a/src/modules/rlm_winbind/rlm_winbind.c +++ b/src/modules/rlm_winbind/rlm_winbind.c @@ -565,8 +565,9 @@ module_rlm_t rlm_winbind = { .bootstrap = mod_bootstrap, .detach = mod_detach }, - .methods = { - [MOD_AUTHENTICATE] = mod_authenticate, - [MOD_AUTHORIZE] = mod_authorize - }, + .method_names = (module_method_names_t[]){ + { .name1 = "recv", .name2 = CF_IDENT_ANY, .method = mod_authorize }, + { .name1 = "authenticate", .name2 = CF_IDENT_ANY, .method = mod_authenticate }, + MODULE_NAME_TERMINATOR + } }; diff --git a/src/modules/rlm_yubikey/rlm_yubikey.c b/src/modules/rlm_yubikey/rlm_yubikey.c index 5b388015307..04192f504ce 100644 --- a/src/modules/rlm_yubikey/rlm_yubikey.c +++ b/src/modules/rlm_yubikey/rlm_yubikey.c @@ -470,8 +470,9 @@ module_rlm_t rlm_yubikey = { .detach = mod_detach, #endif }, - .methods = { - [MOD_AUTHENTICATE] = mod_authenticate, - [MOD_AUTHORIZE] = mod_authorize - }, + .method_names = (module_method_names_t[]){ + { .name1 = "recv", .name2 = "access-request", .method = mod_authorize }, + { .name1 = "authenticate", .name2 = CF_IDENT_ANY, .method = mod_authenticate }, + MODULE_NAME_TERMINATOR + } };