The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Functions | Variables
module_rlm.h File Reference

Defines functions for rlm module (re-)initialisation. More...

#include <freeradius-devel/server/module.h>
+ Include dependency graph for module_rlm.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_tmodule_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_tmodule_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_tmodule_rlm_by_name (module_instance_t const *parent, char const *asked_name)
 
module_instance_tmodule_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_SECTIONmodule_rlm_by_name_virtual (char const *asked_name)
 
module_thread_instance_tmodule_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...
 

Detailed Description

Defines functions for rlm module (re-)initialisation.

Id
bc6487c43fafb70cca2675812562f2163931c392

Definition in file module_rlm.h.


Data Structure Documentation

◆ module_rlm_t

struct module_rlm_t

Definition at line 36 of file module_rlm.h.

+ Collaboration diagram for module_rlm_t:
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

Function Documentation

◆ module_rlm_by_name()

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.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ module_rlm_by_name_and_method()

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.

Parameters
[out]methodthe method function we will call
[out]method_envthe module_call_env to evaluate when compiling the method.
[out]name1name1 of the method being called
[out]name2name2 of the method being called
[in]nameThe name of the module we're attempting to find, possibly concatenated with the method
Returns
  • The module instance on success.
  • NULL on not found

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.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ module_rlm_by_name_virtual()

CONF_SECTION* module_rlm_by_name_virtual ( char const *  asked_name)

Definition at line 767 of file module_rlm.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ module_rlm_connection_pool_init()

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.

See also
fr_pool_init
Parameters
[in]modulesection.
[in]opaquedata pointer to pass to callbacks.
[in]cCallback to create new connections.
[in]aCallback to check the status of connections.
[in]log_prefixoverride, if NULL will be set automatically from the module CONF_SECTION.
[in]trigger_prefixif NULL will be set automatically from the module CONF_SECTION.
[in]trigger_argsto make available in any triggers executed by the connection pool.
Returns
  • New connection pool.
  • NULL on error.

Definition at line 248 of file module_rlm.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ module_rlm_exfile_init()

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.

See also
exfile_init
Parameters
[in]ctxto bind the lifetime of the exfile handle to.
[in]modulesection.
[in]max_entriesMax file descriptors to cache, and manage locks for.
[in]max_idleMaximum time a file descriptor can be idle before it's closed.
[in]lockingWhether or not to lock the files.
[in]trigger_prefixif NULL will be set automatically from the module CONF_SECTION.
[in]trigger_argsto make available in any triggers executed by the connection pool.
Returns
  • New connection pool.
  • NULL on error.

Definition at line 92 of file module_rlm.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ module_rlm_from_module()

static module_rlm_t const* module_rlm_from_module ( module_t const *  module)
inlinestatic

Cast a module_t to a module_rlm_t.

Definition at line 45 of file module_rlm.h.

+ Here is the caller graph for this function:

◆ module_rlm_section_type_set()

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.

Parameters
[in]requestThe current request.
[in]type_dato use. Usually attr_auth_type.
[in]enumvEnumeration value of the specified type_da.

Definition at line 397 of file module_rlm.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ module_rlm_state_method_to_str()

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_rlm_state_str_to_method()

module_method_t module_rlm_state_str_to_method ( module_state_func_table_t const *  table,
char const *  name,
module_method_t  def 
)

Definition at line 364 of file module_rlm.c.

+ Here is the call graph for this function:

◆ module_rlm_submodule_parse()

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.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ module_rlm_thread_by_data()

module_thread_instance_t* module_rlm_thread_by_data ( void const *  data)

Definition at line 780 of file module_rlm.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ modules_rlm_bootstrap()

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.

Parameters
[in]rootof the server configuration.
Returns
  • 0 if all modules were bootstrapped successfully.
  • -1 if a module/virtual module failed to bootstrap.

Definition at line 964 of file module_rlm.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ modules_rlm_free()

int modules_rlm_free ( void  )

Cleanup all global structures.

Automatically called on exit.

Definition at line 1138 of file module_rlm.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ modules_rlm_init()

int modules_rlm_init ( void  )

Initialise the module list structure.

Definition at line 1156 of file module_rlm.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ modules_rlm_instantiate()

int modules_rlm_instantiate ( void  )

Performs the instantiation phase for all backend modules.

Returns
  • 0 if all modules were instantiated successfully.
  • -1 if a module failed instantiation.

Definition at line 950 of file module_rlm.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ modules_rlm_thread_detach()

void modules_rlm_thread_detach ( void  )

Frees thread-specific data for all registered backend modules.

Definition at line 926 of file module_rlm.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ modules_rlm_thread_instantiate()

int modules_rlm_thread_instantiate ( TALLOC_CTX *  ctx,
fr_event_list_t el 
)

Allocates thread-specific data for all registered backend modules.

Parameters
[in]ctxTo allocate any thread-specific data in.
[in]elto register events.
Returns
  • 0 if all modules were instantiated successfully.
  • -1 if a module failed instantiation.

Definition at line 939 of file module_rlm.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ section_type_value

char const* section_type_value[MOD_COUNT]
extern

Definition at line 64 of file module_rlm.c.