*
*/
typedef struct {
- DL_MODULE_COMMON; //!< Common fields to all loadable modules.
- FR_MODULE_COMMON; //!< Common fields for all instantiated modules.
- FR_MODULE_THREADED_COMMON; //!< Common fields for threaded modules.
+ module_t common; //!< Common fields provided by all modules.
eap_type_t provides[MAX_PROVIDED_METHODS]; //!< Allow the module to register itself for more
///< than one EAP-Method.
fr_app_io_t fr_master_app_io = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "radius_master_io",
.bootstrap = mod_bootstrap,
/** Stop people using different module/library/server versions together
*
*/
-#define RLM_MODULE_INIT RADIUSD_MAGIC_NUMBER
+#define MODULE_MAGIC_INIT RADIUSD_MAGIC_NUMBER
typedef enum {
DL_MODULE_TYPE_MODULE = 0, //!< Standard loadable module.
*
* If it isn't, we create a mutex.
*/
- if ((mi->module->type & RLM_TYPE_THREAD_UNSAFE) != 0) {
+ if ((mi->module->type & MODULE_TYPE_THREAD_UNSAFE) != 0) {
mi->mutex = talloc_zero(mi, pthread_mutex_t);
/*
typedef struct module_instance_s module_instance_t;
typedef struct module_thread_instance_s module_thread_instance_t;
-#define RLM_TYPE_THREAD_SAFE (0 << 0) //!< Module is threadsafe.
-#define RLM_TYPE_THREAD_UNSAFE (1 << 0) //!< Module is not threadsafe.
- //!< Server will protect calls
- //!< with mutex.
-#define RLM_TYPE_RESUMABLE (1 << 2) //!< does yield / resume
+#define MODULE_TYPE_THREAD_SAFE (0 << 0) //!< Module is threadsafe.
+#define MODULE_TYPE_THREAD_UNSAFE (1 << 0) //!< Module is not threadsafe.
+ //!< Server will protect calls
+ //!< with mutex.
+#define MODULE_TYPE_RESUMABLE (1 << 2) //!< does yield / resume
-#define RLM_TYPE_RETRY (1 << 3) //!< can handle retries
+#define MODULE_TYPE_RETRY (1 << 3) //!< can handle retries
/** Module section callback
*
*/
typedef int (*module_thread_detach_t)(module_thread_inst_ctx_t const *mctx);
-#define FR_MODULE_COMMON \
- struct { \
- module_instantiate_t bootstrap; \
- module_instantiate_t instantiate; \
- int type; /* flags */ \
- }
-
-/** Common fields for the interface struct modules export
- *
- */
-#define FR_MODULE_THREADED_COMMON \
- struct { \
- module_thread_instantiate_t thread_instantiate; \
- module_thread_detach_t thread_detach; \
- char const *thread_inst_type; \
- size_t thread_inst_size; \
- }
-
#ifdef __cplusplus
}
#endif
extern "C" {
#endif
-/** Common fields for submodules
- *
- * This should either be the first field in the structure exported from
- * the submodule or the submodule should export an identical set of fields
- * in the same order, preferably using the macros above.
- */
-struct submodule_s {
- DL_MODULE_COMMON; //!< Common fields for all loadable modules.
- FR_MODULE_COMMON; //!< Common fields for all instantiated modules.
- FR_MODULE_THREADED_COMMON; //!< Common fields for threaded modules.
-};
-
/** Named methods exported by a module
*
*/
* within the module to different sections.
*/
struct module_s {
- DL_MODULE_COMMON; //!< Common fields for all loadable modules.
- FR_MODULE_COMMON; //!< Common fields for all instantiated modules.
- FR_MODULE_THREADED_COMMON; //!< Common fields for threaded modules.
-
- module_method_t methods[MOD_COUNT]; //!< Pointers to the various section callbacks.
- module_method_names_t const *method_names; //!< named methods
- fr_dict_t const **dict; //!< pointer to local fr_dict_t*
+ DL_MODULE_COMMON; //!< Common fields for all loadable modules.
+
+ module_instantiate_t bootstrap;
+ module_instantiate_t instantiate;
+ int type; /* flags */
+ module_thread_instantiate_t thread_instantiate;
+ module_thread_detach_t thread_detach;
+ char const *thread_inst_type;
+ size_t thread_inst_size;
};
/** Per instance data
module_instance_t *mi;
module_method_names_t const *methods;
char const *method_name1, *method_name2;
+ module_rlm_t const *mrlm;
if (method) *method = NULL;
*/
mi = module_by_name(NULL, name);
if (mi) {
- virtual_server_method_t const *allowed_list;
+ virtual_server_method_t const *allowed_list;
if (!method) return mi;
+ mrlm = module_rlm_from_module(mi->module);
+
/*
* We're not searching for a named method, OR the
* module has no named methods. Try to return a
* method based on the component.
*/
- if (!method_name1 || !mi->module->method_names) goto return_component;
+ if (!method_name1 || !mrlm->method_names) goto return_component;
/*
* Walk through the module, finding a matching
* method.
*/
- for (j = 0; mi->module->method_names[j].name1 != NULL; j++) {
- methods = &mi->module->method_names[j];
+ for (j = 0; mrlm->method_names[j].name1 != NULL; j++) {
+ methods = &mrlm->method_names[j];
/*
* Wildcard match name1, we're
int k;
virtual_server_method_t const *allowed = &allowed_list[j];
- for (k = 0; mi->module->method_names[k].name1 != NULL; k++) {
- methods = &mi->module->method_names[k];
+ for (k = 0; mrlm->method_names[k].name1 != NULL; k++) {
+ methods = &mrlm->method_names[k];
fr_assert(methods->name1 != CF_IDENT_ANY); /* should have been caught above */
* No matching method. Just return a method
* based on the component.
*/
- if (component && mi->module->methods[*component]) {
- *method = mi->module->methods[*component];
+ if (component && mrlm->methods[*component]) {
+ *method = mrlm->methods[*component];
}
/*
return NULL;
}
+ mrlm = module_rlm_from_module(mi->module);
+
/*
* We have a module, but the caller doesn't care about
* method or names, so just return the module.
*/
if (component) {
*component = i;
- if (method) *method = mi->module->methods[*component];
+ if (method) *method = mrlm->methods[*component];
}
/*
/*
* We've found the module, but it has no named methods.
*/
- if (!mi->module->method_names) {
+ if (!mrlm->method_names) {
*name1 = name + (p - inst_name);
*name2 = NULL;
talloc_free(inst_name);
* matches anything else.
*/
if (!q) {
- for (j = 0; mi->module->method_names[j].name1 != NULL; j++) {
- methods = &mi->module->method_names[j];
+ for (j = 0; mrlm->method_names[j].name1 != NULL; j++) {
+ methods = &mrlm->method_names[j];
/*
* If we do not have the second $method, then ignore it!
*
* Loop over the method names, seeing if we have a match.
*/
- for (j = 0; mi->module->method_names[j].name1 != NULL; j++) {
- methods = &mi->module->method_names[j];
+ for (j = 0; mrlm->method_names[j].name1 != NULL; j++) {
+ methods = &mrlm->method_names[j];
/*
* If name1 doesn't match, skip it.
* Compile the default "actions" subsection, which includes retries.
*/
actions = cf_section_find(subcs, "actions", NULL);
- if (actions && unlang_compile_actions(&mi->actions, actions, (mi->module->type & RLM_TYPE_RETRY) != 0)) {
+ if (actions && unlang_compile_actions(&mi->actions, actions, (mi->module->type & MODULE_TYPE_RETRY) != 0)) {
talloc_free(mi);
return -1;
}
extern char const *section_type_value[MOD_COUNT];
+typedef struct {
+ module_t common; //!< Common fields presented by all modules.
+
+ module_method_t methods[MOD_COUNT]; //!< Pointers to the various section callbacks.
+ module_method_names_t const *method_names; //!< named methods
+ fr_dict_t const **dict; //!< pointer to local fr_dict_t*
+} module_rlm_t;
+
+/** Cast a module_t to a module_rlm_t
+ *
+ */
+static inline module_rlm_t const *module_rlm_from_module(module_t const *module)
+{
+ return (module_rlm_t const *)module;
+}
+
/** @name Convenience wrappers around other internal APIs to make them easier to instantiate with modules
*
* @{
*/
typedef struct fr_process_module_s {
DL_MODULE_COMMON; //!< Common fields for all loadable modules.
- FR_MODULE_COMMON; //!< bootstrap, instantiate
+ module_instantiate_t bootstrap;
+ module_instantiate_t instantiate;
+ int type; /* flags */
module_method_t process; //!< Process packets
virtual_server_compile_t const *compile_list; //!< list of processing sections
CONF_ITEM *ci, module_instance_t *inst, module_method_t method,
char const *realname)
{
+ module_rlm_t const *mrlm = module_rlm_from_module(inst->module);
unlang_t *c;
unlang_module_t *single;
/*
* Can't use "chap" in "dhcp".
*/
- if (inst->module->dict && *inst->module->dict && unlang_ctx->rules && unlang_ctx->rules->attr.dict_def &&
+ if (mrlm->dict && *mrlm->dict && unlang_ctx->rules && unlang_ctx->rules->attr.dict_def &&
(unlang_ctx->rules->attr.dict_def != fr_dict_internal()) &&
- (*(inst->module->dict) != unlang_ctx->rules->attr.dict_def)) {
+ (*(mrlm->dict) != unlang_ctx->rules->attr.dict_def)) {
cf_log_err(ci, "The \"%s\" module can only used with 'namespace = %s'. It cannot be used with 'namespace = %s'.",
inst->module->name,
- fr_dict_root(*inst->module->dict)->name,
+ fr_dict_root(*mrlm->dict)->name,
fr_dict_root(unlang_ctx->rules->attr.dict_def)->name);
return NULL;
}
*/
if (cf_item_is_section(ci) &&
!unlang_compile_actions(&c->actions, cf_item_to_section(ci),
- (inst->module->type & RLM_TYPE_RETRY) != 0)) {
+ (inst->module->type & MODULE_TYPE_RETRY) != 0)) {
talloc_free(c);
return NULL;
}
*/
UPDATE_CTX2;
inst = module_rlm_by_name_and_method(&method, &unlang_ctx2.component,
- &unlang_ctx2.section_name1, &unlang_ctx2.section_name2,
- realname);
+ &unlang_ctx2.section_name1, &unlang_ctx2.section_name2,
+ realname);
if (inst) {
c = compile_module(parent, &unlang_ctx2, ci, inst, method, realname);
goto allocate_number;
}
fr_app_t proto_arp = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "arp",
.config = proto_arp_config,
.inst_size = sizeof(proto_arp_t),
fr_app_io_t proto_arp_ethernet = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "arp_ethernet",
.config = arp_listen_config,
.inst_size = sizeof(proto_arp_ethernet_t),
}
fr_app_t proto_control = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "control",
.config = proto_control_config,
.inst_size = sizeof(proto_control_t),
extern fr_app_io_t proto_control_unix;
fr_app_io_t proto_control_unix = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "control_unix",
.config = unix_listen_config,
.inst_size = sizeof(proto_control_unix_t),
fr_app_t proto_cron = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "cron",
.config = proto_cron_config,
.inst_size = sizeof(proto_cron_t),
}
fr_app_io_t proto_cron_crontab = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "cron_crontab",
.config = crontab_listen_config,
.inst_size = sizeof(proto_cron_crontab_t),
fr_app_t proto_detail = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "detail",
.config = proto_detail_config,
.inst_size = sizeof(proto_detail_t),
*/
extern fr_app_io_t proto_detail_file;
fr_app_io_t proto_detail_file = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "detail_file",
.config = file_listen_config,
.inst_size = sizeof(proto_detail_file_t),
*/
extern fr_app_io_t proto_detail_work;
fr_app_io_t proto_detail_work = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "detail_work",
.config = file_listen_config,
.inst_size = sizeof(proto_detail_work_t),
}
fr_app_t proto_dhcpv4 = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "dhcpv4",
.config = proto_dhcpv4_config,
.inst_size = sizeof(proto_dhcpv4_t),
}
fr_app_io_t proto_dhcpv4_udp = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "dhcpv4_udp",
.config = udp_listen_config,
.inst_size = sizeof(proto_dhcpv4_udp_t),
}
fr_app_t proto_dhcpv6 = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "dhcpv6",
.config = proto_dhcpv6_config,
.inst_size = sizeof(proto_dhcpv6_t),
}
fr_app_io_t proto_dhcpv6_udp = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "dhcpv6_udp",
.config = udp_listen_config,
.inst_size = sizeof(proto_dhcpv6_udp_t),
}
fr_app_t proto_dns = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "dns",
.config = proto_dns_config,
.inst_size = sizeof(proto_dns_t),
}
fr_app_io_t proto_dns_udp = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "dns_udp",
.config = udp_listen_config,
.inst_size = sizeof(proto_dns_udp_t),
fr_app_t proto_load = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "load",
.config = proto_load_config,
.inst_size = sizeof(proto_load_t),
}
fr_app_io_t proto_load_step = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "load_step",
.config = load_listen_config,
.inst_size = sizeof(proto_load_step_t),
}
fr_app_t proto_radius = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "radius",
.config = proto_radius_config,
.inst_size = sizeof(proto_radius_t),
}
fr_app_io_t proto_radius_tcp = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "radius_tcp",
.config = tcp_listen_config,
.inst_size = sizeof(proto_radius_tcp_t),
}
fr_app_io_t proto_radius_udp = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "radius_udp",
.config = udp_listen_config,
.inst_size = sizeof(proto_radius_udp_t),
}
fr_app_t proto_tacacs = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "tacacs",
.config = proto_tacacs_config,
.inst_size = sizeof(proto_tacacs_t),
}
fr_app_io_t proto_tacacs_tcp = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "tacacs_tcp",
.config = tcp_listen_config,
.inst_size = sizeof(proto_tacacs_tcp_t),
}
fr_app_t proto_vmps = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "vmps",
.config = proto_vmps_config,
.inst_size = sizeof(proto_vmps_t),
}
fr_app_io_t proto_vmps_udp = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "vmps_udp",
.config = udp_listen_config,
.inst_size = sizeof(proto_vmps_udp_t),
extern rad_protocol_t proto_bfd;
rad_protocol_t proto_bfd = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "bfd",
.inst_size = sizeof(bfd_socket_t),
.transports = TRANSPORT_UDP,
extern rad_protocol_t proto_ldap_sync;
rad_protocol_t proto_ldap_sync = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "ldap_sync",
.inst_size = sizeof(proto_ldap_inst_t),
.transports = TRANSPORT_NONE,
RETURN_MODULE_RCODE(inst->rcode);
}
-extern module_t rlm_always;
-module_t rlm_always = {
- .magic = RLM_MODULE_INIT,
- .name = "always",
- .inst_size = sizeof(rlm_always_t),
- .config = module_config,
- .bootstrap = mod_bootstrap,
- .instantiate = mod_instantiate,
+extern module_rlm_t rlm_always;
+module_rlm_t rlm_always = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "always",
+ .inst_size = sizeof(rlm_always_t),
+ .config = module_config,
+ .bootstrap = mod_bootstrap,
+ .instantiate = mod_instantiate,
+ },
.methods = {
[MOD_AUTHENTICATE] = mod_always_return,
[MOD_AUTHORIZE] = mod_always_return,
RLM_AF_FUNC(accounting, reply, reply)
/* globally exported name */
-extern module_t rlm_attr_filter;
-module_t rlm_attr_filter = {
- .magic = RLM_MODULE_INIT,
- .name = "attr_filter",
- .inst_size = sizeof(rlm_attr_filter_t),
- .config = module_config,
- .instantiate = mod_instantiate,
+extern module_rlm_t rlm_attr_filter;
+module_rlm_t rlm_attr_filter = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "attr_filter",
+ .inst_size = sizeof(rlm_attr_filter_t),
+ .config = module_config,
+ .instantiate = mod_instantiate,
+ },
.methods = {
[MOD_AUTHORIZE] = mod_authorize,
[MOD_PREACCT] = mod_preacct,
extern rlm_cache_driver_t rlm_cache_memcached;
rlm_cache_driver_t rlm_cache_memcached = {
- .name = "rlm_cache_memcached",
- .magic = RLM_MODULE_INIT,
- .inst_size = sizeof(rlm_cache_memcached_t),
- .config = driver_config,
-
- .onload = mod_load,
- .instantiate = mod_instantiate,
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "rlm_cache_memcached",
+ .inst_size = sizeof(rlm_cache_memcached_t),
+ .config = driver_config,
+
+ .onload = mod_load,
+ .instantiate = mod_instantiate
+ },
.free = cache_entry_free,
extern rlm_cache_driver_t rlm_cache_rbtree;
rlm_cache_driver_t rlm_cache_rbtree = {
- .name = "rlm_cache_rbtree",
- .magic = RLM_MODULE_INIT,
- .instantiate = mod_instantiate,
- .detach = mod_detach,
- .inst_size = sizeof(rlm_cache_rbtree_t),
- .inst_type = "rlm_cache_rbtree_t",
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "rlm_cache_rbtree",
+ .instantiate = mod_instantiate,
+ .detach = mod_detach,
+ .inst_size = sizeof(rlm_cache_rbtree_t),
+ .inst_type = "rlm_cache_rbtree_t",
+ },
.alloc = cache_entry_alloc,
.find = cache_entry_find,
extern rlm_cache_driver_t rlm_cache_redis;
rlm_cache_driver_t rlm_cache_redis = {
- .name = "rlm_cache_redis",
- .magic = RLM_MODULE_INIT,
- .onload = mod_load,
- .instantiate = mod_instantiate,
- .inst_size = sizeof(rlm_cache_redis_t),
- .config = driver_config,
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "rlm_cache_redis",
+ .onload = mod_load,
+ .instantiate = mod_instantiate,
+ .inst_size = sizeof(rlm_cache_redis_t),
+ .config = driver_config,
+ },
.free = cache_entry_free,
-
.find = cache_entry_find,
.insert = cache_entry_insert,
.expire = cache_entry_expire,
#include "rlm_cache.h"
-extern module_t rlm_cache;
+extern module_rlm_t rlm_cache;
static const CONF_PARSER module_config[] = {
{ FR_CONF_OFFSET("driver", FR_TYPE_STRING, rlm_cache_config_t, driver_name), .dflt = "rlm_cache_rbtree" },
/*
* Non optional fields and callbacks
*/
- fr_assert(inst->driver->name);
+ fr_assert(inst->driver->common.name);
fr_assert(inst->driver->find);
fr_assert(inst->driver->insert);
fr_assert(inst->driver->expire);
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-module_t rlm_cache = {
- .magic = RLM_MODULE_INIT,
- .name = "cache",
- .inst_size = sizeof(rlm_cache_t),
- .config = module_config,
- .bootstrap = mod_bootstrap,
- .instantiate = mod_instantiate,
- .detach = mod_detach,
+module_rlm_t rlm_cache = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "cache",
+ .inst_size = sizeof(rlm_cache_t),
+ .config = module_config,
+ .bootstrap = mod_bootstrap,
+ .instantiate = mod_instantiate,
+ .detach = mod_detach
+ },
.methods = {
[MOD_AUTHORIZE] = mod_cache_it,
[MOD_PREACCT] = mod_cache_it,
void *instance, request_t *request);
struct rlm_cache_driver_s {
- DL_MODULE_COMMON; //!< Common fields for all loadable modules.
- FR_MODULE_COMMON; //!< Common fields for all instantiated modules.
- FR_MODULE_THREADED_COMMON; //!< Common fields for threaded modules.
+ module_t common; //!< Common fields for all loadable modules.
cache_entry_alloc_t alloc; //!< (optional) Allocate a new entry.
cache_entry_free_t free; //!< (optional) Free memory used by an entry.
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_chap;
-module_t rlm_chap = {
- .magic = RLM_MODULE_INIT,
- .name = "chap",
- .inst_size = sizeof(rlm_chap_t),
- .onload = mod_load,
- .unload = mod_unload,
- .instantiate = mod_instantiate,
+extern module_rlm_t rlm_chap;
+module_rlm_t rlm_chap = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "chap",
+ .inst_size = sizeof(rlm_chap_t),
+ .onload = mod_load,
+ .unload = mod_unload,
+ .instantiate = mod_instantiate
+ },
.dict = &dict_radius,
.methods = {
[MOD_AUTHENTICATE] = mod_authenticate,
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_cipher;
-module_t rlm_cipher = {
- .magic = RLM_MODULE_INIT,
- .name = "cipher",
- .type = RLM_TYPE_THREAD_SAFE,
- .inst_size = sizeof(rlm_cipher_t),
- .thread_inst_size = sizeof(rlm_cipher_rsa_thread_inst_t),
- .config = module_config,
- .bootstrap = mod_bootstrap,
- .thread_instantiate = mod_thread_instantiate,
+extern module_rlm_t rlm_cipher;
+module_rlm_t rlm_cipher = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "cipher",
+ .type = MODULE_TYPE_THREAD_SAFE,
+ .inst_size = sizeof(rlm_cipher_t),
+ .thread_inst_size = sizeof(rlm_cipher_rsa_thread_inst_t),
+ .config = module_config,
+ .bootstrap = mod_bootstrap,
+ .thread_instantiate = mod_thread_instantiate
+ }
};
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_client;
-module_t rlm_client = {
- .magic = RLM_MODULE_INIT,
- .name = "dynamic_clients",
- .type = RLM_TYPE_THREAD_SAFE, /* type */
- .onload = mod_load,
- .unload = mod_unload,
+extern module_rlm_t rlm_client;
+module_rlm_t rlm_client = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "dynamic_clients",
+ .type = MODULE_TYPE_THREAD_SAFE, /* type */
+ .onload = mod_load,
+ .unload = mod_unload
+ },
.methods = {
[MOD_AUTHORIZE] = mod_authorize
},
/*
* Hook into the FreeRADIUS module system.
*/
-extern module_t rlm_couchbase;
-module_t rlm_couchbase = {
- .magic = RLM_MODULE_INIT,
- .name = "couchbase",
- .type = RLM_TYPE_THREAD_SAFE,
- .inst_size = sizeof(rlm_couchbase_t),
- .config = module_config,
- .onload = mod_load,
- .instantiate = mod_instantiate,
- .detach = mod_detach,
+extern module_rlm_t rlm_couchbase;
+module_rlm_t rlm_couchbase = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "couchbase",
+ .type = MODULE_TYPE_THREAD_SAFE,
+ .inst_size = sizeof(rlm_couchbase_t),
+ .config = module_config,
+ .onload = mod_load,
+ .instantiate = mod_instantiate,
+ .detach = mod_detach
+ }
.methods = {
[MOD_AUTHORIZE] = mod_authorize,
[MOD_ACCOUNTING] = mod_accounting,
RETURN_MODULE_RCODE(rcode);
}
-extern module_t rlm_csv;
-module_t rlm_csv = {
- .magic = RLM_MODULE_INIT,
- .name = "csv",
- .type = 0,
- .inst_size = sizeof(rlm_csv_t),
- .config = module_config,
- .bootstrap = mod_bootstrap,
- .instantiate = mod_instantiate,
-
+extern module_rlm_t rlm_csv;
+module_rlm_t rlm_csv = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "csv",
+ .type = 0,
+ .inst_size = sizeof(rlm_csv_t),
+ .config = module_config,
+ .bootstrap = mod_bootstrap,
+ .instantiate = mod_instantiate,
+ },
.method_names = (module_method_names_t[]){
{ .name1 = CF_IDENT_ANY, .name2 = CF_IDENT_ANY, .method = mod_process },
return 0;
}
-extern module_t rlm_date;
-module_t rlm_date = {
- .magic = RLM_MODULE_INIT,
- .name = "date",
- .inst_size = sizeof(rlm_date_t),
- .config = module_config,
- .bootstrap = mod_bootstrap
+extern module_rlm_t rlm_date;
+module_rlm_t rlm_date = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "date",
+ .inst_size = sizeof(rlm_date_t),
+ .config = module_config,
+ .bootstrap = mod_bootstrap
+ }
};
return 0;
}
-extern module_t rlm_delay;
-module_t rlm_delay = {
- .magic = RLM_MODULE_INIT,
- .name = "delay",
- .type = 0,
- .inst_size = sizeof(rlm_delay_t),
- .config = module_config,
- .bootstrap = mod_bootstrap,
+extern module_rlm_t rlm_delay;
+module_rlm_t rlm_delay = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "delay",
+ .type = 0,
+ .inst_size = sizeof(rlm_delay_t),
+ .config = module_config,
+ .bootstrap = mod_bootstrap
+ },
.methods = {
[MOD_PREACCT] = mod_delay,
[MOD_AUTHORIZE] = mod_delay,
/* globally exported name */
-extern module_t rlm_detail;
-module_t rlm_detail = {
- .magic = RLM_MODULE_INIT,
- .name = "detail",
- .inst_size = sizeof(rlm_detail_t),
- .config = module_config,
- .instantiate = mod_instantiate,
+extern module_rlm_t rlm_detail;
+module_rlm_t rlm_detail = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "detail",
+ .inst_size = sizeof(rlm_detail_t),
+ .config = module_config,
+ .instantiate = mod_instantiate
+ },
.methods = {
[MOD_AUTHORIZE] = mod_authorize,
[MOD_PREACCT] = mod_accounting,
return unlang_module_yield(request, dhcpv4_resume, NULL, d);
}
-extern module_t rlm_dhcpv4;
-module_t rlm_dhcpv4 = {
- .magic = RLM_MODULE_INIT,
- .name = "dhcpv4",
- .inst_size = sizeof(rlm_dhcpv4_t),
- .bootstrap = mod_bootstrap,
-
- .config = module_config,
-
- .thread_inst_size = sizeof(rlm_dhcpv4_thread_t),
- .thread_inst_type = "rlm_dhcpv4_thread_t",
- .thread_instantiate = mod_thread_instantiate,
-
+extern module_rlm_t rlm_dhcpv4;
+module_rlm_t rlm_dhcpv4 = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "dhcpv4",
+ .inst_size = sizeof(rlm_dhcpv4_t),
+ .bootstrap = mod_bootstrap,
+
+ .config = module_config,
+
+ .thread_inst_size = sizeof(rlm_dhcpv4_thread_t),
+ .thread_inst_type = "rlm_dhcpv4_thread_t",
+ .thread_instantiate = mod_thread_instantiate
+ },
.methods = {
[MOD_AUTHORIZE] = mod_process,
[MOD_POST_AUTH] = mod_process,
return 0;
}
-extern module_t rlm_dict;
-module_t rlm_dict = {
- .magic = RLM_MODULE_INIT,
- .name = "dict",
- .bootstrap = mod_bootstrap,
+extern module_rlm_t rlm_dict;
+module_rlm_t rlm_dict = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "dict",
+ .bootstrap = mod_bootstrap
+ }
};
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_digest;
-module_t rlm_digest = {
- .magic = RLM_MODULE_INIT,
- .name = "digest",
- .inst_size = sizeof(rlm_digest_t),
- .instantiate = mod_instantiate,
+extern module_rlm_t rlm_digest;
+module_rlm_t rlm_digest = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "digest",
+ .inst_size = sizeof(rlm_digest_t),
+ .instantiate = mod_instantiate,
+ },
.dict = &dict_radius,
.methods = {
[MOD_AUTHENTICATE] = mod_authenticate,
#include <freeradius-devel/unlang/module.h>
#include "rlm_eap.h"
-extern module_t rlm_eap;
+extern module_rlm_t rlm_eap;
/** Resume context for calling a submodule
*
method = &inst->methods[eap_session->type];
- RDEBUG2("Calling submodule %s", method->submodule->name);
+ RDEBUG2("Calling submodule %s", method->submodule->common.name);
/*
* Allocate a new subrequest
* The module name should be the only globally exported symbol.
* That is, everything else should be 'static'.
*/
-module_t rlm_eap = {
- .magic = RLM_MODULE_INIT,
- .name = "eap",
- .inst_size = sizeof(rlm_eap_t),
- .config = module_config,
- .onload = mod_load,
- .unload = mod_unload,
- .bootstrap = mod_bootstrap,
- .instantiate = mod_instantiate,
+module_rlm_t rlm_eap = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "eap",
+ .inst_size = sizeof(rlm_eap_t),
+ .config = module_config,
+ .onload = mod_load,
+ .unload = mod_unload,
+ .bootstrap = mod_bootstrap,
+ .instantiate = mod_instantiate,
+ },
.methods = {
[MOD_AUTHENTICATE] = mod_authenticate,
[MOD_AUTHORIZE] = mod_authorize,
* That is, everything else should be 'static'.
*/
rlm_eap_submodule_t rlm_eap_aka = {
- .name = "eap_aka",
- .magic = RLM_MODULE_INIT,
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "eap_aka",
- .provides = { FR_EAP_METHOD_AKA },
-
- .inst_size = sizeof(eap_aka_sim_module_conf_t),
- .inst_type = "eap_aka_sim_module_conf_t",
- .config = submodule_config,
+ .inst_size = sizeof(eap_aka_sim_module_conf_t),
+ .inst_type = "eap_aka_sim_module_conf_t",
+ .config = submodule_config,
- .onload = mod_load,
- .unload = mod_unload,
-
- .instantiate = mod_instantiate,
+ .onload = mod_load,
+ .unload = mod_unload,
+ .instantiate = mod_instantiate,
+ },
+ .provides = { FR_EAP_METHOD_AKA },
.type_identity = mod_type_identity,
.session_init = mod_session_init,
.namespace = &dict_eap_aka_sim
* That is, everything else should be 'static'.
*/
rlm_eap_submodule_t rlm_eap_aka_prime = {
- .name = "eap_aka_prime",
- .magic = RLM_MODULE_INIT,
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "eap_aka_prime",
- .provides = { FR_EAP_METHOD_AKA_PRIME },
-
- .inst_size = sizeof(eap_aka_sim_module_conf_t),
- .inst_type = "eap_aka_sim_module_conf_t",
- .config = submodule_config,
+ .inst_size = sizeof(eap_aka_sim_module_conf_t),
+ .inst_type = "eap_aka_sim_module_conf_t",
+ .config = submodule_config,
- .onload = mod_load,
- .unload = mod_unload,
-
- .instantiate = mod_instantiate,
+ .onload = mod_load,
+ .unload = mod_unload,
+ .instantiate = mod_instantiate,
+ },
+ .provides = { FR_EAP_METHOD_AKA_PRIME },
.type_identity = mod_type_identity,
.session_init = mod_session_init,
.namespace = &dict_eap_aka_sim
*/
extern rlm_eap_submodule_t rlm_eap_fast;
rlm_eap_submodule_t rlm_eap_fast = {
- .name = "eap_fast",
- .magic = RLM_MODULE_INIT,
-
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "eap_fast",
+
+ .inst_size = sizeof(rlm_eap_fast_t),
+ .config = submodule_config,
+ .instantiate = mod_instantiate, /* Create new submodule instance */
+
+ .thread_inst_size = sizeof(rlm_eap_fast_thread_t),
+ .thread_instantiate = mod_thread_instantiate,
+ .thread_detach = mod_thread_detach,
+ },
.provides = { FR_EAP_METHOD_FAST },
- .inst_size = sizeof(rlm_eap_fast_t),
- .config = submodule_config,
- .instantiate = mod_instantiate, /* Create new submodule instance */
-
- .thread_inst_size = sizeof(rlm_eap_fast_thread_t),
- .thread_instantiate = mod_thread_instantiate,
- .thread_detach = mod_thread_detach,
-
.session_init = mod_session_init, /* Initialise a new EAP session */
};
*/
extern rlm_eap_submodule_t rlm_eap_gtc;
rlm_eap_submodule_t rlm_eap_gtc = {
- .name = "eap_gtc",
- .magic = RLM_MODULE_INIT,
-
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "eap_gtc",
+ .inst_size = sizeof(rlm_eap_gtc_t),
+ .config = submodule_config,
+ },
.provides = { FR_EAP_METHOD_GTC },
- .inst_size = sizeof(rlm_eap_gtc_t),
- .config = submodule_config,
-
.session_init = mod_session_init, /* Initialise a new EAP session */
-
.clone_parent_lists = true /* HACK */
};
*/
extern rlm_eap_submodule_t rlm_eap_md5;
rlm_eap_submodule_t rlm_eap_md5 = {
- .name = "eap_md5",
-
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "eap_md5"
+ },
.provides = { FR_EAP_METHOD_MD5 },
- .magic = RLM_MODULE_INIT,
.session_init = mod_session_init, /* Initialise a new EAP session */
};
*/
extern rlm_eap_submodule_t rlm_eap_mschapv2;
rlm_eap_submodule_t rlm_eap_mschapv2 = {
- .name = "eap_mschapv2",
- .magic = RLM_MODULE_INIT,
-
+ .common = {
+ .name = "eap_mschapv2",
+ .magic = MODULE_MAGIC_INIT,
+ .inst_size = sizeof(rlm_eap_mschapv2_t),
+ .config = submodule_config,
+ .instantiate = mod_instantiate, /* Create new submodule instance */
+ },
.provides = { FR_EAP_METHOD_MSCHAPV2 },
- .inst_size = sizeof(rlm_eap_mschapv2_t),
- .config = submodule_config,
- .instantiate = mod_instantiate, /* Create new submodule instance */
-
.session_init = mod_session_init, /* Initialise a new EAP session */
.clone_parent_lists = false /* HACK */
};
*/
extern rlm_eap_submodule_t rlm_eap_peap;
rlm_eap_submodule_t rlm_eap_peap = {
- .name = "eap_peap",
- .magic = RLM_MODULE_INIT,
-
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "eap_peap",
+ .inst_size = sizeof(rlm_eap_peap_t),
+ .config = submodule_config,
+ .onload = mod_load,
+ .unload = mod_unload,
+ .instantiate = mod_instantiate,
+
+ .thread_inst_size = sizeof(rlm_eap_peap_thread_t),
+ .thread_instantiate = mod_thread_instantiate,
+ .thread_detach = mod_thread_detach,
+ },
.provides = { FR_EAP_METHOD_PEAP },
- .inst_size = sizeof(rlm_eap_peap_t),
- .config = submodule_config,
- .onload = mod_load,
- .unload = mod_unload,
- .instantiate = mod_instantiate,
-
- .thread_inst_size = sizeof(rlm_eap_peap_thread_t),
- .thread_instantiate = mod_thread_instantiate,
- .thread_detach = mod_thread_detach,
-
.session_init = mod_session_init, /* Initialise a new EAP session */
};
extern rlm_eap_submodule_t rlm_eap_pwd;
rlm_eap_submodule_t rlm_eap_pwd = {
- .name = "eap_pwd",
- .magic = RLM_MODULE_INIT,
-
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "eap_pwd",
+ .inst_size = sizeof(rlm_eap_pwd_t),
+ .config = submodule_config,
+ .instantiate = mod_instantiate, /* Create new submodule instance */
+ .detach = mod_detach
+ },
.provides = { FR_EAP_METHOD_PWD },
- .inst_size = sizeof(rlm_eap_pwd_t),
- .config = submodule_config,
- .instantiate = mod_instantiate, /* Create new submodule instance */
- .detach = mod_detach,
-
.session_init = mod_session_init, /* Create the initial request */
};
* That is, everything else should be 'static'.
*/
rlm_eap_submodule_t rlm_eap_sim = {
- .name = "eap_sim",
- .magic = RLM_MODULE_INIT,
-
+ .common = {
+ .name = "eap_sim",
+ .magic = MODULE_MAGIC_INIT,
+ .inst_size = sizeof(eap_aka_sim_module_conf_t),
+ .inst_type = "eap_aka_sim_module_conf_t",
+ .config = submodule_config,
+
+ .onload = mod_load,
+ .unload = mod_unload,
+
+ .instantiate = mod_instantiate
+ },
.provides = { FR_EAP_METHOD_SIM },
-
- .inst_size = sizeof(eap_aka_sim_module_conf_t),
- .inst_type = "eap_aka_sim_module_conf_t",
- .config = submodule_config,
-
- .onload = mod_load,
- .unload = mod_unload,
-
- .instantiate = mod_instantiate,
-
.type_identity = mod_type_identity,
.session_init = mod_session_init, /* Initialise a new EAP session */
.namespace = &dict_eap_aka_sim
*/
extern rlm_eap_submodule_t rlm_eap_tls;
rlm_eap_submodule_t rlm_eap_tls = {
- .name = "eap_tls",
- .magic = RLM_MODULE_INIT,
-
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "eap_tls",
+ .inst_size = sizeof(rlm_eap_tls_t),
+ .config = submodule_config,
+ .instantiate = mod_instantiate, /* Create new submodule instance */
+
+ .thread_inst_size = sizeof(rlm_eap_tls_thread_t),
+ .thread_instantiate = mod_thread_instantiate,
+ .thread_detach = mod_thread_detach,
+ },
.provides = { FR_EAP_METHOD_TLS },
- .inst_size = sizeof(rlm_eap_tls_t),
- .config = submodule_config,
- .instantiate = mod_instantiate, /* Create new submodule instance */
-
- .thread_inst_size = sizeof(rlm_eap_tls_thread_t),
- .thread_instantiate = mod_thread_instantiate,
- .thread_detach = mod_thread_detach,
-
.session_init = mod_session_init, /* Initialise a new EAP session */
};
*/
extern rlm_eap_submodule_t rlm_eap_ttls;
rlm_eap_submodule_t rlm_eap_ttls = {
- .name = "eap_ttls",
- .magic = RLM_MODULE_INIT,
-
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "eap_ttls",
+
+ .inst_size = sizeof(rlm_eap_ttls_t),
+ .config = submodule_config,
+ .instantiate = mod_instantiate, /* Create new submodule instance */
+
+ .thread_inst_size = sizeof(rlm_eap_ttls_thread_t),
+ .thread_instantiate = mod_thread_instantiate,
+ .thread_detach = mod_thread_detach,
+ },
.provides = { FR_EAP_METHOD_TTLS },
- .inst_size = sizeof(rlm_eap_ttls_t),
- .config = submodule_config,
- .instantiate = mod_instantiate, /* Create new submodule instance */
-
- .thread_inst_size = sizeof(rlm_eap_ttls_thread_t),
- .thread_instantiate = mod_thread_instantiate,
- .thread_detach = mod_thread_detach,
-
.session_init = mod_session_init, /* Initialise a new EAP session */
};
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_escape;
-module_t rlm_escape = {
- .magic = RLM_MODULE_INIT,
- .name = "escape",
- .inst_size = sizeof(rlm_escape_t),
- .config = module_config,
- .bootstrap = mod_bootstrap,
+extern module_rlm_t rlm_escape;
+module_rlm_t rlm_escape = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "escape",
+ .inst_size = sizeof(rlm_escape_t),
+ .config = module_config,
+ .bootstrap = mod_bootstrap
+ }
};
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_exec;
-module_t rlm_exec = {
- .magic = RLM_MODULE_INIT,
- .name = "exec",
- .type = RLM_TYPE_THREAD_SAFE,
- .inst_size = sizeof(rlm_exec_t),
- .config = module_config,
- .bootstrap = mod_bootstrap,
- .instantiate = mod_instantiate,
+extern module_rlm_t rlm_exec;
+module_rlm_t rlm_exec = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "exec",
+ .type = MODULE_TYPE_THREAD_SAFE,
+ .inst_size = sizeof(rlm_exec_t),
+ .config = module_config,
+ .bootstrap = mod_bootstrap,
+ .instantiate = mod_instantiate
+ },
.methods = {
[MOD_AUTHENTICATE] = mod_exec_dispatch,
[MOD_AUTHORIZE] = mod_exec_dispatch,
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_expr;
-module_t rlm_expr = {
- .magic = RLM_MODULE_INIT,
- .name = "expr",
- .bootstrap = mod_bootstrap,
+extern module_rlm_t rlm_expr;
+module_rlm_t rlm_expr = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "expr",
+ .bootstrap = mod_bootstrap
+ }
};
/* globally exported name */
-extern module_t rlm_files;
-module_t rlm_files = {
- .magic = RLM_MODULE_INIT,
- .name = "files",
- .inst_size = sizeof(rlm_files_t),
- .config = module_config,
- .instantiate = mod_instantiate,
+extern module_rlm_t rlm_files;
+module_rlm_t rlm_files = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "files",
+ .inst_size = sizeof(rlm_files_t),
+ .config = module_config,
+ .instantiate = mod_instantiate
+ },
.methods = {
[MOD_AUTHENTICATE] = mod_authenticate,
[MOD_AUTHORIZE] = mod_authorize,
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_icmp;
-module_t rlm_icmp = {
- .magic = RLM_MODULE_INIT,
- .name = "icmp",
- .type = RLM_TYPE_THREAD_SAFE,
- .inst_size = sizeof(rlm_icmp_t),
- .config = module_config,
- .bootstrap = mod_bootstrap,
-
- .thread_inst_size = sizeof(rlm_icmp_thread_t),
- .thread_inst_type = "rlm_icmp_thread_t",
- .thread_instantiate = mod_thread_instantiate,
- .thread_detach = mod_thread_detach,
+extern module_rlm_t rlm_icmp;
+module_rlm_t rlm_icmp = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "icmp",
+ .type = MODULE_TYPE_THREAD_SAFE,
+ .inst_size = sizeof(rlm_icmp_t),
+ .config = module_config,
+ .bootstrap = mod_bootstrap,
+ .thread_inst_size = sizeof(rlm_icmp_thread_t),
+ .thread_inst_type = "rlm_icmp_thread_t",
+ .thread_instantiate = mod_thread_instantiate,
+ .thread_detach = mod_thread_detach
+ }
};
return 0;
}
-extern module_t rlm_idn;
-module_t rlm_idn = {
- .magic = RLM_MODULE_INIT,
- .name = "idn",
- .type = RLM_TYPE_THREAD_SAFE,
- .inst_size = sizeof(rlm_idn_t),
- .config = mod_config,
- .bootstrap = mod_bootstrap
+extern module_rlm_t rlm_idn;
+module_rlm_t rlm_idn = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "idn",
+ .type = MODULE_TYPE_THREAD_SAFE,
+ .inst_size = sizeof(rlm_idn_t),
+ .config = mod_config,
+ .bootstrap = mod_bootstrap
+ }
};
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_imap;
-module_t rlm_imap = {
- .magic = RLM_MODULE_INIT,
- .name = "imap",
- .type = RLM_TYPE_THREAD_SAFE,
- .inst_size = sizeof(rlm_imap_t),
- .thread_inst_size = sizeof(rlm_imap_thread_t),
- .config = module_config,
- .onload = mod_load,
- .unload = mod_unload,
- .thread_instantiate = mod_thread_instantiate,
- .thread_detach = mod_thread_detach,
-
+extern module_rlm_t rlm_imap;
+module_rlm_t rlm_imap = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "imap",
+ .type = MODULE_TYPE_THREAD_SAFE,
+ .inst_size = sizeof(rlm_imap_t),
+ .thread_inst_size = sizeof(rlm_imap_thread_t),
+ .config = module_config,
+ .onload = mod_load,
+ .unload = mod_unload,
+ .thread_instantiate = mod_thread_instantiate,
+ .thread_detach = mod_thread_detach,
+ },
.methods = {
[MOD_AUTHENTICATE] = mod_authenticate,
},
RETURN_MODULE_OK;
}
-extern module_t rlm_isc_dhcp;
-module_t rlm_isc_dhcp = {
- .magic = RLM_MODULE_INIT,
- .name = "isc_dhcp",
- .type = 0,
- .inst_size = sizeof(rlm_isc_dhcp_t),
- .config = module_config,
- .instantiate = mod_instantiate,
+extern module_rlm_t rlm_isc_dhcp;
+module_rlm_t rlm_isc_dhcp = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "isc_dhcp",
+ .inst_size = sizeof(rlm_isc_dhcp_t),
+ .config = module_config,
+ .instantiate = mod_instantiate
+ },
.methods = {
[MOD_AUTHORIZE] = mod_authorize,
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_json;
-module_t rlm_json = {
- .magic = RLM_MODULE_INIT,
- .name = "json",
- .type = RLM_TYPE_THREAD_SAFE,
- .onload = mod_load,
- .config = module_config,
- .inst_size = sizeof(rlm_json_t),
- .bootstrap = mod_bootstrap,
+extern module_rlm_t rlm_json;
+module_rlm_t rlm_json = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "json",
+ .type = MODULE_TYPE_THREAD_SAFE,
+ .onload = mod_load,
+ .config = module_config,
+ .inst_size = sizeof(rlm_json_t),
+ .bootstrap = mod_bootstrap
+ }
};
#endif /* MIT_KRB5 */
-extern module_t rlm_krb5;
-module_t rlm_krb5 = {
- .magic = RLM_MODULE_INIT,
- .name = "krb5",
+extern module_rlm_t rlm_krb5;
+module_rlm_t rlm_krb5 = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "krb5",
#ifdef KRB5_IS_THREAD_SAFE
- .type = RLM_TYPE_THREAD_SAFE,
+ .type = MODULE_TYPE_THREAD_SAFE,
+#else
+ .type = MODULE_TYPE_THREAD_UNSAFE,
#endif
- .inst_size = sizeof(rlm_krb5_t),
- .config = module_config,
- .instantiate = mod_instantiate,
- .detach = mod_detach,
+ .inst_size = sizeof(rlm_krb5_t),
+ .config = module_config,
+ .instantiate = mod_instantiate,
+ .detach = mod_detach
+ },
.methods = {
[MOD_AUTHENTICATE] = mod_authenticate
},
}
/* globally exported name */
-extern module_t rlm_ldap;
-module_t rlm_ldap = {
- .magic = RLM_MODULE_INIT,
- .name = "ldap",
- .type = 0,
- .inst_size = sizeof(rlm_ldap_t),
- .config = module_config,
- .onload = mod_load,
- .unload = mod_unload,
- .bootstrap = mod_bootstrap,
- .instantiate = mod_instantiate,
- .detach = mod_detach,
- .thread_inst_size = sizeof(fr_ldap_thread_t),
- .thread_inst_type = "fr_ldap_thread_t",
- .thread_instantiate = mod_thread_instatiate,
- .thread_detach = mod_thread_detach,
+extern module_rlm_t rlm_ldap;
+module_rlm_t rlm_ldap = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "ldap",
+ .type = 0,
+ .inst_size = sizeof(rlm_ldap_t),
+ .config = module_config,
+ .onload = mod_load,
+ .unload = mod_unload,
+ .bootstrap = mod_bootstrap,
+ .instantiate = mod_instantiate,
+ .detach = mod_detach,
+ .thread_inst_size = sizeof(fr_ldap_thread_t),
+ .thread_inst_type = "fr_ldap_thread_t",
+ .thread_instantiate = mod_thread_instatiate,
+ .thread_detach = mod_thread_detach,
+ },
.methods = {
[MOD_AUTHENTICATE] = mod_authenticate,
[MOD_AUTHORIZE] = mod_authorize,
/*
* Externally visible module definition.
*/
-extern module_t rlm_linelog;
-module_t rlm_linelog = {
- .magic = RLM_MODULE_INIT,
- .name = "linelog",
- .inst_size = sizeof(rlm_linelog_t),
- .config = module_config,
- .instantiate = mod_instantiate,
- .detach = mod_detach,
+extern module_rlm_t rlm_linelog;
+module_rlm_t rlm_linelog = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "linelog",
+ .inst_size = sizeof(rlm_linelog_t),
+ .config = module_config,
+ .instantiate = mod_instantiate,
+ .detach = mod_detach
+ },
.methods = {
[MOD_AUTHENTICATE] = mod_do_linelog,
[MOD_AUTHORIZE] = mod_do_linelog,
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_logintime;
-module_t rlm_logintime = {
- .magic = RLM_MODULE_INIT,
- .name = "logintime",
- .inst_size = sizeof(rlm_logintime_t),
- .config = module_config,
- .instantiate = mod_instantiate,
+extern module_rlm_t rlm_logintime;
+module_rlm_t rlm_logintime = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "logintime",
+ .inst_size = sizeof(rlm_logintime_t),
+ .config = module_config,
+ .instantiate = mod_instantiate
+ },
.methods = {
[MOD_AUTHORIZE] = mod_authorize,
[MOD_POST_AUTH] = mod_authorize
/*
* Externally visible module definition.
*/
-extern module_t rlm_logtee;
-module_t rlm_logtee = {
- .magic = RLM_MODULE_INIT,
- .name = "logtee",
- .inst_size = sizeof(rlm_logtee_t),
- .thread_inst_size = sizeof(rlm_logtee_thread_t),
- .config = module_config,
- .instantiate = mod_instantiate,
- .thread_instantiate = mod_thread_instantiate,
-
+extern module_rlm_t rlm_logtee;
+module_rlm_t rlm_logtee = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "logtee",
+ .inst_size = sizeof(rlm_logtee_t),
+ .thread_inst_size = sizeof(rlm_logtee_thread_t),
+ .config = module_config,
+ .instantiate = mod_instantiate,
+ .thread_instantiate = mod_thread_instantiate,
+ },
.methods = {
[MOD_AUTHENTICATE] = mod_insert_logtee,
[MOD_AUTHORIZE] = mod_insert_logtee,
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_lua;
-module_t rlm_lua = {
- .magic = RLM_MODULE_INIT,
- .name = "lua",
- .type = RLM_TYPE_THREAD_SAFE,
- .inst_size = sizeof(rlm_lua_t),
-
- .thread_inst_size = sizeof(rlm_lua_thread_t),
-
- .config = module_config,
- .instantiate = mod_instantiate,
- .thread_instantiate = mod_thread_instantiate,
-
- .detach = mod_detach,
- .thread_detach = mod_thread_detach,
-
+extern module_rlm_t rlm_lua;
+module_rlm_t rlm_lua = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "lua",
+ .type = MODULE_TYPE_THREAD_SAFE,
+ .inst_size = sizeof(rlm_lua_t),
+
+ .thread_inst_size = sizeof(rlm_lua_thread_t),
+
+ .config = module_config,
+ .instantiate = mod_instantiate,
+ .thread_instantiate = mod_thread_instantiate,
+
+ .detach = mod_detach,
+ .thread_detach = mod_thread_detach
+ },
.methods = {
[MOD_AUTHENTICATE] = mod_authenticate,
[MOD_AUTHORIZE] = mod_authorize,
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_mruby;
-module_t rlm_mruby = {
- .magic = RLM_MODULE_INIT,
- .name = "mruby",
- .type = RLM_TYPE_THREAD_UNSAFE, /* Not sure */
- .inst_size = sizeof(rlm_mruby_t),
- .config = module_config,
- .instantiate = mod_instantiate,
- .detach = mod_detach,
+extern module_rlm_t rlm_mruby;
+module_rlm_t rlm_mruby = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "mruby",
+ .type = MODULE_TYPE_THREAD_UNSAFE, /* Not sure */
+ .inst_size = sizeof(rlm_mruby_t),
+ .config = module_config,
+ .instantiate = mod_instantiate,
+ .detach = mod_detach,
+ },
.methods = {
[MOD_AUTHENTICATE] = mod_authenticate,
[MOD_AUTHORIZE] = mod_authorize,
}
-extern module_t rlm_mschap;
-module_t rlm_mschap = {
- .magic = RLM_MODULE_INIT,
- .name = "mschap",
- .type = 0,
- .inst_size = sizeof(rlm_mschap_t),
- .config = module_config,
- .bootstrap = mod_bootstrap,
- .instantiate = mod_instantiate,
- .detach = mod_detach,
+extern module_rlm_t rlm_mschap;
+module_rlm_t rlm_mschap = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "mschap",
+ .inst_size = sizeof(rlm_mschap_t),
+ .config = module_config,
+ .bootstrap = mod_bootstrap,
+ .instantiate = mod_instantiate,
+ .detach = mod_detach
+ },
.methods = {
[MOD_AUTHENTICATE] = mod_authenticate,
[MOD_AUTHORIZE] = mod_authorize
}
/* globally exported name */
-extern module_t rlm_opendirectory;
-module_t rlm_opendirectory = {
- .magic = RLM_MODULE_INIT,
- .name = "opendirectory",
- .inst_size = sizeof(rlm_opendirectory_t),
- .type = RLM_TYPE_THREAD_SAFE,
- .instantiate = mod_instantiate,
+extern module_rlm_t rlm_opendirectory;
+module_rlm_t rlm_opendirectory = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "opendirectory",
+ .inst_size = sizeof(rlm_opendirectory_t),
+ .type = MODULE_TYPE_THREAD_SAFE,
+ .instantiate = mod_instantiate
+ },
.methods = {
[MOD_AUTHENTICATE] = mod_authenticate,
[MOD_AUTHORIZE] = mod_authorize
RETURN_MODULE_OK;
}
-extern module_t rlm_pam;
-module_t rlm_pam = {
- .magic = RLM_MODULE_INIT,
- .name = "pam",
- .type = RLM_TYPE_THREAD_UNSAFE, /* The PAM libraries are not thread-safe */
- .inst_size = sizeof(rlm_pam_t),
- .config = module_config,
- .instantiate = mod_instantiate,
+extern module_rlm_t rlm_pam;
+module_rlm_t rlm_pam = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "pam",
+ .type = MODULE_TYPE_THREAD_UNSAFE, /* The PAM libraries are not thread-safe */
+ .inst_size = sizeof(rlm_pam_t),
+ .config = module_config,
+ .instantiate = mod_instantiate
+ },
.methods = {
[MOD_AUTHENTICATE] = mod_authenticate
},
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_pap;
-module_t rlm_pap = {
- .magic = RLM_MODULE_INIT,
- .name = "pap",
- .inst_size = sizeof(rlm_pap_t),
- .onload = mod_load,
- .unload = mod_unload,
- .config = module_config,
- .instantiate = mod_instantiate,
+extern module_rlm_t rlm_pap;
+module_rlm_t rlm_pap = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "pap",
+ .inst_size = sizeof(rlm_pap_t),
+ .onload = mod_load,
+ .unload = mod_unload,
+ .config = module_config,
+ .instantiate = mod_instantiate
+ },
.methods = {
[MOD_AUTHENTICATE] = mod_authenticate,
[MOD_AUTHORIZE] = mod_authorize
RETURN_MODULE_OK;
}
-extern module_t rlm_passwd;
-module_t rlm_passwd = {
- .magic = RLM_MODULE_INIT,
- .name = "passwd",
- .inst_size = sizeof(rlm_passwd_t),
- .config = module_config,
- .instantiate = mod_instantiate,
- .detach = mod_detach,
+extern module_rlm_t rlm_passwd;
+module_rlm_t rlm_passwd = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "passwd",
+ .inst_size = sizeof(rlm_passwd_t),
+ .config = module_config,
+ .instantiate = mod_instantiate,
+ .detach = mod_detach
+ },
.methods = {
[MOD_AUTHORIZE] = mod_passwd_map,
[MOD_ACCOUNTING] = mod_passwd_map,
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_perl;
-module_t rlm_perl = {
- .magic = RLM_MODULE_INIT,
- .name = "perl",
- .type = RLM_TYPE_THREAD_SAFE,
- .inst_size = sizeof(rlm_perl_t),
-
- .config = module_config,
- .onload = mod_load,
- .unload = mod_unload,
- .bootstrap = mod_bootstrap,
- .instantiate = mod_instantiate,
- .detach = mod_detach,
-
- .thread_inst_size = sizeof(rlm_perl_thread_t),
- .thread_instantiate = mod_thread_instantiate,
- .thread_detach = mod_thread_detach,
-
+extern module_rlm_t rlm_perl;
+module_rlm_t rlm_perl = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "perl",
+ .type = MODULE_TYPE_THREAD_SAFE,
+ .inst_size = sizeof(rlm_perl_t),
+
+ .config = module_config,
+ .onload = mod_load,
+ .unload = mod_unload,
+ .bootstrap = mod_bootstrap,
+ .instantiate = mod_instantiate,
+ .detach = mod_detach,
+
+ .thread_inst_size = sizeof(rlm_perl_thread_t),
+ .thread_instantiate = mod_thread_instantiate,
+ .thread_detach = mod_thread_detach,
+ },
.methods = {
[MOD_AUTHENTICATE] = mod_authenticate,
[MOD_AUTHORIZE] = mod_authorize,
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_python;
-module_t rlm_python = {
- .magic = RLM_MODULE_INIT,
- .name = "python",
- .type = RLM_TYPE_THREAD_SAFE,
+extern module_rlm_t rlm_python;
+module_rlm_t rlm_python = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "python",
+ .type = MODULE_TYPE_THREAD_SAFE,
- .inst_size = sizeof(rlm_python_t),
- .thread_inst_size = sizeof(rlm_python_thread_t),
+ .inst_size = sizeof(rlm_python_t),
+ .thread_inst_size = sizeof(rlm_python_thread_t),
- .config = module_config,
- .onload = mod_load,
- .unload = mod_unload,
+ .config = module_config,
+ .onload = mod_load,
+ .unload = mod_unload,
- .instantiate = mod_instantiate,
- .detach = mod_detach,
-
- .thread_instantiate = mod_thread_instantiate,
- .thread_detach = mod_thread_detach,
+ .instantiate = mod_instantiate,
+ .detach = mod_detach,
+ .thread_instantiate = mod_thread_instantiate,
+ .thread_detach = mod_thread_detach
+ },
.methods = {
[MOD_AUTHENTICATE] = mod_authenticate,
[MOD_AUTHORIZE] = mod_authorize,
typedef struct rlm_radius_s rlm_radius_t;
typedef struct rlm_radius_io_s rlm_radius_io_t;
-/** Per-thread instance data
- *
- * Contains buffers and connection handles specific to the thread.
- */
-typedef struct {
- void *io_thread; //!< thread context for the IO submodule
-} rlm_radius_thread_t;
-
/*
* Define a structure for our module configuration.
*/
struct rlm_radius_s {
char const *name;
- dl_module_inst_t *io_submodule; //!< As provided by the transport_parse
- rlm_radius_io_t const *io; //!< Easy access to the IO handle
- void *io_instance; //!< Easy access to the IO instance
- CONF_SECTION *io_conf; //!< Easy access to the IO config section
+ module_instance_t *io_submodule;
+ rlm_radius_io_t const *io; //!< Public symbol exported by the submodule.
fr_time_delta_t response_window;
fr_time_delta_t zombie_period;
* This structure is exported by client I/O modules e.g. rlm_radius_udp.
*/
struct rlm_radius_io_s {
- DL_MODULE_COMMON; //!< Common fields to all loadable modules.
- FR_MODULE_COMMON;
- FR_MODULE_THREADED_COMMON;
-
- rlm_radius_io_enqueue_t enqueue; //!< Enqueue a request_t with an IO submodule.
- unlang_module_signal_t signal; //!< Send a signal to an IO module.
- unlang_module_resume_t resume; //!< Resume a request, and get rcode.
+ module_t common; //!< Common fields to all loadable modules.
+ rlm_radius_io_enqueue_t enqueue; //!< Enqueue a request_t with an IO submodule.
+ unlang_module_signal_t signal; //!< Send a signal to an IO module.
+ unlang_module_resume_t resume; //!< Resume a request, and get rcode.
};
extern rlm_radius_io_t rlm_radius_udp;
rlm_radius_io_t rlm_radius_udp = {
- .magic = RLM_MODULE_INIT,
- .name = "radius_udp",
- .inst_size = sizeof(rlm_radius_udp_t),
-
- .thread_inst_size = sizeof(udp_thread_t),
- .thread_inst_type = "udp_thread_t",
-
- .config = module_config,
- .instantiate = mod_instantiate,
- .thread_instantiate = mod_thread_instantiate,
-
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "radius_udp",
+ .inst_size = sizeof(rlm_radius_udp_t),
+
+ .thread_inst_size = sizeof(udp_thread_t),
+ .thread_inst_type = "udp_thread_t",
+
+ .config = module_config,
+ .instantiate = mod_instantiate,
+ .thread_instantiate = mod_thread_instantiate,
+ },
.enqueue = mod_enqueue,
.signal = mod_signal,
.resume = mod_resume,
}
/* globally exported name */
-extern module_t rlm_radutmp;
-module_t rlm_radutmp = {
- .magic = RLM_MODULE_INIT,
- .name = "radutmp",
- .type = RLM_TYPE_THREAD_UNSAFE,
- .inst_size = sizeof(rlm_radutmp_t),
- .config = module_config,
+extern module_rlm_t rlm_radutmp;
+module_rlm_t rlm_radutmp = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "radutmp",
+ .type = MODULE_TYPE_THREAD_UNSAFE,
+ .inst_size = sizeof(rlm_radutmp_t),
+ .config = module_config
+ },
.methods = {
[MOD_ACCOUNTING] = mod_accounting,
},
return 0;
}
-extern module_t rlm_redis;
-module_t rlm_redis = {
- .magic = RLM_MODULE_INIT,
- .name = "redis",
- .type = RLM_TYPE_THREAD_SAFE,
- .inst_size = sizeof(rlm_redis_t),
- .config = module_config,
- .onload = mod_load,
- .bootstrap = mod_bootstrap,
- .instantiate = mod_instantiate,
+extern module_rlm_t rlm_redis;
+module_rlm_t rlm_redis = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "redis",
+ .type = MODULE_TYPE_THREAD_SAFE,
+ .inst_size = sizeof(rlm_redis_t),
+ .config = module_config,
+ .onload = mod_load,
+ .bootstrap = mod_bootstrap,
+ .instantiate = mod_instantiate
+ }
};
return 0;
}
-extern module_t rlm_redis_ippool;
-module_t rlm_redis_ippool = {
- .magic = RLM_MODULE_INIT,
- .name = "redis",
- .type = RLM_TYPE_THREAD_SAFE,
- .inst_size = sizeof(rlm_redis_ippool_t),
- .config = module_config,
- .onload = mod_load,
- .instantiate = mod_instantiate,
+extern module_rlm_t rlm_redis_ippool;
+module_rlm_t rlm_redis_ippool = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "redis",
+ .type = MODULE_TYPE_THREAD_SAFE,
+ .inst_size = sizeof(rlm_redis_ippool_t),
+ .config = module_config,
+ .onload = mod_load,
+ .instantiate = mod_instantiate
+ },
.methods = {
[MOD_ACCOUNTING] = mod_accounting,
[MOD_AUTHORIZE] = mod_authorize,
return 0;
}
-extern module_t rlm_rediswho;
-module_t rlm_rediswho = {
- .magic = RLM_MODULE_INIT,
- .name = "rediswho",
- .type = RLM_TYPE_THREAD_SAFE,
- .inst_size = sizeof(rlm_rediswho_t),
- .config = module_config,
- .onload = mod_load,
- .instantiate = mod_instantiate,
+extern module_rlm_t rlm_rediswho;
+module_rlm_t rlm_rediswho = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "rediswho",
+ .type = MODULE_TYPE_THREAD_SAFE,
+ .inst_size = sizeof(rlm_rediswho_t),
+ .config = module_config,
+ .onload = mod_load,
+ .instantiate = mod_instantiate
+ },
.methods = {
[MOD_ACCOUNTING] = mod_accounting
},
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_rest;
-module_t rlm_rest = {
- .magic = RLM_MODULE_INIT,
- .name = "rest",
- .type = RLM_TYPE_THREAD_SAFE,
- .inst_size = sizeof(rlm_rest_t),
- .thread_inst_size = sizeof(rlm_rest_thread_t),
- .config = module_config,
- .onload = mod_load,
- .unload = mod_unload,
- .bootstrap = mod_bootstrap,
- .instantiate = instantiate,
- .thread_instantiate = mod_thread_instantiate,
- .thread_detach = mod_thread_detach,
+extern module_rlm_t rlm_rest;
+module_rlm_t rlm_rest = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "rest",
+ .type = MODULE_TYPE_THREAD_SAFE,
+ .inst_size = sizeof(rlm_rest_t),
+ .thread_inst_size = sizeof(rlm_rest_thread_t),
+ .config = module_config,
+ .onload = mod_load,
+ .unload = mod_unload,
+ .bootstrap = mod_bootstrap,
+ .instantiate = instantiate,
+ .thread_instantiate = mod_thread_instantiate,
+ .thread_detach = mod_thread_detach
+ },
.methods = {
[MOD_AUTHENTICATE] = mod_authenticate,
[MOD_AUTHORIZE] = mod_authorize,
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_securid;
-module_t rlm_securid = {
- .magic = RLM_MODULE_INIT,
- .name = "securid",
- .inst_size = sizeof(rlm_securid_t),
- .config = module_config,
- .instantiate = mod_instantiate,
- .detach = mod_detach,
+extern module_rlm_t rlm_securid;
+module_rlm_t rlm_securid = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "securid",
+ .inst_size = sizeof(rlm_securid_t),
+ .config = module_config,
+ .instantiate = mod_instantiate,
+ .detach = mod_detach
+ },
.methods = {
[MOD_AUTHENTICATE] = mod_authenticate
},
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_sigtran;
-module_t rlm_sigtran = {
- .magic = RLM_MODULE_INIT,
- .name = "sigtran",
- .type = RLM_TYPE_THREAD_SAFE | RLM_TYPE_RESUMABLE,
- .inst_size = sizeof(rlm_sigtran_t),
- .thread_inst_size = sizeof(rlm_sigtran_thread_t),
- .config = module_config,
- .instantiate = mod_instantiate,
- .detach = mod_detach,
- .thread_instantiate = mod_thread_instantiate,
- .thread_detach = mod_thread_detach,
+extern module_rlm_t rlm_sigtran;
+module_rlm_t rlm_sigtran = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "sigtran",
+ .type = MODULE_TYPE_THREAD_SAFE | MODULE_TYPE_RESUMABLE,
+ .inst_size = sizeof(rlm_sigtran_t),
+ .thread_inst_size = sizeof(rlm_sigtran_thread_t),
+ .config = module_config,
+ .instantiate = mod_instantiate,
+ .detach = mod_detach,
+ .thread_instantiate = mod_thread_instantiate,
+ .thread_detach = mod_thread_detach
+ },
.methods = {
[MOD_AUTHORIZE] = mod_authorize,
}
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_smtp;
-module_t rlm_smtp = {
- .magic = RLM_MODULE_INIT,
- .name = "smtp",
- .type = RLM_TYPE_THREAD_SAFE,
- .inst_size = sizeof(rlm_smtp_t),
- .thread_inst_size = sizeof(rlm_smtp_thread_t),
- .config = module_config,
- .bootstrap = mod_bootstrap,
- .instantiate = mod_instantiate,
- .onload = mod_load,
- .unload = mod_unload,
- .thread_instantiate = mod_thread_instantiate,
- .thread_detach = mod_thread_detach,
-
+extern module_rlm_t rlm_smtp;
+module_rlm_t rlm_smtp = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "smtp",
+ .type = MODULE_TYPE_THREAD_SAFE,
+ .inst_size = sizeof(rlm_smtp_t),
+ .thread_inst_size = sizeof(rlm_smtp_thread_t),
+ .config = module_config,
+ .bootstrap = mod_bootstrap,
+ .instantiate = mod_instantiate,
+ .onload = mod_load,
+ .unload = mod_unload,
+ .thread_instantiate = mod_thread_instantiate,
+ .thread_detach = mod_thread_detach,
+ },
.methods = {
[MOD_AUTHENTICATE] = mod_authenticate,
[MOD_AUTHORIZE] = mod_authorize,
fr_soh_free();
}
-extern module_t rlm_soh;
-module_t rlm_soh = {
- .magic = RLM_MODULE_INIT,
- .name = "soh",
- .type = RLM_TYPE_THREAD_SAFE,
- .inst_size = sizeof(rlm_soh_t),
- .config = module_config,
- .onload = mod_load,
- .unload = mod_unload,
- .bootstrap = mod_bootstrap,
+extern module_rlm_t rlm_soh;
+module_rlm_t rlm_soh = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "soh",
+ .type = MODULE_TYPE_THREAD_SAFE,
+ .inst_size = sizeof(rlm_soh_t),
+ .config = module_config,
+ .onload = mod_load,
+ .unload = mod_unload,
+ .bootstrap = mod_bootstrap
+ },
.methods = {
[MOD_AUTHORIZE] = mod_authorize,
[MOD_POST_AUTH] = mod_post_auth
return sometimes_return(p_result, mctx, request, request->reply, NULL);
}
-extern module_t rlm_sometimes;
-module_t rlm_sometimes = {
- .magic = RLM_MODULE_INIT,
- .name = "sometimes",
- .inst_size = sizeof(rlm_sometimes_t),
- .config = module_config,
- .instantiate = mod_instantiate,
+extern module_rlm_t rlm_sometimes;
+module_rlm_t rlm_sometimes = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "sometimes",
+ .inst_size = sizeof(rlm_sometimes_t),
+ .config = module_config,
+ .instantiate = mod_instantiate
+ },
.methods = {
[MOD_AUTHENTICATE] = mod_sometimes_packet,
[MOD_AUTHORIZE] = mod_sometimes_packet,
return 0;
}
-static int mod_instantiate(rlm_sql_config_t const *config, void *instance, CONF_SECTION *cs)
+static int mod_instantiate(module_inst_ctx_t const *mctx)
{
- bool do_tls = false;
- bool do_latency_aware_routing = false;
- rlm_sql_cassandra_t *inst = talloc_get_type_abort(instance, rlm_sql_cassandra_t);
-
- CassCluster *cluster;
+ rlm_sql_t const *parent = talloc_get_type_abort(mctx->inst->parent->data, rlm_sql_t);
+ rlm_sql_config_t const *config = &parent->config;
+ rlm_sql_cassandra_t *inst = talloc_get_type_abort(mctx->inst, rlm_sql_cassandra_t);
+ bool do_tls = false;
+ bool do_latency_aware_routing = false;
+ CassCluster *cluster;
#define DO_CASS_OPTION(_opt, _x) \
do {\
* This has to be done before we call cf_section_parse
* as it sets default values, and creates the section.
*/
- if (cf_section_find(cs, "tls", NULL)) do_tls = true;
- if (cf_section_find(cs, "latency_aware_routing", NULL)) do_latency_aware_routing = true;
+ if (cf_section_find(mctx->inst->conf, "tls", NULL)) do_tls = true;
+ if (cf_section_find(mctx->inst->conf, "latency_aware_routing", NULL)) do_latency_aware_routing = true;
DEBUG4("Configuring CassCluster structure");
cluster = inst->cluster = cass_cluster_new();
/* Exported to rlm_sql */
extern rlm_sql_driver_t rlm_sql_db2;
rlm_sql_driver_t rlm_sql_db2 = {
- .name = "rlm_sql_db2",
- .magic = RLM_MODULE_INIT,
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "rlm_sql_db2",
+ },
.sql_socket_init = sql_socket_init,
.sql_query = sql_query,
.sql_select_query = sql_select_query,
/* Exported to rlm_sql */
extern rlm_sql_driver_t rlm_sql_firebird;
rlm_sql_driver_t rlm_sql_firebird = {
- .name = "rlm_sql_firebird",
- .magic = RLM_MODULE_INIT,
+ .common = {
+ .name = "rlm_sql_firebird",
+ .magic = MODULE_MAGIC_INIT
+ },
.sql_socket_init = sql_socket_init,
.sql_query = sql_query,
.sql_select_query = sql_select_query,
/* Exported to rlm_sql */
extern rlm_sql_driver_t rlm_sql_freetds;
rlm_sql_driver_t rlm_sql_freetds = {
- .name = "rlm_sql_freetds",
- .magic = RLM_MODULE_INIT,
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "rlm_sql_freetds"
+ },
.sql_socket_init = sql_socket_init,
.sql_query = sql_query,
.sql_select_query = sql_select_query,
return 0;
}
-static int mod_instantiate(UNUSED rlm_sql_config_t const *config, void *instance, UNUSED CONF_SECTION *cs)
+static int mod_instantiate(module_inst_ctx_t const *mctx)
{
- rlm_sql_mysql_t *inst = talloc_get_type_abort(instance, rlm_sql_mysql_t);
+ rlm_sql_mysql_t *inst = talloc_get_type_abort(mctx->inst->data, rlm_sql_mysql_t);
int warnings;
warnings = fr_table_value_by_str(server_warnings_table, inst->warnings_str, -1);
/* Exported to rlm_sql */
extern rlm_sql_driver_t rlm_sql_mysql;
rlm_sql_driver_t rlm_sql_mysql = {
- .name = "rlm_sql_mysql",
- .magic = RLM_MODULE_INIT,
+ .common = {
+ .name = "rlm_sql_mysql",
+ .magic = MODULE_MAGIC_INIT,
+ .inst_size = sizeof(rlm_sql_mysql_t),
+ .onload = mod_load,
+ .unload = mod_unload,
+ .config = driver_config,
+ .instantiate = mod_instantiate
+ },
.flags = RLM_SQL_RCODE_FLAGS_ALT_QUERY,
- .inst_size = sizeof(rlm_sql_mysql_t),
- .onload = mod_load,
- .unload = mod_unload,
- .config = driver_config,
- .instantiate = mod_instantiate,
.sql_socket_init = sql_socket_init,
.sql_query = sql_query,
.sql_select_query = sql_select_query,
/* Exported to rlm_sql */
extern rlm_sql_driver_t rlm_sql_null;
rlm_sql_driver_t rlm_sql_null = {
- .name = "rlm_sql_null",
- .magic = RLM_MODULE_INIT,
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "rlm_sql_null"
+ },
.sql_socket_init = sql_socket_init,
.sql_query = sql_query,
.sql_select_query = sql_select_query,
return 0;
}
-static int mod_instantiate(rlm_sql_config_t const *config, void *instance, CONF_SECTION *conf)
+static int mod_instantiate(module_inst_ctx_t const *mctx)
{
- char errbuff[512];
- sb4 errcode = 0;
- rlm_sql_oracle_t *inst = talloc_get_type_abort(instance, rlm_sql_oracle_t);
- OraText *sql_password = NULL;
- OraText *sql_login = NULL;
-
- if (!cf_section_find(conf, "spool", NULL)) {
- ERROR("Couldn't load configuration of session pool(\"spool\" section in driver config)");
+ rlm_sql_t const *parent = talloc_get_type_abort(mctx->inst->parent->data, rlm_sql_t);
+ rlm_sql_config_t const *config = &parent->config;
+ rlm_sql_oracle_t *inst = talloc_get_type_abort(mctx->inst, rlm_sql_oracle_t);
+ char errbuff[512];
+ sb4 errcode = 0;
+ OraText *sql_password = NULL;
+ OraText *sql_login = NULL;
+
+ if (!cf_section_find(mctx->inst->conf, "spool", NULL)) {
+ ERROR("Couldn't load mctx->configuration of session pool(\"spool\" section in driver mctx->config)");
return RLM_SQL_ERROR;
}
memcpy(&sql_password, config->sql_password, sizeof(sql_password));
if (OCISessionPoolCreate((dvoid *)inst->env, (dvoid *)inst->error, (dvoid *)inst->pool,
- (OraText**)&inst->pool_name, (ub4*)&inst->pool_name_len,
- (CONST OraText *)config->sql_db, strlen(config->sql_db),
- inst->spool_min, inst->spool_max, inst->spool_inc,
- sql_login, strlen(config->sql_login),
- sql_password, strlen(config->sql_password),
- OCI_SPC_STMTCACHE | OCI_SPC_HOMOGENEOUS)) {
+ (OraText**)&inst->pool_name, (ub4*)&inst->pool_name_len,
+ (CONST OraText *)config->sql_db, strlen(config->sql_db),
+ inst->spool_min, inst->spool_max, inst->spool_inc,
+ sql_login, strlen(config->sql_login),
+ sql_password, strlen(config->sql_password),
+ OCI_SPC_STMTCACHE | OCI_SPC_HOMOGENEOUS)) {
errbuff[0] = '\0';
OCIErrorGet((dvoid *) inst->error, 1, (OraText *) NULL, &errcode, (OraText *) errbuff,
/* Exported to rlm_sql */
extern rlm_sql_driver_t rlm_sql_oracle;
rlm_sql_driver_t rlm_sql_oracle = {
- .name = "rlm_sql_oracle",
- .magic = RLM_MODULE_INIT,
- .inst_size = sizeof(rlm_sql_oracle_t),
- .config = driver_config,
- .instantiate = mod_instantiate,
- .detach = mod_detach,
+ .common = {
+ .name = "rlm_sql_oracle",
+ .magic = MODULE_MAGIC_INIT,
+ .inst_size = sizeof(rlm_sql_oracle_t),
+ .config = driver_config,
+ .instantiate = mod_instantiate,
+ .detach = mod_detach
+ },
.sql_socket_init = sql_socket_init,
.sql_query = sql_query,
.sql_select_query = sql_select_query,
return ret;
}
-static int mod_instantiate(rlm_sql_config_t const *config, void *instance, CONF_SECTION *conf)
+static int mod_instantiate(module_inst_ctx_t const *mctx)
{
- rlm_sql_postgresql_t *inst = talloc_get_type_abort(instance, rlm_sql_postgresql_t);
+ rlm_sql_t const *parent = talloc_get_type_abort(mctx->inst->parent->data, rlm_sql_t);
+ rlm_sql_config_t const *config = &parent->config;
+ rlm_sql_postgresql_t *inst = talloc_get_type_abort(mctx->inst, rlm_sql_postgresql_t);
char application_name[NAMEDATALEN];
char *db_string;
CONF_SECTION *cs;
char const *name;
- cs = cf_item_to_section(cf_parent(conf));
+ cs = cf_item_to_section(cf_parent(mctx->inst->conf));
name = cf_section_name2(cs);
if (!name) name = cf_section_name1(cs);
{
CONF_SECTION *cs;
- cs = cf_section_find(conf, "states", NULL);
+ cs = cf_section_find(mctx->inst->conf, "states", NULL);
if (cs && (sql_state_entries_from_cs(inst->states, cs) < 0)) return -1;
}
/* Exported to rlm_sql */
extern rlm_sql_driver_t rlm_sql_postgresql;
rlm_sql_driver_t rlm_sql_postgresql = {
- .name = "rlm_sql_postgresql",
- .magic = RLM_MODULE_INIT,
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "rlm_sql_postgresql",
+ .inst_size = sizeof(rlm_sql_postgresql_t),
+ .onload = mod_load,
+ .config = driver_config,
+ .instantiate = mod_instantiate
+ },
.flags = RLM_SQL_RCODE_FLAGS_ALT_QUERY,
- .inst_size = sizeof(rlm_sql_postgresql_t),
- .onload = mod_load,
- .config = driver_config,
- .instantiate = mod_instantiate,
.sql_socket_init = sql_socket_init,
.sql_query = sql_query,
.sql_select_query = sql_select_query,
return -1;
}
-static int mod_instantiate(rlm_sql_config_t const *config, void *instance, CONF_SECTION *cs)
+static int mod_instantiate(module_inst_ctx_t const *mctx)
{
+ rlm_sql_t const *parent = talloc_get_type_abort(mctx->inst->parent->data, rlm_sql_t);
+ rlm_sql_config_t const *config = &parent->config;
+ rlm_sql_sqlite_t *inst = talloc_get_type_abort(mctx->inst, rlm_sql_sqlite_t);
bool exists;
- rlm_sql_sqlite_t *inst = talloc_get_type_abort(instance, rlm_sql_sqlite_t);
struct stat buf;
if (!inst->filename) {
return -1;
}
- if (cf_pair_find(cs, "bootstrap")) {
+ if (cf_pair_find(mctx->inst->conf, "bootstrap")) {
inst->bootstrap = true;
}
if (p) {
size_t len = (p - inst->filename) + 1;
- buff = talloc_array(cs, char, len);
+ buff = talloc_array(mctx->inst->conf, char, len);
strlcpy(buff, inst->filename, len);
} else {
- MEM(buff = talloc_typed_strdup(cs, inst->filename));
+ MEM(buff = talloc_typed_strdup(mctx->inst->conf, inst->filename));
}
ret = fr_mkdir(NULL, buff, -1, 0700, NULL, NULL);
/*
* Execute multiple bootstrap SQL files in order
*/
- for (cp = cf_pair_find(cs, "bootstrap");
+ for (cp = cf_pair_find(mctx->inst->conf, "bootstrap");
cp;
- cp = cf_pair_find_next(cs, cp, "bootstrap")) {
+ cp = cf_pair_find_next(mctx->inst->conf, cp, "bootstrap")) {
p = cf_pair_value(cp);
if (!p) continue;
- ret = sql_loadfile(cs, db, p);
+ ret = sql_loadfile(mctx->inst->conf, db, p);
if (ret < 0) goto unlink;
}
/* Exported to rlm_sql */
extern rlm_sql_driver_t rlm_sql_sqlite;
rlm_sql_driver_t rlm_sql_sqlite = {
- .name = "rlm_sql_sqlite",
- .magic = RLM_MODULE_INIT,
+ .common = {
+ .name = "rlm_sql_sqlite",
+ .magic = MODULE_MAGIC_INIT,
+ .inst_size = sizeof(rlm_sql_sqlite_t),
+ .config = driver_config,
+ .onload = mod_load,
+ .instantiate = mod_instantiate
+ },
.flags = RLM_SQL_RCODE_FLAGS_ALT_QUERY,
- .inst_size = sizeof(rlm_sql_sqlite_t),
- .config = driver_config,
- .onload = mod_load,
- .instantiate = mod_instantiate,
.sql_socket_init = sql_socket_init,
.sql_query = sql_query,
.sql_select_query = sql_select_query,
/* Exported to rlm_sql */
extern rlm_sql_driver_t rlm_sql_unixodbc;
rlm_sql_driver_t rlm_sql_unixodbc = {
- .name = "rlm_sql_unixodbc",
- .magic = RLM_MODULE_INIT,
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "rlm_sql_unixodbc"
+ },
.sql_socket_init = sql_socket_init,
.sql_query = sql_query,
.sql_select_query = sql_select_query,
#include "rlm_sql.h"
-extern module_t rlm_sql;
+extern module_rlm_t rlm_sql;
/*
* So we can do pass2 xlat checks on the queries.
}
inst->driver = (rlm_sql_driver_t const *)inst->driver_inst->module->common;
- fr_assert(!inst->driver->inst_size || inst->driver_inst->data);
+ fr_assert(!inst->driver->common.inst_size || inst->driver_inst->data);
/*
* Call the driver's instantiate function (if set)
/* globally exported name */
-module_t rlm_sql = {
- .magic = RLM_MODULE_INIT,
- .name = "sql",
- .type = RLM_TYPE_THREAD_SAFE,
- .inst_size = sizeof(rlm_sql_t),
- .config = module_config,
- .bootstrap = mod_bootstrap,
- .instantiate = mod_instantiate,
- .detach = mod_detach,
+module_rlm_t rlm_sql = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "sql",
+ .type = MODULE_TYPE_THREAD_SAFE,
+ .inst_size = sizeof(rlm_sql_t),
+ .config = module_config,
+ .bootstrap = mod_bootstrap,
+ .instantiate = mod_instantiate,
+ .detach = mod_detach
+ },
.methods = {
[MOD_AUTHORIZE] = mod_authorize,
[MOD_ACCOUNTING] = mod_accounting,
rlm_sql_config_t const *config);
typedef struct {
- DL_MODULE_COMMON; //!< Common fields to all loadable modules.
+ module_t common; //!< Common fields for all loadable modules.
int flags;
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_sqlcounter;
-module_t rlm_sqlcounter = {
- .magic = RLM_MODULE_INIT,
- .name = "sqlcounter",
- .type = RLM_TYPE_THREAD_SAFE,
- .inst_size = sizeof(rlm_sqlcounter_t),
- .config = module_config,
- .bootstrap = mod_bootstrap,
- .instantiate = mod_instantiate,
+extern module_rlm_t rlm_sqlcounter;
+module_rlm_t rlm_sqlcounter = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "sqlcounter",
+ .type = MODULE_TYPE_THREAD_SAFE,
+ .inst_size = sizeof(rlm_sqlcounter_t),
+ .config = module_config,
+ .bootstrap = mod_bootstrap,
+ .instantiate = mod_instantiate,
+ },
.methods = {
[MOD_AUTHORIZE] = mod_authorize
},
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_sqlippool;
-module_t rlm_sqlippool = {
- .magic = RLM_MODULE_INIT,
- .name = "sqlippool",
- .type = RLM_TYPE_THREAD_SAFE,
- .inst_size = sizeof(rlm_sqlippool_t),
- .config = module_config,
- .bootstrap = mod_bootstrap,
- .instantiate = mod_instantiate,
+extern module_rlm_t rlm_sqlippool;
+module_rlm_t rlm_sqlippool = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "sqlippool",
+ .type = MODULE_TYPE_THREAD_SAFE,
+ .inst_size = sizeof(rlm_sqlippool_t),
+ .config = module_config,
+ .bootstrap = mod_bootstrap,
+ .instantiate = mod_instantiate
+ },
.methods = {
[MOD_ACCOUNTING] = mod_accounting,
[MOD_POST_AUTH] = mod_alloc
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_stats;
-
-module_t rlm_stats = {
- .magic = RLM_MODULE_INIT,
- .name = "stats",
- .inst_size = sizeof(rlm_stats_t),
- .thread_inst_size = sizeof(rlm_stats_thread_t),
- .config = module_config,
- .instantiate = mod_instantiate,
- .detach = mod_detach,
- .thread_instantiate = mod_thread_instantiate,
- .thread_detach = mod_thread_detach,
+extern module_rlm_t rlm_stats;
+
+module_rlm_t rlm_stats = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "stats",
+ .inst_size = sizeof(rlm_stats_t),
+ .thread_inst_size = sizeof(rlm_stats_thread_t),
+ .config = module_config,
+ .instantiate = mod_instantiate,
+ .detach = mod_detach,
+ .thread_instantiate = mod_thread_instantiate,
+ .thread_detach = mod_thread_detach
+ },
.methods = {
[MOD_AUTHORIZE] = mod_stats, /* @mod_stats_query */
[MOD_POST_AUTH] = mod_stats,
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_test;
-module_t rlm_test = {
- .magic = RLM_MODULE_INIT,
- .name = "test",
- .type = RLM_TYPE_THREAD_SAFE | RLM_TYPE_RETRY,
- .inst_size = sizeof(rlm_test_t),
- .thread_inst_size = sizeof(rlm_test_thread_t),
- .config = module_config,
- .bootstrap = mod_bootstrap,
- .thread_instantiate = mod_thread_instantiate,
- .thread_detach = mod_thread_detach,
+extern module_rlm_t rlm_test;
+module_rlm_t rlm_test = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "test",
+ .type = MODULE_TYPE_THREAD_SAFE | MODULE_TYPE_RETRY,
+ .inst_size = sizeof(rlm_test_t),
+ .thread_inst_size = sizeof(rlm_test_thread_t),
+ .config = module_config,
+ .bootstrap = mod_bootstrap,
+ .thread_instantiate = mod_thread_instantiate,
+ .thread_detach = mod_thread_detach
+ },
.methods = {
[MOD_AUTHENTICATE] = mod_authenticate,
[MOD_AUTHORIZE] = mod_authorize,
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_totp;
-module_t rlm_totp = {
- .magic = RLM_MODULE_INIT,
- .name = "totp",
- .type = RLM_TYPE_THREAD_SAFE,
+extern module_rlm_t rlm_totp;
+module_rlm_t rlm_totp = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "totp",
+ .type = MODULE_TYPE_THREAD_SAFE
+ },
.methods = {
[MOD_AUTHENTICATE] = mod_authenticate,
},
return 0;
}
-extern module_t rlm_unbound;
-module_t rlm_unbound = {
- .magic = RLM_MODULE_INIT,
- .name = "unbound",
- .type = RLM_TYPE_THREAD_SAFE,
- .inst_size = sizeof(rlm_unbound_t),
- .config = module_config,
- .bootstrap = mod_bootstrap,
-
- .thread_inst_size = sizeof(rlm_unbound_thread_t),
- .thread_inst_type = "rlm_unbound_thread_t",
- .thread_instantiate = mod_thread_instantiate,
- .thread_detach = mod_thread_detach,
+extern module_rlm_t rlm_unbound;
+module_rlm_t rlm_unbound = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "unbound",
+ .type = MODULE_TYPE_THREAD_SAFE,
+ .inst_size = sizeof(rlm_unbound_t),
+ .config = module_config,
+ .bootstrap = mod_bootstrap,
+
+ .thread_inst_size = sizeof(rlm_unbound_thread_t),
+ .thread_inst_type = "rlm_unbound_thread_t",
+ .thread_instantiate = mod_thread_instantiate,
+ .thread_detach = mod_thread_detach
+ }
};
}
/* globally exported name */
-extern module_t rlm_unix;
-module_t rlm_unix = {
- .magic = RLM_MODULE_INIT,
- .name = "unix",
- .type = RLM_TYPE_THREAD_UNSAFE,
- .inst_size = sizeof(rlm_unix_t),
- .config = module_config,
- .bootstrap = mod_bootstrap,
+extern module_rlm_t rlm_unix;
+module_rlm_t rlm_unix = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "unix",
+ .type = MODULE_TYPE_THREAD_UNSAFE,
+ .inst_size = sizeof(rlm_unix_t),
+ .config = module_config,
+ .bootstrap = mod_bootstrap
+ },
.methods = {
[MOD_AUTHORIZE] = mod_authorize,
[MOD_ACCOUNTING] = mod_accounting
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_unpack;
-module_t rlm_unpack = {
- .magic = RLM_MODULE_INIT,
- .name = "unpack",
- .type = RLM_TYPE_THREAD_SAFE,
- .bootstrap = mod_bootstrap
+extern module_rlm_t rlm_unpack;
+module_rlm_t rlm_unpack = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "unpack",
+ .type = MODULE_TYPE_THREAD_SAFE,
+ .bootstrap = mod_bootstrap
+ }
};
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_utf8;
-module_t rlm_utf8 = {
- .magic = RLM_MODULE_INIT,
- .name = "utf8",
- .type = RLM_TYPE_THREAD_SAFE,
+extern module_rlm_t rlm_utf8;
+module_rlm_t rlm_utf8 = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "utf8",
+ .type = MODULE_TYPE_THREAD_SAFE
+ },
.methods = {
[MOD_AUTHORIZE] = mod_utf8_clean,
[MOD_PREACCT] = mod_utf8_clean,
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_wimax;
-module_t rlm_wimax = {
- .magic = RLM_MODULE_INIT,
- .name = "wimax",
- .type = RLM_TYPE_THREAD_SAFE,
- .inst_size = sizeof(rlm_wimax_t),
- .config = module_config,
+extern module_rlm_t rlm_wimax;
+module_rlm_t rlm_wimax = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "wimax",
+ .type = MODULE_TYPE_THREAD_SAFE,
+ .inst_size = sizeof(rlm_wimax_t),
+ .config = module_config,
+ },
.dict = &dict_radius,
.methods = {
[MOD_AUTHORIZE] = mod_authorize,
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_winbind;
-module_t rlm_winbind = {
- .magic = RLM_MODULE_INIT,
- .name = "winbind",
- .inst_size = sizeof(rlm_winbind_t),
- .config = module_config,
- .instantiate = mod_instantiate,
- .bootstrap = mod_bootstrap,
- .detach = mod_detach,
+extern module_rlm_t rlm_winbind;
+module_rlm_t rlm_winbind = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "winbind",
+ .inst_size = sizeof(rlm_winbind_t),
+ .config = module_config,
+ .instantiate = mod_instantiate,
+ .bootstrap = mod_bootstrap,
+ .detach = mod_detach
+ },
.methods = {
[MOD_AUTHENTICATE] = mod_authenticate,
[MOD_AUTHORIZE] = mod_authorize
* That is, everything else should be 'static'.
*
* If the module needs to temporarily modify it's instantiation
- * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ * data, the type should be changed to MODULE_TYPE_THREAD_UNSAFE.
* The server will then take care of ensuring that the module
* is single-threaded.
*/
-extern module_t rlm_yubikey;
-module_t rlm_yubikey = {
- .magic = RLM_MODULE_INIT,
- .name = "yubikey",
- .type = RLM_TYPE_THREAD_SAFE,
- .inst_size = sizeof(rlm_yubikey_t),
- .onload = mod_load,
- .unload = mod_unload,
- .config = module_config,
- .bootstrap = mod_bootstrap,
- .instantiate = mod_instantiate,
+extern module_rlm_t rlm_yubikey;
+module_rlm_t rlm_yubikey = {
+ .common = {
+ .magic = MODULE_MAGIC_INIT,
+ .name = "yubikey",
+ .type = MODULE_TYPE_THREAD_SAFE,
+ .inst_size = sizeof(rlm_yubikey_t),
+ .onload = mod_load,
+ .unload = mod_unload,
+ .config = module_config,
+ .bootstrap = mod_bootstrap,
+ .instantiate = mod_instantiate,
#ifdef HAVE_YKCLIENT
- .detach = mod_detach,
+ .detach = mod_detach,
#endif
+ },
.methods = {
[MOD_AUTHENTICATE] = mod_authenticate,
[MOD_AUTHORIZE] = mod_authorize
extern fr_process_module_t process_arp;
fr_process_module_t process_arp = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "process_arp",
.inst_size = sizeof(process_arp_t),
.process = mod_process,
extern fr_process_module_t process_control;
fr_process_module_t process_control = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "process_control",
.process = mod_process,
.dict = &dict_freeradius,
extern fr_process_module_t process_dhcpv4;
fr_process_module_t process_dhcpv4 = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "process_dhcpv4",
.inst_size = sizeof(process_dhcpv4_t),
.process = mod_process,
extern fr_process_module_t process_dhcpv6;
fr_process_module_t process_dhcpv6 = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "process_dhcpv6",
.config = dhcpv6_process_config,
.inst_size = sizeof(process_dhcpv6_t),
extern fr_process_module_t process_dns;
fr_process_module_t process_dns = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "process_dns",
.inst_size = sizeof(process_dns_t),
.process = mod_process,
extern fr_process_module_t process_eap_aka;
fr_process_module_t process_eap_aka = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "process_eap_aka",
.onload = mod_load,
.unload = mod_unload,
extern fr_process_module_t process_eap_aka_prime;
fr_process_module_t process_eap_aka_prime = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "process_eap_aka_prime",
.onload = mod_load,
.unload = mod_unload,
extern fr_process_module_t process_eap_sim;
fr_process_module_t process_eap_sim = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "process_eap_sim",
.onload = mod_load,
.unload = mod_unload,
extern fr_process_module_t process_radius;
fr_process_module_t process_radius = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "process_radius",
.config = config,
.inst_size = sizeof(process_radius_t),
extern fr_process_module_t process_tacacs;
fr_process_module_t process_tacacs = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "process_tacacs",
.config = config,
.inst_size = sizeof(process_tacacs_t),
extern fr_process_module_t process_tls;
fr_process_module_t process_tls = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "process_tls",
.inst_size = sizeof(process_tls_t),
.process = mod_process,
extern fr_process_module_t process_ttls;
fr_process_module_t process_ttls = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "process_ttls",
.config = config,
.inst_size = sizeof(process_ttls_t),
extern fr_process_module_t process_vmps;
fr_process_module_t process_vmps = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "process_vmps",
.inst_size = sizeof(process_vmps_t),
extern fr_proto_lib_t const libfreeradius_ethernet;
fr_proto_lib_t const libfreeradius_ethernet = {
- .magic = RLM_MODULE_INIT,
+ .magic = MODULE_MAGIC_INIT,
.name = "ethernet",
.inst_size = sizeof(fr_ethernet_proto_ctx_t),