25 RCSID(
"$Id: ff3e1336ee384078ce1e3bb49f99e00307df4f91 $")
27 #define LOG_PREFIX mctx->mi->name
29 #include <freeradius-devel/server/base.h>
30 #include <freeradius-devel/server/module_rlm.h>
31 #include <freeradius-devel/server/tmpl.h>
32 #include <freeradius-devel/util/debug.h>
33 #include <freeradius-devel/util/inet.h>
34 #include <freeradius-devel/unlang/xlat_func.h>
205 RINFO(
"RINFO message");
209 RWARN(
"RWARN message");
216 RERROR(
"RERROR error message");
218 REDEBUG(
"RDEBUG error message");
282 RDEBUG(
"Test called main retry handler - that's a failure");
302 RDEBUG(
"Test timed out as expected");
310 case FR_SIGNAL_RETRY:
316 case FR_SIGNAL_TIMEOUT:
351 fr_value_box_list_t *
in)
384 fr_value_box_list_t *
in)
425 t->
value = pthread_self();
426 INFO(
"Performing instantiation for thread %p (ctx %p)", (
void *)t->
value, t);
435 INFO(
"Performing detach for thread %p", (
void *)t->
value);
460 INFO(
"Informational message");
461 WARN(
"Warning message");
462 ERROR(
"Error message");
463 DEBUG(
"Debug message");
474 INFO(
"inst->tmpl is NULL");
480 INFO(
"inst->tmpl_m is NULL");
unlang_action_t
Returned by unlang_op_t calls, determine the next action of the interpreter.
#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
#define FR_CONF_OFFSET_FLAGS(_name, _flags, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
@ CONF_FLAG_MULTI
CONF_PAIR can have multiple copies.
#define FR_CONF_OFFSET_TYPE_FLAGS(_name, _type, _flags, _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.
static int fr_dcursor_append(fr_dcursor_t *cursor, void *v)
Insert a single item at the end of the list.
#define fr_cond_assert(_x)
Calls panic_action ifndef NDEBUG, else logs error and evaluates to value of _x.
fr_dict_attr_t const ** out
Where to write a pointer to the resolved fr_dict_attr_t.
fr_dict_t const ** out
Where to write a pointer to the loaded/resolved fr_dict_t.
Specifies an attribute which must be present for the module to function.
Specifies a dictionary which must be loaded/loadable for the module to function.
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
Struct to represent an ethernet address.
Struct to represent an interface id.
unlang_interpret_t * unlang_interpret_get(request_t *request)
Get the interpreter set for a request.
void unlang_interpret_mark_runnable(request_t *request)
Mark a request as resumable.
#define REXDENT()
Exdent (unindent) R* messages by one level.
#define REDEBUG3(fmt,...)
#define RPEDEBUG(fmt,...)
#define REDEBUG2(fmt,...)
#define REDEBUG4(fmt,...)
#define RINDENT()
Indent R* messages by one level.
@ FR_TYPE_IPV4_ADDR
32 Bit IPv4 Address.
@ FR_TYPE_IPV6_PREFIX
IPv6 Prefix.
@ FR_TYPE_STRING
String of printable characters.
@ FR_TYPE_IPV6_ADDR
128 Bit IPv6 Address.
@ FR_TYPE_IPV4_PREFIX
IPv4 Prefix.
@ FR_TYPE_BOOL
A truth value.
@ FR_TYPE_COMBO_IP_ADDR
IPv4 or IPv6 address depending on length.
void * thread
Thread specific instance data.
void * thread
Thread instance data.
module_instance_t const * mi
Instance of the module being instantiated.
module_instance_t * mi
Instance of the module being instantiated.
Temporary structure to hold arguments for module calls.
Temporary structure to hold arguments for instantiation calls.
Temporary structure to hold arguments for thread_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.
rlm_rcode_t
Return codes indicating the result of the module call.
static xlat_arg_parser_t const test_xlat_fail_args[]
static int mod_load(void)
static unlang_action_t mod_authenticate(rlm_rcode_t *p_result, module_ctx_t const *mctx, UNUSED request_t *request)
static void mod_retry_signal(module_ctx_t const *mctx, request_t *request, fr_signal_t action)
fr_time_delta_t time_delta
fr_ipaddr_t * ipv4_addr_m
static xlat_action_t trigger_test_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in)
Run a trigger (useful for testing)
fr_ipaddr_t * ipv4_prefix_m
fr_ipaddr_t * ipv6_addr_m
static unlang_action_t mod_preacct(rlm_rcode_t *p_result, module_ctx_t const *mctx, UNUSED request_t *request)
static unlang_action_t mod_retry_resume(rlm_rcode_t *p_result, UNUSED module_ctx_t const *mctx, request_t *request)
Continue after marked runnable.
fr_ipaddr_t * combo_ipaddr_m
static unlang_action_t mod_accounting(rlm_rcode_t *p_result, module_ctx_t const *mctx, UNUSED request_t *request)
fr_time_delta_t * time_delta_m
static xlat_arg_parser_t const test_xlat_passthrough_args[]
static fr_dict_t const * dict_radius
static xlat_arg_parser_t const trigger_test_xlat_args[]
static int mod_bootstrap(module_inst_ctx_t const *mctx)
static xlat_action_t test_xlat_passthrough(TALLOC_CTX *ctx, fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, UNUSED request_t *request, fr_value_box_list_t *in)
Run a generic xlat (useful for testing)
static void mod_unload(void)
static unlang_action_t mod_return(rlm_rcode_t *p_result, UNUSED module_ctx_t const *mctx, UNUSED request_t *request)
fr_dict_autoload_t rlm_test_dict[]
static unlang_action_t mod_authorize(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
static int mod_thread_instantiate(module_thread_inst_ctx_t const *mctx)
fr_ethernet_t * ethernet_m
fr_dict_attr_autoload_t rlm_test_dict_attr[]
fr_ipaddr_t * ipv6_prefix_m
uint8_t const ** octets_m
static fr_dict_attr_t const * attr_user_name
static unlang_action_t mod_retry_resume_retry(UNUSED rlm_rcode_t *p_result, UNUSED module_ctx_t const *mctx, request_t *request)
Continue after FR_SIGNAL_RETRY.
static unlang_action_t mod_retry_resume_timeout(rlm_rcode_t *p_result, UNUSED module_ctx_t const *mctx, request_t *request)
Continue after FR_SIGNAL_TIMEOUT.
static const conf_parser_t module_config[]
static xlat_action_t test_xlat_fail(UNUSED TALLOC_CTX *ctx, UNUSED fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, UNUSED request_t *request, UNUSED fr_value_box_list_t *in)
Always return XLAT_ACTION_FAIL.
static int mod_thread_detach(module_thread_inst_ctx_t const *mctx)
static unlang_action_t mod_retry(UNUSED rlm_rcode_t *p_result, UNUSED module_ctx_t const *mctx, request_t *request)
#define SECTION_NAME(_name1, _name2)
Define a section name consisting of a verb and a noun.
@ MODULE_TYPE_RETRY
can handle retries
void * data
Module's instance data.
void * boot
Data allocated during the boostrap phase.
#define MODULE_BINDING_TERMINATOR
Terminate a module binding list.
Named methods exported by a module.
int unlang_module_set_resume(request_t *request, module_method_t resume)
Change the resume function of a module.
unlang_action_t unlang_module_yield(request_t *request, module_method_t resume, unlang_module_signal_t signal, fr_signal_t sigmask, void *rctx)
Yield a request back to the interpreter from within a module.
MEM(pair_append_request(&vp, attr_eap_aka_sim_identity) >=0)
eap_aka_sim_process_conf_t * inst
#define talloc_foreach(_array, _iter)
Iterate over a talloced array of elements.
A time delta, a difference in time measured in nanoseconds.
int trigger_exec(unlang_interpret_t *intp, CONF_SECTION const *cs, char const *name, bool rate_limit, fr_pair_list_t *args)
Execute a trigger - call an executable to process an event.
bool required
Argument must be present, and non-empty.
@ XLAT_ARG_VARIADIC_EMPTY_KEEP
Empty argument groups are left alone, and either passed through as empty groups or null boxes.
#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_copy(TALLOC_CTX *ctx, fr_value_box_t *dst, const fr_value_box_t *src)
Copy value data verbatim duplicating any buffers.
#define fr_value_box_alloc(_ctx, _type, _enumv)
Allocate a value box of a specific type.
#define fr_value_box_list_foreach(_list_head, _iter)
static size_t char ** out
int xlat_func_args_set(xlat_t *x, xlat_arg_parser_t const args[])
Register the arguments of an xlat.
xlat_t * xlat_func_register(TALLOC_CTX *ctx, char const *name, xlat_func_t func, fr_type_t return_type)
Register an xlat function.
void xlat_func_unregister(char const *name)
Unregister an xlat function.