25 RCSID(
"$Id: f954669b977ef0da53694bfe10ae3ed4889588f1 $")
27 #define LOG_PREFIX mctx->mi->name
29 #include <freeradius-devel/server/base.h>
30 #include <freeradius-devel/server/module.h>
31 #include <freeradius-devel/server/module_rlm.h>
32 #include <freeradius-devel/unlang/xlat_func.h>
94 if (!in_head || in_head->vb_length == 0)
goto done;
95 status = in_head->vb_strvalue;
100 if (strcmp(status,
"alive") == 0) {
107 RWARN(
"Unknown status \"%s\"", status);
unlang_action_t
Returned by unlang_op_t calls, determine the next action of the interpreter.
#define UNCONST(_type, _ptr)
Remove const qualification from a pointer.
#define CONF_PARSER_TERMINATOR
#define FR_CONF_OFFSET(_name, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
Defines a CONF_PAIR to C data type mapping.
#define cf_log_err(_cf, _fmt,...)
static int fr_dcursor_append(fr_dcursor_t *cursor, void *v)
Insert a single item at the end of the list.
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
@ FR_TYPE_STRING
String of printable characters.
module_instance_t const * mi
Instance of the module being instantiated.
module_instance_t * mi
Module instance to detach.
module_instance_t * mi
Instance of the module being instantiated.
Temporary structure to hold arguments for module calls.
Temporary structure to hold arguments for detach calls.
Temporary structure to hold arguments for instantiation calls.
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)
module_t common
Common fields presented by all modules.
static const conf_parser_t config[]
fr_table_num_sorted_t const rcode_table[]
#define RETURN_MODULE_RCODE(_rcode)
rlm_rcode_t
Return codes indicating the result of the module call.
@ RLM_MODULE_NOT_SET
Error resolving rcode (should not be returned by modules).
static int mod_detach(module_detach_ctx_t const *mctx)
static xlat_action_t always_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in)
Set module status or rcode.
static unlang_action_t mod_always_return(rlm_rcode_t *p_result, module_ctx_t const *mctx, UNUSED request_t *request)
char const * rcode_str
The base value.
static int mod_bootstrap(module_inst_ctx_t const *mctx)
static xlat_arg_parser_t const always_xlat_args[]
static const conf_parser_t module_config[]
bool force
If true, we force the rcode.
static int mod_instantiate(module_inst_ctx_t const *mctx)
rlm_rcode_t rcode
The integer constant representing rcode_str.
static int instantiate(module_inst_ctx_t const *mctx)
#define SECTION_NAME(_name1, _name2)
Define a section name consisting of a verb and a noun.
char const * name
Instance name e.g. user_database.
CONF_SECTION * conf
Module's instance configuration.
bool force
Force the module to return a specific code.
void * data
Module's instance data.
void * boot
Data allocated during the boostrap phase.
rlm_rcode_t code
Code module will return when 'force' has has been set to true.
#define MODULE_BINDING_TERMINATOR
Terminate a module binding list.
Named methods exported by a module.
MEM(pair_append_request(&vp, attr_eap_aka_sim_identity) >=0)
eap_aka_sim_process_conf_t * inst
#define fr_table_value_by_str(_table, _name, _def)
Convert a string to a value using a sorted or ordered table.
#define fr_table_str_by_value(_table, _number, _def)
Convert an integer to a string.
#define talloc_get_type_abort_const
bool single
Argument must only contain a single box.
#define XLAT_ARG_PARSER_TERMINATOR
@ XLAT_ACTION_FAIL
An xlat function failed.
@ XLAT_ACTION_DONE
We're done evaluating this level of nesting.
Definition for a single argument consumend by an xlat function.
int fr_value_box_strdup(TALLOC_CTX *ctx, fr_value_box_t *dst, fr_dict_attr_t const *enumv, char const *src, bool tainted)
Copy a nul terminated string to a fr_value_box_t.
#define fr_value_box_alloc_null(_ctx)
Allocate a value box for later use with a value assignment function.
static size_t char ** out
module_ctx_t const * mctx
Synthesised module calling ctx.
int xlat_func_args_set(xlat_t *x, xlat_arg_parser_t const args[])
Register the arguments of an xlat.