Structures and prototypes for map functions. More...
#include <freeradius-devel/conffile.h>
#include <freeradius-devel/tmpl.h>
Go to the source code of this file.
Typedefs | |
typedef rlm_rcode_t(* | map_proc_func_t )(void *mod_inst, void *proc_inst, REQUEST *request, char const *src, vp_map_t const *maps) |
Function to evaluate the src string and map the result to server attributes. More... | |
typedef struct map_proc_inst | map_proc_inst_t |
typedef int(* | map_proc_instantiate_t )(void *proc_inst, void *mod_inst, vp_tmpl_t const *src, vp_map_t const *maps) |
Allocate new instance data for a map processor. More... | |
typedef struct map_proc | map_proc_t |
Functions | |
rlm_rcode_t | map_proc (REQUEST *request, map_proc_inst_t const *inst) |
Evaluate a set of maps using the specified map processor. 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... | |
Structures and prototypes for map functions.
Definition in file map_proc.h.
typedef rlm_rcode_t(* map_proc_func_t)(void *mod_inst, void *proc_inst, REQUEST *request, char const *src, vp_map_t const *maps) |
Function to evaluate the src string and map the result to server attributes.
[in] | mod_inst | Instance of the module that registered the map_proc. |
[in] | proc_inst | Map proc data created by map_proc_instantiate_t. |
[in] | request | The current request. |
[in] | src | Talloced buffer, the result of evaluating the src vp_tmpl_t. |
[in] | maps | Head of the list of maps to process. |
Definition at line 51 of file map_proc.h.
typedef struct map_proc_inst map_proc_inst_t |
Definition at line 37 of file map_proc.h.
typedef int(* map_proc_instantiate_t)(void *proc_inst, void *mod_inst, vp_tmpl_t const *src, vp_map_t const *maps) |
Allocate new instance data for a map processor.
[out] | proc_inst | Structure to populate. Allocated by map_proc_instantiate. |
[in] | mod_inst | Module instance that registered the map_proc_t. |
[in] | src | template. |
[in] | maps | Head of the list of maps to process. |
Definition at line 64 of file map_proc.h.
typedef struct map_proc map_proc_t |
Definition at line 36 of file map_proc.h.
rlm_rcode_t map_proc | ( | REQUEST * | request, |
map_proc_inst_t const * | inst | ||
) |
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.
request | The current request. |
inst | of a map processor. |
Definition at line 225 of file map_proc.c.
map_proc_t* map_proc_find | ( | char const * | name | ) |
Find a map processor by name.
[in] | name | of map processor. |
Definition at line 101 of file map_proc.c.
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.
This should be called for every map {} section in the configuration.
ctx | to allocate proc instance in. |
proc | resolved with map_proc_find. |
src | template. |
maps | Head of the list of maps. |
Definition at line 192 of file map_proc.c.
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.
This should be called by every module that provides a map processing function.
[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). |
Definition at line 132 of file map_proc.c.