Will allow slightly faster comparisons in some cases, and allow common module method names to be defined
map_async.c \
map_proc.c \
module.c \
+ module_method.c \
module_rlm.c \
packet.c \
paircmp.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;
#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>
*/
#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
*
* $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"
};
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
}
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;
*/
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;
* 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;
/*
* 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;
* 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;
/*
* 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;
}
}
/*
* 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;
* 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:
/*
*
* 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;
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
#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), \
}
--- /dev/null
+#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
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;
}
}
* 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;
* 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
*/
/*
* 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.");
* 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);
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);
}
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;
}
}
/** 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;
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;
}
*/
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;
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);
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.
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>
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
},
};
.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
},
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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 */
.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
}
};
.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
}
};
.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
},
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
},
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
.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
}
};
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
};
*/
#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), \
}
#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>
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),
},
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)
},
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]), \
}
* 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)
},
* 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)
},
* 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)
},
* 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)
},
* 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)
},
* 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)
},
* 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)
},
* 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)
},
* 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)
},
* 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)
},
* 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)
},
* 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)
},
* 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)
},
* 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)
},
* 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)
},
* 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)
},
* 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)
},
* 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)
},
* 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)
},
* 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)
},
* 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)
},
* 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)
},
* 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)
},
* 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)
},
* 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)
},
* 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)
},
* 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)
},
* 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)
},
* 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)
},
* 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)
},
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)
},
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
},
* 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),
},
/* 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),
},
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),
},
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)
},
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
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),
},
-# .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