#include <freeradius-devel/server/base.h>
#include <freeradius-devel/server/map_proc.h>
#include <freeradius-devel/server/map_proc_priv.h>
#include <freeradius-devel/util/atexit.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/util/value.h>
#include <freeradius-devel/util/talloc.h>
Go to the source code of this file.
|
static int | _map_proc_talloc_free (map_proc_t *proc) |
| Unregister a map processor. More...
|
|
static int | _map_proc_tree_free (UNUSED void *uctx) |
|
static int | _map_proc_tree_init (UNUSED void *uctx) |
|
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. More...
|
|
static int8_t | map_proc_cmp (void const *one, void const *two) |
| Compare two map_proc_t structs, based ONLY on the name. More...
|
|
map_proc_t * | map_proc_find (char const *name) |
| Find a map processor by name. More...
|
|
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. More...
|
|
fr_value_box_safe_for_t | map_proc_literals_safe_for (map_proc_t const *proc) |
|
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. More...
|
|
int | map_proc_unregister (char const *name) |
| Unregister a map processor by name. More...
|
|
◆ _map_proc_talloc_free()
static int _map_proc_talloc_free |
( |
map_proc_t * |
proc | ) |
|
|
static |
Unregister a map processor.
- Parameters
-
Definition at line 57 of file map_proc.c.
◆ _map_proc_tree_free()
static int _map_proc_tree_free |
( |
UNUSED void * |
uctx | ) |
|
|
static |
◆ _map_proc_tree_init()
static int _map_proc_tree_init |
( |
UNUSED void * |
uctx | ) |
|
|
static |
◆ map_proc()
Evaluate a set of maps using the specified map processor.
Evaluate the map processor src template, then call a map processor function to do something with the expanded src template and map the result to attributes in the request.
- Parameters
-
[out] | p_result | Result code of evaluating the map. |
[in] | request | The current request. |
[in] | inst | of a map processor. |
[in,out] | result | Result of expanding the map input. May be consumed by the map processor. |
- Returns
- one of UNLANG_ACTION_*
Definition at line 247 of file map_proc.c.
◆ map_proc_cmp()
static int8_t map_proc_cmp |
( |
void const * |
one, |
|
|
void const * |
two |
|
) |
| |
|
static |
Compare two map_proc_t structs, based ONLY on the name.
- Parameters
-
[in] | one | First map struct. |
[in] | two | Second map struct. |
- Returns
- Integer specifying order of map func instances.
Definition at line 45 of file map_proc.c.
◆ map_proc_find()
Find a map processor by name.
- Parameters
-
[in] | name | of map processor. |
- Returns
- map_proc matching name.
- NULL if none was found.
Definition at line 87 of file map_proc.c.
◆ map_proc_instantiate()
Create a new map proc instance.
This should be called for every map {} section in the configuration.
- Parameters
-
[in] | ctx | to allocate proc instance in. |
[in] | proc | resolved with map_proc_find. |
[in] | cs | CONF_SECTION representing this instance of a map processor. |
[in] | src | template. |
[in] | maps | Head of the list of maps. |
- Returns
-
Definition at line 210 of file map_proc.c.
◆ map_proc_literals_safe_for()
◆ map_proc_register()
Register a map processor.
This should be called by every module that provides a map processing function.
- Parameters
-
[in] | ctx | if non-null, the ctx to bind this map processor to. |
[in] | mod_inst | of module registering the map_proc. |
[in] | name | of map processor. If processor already exists, it is replaced. |
[in] | evaluate | Module's map processor function. |
[in] | instantiate | function (optional). |
[in] | inst_size | of talloc chunk to allocate for instance data (optional). |
[in] | literals_safe_for | What safe_for value to assign to literals. |
- Returns
- 0 on success.
- -1 on failure.
Definition at line 131 of file map_proc.c.
◆ map_proc_unregister()
int map_proc_unregister |
( |
char const * |
name | ) |
|
Unregister a map processor by name.
- Parameters
-
[in] | name | of map processor to unregister. |
- Returns
- 0 if map processor was found and unregistered.
- -1 if map processor was not found.
Definition at line 183 of file map_proc.c.
◆ map_proc_root