|  | The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
    | 
Registration API for xlat functions. More...
#include <freeradius-devel/server/module_rlm.h>#include <freeradius-devel/unlang/xlat_priv.h> Include dependency graph for xlat_func.c:
 Include dependency graph for xlat_func.c:Go to the source code of this file.
| Functions | |
| void | _xlat_func_instantiate_set (xlat_t const *xlat, xlat_instantiate_t instantiate, char const *inst_type, size_t inst_size, xlat_detach_t detach, void *uctx) | 
| Set global instantiation/detach callbacks. | |
| void | _xlat_func_safe_for_set (xlat_t *xlat, fr_value_box_safe_for_t safe_for) | 
| Set the escaped values for output boxes. | |
| static int | _xlat_func_talloc_free (xlat_t *xlat) | 
| Remove an xlat function from the function tree. | |
| void | _xlat_func_thread_instantiate_set (xlat_t const *xlat, xlat_thread_instantiate_t thread_instantiate, char const *thread_inst_type, size_t thread_inst_size, xlat_thread_detach_t thread_detach, void *uctx) | 
| Register an async xlat. | |
| static void | _xlat_func_tree_free (void *xlat) | 
| Callback for the rbtree to clear out any xlats still registered. | |
| static int | xlat_arg_parser_validate (xlat_t *x, xlat_arg_parser_t const *arg, bool last) | 
| Verify xlat arg specifications are valid. | |
| int | xlat_func_args_set (xlat_t *x, xlat_arg_parser_t const args[]) | 
| Register the arguments of an xlat. | |
| void | xlat_func_call_env_set (xlat_t *x, call_env_method_t const *env_method) | 
| Register call environment of an xlat. | |
| int8_t | xlat_func_cmp (void const *one, void const *two) | 
| Compare two xlat_t by the underlying function. | |
| xlat_t * | xlat_func_find (char const *in, ssize_t inlen) | 
| xlat_t * | xlat_func_find_module (module_inst_ctx_t const *mctx, char const *name) | 
| void | xlat_func_flags_set (xlat_t *x, xlat_func_flags_t flags) | 
| Specify flags that alter the xlat's behaviour. | |
| void | xlat_func_free (void) | 
| int | xlat_func_init (void) | 
| void | xlat_func_print_set (xlat_t *xlat, xlat_print_t func) | 
| Set a print routine for an xlat function. | |
| xlat_t * | xlat_func_register (TALLOC_CTX *ctx, char const *name, xlat_func_t func, fr_type_t return_type) | 
| Register an xlat function. | |
| void | xlat_func_resolve_set (xlat_t *xlat, xlat_resolve_t func) | 
| Set a resolve routine for an xlat function. | |
| void | xlat_func_unregister (char const *name) | 
| Unregister an xlat function. | |
| void | xlat_func_unregister_module (module_instance_t const *inst) | 
| void | xlat_mctx_set (xlat_t *x, module_inst_ctx_t const *mctx) | 
| Associate a module calling ctx with the xlat. | |
| static int8_t | xlat_name_cmp (void const *one, void const *two) | 
| Compare two xlat_t by the registered name. | |
| void | xlat_purify_func_set (xlat_t *xlat, xlat_purify_t func) | 
| Set a resolve routine for an xlat function. | |
| Variables | |
| static fr_rb_tree_t * | xlat_root = NULL | 
Registration API for xlat functions.
Definition in file xlat_func.c.
| void _xlat_func_instantiate_set | ( | xlat_t const * | xlat, | 
| xlat_instantiate_t | instantiate, | ||
| char const * | inst_type, | ||
| size_t | inst_size, | ||
| xlat_detach_t | detach, | ||
| void * | uctx | ||
| ) | 
Set global instantiation/detach callbacks.
| [in] | xlat | to set instantiation callbacks for. | 
| [in] | instantiate | Instantiation function. Called whenever a xlat is compiled. | 
| [in] | inst_type | Name of the instance structure. | 
| [in] | inst_size | The size of the instance struct. Pre-allocated for use by the instantiate function. If 0, no memory will be allocated. | 
| [in] | detach | Called when an xlat_exp_t is freed. | 
| [in] | uctx | Passed to the instantiation function. | 
Definition at line 458 of file xlat_func.c.
| void _xlat_func_safe_for_set | ( | xlat_t * | xlat, | 
| fr_value_box_safe_for_t | safe_for | ||
| ) | 
Set the escaped values for output boxes.
| [in] | xlat | function to set the escaped value for (as returned by xlat_register). | 
| [in] | safe_for | escaped value to write to output boxes. | 
Definition at line 441 of file xlat_func.c.
| 
 | static | 
Remove an xlat function from the function tree.
| [in] | xlat | to free. | 
Definition at line 98 of file xlat_func.c.
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:| void _xlat_func_thread_instantiate_set | ( | xlat_t const * | xlat, | 
| xlat_thread_instantiate_t | thread_instantiate, | ||
| char const * | thread_inst_type, | ||
| size_t | thread_inst_size, | ||
| xlat_thread_detach_t | thread_detach, | ||
| void * | uctx | ||
| ) | 
Register an async xlat.
All functions registered must be !pure
| [in] | xlat | to set instantiation callbacks for. | 
| [in] | thread_instantiate | Instantiation function. Called for every compiled xlat every time a thread is started. | 
| [in] | thread_inst_type | Name of the thread instance structure. | 
| [in] | thread_inst_size | The size of the thread instance struct. Pre-allocated for use by the instantiate function. If 0, no memory will be allocated. | 
| [in] | thread_detach | Called when the thread is freed. | 
| [in] | uctx | Passed to the thread instantiate function. | 
Definition at line 486 of file xlat_func.c.
 Here is the call graph for this function:
 Here is the call graph for this function:| 
 | static | 
Callback for the rbtree to clear out any xlats still registered.
Definition at line 112 of file xlat_func.c.
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:| 
 | inlinestatic | 
Verify xlat arg specifications are valid.
| [in] | x | we're setting arguments for. | 
| [in] | arg | specification to validate. | 
| [in] | last | Is this the last argument in the list. | 
Definition at line 312 of file xlat_func.c.
 Here is the caller graph for this function:
 Here is the caller graph for this function:| int xlat_func_args_set | ( | xlat_t * | x, | 
| xlat_arg_parser_t const | args[] | ||
| ) | 
Register the arguments of an xlat.
For xlats that take multiple arguments
| [in,out] | x | to have it's arguments registered | 
| [in] | args | to be registered | 
Definition at line 363 of file xlat_func.c.
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:| void xlat_func_call_env_set | ( | xlat_t * | x, | 
| call_env_method_t const * | env_method | ||
| ) | 
Register call environment of an xlat.
| [in,out] | x | to have it's module method env registered. | 
| [in] | env_method | to be registered. | 
Definition at line 389 of file xlat_func.c.
 Here is the caller graph for this function:
 Here is the caller graph for this function:| int8_t xlat_func_cmp | ( | void const * | one, | 
| void const * | two | ||
| ) | 
Compare two xlat_t by the underlying function.
| [in] | one | First xlat_t to compare. | 
| [in] | two | Second xlat_t to compare. | 
Definition at line 67 of file xlat_func.c.
Definition at line 77 of file xlat_func.c.
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:| xlat_t * xlat_func_find_module | ( | module_inst_ctx_t const * | mctx, | 
| char const * | name | ||
| ) | 
| void xlat_func_flags_set | ( | xlat_t * | x, | 
| xlat_func_flags_t | flags | ||
| ) | 
Specify flags that alter the xlat's behaviour.
| [in] | x | xlat to set flags for. | 
| [in] | flags | to set. | 
Definition at line 399 of file xlat_func.c.
 Here is the caller graph for this function:
 Here is the caller graph for this function:| void xlat_func_free | ( | void | ) | 
Definition at line 563 of file xlat_func.c.
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:| int xlat_func_init | ( | void | ) | 
Definition at line 547 of file xlat_func.c.
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:| void xlat_func_print_set | ( | xlat_t * | xlat, | 
| xlat_print_t | func | ||
| ) | 
Set a print routine for an xlat function.
| [in] | xlat | to set | 
| [in] | func | for printing | 
Definition at line 411 of file xlat_func.c.
 Here is the caller graph for this function:
 Here is the caller graph for this function:| xlat_t * xlat_func_register | ( | TALLOC_CTX * | ctx, | 
| char const * | name, | ||
| xlat_func_t | func, | ||
| fr_type_t | return_type | ||
| ) | 
Register an xlat function.
| [in] | ctx | Used to automate deregistration of the xlat function. | 
| [in] | name | of the xlat. | 
| [in] | func | to register. | 
| [in] | return_type | what type of output the xlat function will produce. | 
Definition at line 216 of file xlat_func.c.
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:| void xlat_func_resolve_set | ( | xlat_t * | xlat, | 
| xlat_resolve_t | func | ||
| ) | 
Set a resolve routine for an xlat function.
| [in] | xlat | to set | 
| [in] | func | to resolve xlat. | 
Definition at line 421 of file xlat_func.c.
| void xlat_func_unregister | ( | char const * | name | ) | 
Unregister an xlat function.
We can only have one function to call per name, so the passing of "func" here is extraneous.
| [in] | name | xlat to unregister. | 
Definition at line 516 of file xlat_func.c.
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:| void xlat_func_unregister_module | ( | module_instance_t const * | inst | ) | 
Definition at line 530 of file xlat_func.c.
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:| void xlat_mctx_set | ( | xlat_t * | x, | 
| module_inst_ctx_t const * | mctx | ||
| ) | 
Associate a module calling ctx with the xlat.
| [in] | x | to set the mctx for. | 
| [in] | mctx | Is duplicated and about to the lifetime of the xlat. | 
Definition at line 296 of file xlat_func.c.
 Here is the caller graph for this function:
 Here is the caller graph for this function:| 
 | static | 
Compare two xlat_t by the registered name.
| [in] | one | First xlat_t to compare. | 
| [in] | two | Second xlat_t to compare. | 
Definition at line 42 of file xlat_func.c.
 Here is the caller graph for this function:
 Here is the caller graph for this function:| void xlat_purify_func_set | ( | xlat_t * | xlat, | 
| xlat_purify_t | func | ||
| ) | 
Set a resolve routine for an xlat function.
| [in] | xlat | to set | 
| [in] | func | to purify xlat | 
Definition at line 431 of file xlat_func.c.
| 
 | static | 
Definition at line 31 of file xlat_func.c.
 1.9.8
 1.9.8