The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Defines functions for rlm module (re-)initialisation. More...
#include <freeradius-devel/server/module.h>
Go to the source code of this file.
Data Structures | |
struct | module_rlm_t |
Functions | |
static module_rlm_t const * | module_rlm_from_module (module_t const *module) |
Cast a module_t to a module_rlm_t. More... | |
Variables | |
char const * | section_type_value [MOD_COUNT] |
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... | |
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... | |
char const * | module_rlm_state_method_to_str (module_state_func_table_t const *table, module_method_t method, char const *def) |
module_method_t | module_rlm_state_str_to_method (module_state_func_table_t const *table, char const *name, module_method_t def) |
Module and module thread lookup | |
module_instance_t * | module_rlm_by_name (module_instance_t const *parent, char const *asked_name) |
module_instance_t * | module_rlm_by_name_and_method (module_method_t *method, call_env_method_t const **method_env, char const **name1, char const **name2, char const *asked_name) |
Find an existing module instance and verify it implements the specified method. More... | |
CONF_SECTION * | module_rlm_by_name_virtual (char const *asked_name) |
module_thread_instance_t * | module_rlm_thread_by_data (void const *data) |
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_rlm_t |
Definition at line 36 of file module_rlm.h.
Data Fields | ||
---|---|---|
module_t | common | Common fields presented by all modules. |
fr_dict_t const ** | dict | pointer to local fr_dict_t* |
module_method_name_t const * | method_names | named methods |
module_instance_t* module_rlm_by_name | ( | module_instance_t const * | parent, |
char const * | asked_name | ||
) |
Definition at line 785 of file module_rlm.c.
module_instance_t* module_rlm_by_name_and_method | ( | module_method_t * | method, |
call_env_method_t const ** | method_env, | ||
char const ** | name1, | ||
char const ** | name2, | ||
char const * | name | ||
) |
Find an existing module instance and verify it implements the specified method.
Extracts the method from the module name where the format is
<module>.<method>
and ensures the module implements the specified method.
[out] | method | the method function we will call |
[out] | method_env | the module_call_env to evaluate when compiling the method. |
[out] | name1 | name1 of the method being called |
[out] | name2 | name2 of the method being called |
[in] | name | The name of the module we're attempting to find, possibly concatenated with the method |
If the module exists but the method doesn't exist, then method
is set to NULL.
Definition at line 433 of file module_rlm.c.
CONF_SECTION* module_rlm_by_name_virtual | ( | char const * | asked_name | ) |
Definition at line 767 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 248 of file module_rlm.c.
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 92 of file module_rlm.c.
|
inlinestatic |
Cast a module_t to a module_rlm_t.
Definition at line 45 of file module_rlm.h.
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 397 of file module_rlm.c.
char const* module_rlm_state_method_to_str | ( | module_state_func_table_t const * | table, |
module_method_t | method, | ||
char const * | def | ||
) |
Definition at line 381 of file module_rlm.c.
module_method_t module_rlm_state_str_to_method | ( | module_state_func_table_t const * | table, |
char const * | name, | ||
module_method_t | def | ||
) |
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 913 of file module_rlm.c.
module_thread_instance_t* module_rlm_thread_by_data | ( | void const * | data | ) |
Definition at line 780 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 964 of file module_rlm.c.
int modules_rlm_free | ( | void | ) |
Cleanup all global structures.
Automatically called on exit.
Definition at line 1138 of file module_rlm.c.
int modules_rlm_init | ( | void | ) |
Initialise the module list structure.
Definition at line 1156 of file module_rlm.c.
int modules_rlm_instantiate | ( | void | ) |
Performs the instantiation phase for all backend modules.
Definition at line 950 of file module_rlm.c.
void modules_rlm_thread_detach | ( | void | ) |
Frees thread-specific data for all registered backend modules.
Definition at line 926 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 939 of file module_rlm.c.
|
extern |
Definition at line 64 of file module_rlm.c.