*
* 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;
}
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.
*/
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.
*/
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;
.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
+ }
};
.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
+ }
+};
.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
}
};
.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
+ }
};
* @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 <freeradius-devel/server/base.h>
.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
+ }
};
.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
+ }
};
},
.method_names = (module_method_names_t[]){
{ .name1 = CF_IDENT_ANY, .name2 = CF_IDENT_ANY, .method = mod_process },
-
MODULE_NAME_TERMINATOR
}
};
.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
+ }
};
.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
+ }
};
-
.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
.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
+ },
};
.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
+ }
};
.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
+ }
};
.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
}
.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
+ }
};
.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
+ }
};
.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
+ }
};
.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
+ }
};
.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
+ }
};
.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
+ }
};
.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
+ }
};
.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
}
};
.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
+ }
};
.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
+ }
};
.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
+ }
};
.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
+ }
};
-
.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
+ }
};
.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 */
.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
+ }
};
.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
}
};
.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
.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
+ }
};
-
.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
}
};
.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
+ }
};
.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
+ }
};
.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
+ }
};
.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
}
};
.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
+ }
};
.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
+ }
};
.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
+ }
};
.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
+ }
};
.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
+ }
};
-
.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
}
.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
+ }
};
.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 },
.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 */
.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
+ }
};
.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
+ }
};
.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
+ }
};
.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
+ }
};
.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
+ }
};