26 RCSIDH(xlat_register_h,
"$Id: 6d64d87b17c118971ad984eab390f5a557882302 $")
28 #include <freeradius-devel/unlang/xlat.h>
36 typedef enum CC_HINT(flag_enum) {
82 #define xlat_func_safe_for_set(_xlat, _escaped) _xlat_func_safe_for_set(_xlat, (uintptr_t) (_escaped))
93 #define xlat_func_instantiate_set(_xlat, _instantiate, _inst_struct, _detach, _uctx) \
94 _xlat_func_instantiate_set(_xlat, _instantiate, #_inst_struct, sizeof(_inst_struct), _detach, _uctx)
108 #define xlat_func_thread_instantiate_set(_xlat, _instantiate, _inst_struct, _detach, _uctx) \
109 _xlat_func_thread_instantiate_set(_xlat, _instantiate, #_inst_struct, sizeof(_inst_struct), _detach, _uctx)
112 char const *thread_inst_type,
size_t thread_inst_size,
fr_dcursor_eval_t void const * uctx
Temporary structure to hold arguments for instantiation calls.
static void thread_detach(UNUSED void *uctx)
Explicitly cleanup module/xlat resources.
static int thread_instantiate(TALLOC_CTX *ctx, fr_event_list_t *el, UNUSED void *uctx)
Create module and xlat per-thread instances.
static int instantiate(module_inst_ctx_t const *mctx)
eap_aka_sim_process_conf_t * inst
int(* xlat_thread_detach_t)(xlat_thread_inst_ctx_t const *xctx)
xlat thread detach callback
int(* xlat_detach_t)(xlat_inst_ctx_t const *xctx)
xlat detach callback
xlat_action_t(* xlat_func_t)(TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in)
xlat callback function
int(* xlat_thread_instantiate_t)(xlat_thread_inst_ctx_t const *xctx)
Allocate new thread instance data for an xlat instance.
int(* xlat_instantiate_t)(xlat_inst_ctx_t const *xctx)
Allocate new instance data for an xlat instance.
Definition for a single argument consumend by an xlat function.
void xlat_purify_func_set(xlat_t *xlat, xlat_purify_t func)
Set a resolve routine for an xlat function.
void _xlat_func_safe_for_set(xlat_t *xlat, uintptr_t escaped)
Set the escaped values for output boxes.
void xlat_func_free(void)
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_flags_set(xlat_t *x, xlat_func_flags_t flags)
Specify flags that alter the xlat's behaviour.
void xlat_func_call_env_set(xlat_t *x, call_env_method_t const *env)
Register call environment of an xlat.
void xlat_func_resolve_set(xlat_t *xlat, xlat_resolve_t func)
Set a resolve routine for an xlat function.
int(* xlat_purify_t)(xlat_exp_t *xlat, void *inst, request_t *request)
Custom function purify the result of an xlat function.
int(* xlat_resolve_t)(xlat_exp_t *xlat, void *inst, xlat_res_rules_t const *xr_rules)
Custom function to perform resolution of arguments.
fr_slen_t(* xlat_print_t)(fr_sbuff_t *in, xlat_exp_t const *self, void *inst, fr_sbuff_escape_rules_t const *e_rules)
Custom function to print xlat debug.
@ XLAT_FUNC_FLAG_INTERNAL
int xlat_func_args_set(xlat_t *xlat, xlat_arg_parser_t const args[])
Register the arguments of an xlat.
void xlat_func_unregister_module(module_instance_t const *inst)
void xlat_func_print_set(xlat_t *xlat, xlat_print_t func)
Set a print routine for an xlat function.
int8_t xlat_func_cmp(void const *one, void const *two)
Compare two xlat_t by the underlying function.
void xlat_mctx_set(xlat_t *x, module_inst_ctx_t const *mctx)
Associate a module calling ctx with the xlat.
void xlat_func_unregister(char const *name)
Unregister an xlat function.
void _xlat_func_thread_instantiate_set(xlat_t const *xlat, xlat_thread_instantiate_t thread_instantiate, char const *thread_inst_type, size_t thread_inst_size, xlat_thread_detach_t thread_detach, void *uctx)
Register an async xlat.
void _xlat_func_instantiate_set(xlat_t const *xlat, xlat_instantiate_t instantiate, char const *inst_type, size_t inst_size, xlat_detach_t detach, void *uctx)
Set global instantiation/detach callbacks.
xlat_t * xlat_func_find_module(module_inst_ctx_t const *mctx, char const *name)