#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/rad_assert.h>
#include <freeradius-devel/map_proc.h>
Go to the source code of this file.
|
static int | _map_proc_unregister (map_proc_t *proc) |
| Unregister a map processor. More...
|
|
rlm_rcode_t | map_proc (REQUEST *request, map_proc_inst_t const *inst) |
| Evaluate a set of maps using the specified map processor. More...
|
|
static int | 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...
|
|
void | map_proc_free (void) |
|
map_proc_inst_t * | map_proc_instantiate (TALLOC_CTX *ctx, map_proc_t const *proc, vp_tmpl_t const *src, vp_map_t const *maps) |
| Create a new map proc instance. More...
|
|
int | map_proc_register (void *mod_inst, char const *name, map_proc_func_t evaluate, xlat_escape_t escape, map_proc_instantiate_t instantiate, size_t inst_size) |
| Register a map processor. More...
|
|
Map processor registration.
Definition at line 37 of file map_proc.c.
Data Fields |
xlat_escape_t |
escape |
Escape function to apply to expansions in the map query string. |
map_proc_func_t |
evaluate |
Module's map processor function. |
size_t |
inst_size |
Size of map_proc instance data to allocate. |
map_proc_instantiate_t |
instantiate |
Callback to create new instance struct. |
int |
length |
Length of name. |
void * |
mod_inst |
Module instance. |
char |
name[MAX_STRING_LEN] |
Name of the map function. |
Map processor instance.
Definition at line 51 of file map_proc.c.
static int _map_proc_unregister |
( |
map_proc_t * |
proc | ) |
|
|
static |
Unregister a map processor.
- Parameters
-
Definition at line 78 of file map_proc.c.
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
-
request | The current request. |
inst | of a map processor. |
Definition at line 225 of file map_proc.c.
static int 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 64 of file map_proc.c.
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 101 of file map_proc.c.
void map_proc_free |
( |
void |
| ) |
|
Create a new map proc instance.
This should be called for every map {} section in the configuration.
- Parameters
-
ctx | to allocate proc instance in. |
proc | resolved with map_proc_find. |
src | template. |
maps | Head of the list of maps. |
- Returns
-
Definition at line 192 of file map_proc.c.
Register a map processor.
This should be called by every module that provides a map processing function.
- Parameters
-
[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] | escape | function to sanitize any sub expansions in the map source query. |
[in] | instantiate | function (optional). |
[in] | inst_size | of talloc chunk to allocate for instance data (optional). |
- Returns
- 0 on success.
- -1 on failure.
Definition at line 132 of file map_proc.c.