27RCSID(
"$Id: 1cdbbeb50be0a2e088a2961ae98069b0f6df3044 $")
29#include <freeradius-devel/server/base.h>
38 cf_log_err(cs,
"Missing source of value list");
67 fr_value_box_list_t *
in, map_list_t
const *maps)
72 uint32_t index, i = 0, value_count = fr_value_box_list_num_elements(
in);
73 TALLOC_CTX *local = talloc_new(NULL);
76 if (value_count == 0)
goto finish;
82 while ((vb = fr_value_box_list_next(
in, vb))) values[i++] = vb;
89 while ((map = map_list_next(maps, map))) {
91 RPERROR(
"Failed expanding map RHS");
95 if (index > value_count) {
96 RWARN(
"Asked for index %d when max is %d.", index, value_count);
100 RDEBUG2(
"Skipping null value for index %d.", index);
unlang_action_t
Returned by unlang_op_t calls, determine the next action of the interpreter.
A section grouping multiple CONF_PAIR.
#define cf_log_err(_cf, _fmt,...)
#define RPEDEBUG(fmt,...)
int map_to_request(request_t *request, map_t const *map, radius_map_getvalue_t func, void *ctx)
Convert map_t to fr_pair_t (s) and add them to a request_t.
static int _map_global_init(UNUSED void *uctx)
static TALLOC_CTX * map_ctx
static unlang_action_t mod_list_map_proc(unlang_result_t *p_result, UNUSED map_ctx_t const *mpctx, request_t *request, fr_value_box_list_t *in, map_list_t const *maps)
Map a list of value boxes to attributes using the index number in the list.
static int _map_global_free(UNUSED void *uctx)
int map_global_init(void)
static int _list_map_proc_get_value(TALLOC_CTX *ctx, fr_pair_list_t *out, request_t *request, map_t const *map, void *uctx)
static int list_map_verify(CONF_SECTION *cs, UNUSED void const *mod_inst, UNUSED void *proc_inst, tmpl_t const *src, UNUSED map_list_t const *maps)
int map_proc_register(TALLOC_CTX *ctx, void const *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.
Temporary structure to hold arguments for map calls.
@ FR_TYPE_NULL
Invalid (uninitialised) attribute type.
int fr_pair_append(fr_pair_list_t *list, fr_pair_t *to_add)
Add a VP to the end of the list.
fr_pair_t * fr_pair_afrom_da(TALLOC_CTX *ctx, fr_dict_attr_t const *da)
Dynamically allocate a new attribute and assign a fr_dict_attr_t.
#define RETURN_UNLANG_RCODE(_rcode)
rlm_rcode_t
Return codes indicating the result of the module call.
@ RLM_MODULE_FAIL
Module failed, don't reply.
@ RLM_MODULE_UPDATED
OK (pairs modified).
@ RLM_MODULE_NOOP
Module succeeded without doing anything.
static fr_dict_attr_t const * tmpl_attr_tail_da(tmpl_t const *vpt)
Return the last attribute reference da.
#define tmpl_aexpand(_ctx, _out, _request, _vpt, _escape, _escape_ctx)
Expand a tmpl to a C type, allocing a new buffer to hold the string.
fr_aka_sim_id_type_t type
tmpl_t * lhs
Typically describes the attribute to add, modify or compare.
tmpl_t * rhs
Typically describes a literal value or a src attribute to copy or compare.
Stores an attribute, a value and various bits of other data.
fr_dict_attr_t const *_CONST da
Dictionary attribute defines the attribute number, vendor and type of the pair.
int fr_value_box_cast(TALLOC_CTX *ctx, fr_value_box_t *dst, fr_type_t dst_type, fr_dict_attr_t const *dst_enumv, fr_value_box_t const *src)
Convert one type of fr_value_box_t to another.
static size_t char ** out
#define FR_VALUE_BOX_SAFE_FOR_ANY