The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Defines functions for rlm module (re-)initialisation. More...
#include <freeradius-devel/server/module.h>
#include <freeradius-devel/server/virtual_servers.h>
Go to the source code of this file.
Data Structures | |
struct | module_method_call_t |
The output of module_rlm_by_name_and_method. More... | |
struct | module_rlm_instance_s |
struct | module_rlm_s |
struct | module_rlm_xlat_t |
An xlat function registered to a module. More... | |
Typedefs | |
typedef struct module_rlm_instance_s | module_rlm_instance_t |
typedef struct module_rlm_s | module_rlm_t |
Functions | |
static module_rlm_t * | module_rlm_from_module (module_t *module) |
Debug functions | |
void | module_rlm_list_debug (void) |
Print information on all loaded modules. More... | |
Convenience wrappers around other internal APIs to make them easier to instantiate with modules | |
fr_pool_t * | module_rlm_connection_pool_init (CONF_SECTION *module, void *opaque, fr_pool_connection_create_t c, fr_pool_connection_alive_t a, char const *log_prefix, char const *trigger_prefix, fr_pair_list_t *trigger_args) |
Initialise a module specific connection pool. More... | |
exfile_t * | module_rlm_exfile_init (TALLOC_CTX *ctx, CONF_SECTION *module, uint32_t max_entries, fr_time_delta_t max_idle, bool locking, char const *trigger_prefix, fr_pair_list_t *trigger_args) |
Initialise a module specific exfile handle. More... | |
xlat_t * | module_rlm_xlat_register (TALLOC_CTX *ctx, module_inst_ctx_t const *mctx, char const *name, xlat_func_t func, fr_type_t return_type)) |
Helper functions | |
bool | module_rlm_section_type_set (request_t *request, fr_dict_attr_t const *type_da, fr_dict_enum_value_t const *enumv) |
Set the next section type if it's not already set. More... | |
Module and module thread lookup | |
fr_slen_t | module_rlm_by_name_and_method (TALLOC_CTX *ctx, module_method_call_t *mmc_out, virtual_server_t const *vs, section_name_t const *section, fr_sbuff_t *name, tmpl_rules_t const *t_rules)) |
Find an existing module instance and verify it implements the specified method. More... | |
module_instance_t * | module_rlm_dynamic_by_name (module_instance_t const *parent, char const *name) |
module_instance_t * | module_rlm_static_by_name (module_instance_t const *parent, char const *name) |
CONF_SECTION * | module_rlm_virtual_by_name (char const *name) |
Support functions | |
int | module_rlm_submodule_parse (TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule) |
Generic conf_parser_t func for loading drivers. More... | |
Module and module thread initialisation and instantiation | |
int | modules_rlm_bootstrap (CONF_SECTION *root) |
Bootstrap modules and virtual modules. More... | |
int | modules_rlm_instantiate (void) |
Performs the instantiation phase for all backend modules. More... | |
void | modules_rlm_thread_detach (void) |
Frees thread-specific data for all registered backend modules. More... | |
int | modules_rlm_thread_instantiate (TALLOC_CTX *ctx, fr_event_list_t *el)) |
Allocates thread-specific data for all registered backend modules. More... | |
Global initialisation and free functions | |
int | modules_rlm_free (void) |
Cleanup all global structures. More... | |
int | modules_rlm_init (void) |
Initialise the module list structure. More... | |
Defines functions for rlm module (re-)initialisation.
Definition in file module_rlm.h.
struct module_method_call_t |
The output of module_rlm_by_name_and_method.
Everything needed to call a module method.
Definition at line 62 of file module_rlm.h.
Data Fields | ||
---|---|---|
section_name_t | asked |
The actual <name1>. <name2> used for the module call. This was either the override the user specified, or the name of the section. |
tmpl_t * | key | Dynamic key, only set for dynamic modules. |
module_instance_t * | mi |
The process modules also push module calls onto the stack for execution. So we need to use the common type here. |
module_method_binding_t | mmb | Method we're calling. |
module_rlm_t const * | rlm | Cached module_rlm_t. |
struct module_rlm_instance_s |
Definition at line 43 of file module_rlm.h.
Data Fields | ||
---|---|---|
fr_dlist_head_t | xlats |
xlats registered to this module instance. This is used by the redundant/loadbalance xlats to register versions of the xlats exported by the module instances. |
struct module_rlm_s |
Definition at line 38 of file module_rlm.h.
Data Fields | ||
---|---|---|
module_t | common | Common fields presented by all modules. |
module_method_group_t | method_group | named methods |
struct module_rlm_xlat_t |
An xlat function registered to a module.
Definition at line 52 of file module_rlm.h.
Data Fields | ||
---|---|---|
fr_dlist_t | entry | Entry in a linked list of registered xlats. |
module_instance_t * | mi | The module instance that registered the xlat. |
xlat_t const * | xlat | The xlat function. |
typedef struct module_rlm_instance_s module_rlm_instance_t |
Definition at line 1 of file module_rlm.h.
typedef struct module_rlm_s module_rlm_t |
Definition at line 1 of file module_rlm.h.
fr_slen_t module_rlm_by_name_and_method | ( | TALLOC_CTX * | ctx, |
module_method_call_t * | mmc_out, | ||
virtual_server_t const * | vs, | ||
section_name_t const * | section, | ||
fr_sbuff_t * | name, | ||
tmpl_rules_t const * | t_rules | ||
) |
Find an existing module instance and verify it implements the specified method.
Extracts the method from the module name where the format is
<module>[.<method1>[.<method2>]]
and ensures the module implements the specified method.
[in] | ctx | to allocate the dynamic module key tmpl from. |
[out] | mmc_out | the result from resolving the module method, plus the key tmpl for dynamic modules. This is not allocated from the ctx to save the runtime dereference. |
[in] | vs | Virtual server to search for alternative module names in. |
[in] | section | Section name containing the module call. |
[in] | name | The module method call i.e. module[<key>][.<method>] |
[in] | t_rules | for resolving the dynamic module key. |
If the module exists but the method doesn't exist, then method
is set to NULL.
Definition at line 569 of file module_rlm.c.
fr_pool_t* module_rlm_connection_pool_init | ( | CONF_SECTION * | module, |
void * | opaque, | ||
fr_pool_connection_create_t | c, | ||
fr_pool_connection_alive_t | a, | ||
char const * | log_prefix, | ||
char const * | trigger_prefix, | ||
fr_pair_list_t * | trigger_args | ||
) |
Initialise a module specific connection pool.
[in] | module | section. |
[in] | opaque | data pointer to pass to callbacks. |
[in] | c | Callback to create new connections. |
[in] | a | Callback to check the status of connections. |
[in] | log_prefix | override, if NULL will be set automatically from the module CONF_SECTION. |
[in] | trigger_prefix | if NULL will be set automatically from the module CONF_SECTION. |
[in] | trigger_args | to make available in any triggers executed by the connection pool. |
Definition at line 308 of file module_rlm.c.
module_instance_t* module_rlm_dynamic_by_name | ( | module_instance_t const * | parent, |
char const * | name | ||
) |
exfile_t* module_rlm_exfile_init | ( | TALLOC_CTX * | ctx, |
CONF_SECTION * | module, | ||
uint32_t | max_entries, | ||
fr_time_delta_t | max_idle, | ||
bool | locking, | ||
char const * | trigger_prefix, | ||
fr_pair_list_t * | trigger_args | ||
) |
Initialise a module specific exfile handle.
[in] | ctx | to bind the lifetime of the exfile handle to. |
[in] | module | section. |
[in] | max_entries | Max file descriptors to cache, and manage locks for. |
[in] | max_idle | Maximum time a file descriptor can be idle before it's closed. |
[in] | locking | Whether or not to lock the files. |
[in] | trigger_prefix | if NULL will be set automatically from the module CONF_SECTION. |
[in] | trigger_args | to make available in any triggers executed by the connection pool. |
Definition at line 116 of file module_rlm.c.
|
inlinestatic |
void module_rlm_list_debug | ( | void | ) |
Print information on all loaded modules.
Definition at line 96 of file module_rlm.c.
bool module_rlm_section_type_set | ( | request_t * | request, |
fr_dict_attr_t const * | type_da, | ||
fr_dict_enum_value_t const * | enumv | ||
) |
Set the next section type if it's not already set.
[in] | request | The current request. |
[in] | type_da | to use. Usually attr_auth_type. |
[in] | enumv | Enumeration value of the specified type_da. |
Definition at line 427 of file module_rlm.c.
module_instance_t* module_rlm_static_by_name | ( | module_instance_t const * | parent, |
char const * | name | ||
) |
Definition at line 828 of file module_rlm.c.
int module_rlm_submodule_parse | ( | TALLOC_CTX * | ctx, |
void * | out, | ||
void * | parent, | ||
CONF_ITEM * | ci, | ||
conf_parser_t const * | rule | ||
) |
Generic conf_parser_t func for loading drivers.
Definition at line 950 of file module_rlm.c.
CONF_SECTION* module_rlm_virtual_by_name | ( | char const * | name | ) |
Definition at line 810 of file module_rlm.c.
xlat_t* module_rlm_xlat_register | ( | TALLOC_CTX * | ctx, |
module_inst_ctx_t const * | mctx, | ||
char const * | name, | ||
xlat_func_t | func, | ||
fr_type_t | return_type | ||
) |
Definition at line 257 of file module_rlm.c.
int modules_rlm_bootstrap | ( | CONF_SECTION * | root | ) |
Bootstrap modules and virtual modules.
Parse the module config sections, and load and call each module's init() function.
[in] | root | of the server configuration. |
Definition at line 1214 of file module_rlm.c.
int modules_rlm_free | ( | void | ) |
Cleanup all global structures.
Automatically called on exit.
Definition at line 1352 of file module_rlm.c.
int modules_rlm_init | ( | void | ) |
Initialise the module list structure.
Definition at line 1370 of file module_rlm.c.
int modules_rlm_instantiate | ( | void | ) |
Performs the instantiation phase for all backend modules.
Definition at line 987 of file module_rlm.c.
void modules_rlm_thread_detach | ( | void | ) |
Frees thread-specific data for all registered backend modules.
Definition at line 963 of file module_rlm.c.
int modules_rlm_thread_instantiate | ( | TALLOC_CTX * | ctx, |
fr_event_list_t * | el | ||
) |
Allocates thread-specific data for all registered backend modules.
[in] | ctx | To allocate any thread-specific data in. |
[in] | el | to register events. |
Definition at line 976 of file module_rlm.c.