#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>
Go to the source code of this file.
|
static vp_list_mod_t * | list_mod_alloc (TALLOC_CTX *ctx) |
|
static vp_list_mod_t * | list_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_t * | list_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_t * | list_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_t * | map_alloc (TALLOC_CTX *ctx) |
|
static fr_pair_list_t * | map_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_t * | map_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...
|
|
◆ list_mod_alloc()
◆ 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] | ctx | to allocate vp_list_mod_t in. |
[in] | original | The map from the update section. |
[in] | mutated | The 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.
◆ 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] | ctx | to allocate vp_list_mod_t in. |
[in] | original | The map from the update section. |
[in] | mutated | The 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.
◆ 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] | ctx | to allocate vp_list_mod_t in. |
[in] | original | The map from the update section. |
[in] | mutated | The 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.
◆ map_alloc()
static map_t* map_alloc |
( |
TALLOC_CTX * |
ctx | ) |
|
|
inlinestatic |
◆ map_check_src_or_dst()
Check that the destination list is currently value.
- Parameters
-
[in] | request | to resolve in the list in. |
[in] | map | to check |
[in] | src_dst | a 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.
◆ map_list_mod_apply()
Apply the output of map_to_list_mod to a request.
- Parameters
-
request | to modify. |
vlm | VP List Modification to apply. |
Definition at line 922 of file map_async.c.
◆ map_list_mod_debug()
Print debug for a modification map.
- Parameters
-
[in] | request | being modified. |
[in] | map | The original map. |
[in] | mod | The ephemeral map which describes the change. |
[in] | vb | The value in the ephemeral map. |
Definition at line 860 of file map_async.c.
◆ map_list_mod_to_vp()
◆ map_list_mod_to_vps()
◆ 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] | ctx | to allocate modification maps in. |
[out] | out | Where to write the fr_pair_t (s), which may be NULL if not found |
[in] | request | The current request. |
[in] | original | the map. The LHS (dst) has to be TMPL_TYPE_ATTR. |
[in] | lhs_result | of previous stack based rhs evaluation. Must be provided for rhs types:
- TMPL_TYPE_XLAT
- TMPL_TYPE_EXEC (in future)
|
[in] | rhs_result | of 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.