Interface to the RADIUS module system. More...
#include <freeradius-devel/conffile.h>
#include <freeradius-devel/features.h>
#include <freeradius-devel/connection.h>
Go to the source code of this file.
Data Structures | |
struct | module_t |
Metadata exported by the module. More... | |
struct | section_type_value_t |
Map a section name, to a section typename, to an attribute number. More... | |
Macros | |
#define | MODULE_NULL_COA_FUNCS ,NULL,NULL |
#define | RLM_MODULE_INIT RADIUSD_MAGIC_NUMBER |
#define | RLM_TYPE_HUP_SAFE (1 << 2) |
Will be restarted on HUP. More... | |
#define | RLM_TYPE_THREAD_SAFE (0 << 0) |
Module is threadsafe. More... | |
#define | RLM_TYPE_THREAD_UNSAFE (1 << 0) |
Module is not threadsafe. More... | |
Typedefs | |
typedef int(* | detach_t )(void *instance) |
Module detach callback. More... | |
typedef int(* | instantiate_t )(CONF_SECTION *mod_cs, void *instance) |
Module instantiation callback. More... | |
typedef struct module_t | module_t |
Metadata exported by the module. More... | |
typedef rlm_rcode_t(* | packetmethod )(void *instance, REQUEST *request) |
Module section callback. More... | |
typedef enum rlm_components | rlm_components_t |
The different section components of the server. More... | |
typedef struct section_type_value_t | section_type_value_t |
Map a section name, to a section typename, to an attribute number. More... | |
Enumerations | |
enum | rlm_components { MOD_AUTHENTICATE = 0, MOD_AUTHORIZE, MOD_PREACCT, MOD_ACCOUNTING, MOD_SESSION, MOD_PRE_PROXY, MOD_POST_PROXY, MOD_POST_AUTH, MOD_RECV_COA, MOD_SEND_COA, MOD_COUNT } |
The different section components of the server. More... | |
Variables | |
const FR_NAME_NUMBER | mod_rcode_table [] |
const section_type_value_t | section_type_value [] |
Mappings between section names, typenames and control attributes. More... | |
Interface to the RADIUS module system.
Definition in file modules.h.
struct module_t |
Metadata exported by the module.
This determines the capabilities of the module, and maps internal functions within the module to different sections.
Data Fields | ||
---|---|---|
instantiate_t | bootstrap | register dynamic attrs, etc. |
CONF_PARSER const * | config | Configuration information. |
detach_t | detach | Function to use to free module instance. |
size_t | inst_size | Size of the instance data. |
instantiate_t | instantiate | Function to use for instantiation. |
uint64_t | magic | Used to validate module struct. |
packetmethod | methods[MOD_COUNT] | Pointers to the various section functions. |
char const * | name | The name of the module (without rlm_ prefix). |
int | type | One or more of the RLM_TYPE_* constants. |
struct section_type_value_t |
Map a section name, to a section typename, to an attribute number.
Used by modules.c to define the mappings between names, types and control attributes.
Data Fields | ||
---|---|---|
int | attr | Attribute number. |
char const * | section | Section name e.g. "Authorize". |
char const * | typename | Type name e.g. "Auth-Type". |
#define RLM_MODULE_INIT RADIUSD_MAGIC_NUMBER |
#define RLM_TYPE_HUP_SAFE (1 << 2) |
#define RLM_TYPE_THREAD_SAFE (0 << 0) |
#define RLM_TYPE_THREAD_UNSAFE (1 << 0) |
typedef int(* detach_t)(void *instance) |
Module detach callback.
Is called just before the server exits, and after re-instantiation on HUP, to free the old module instance.
Detach should close all handles associated with the module instance, and free any memory allocated during instantiate.
[in] | instance | to free. |
typedef int(* instantiate_t)(CONF_SECTION *mod_cs, void *instance) |
Module instantiation callback.
Is called once per module instance. Is not called when new threads are spawned. Modules that require separate thread contexts should use the connection pool API.
[in] | mod_cs | Module instance's configuration section. |
[out] | instance | Module instance's configuration structure, should be alloced by by callback and freed by detach. |
Metadata exported by the module.
This determines the capabilities of the module, and maps internal functions within the module to different sections.
typedef rlm_rcode_t(* packetmethod)(void *instance, REQUEST *request) |
Module section callback.
Is called when the module is listed in a particular section of a virtual server, and the request has reached the module call.
[in] | instance | created in instantiated, holds module config. |
[in,out] | request | being processed. |
typedef enum rlm_components rlm_components_t |
The different section components of the server.
Used as indexes in the methods array in the module_t struct.
typedef struct section_type_value_t section_type_value_t |
Map a section name, to a section typename, to an attribute number.
Used by modules.c to define the mappings between names, types and control attributes.
enum rlm_components |
The different section components of the server.
Used as indexes in the methods array in the module_t struct.
rlm_rcode_t indexed_modcall | ( | rlm_components_t | comp, |
int | idx, | ||
REQUEST * | request | ||
) |
fr_connection_pool_t* module_connection_pool_init | ( | CONF_SECTION * | module, |
void * | opaque, | ||
fr_connection_create_t | c, | ||
fr_connection_alive_t | a, | ||
char const * | log_prefix | ||
) |
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. |
Definition at line 1759 of file modules.c.
rlm_rcode_t module_preacct | ( | REQUEST * | request | ) |
int modules_bootstrap | ( | CONF_SECTION * | ) |
int modules_free | ( | void | ) |
int modules_hup | ( | CONF_SECTION * | modules | ) |
int modules_init | ( | CONF_SECTION * | ) |
rlm_rcode_t process_accounting | ( | int | type, |
REQUEST * | request | ||
) |
rlm_rcode_t process_authenticate | ( | int | type, |
REQUEST * | request | ||
) |
rlm_rcode_t process_authorize | ( | int | type, |
REQUEST * | request | ||
) |
int process_checksimul | ( | int | type, |
REQUEST * | request, | ||
int | maxsimul | ||
) |
rlm_rcode_t process_post_auth | ( | int | type, |
REQUEST * | request | ||
) |
rlm_rcode_t process_post_proxy | ( | int | type, |
REQUEST * | request | ||
) |
rlm_rcode_t process_pre_proxy | ( | int | type, |
REQUEST * | request | ||
) |
rlm_rcode_t process_recv_coa | ( | int | type, |
REQUEST * | request | ||
) |
rlm_rcode_t process_send_coa | ( | int | type, |
REQUEST * | request | ||
) |
int virtual_servers_bootstrap | ( | CONF_SECTION * | config | ) |
int virtual_servers_init | ( | CONF_SECTION * | config | ) |
const FR_NAME_NUMBER mod_rcode_table[] |
const section_type_value_t section_type_value[] |