28 RCSID(
"$Id: 3452d679c08ed0c180c7969b1ff2f00a7b960e86 $")
30 #include <freeradius-devel/server/base.h>
31 #include <freeradius-devel/server/map_proc_priv.h>
32 #include <freeradius-devel/util/debug.h>
33 #include <freeradius-devel/util/value.h>
123 DEBUG(
"map_proc: Failed to create tree");
182 if (!
inst->data)
return NULL;
208 return inst->proc->evaluate(p_result,
inst->proc->mod_inst,
inst->data, request, result,
inst->maps);
unlang_action_t
Returned by unlang_op_t calls, determine the next action of the interpreter.
#define MEMCMP_RETURN(_a, _b, _field, _len_field)
Return if the contents of the specified field is not identical between the specified structures.
A section grouping multiple CONF_PAIR.
int map_proc_register(void *mod_inst, char const *name, map_proc_func_t evaluate, map_proc_instantiate_t instantiate, size_t inst_size, fr_value_box_safe_for_t literals_safe_for)
Register a map processor.
unlang_action_t map_proc(rlm_rcode_t *p_result, request_t *request, map_proc_inst_t const *inst, fr_value_box_list_t *result)
Evaluate a set of maps using the specified map processor.
map_proc_t * map_proc_find(char const *name)
Find a map processor by name.
static void _map_proc_tree_free(void *proc)
static int _map_proc_talloc_free(map_proc_t *proc)
Unregister a map processor.
map_proc_inst_t * map_proc_instantiate(TALLOC_CTX *ctx, map_proc_t const *proc, CONF_SECTION *cs, tmpl_t const *src, map_list_t const *maps)
Create a new map proc instance.
void map_proc_free(void)
Free all map_processors unregistering them.
static fr_rb_tree_t * map_proc_root
static int8_t map_proc_cmp(void const *one, void const *two)
Compare two map_proc_t structs, based ONLY on the name.
unlang_action_t(* map_proc_func_t)(rlm_rcode_t *p_result, void *mod_inst, void *proc_inst, request_t *request, fr_value_box_list_t *result, map_list_t const *maps)
Function to evaluate the src string and map the result to server attributes.
int(* map_proc_instantiate_t)(CONF_SECTION *cs, void *mod_inst, void *proc_inst, tmpl_t const *src, map_list_t const *maps)
Allocate new instance data for a map processor.
char name[FR_MAX_STRING_LEN]
Name of the map function.
int length
Length of name.
fr_value_box_safe_for_t literals_safe_for
Safe for values to be set for literals in the map source.
size_t inst_size
Size of map_proc instance data to allocate.
map_proc_func_t evaluate
Module's map processor function.
void * mod_inst
Module instance.
map_proc_instantiate_t instantiate
Callback to create new instance struct.
Map processor registration.
int fr_rb_replace(void **old, fr_rb_tree_t *tree, void const *data)
Replace old data with new data, OR insert if there is no old.
bool fr_rb_delete(fr_rb_tree_t *tree, void const *data)
Remove node and free data (if a free function was specified)
void * fr_rb_find(fr_rb_tree_t const *tree, void const *data)
Find an element in the tree, returning the data, not the node.
#define fr_rb_inline_talloc_alloc(_ctx, _type, _field, _data_cmp, _data_free)
Allocs a red black that verifies elements are of a specific talloc type.
The main red black tree structure.
rlm_rcode_t
Return codes indicating the result of the module call.
static int instantiate(module_inst_ctx_t const *mctx)
eap_aka_sim_process_conf_t * inst
size_t strlcpy(char *dst, char const *src, size_t siz)
uintptr_t fr_value_box_safe_for_t
Escaping that's been applied to a value box.