2 * module.h Interface to the RADIUS module system.
11 * The types of the functions which are supported by each module.
12 * The functional parameters are defined here, so we don't have to
13 * edit each and every module when we decide to add another type
16 typedef int (*RLM_AUTHORIZE_FUNCP)(REQUEST *request);
17 typedef int (*RLM_AUTHENTICATE_FUNCP)(REQUEST *request);
18 typedef int (*RLM_POST_AUTHENTICATE_FUNCP)(REQUEST *request);
19 typedef int (*RLM_PRE_ACCOUNTING_FUNCP)(REQUEST *request);
20 typedef int (*RLM_ACCOUNTING_FUNCP)(REQUEST *request);
22 /* Shouldn't need these anymore */
23 #define RLM_COMPONENT_AUTH 0
24 #define RLM_COMPONENT_AUTZ 1
25 #define RLM_COMPONENT_PREACCT 2
26 #define RLM_COMPONENT_ACCT 3
27 #define RLM_COMPONENT_COUNT 4 /* How many components are there */
29 typedef struct module_t {
31 int type; /* reserved */
33 int (*instantiate)(CONF_SECTION *mod_cs, void **instance);
34 int (*authorize)(void *instance, REQUEST *request);
35 int (*authenticate)(void *instance, REQUEST *request);
36 int (*preaccounting)(void *instance, REQUEST *request);
37 int (*accounting)(void *instance, REQUEST *request);
38 int (*detach)(void *instance);
43 RLM_MODULE_REJECT = -2, /* reject the request */
44 RLM_MODULE_FAIL = -1, /* module failed, don't reply */
45 RLM_MODULE_OK = 0, /* the module is OK, continue */
46 RLM_MODULE_HANDLED = 1 /* the module handled the request, so stop. */
49 int setup_modules(void);
50 int module_authorize(REQUEST *request);
51 int module_authenticate(int type, REQUEST *request);
52 int module_preacct(REQUEST *request);
53 int module_accounting(REQUEST *request);