All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Typedefs | Functions
map_proc.h File Reference

Structures and prototypes for map functions. More...

#include <freeradius-devel/conffile.h>
#include <freeradius-devel/tmpl.h>
+ Include dependency graph for map_proc.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_tmap_proc_find (char const *name)
 Find a map processor by name. More...
 
void map_proc_free (void)
 
map_proc_inst_tmap_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...
 

Detailed Description

Structures and prototypes for map functions.

Id:
f409f7d0fb866300775423f66d888f8835b1a2fe

Definition in file map_proc.h.

Typedef Documentation

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.

Parameters
[in]mod_instInstance of the module that registered the map_proc.
[in]proc_instMap proc data created by map_proc_instantiate_t.
[in]requestThe current request.
[in]srcTalloced buffer, the result of evaluating the src vp_tmpl_t.
[in]mapsHead of the list of maps to process.
Returns

Definition at line 51 of file map_proc.h.

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.

Parameters
[out]proc_instStructure to populate. Allocated by map_proc_instantiate.
[in]mod_instModule instance that registered the map_proc_t.
[in]srctemplate.
[in]mapsHead of the list of maps to process.
Returns
  • 0 on success.
  • -1 on failure.

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.

Function Documentation

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.

Parameters
requestThe current request.
instof a map processor.

Definition at line 225 of file map_proc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

map_proc_t* map_proc_find ( char const *  name)

Find a map processor by name.

Parameters
[in]nameof map processor.
Returns
  • map_proc matching name.
  • NULL if none was found.

Definition at line 101 of file map_proc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void map_proc_free ( void  )

Definition at line 113 of file map_proc.c.

+ Here is the caller graph for this function:

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.

Parameters
ctxto allocate proc instance in.
procresolved with map_proc_find.
srctemplate.
mapsHead of the list of maps.
Returns

Definition at line 192 of file map_proc.c.

+ Here is the caller graph for this function:

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.

Parameters
[in]mod_instof module registering the map_proc.
[in]nameof map processor. If processor already exists, it is replaced.
[in]evaluateModule's map processor function.
[in]escapefunction to sanitize any sub expansions in the map source query.
[in]instantiatefunction (optional).
[in]inst_sizeof talloc chunk to allocate for instance data (optional).
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 132 of file map_proc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function: