The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Functions
map_async.c File Reference
#include <freeradius-devel/server/exec.h>
#include <freeradius-devel/server/map.h>
#include <freeradius-devel/server/paircmp.h>
#include <freeradius-devel/server/tmpl_dcursor.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/util/misc.h>
#include <freeradius-devel/util/pair_legacy.h>
#include <freeradius-devel/protocol/radius/rfc2865.h>
#include <freeradius-devel/protocol/freeradius/freeradius.internal.h>
#include <ctype.h>
+ Include dependency graph for map_async.c:

Go to the source code of this file.

Functions

static vp_list_mod_tlist_mod_alloc (TALLOC_CTX *ctx)
 
static vp_list_mod_tlist_mod_delete_afrom_map (TALLOC_CTX *ctx, map_t const *original, map_t const *mutated)
 Allocate a 'delete' vp_list_mod_t. More...
 
static vp_list_mod_tlist_mod_empty_string_afrom_map (TALLOC_CTX *ctx, map_t const *original, map_t const *mutated)
 Allocate an 'empty_string' vp_list_mod_t. More...
 
static vp_list_mod_tlist_mod_generic_afrom_map (TALLOC_CTX *ctx, map_t const *original, map_t const *mutated)
 Allocate a 'generic' vp_list_mod_t. More...
 
static map_tmap_alloc (TALLOC_CTX *ctx)
 
static fr_pair_list_tmap_check_src_or_dst (request_t *request, map_t const *map, tmpl_t const *src_dst)
 Check that the destination list is currently value. More...
 
int map_list_mod_apply (request_t *request, vp_list_mod_t const *vlm)
 Apply the output of map_to_list_mod to a request. More...
 
static void map_list_mod_debug (request_t *request, map_t const *map, map_t const *mod, fr_value_box_t const *vb)
 Print debug for a modification map. More...
 
static fr_pair_tmap_list_mod_to_vp (TALLOC_CTX *ctx, tmpl_t const *attr, fr_value_box_t const *value)
 
static void map_list_mod_to_vps (TALLOC_CTX *ctx, fr_pair_list_t *list, vp_list_mod_t const *vlm)
 Allocate one or more fr_pair_ts from a vp_list_mod_t. More...
 
int map_to_list_mod (TALLOC_CTX *ctx, vp_list_mod_t **out, request_t *request, map_t const *original, fr_value_box_list_t *lhs_result, fr_value_box_list_t *rhs_result)
 Evaluate a map creating a new map with TMPL_TYPE_ATTR LHS and TMPL_TYPE_DATA RHS. More...
 

Function Documentation

◆ list_mod_alloc()

static vp_list_mod_t* list_mod_alloc ( TALLOC_CTX *  ctx)
inlinestatic

Definition at line 45 of file map_async.c.

+ Here is the caller graph for this function:

◆ list_mod_delete_afrom_map()

static vp_list_mod_t* list_mod_delete_afrom_map ( TALLOC_CTX *  ctx,
map_t const *  original,
map_t const *  mutated 
)
inlinestatic

Allocate a 'delete' vp_list_mod_t.

This will cause the dst (LHS) to be deleted when applied. This is intended to be used where the RHS expansion is NULL, and we're doing a := assignment, so need to delete the LHS.

Parameters
[in]ctxto allocate vp_list_mod_t in.
[in]originalThe map from the update section.
[in]mutatedThe original map but with a altered dst (LHS). If the LHS of the original map was not expanded, this should be the same as original.
Returns
  • A new vlm structure on success.
  • NULL on failure.

Definition at line 116 of file map_async.c.

+ Here is the call graph for this function:

◆ list_mod_empty_string_afrom_map()

static vp_list_mod_t* list_mod_empty_string_afrom_map ( TALLOC_CTX *  ctx,
map_t const *  original,
map_t const *  mutated 
)
inlinestatic

Allocate an 'empty_string' vp_list_mod_t.

This shallow copies the mutated map, but sets the RHS to be an empty string.

Parameters
[in]ctxto allocate vp_list_mod_t in.
[in]originalThe map from the update section.
[in]mutatedThe original map but with a altered dst (LHS). If the LHS of the original map was not expanded, this should be the same as original.
Returns
  • A new vlm structure on success.
  • NULL on failure.

Definition at line 156 of file map_async.c.

+ Here is the call graph for this function:

◆ list_mod_generic_afrom_map()

static vp_list_mod_t* list_mod_generic_afrom_map ( TALLOC_CTX *  ctx,
map_t const *  original,
map_t const *  mutated 
)
inlinestatic

Allocate a 'generic' vp_list_mod_t.

This covers most cases, where we need to allocate a vp_list_mod_t with a single modification map, with an attribute ref LHS, and a boxed value RHS.

Parameters
[in]ctxto allocate vp_list_mod_t in.
[in]originalThe map from the update section.
[in]mutatedThe original map but with a altered dst (LHS). If the LHS of the original map was not expanded, this should be the same as original.
Returns
  • A new vlm structure on success.
  • NULL on failure.

Definition at line 75 of file map_async.c.

+ Here is the call graph for this function:

◆ map_alloc()

static map_t* map_alloc ( TALLOC_CTX *  ctx)
inlinestatic

Definition at line 53 of file map_async.c.

+ Here is the caller graph for this function:

◆ map_check_src_or_dst()

static fr_pair_list_t* map_check_src_or_dst ( request_t request,
map_t const *  map,
tmpl_t const *  src_dst 
)
inlinestatic

Check that the destination list is currently value.

Parameters
[in]requestto resolve in the list in.
[in]mapto check
[in]src_dsta lhs or rhs tmpl to check.
Returns
  • destination list if list is valid.
  • NULL if destination list is invalid.

Definition at line 205 of file map_async.c.

+ Here is the call graph for this function:

◆ map_list_mod_apply()

int map_list_mod_apply ( request_t request,
vp_list_mod_t const *  vlm 
)

Apply the output of map_to_list_mod to a request.

Parameters
requestto modify.
vlmVP List Modification to apply.

Definition at line 922 of file map_async.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ map_list_mod_debug()

static void map_list_mod_debug ( request_t request,
map_t const *  map,
map_t const *  mod,
fr_value_box_t const *  vb 
)
inlinestatic

Print debug for a modification map.

Parameters
[in]requestbeing modified.
[in]mapThe original map.
[in]modThe ephemeral map which describes the change.
[in]vbThe value in the ephemeral map.

Definition at line 860 of file map_async.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ map_list_mod_to_vp()

static fr_pair_t* map_list_mod_to_vp ( TALLOC_CTX *  ctx,
tmpl_t const *  attr,
fr_value_box_t const *  value 
)
inlinestatic

Definition at line 802 of file map_async.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ map_list_mod_to_vps()

static void map_list_mod_to_vps ( TALLOC_CTX *  ctx,
fr_pair_list_t list,
vp_list_mod_t const *  vlm 
)
static

Allocate one or more fr_pair_ts from a vp_list_mod_t.

Definition at line 819 of file map_async.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ map_to_list_mod()

int map_to_list_mod ( TALLOC_CTX *  ctx,
vp_list_mod_t **  out,
request_t request,
map_t const *  original,
fr_value_box_list_t *  lhs_result,
fr_value_box_list_t *  rhs_result 
)

Evaluate a map creating a new map with TMPL_TYPE_ATTR LHS and TMPL_TYPE_DATA RHS.

This function creates maps for consumption by map_to_request.

Parameters
[in,out]ctxto allocate modification maps in.
[out]outWhere to write the fr_pair_t (s), which may be NULL if not found
[in]requestThe current request.
[in]originalthe map. The LHS (dst) has to be TMPL_TYPE_ATTR.
[in]lhs_resultof previous stack based rhs evaluation. Must be provided for rhs types:
  • TMPL_TYPE_XLAT
  • TMPL_TYPE_EXEC (in future)
[in]rhs_resultof previous stack based rhs evaluation. Must be provided for rhs types:
  • TMPL_TYPE_XLAT
  • TMPL_TYPE_EXEC (in future) Once this function returns result will be invalidated even if this function errors.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 251 of file map_async.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: