The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Macros | Functions | Variables
xlat_eval.c File Reference

String expansion ("translation"). More...

#include <freeradius-devel/server/base.h>
#include <freeradius-devel/unlang/xlat.h>
#include <freeradius-devel/unlang/xlat_priv.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/util/types.h>
#include <freeradius-devel/util/sbuff.h>
#include <freeradius-devel/util/value.h>
#include <freeradius-devel/unlang/unlang_priv.h>
+ Include dependency graph for xlat_eval.c:

Go to the source code of this file.

Data Structures

struct  xlat_exec_rctx_t
 

Macros

#define ESCAPE(_arg, _vb, _arg_num)
 

Functions

static ssize_t _xlat_eval (TALLOC_CTX *ctx, char **out, size_t outlen, request_t *request, char const *fmt, xlat_escape_legacy_t escape, void const *escape_ctx)
 Replace whatever in a string. More...
 
static ssize_t _xlat_eval_compiled (TALLOC_CTX *ctx, char **out, size_t outlen, request_t *request, xlat_exp_head_t const *head, xlat_escape_legacy_t escape, void const *escape_ctx)
 Replace whatever in a string. More...
 
ssize_t xlat_aeval (TALLOC_CTX *ctx, char **out, request_t *request, char const *fmt, xlat_escape_legacy_t escape, void const *escape_ctx)
 
ssize_t xlat_aeval_compiled (TALLOC_CTX *ctx, char **out, request_t *request, xlat_exp_head_t const *xlat, xlat_escape_legacy_t escape, void const *escape_ctx)
 
int xlat_aeval_compiled_argv (TALLOC_CTX *ctx, char ***argv, request_t *request, xlat_exp_head_t const *head, xlat_escape_legacy_t escape, void const *escape_ctx)
 Synchronous compile xlat_tokenize_argv() into argv[] array. More...
 
static void xlat_debug_log_expansion (request_t *request, xlat_exp_t const *node, fr_value_box_list_t const *args, UNUSED int line)
 Output what we're currently expanding. More...
 
static void xlat_debug_log_list_result (request_t *request, xlat_exp_t const *node, fr_value_box_list_t const *result)
 Output the list result of an expansion. More...
 
static void xlat_debug_log_result (request_t *request, xlat_exp_t const *node, fr_value_box_t const *result)
 Output the result of an expansion. More...
 
ssize_t xlat_eval (char *out, size_t outlen, request_t *request, char const *fmt, xlat_escape_legacy_t escape, void const *escape_ctx)
 
ssize_t xlat_eval_compiled (char *out, size_t outlen, request_t *request, xlat_exp_head_t const *xlat, xlat_escape_legacy_t escape, void const *escape_ctx)
 
void xlat_eval_free (void)
 
int xlat_eval_init (void)
 
static xlat_action_t xlat_eval_one_letter (TALLOC_CTX *ctx, fr_value_box_list_t *out, request_t *request, char letter)
 One letter expansions. More...
 
static ssize_t xlat_eval_sync (TALLOC_CTX *ctx, char **out, request_t *request, xlat_exp_head_t const *const head, xlat_escape_legacy_t escape, void const *escape_ctx)
 
int xlat_eval_walk (xlat_exp_head_t *head, xlat_walker_t walker, xlat_type_t type, void *uctx)
 Walk over all xlat nodes (depth first) in a xlat expansion, calling a callback. More...
 
static xlat_action_t xlat_exec_resume (UNUSED TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_ctx_t const *xctx, UNUSED request_t *request, UNUSED fr_value_box_list_t *in)
 
int xlat_flatten_compiled_argv (TALLOC_CTX *ctx, xlat_exp_head_t ***argv, xlat_exp_head_t *head)
 Turn xlat_tokenize_argv() into an argv[] array, and nuke the input list. More...
 
static fr_slen_t xlat_fmt_print (fr_sbuff_t *out, xlat_exp_t const *node)
 Reconstruct the original expansion string from an xlat tree. More...
 
xlat_action_t xlat_frame_eval (TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_exp_head_t const **child, request_t *request, xlat_exp_head_t const *head, xlat_exp_t const **in)
 Converts xlat nodes to value boxes. More...
 
xlat_action_t xlat_frame_eval_repeat (TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_exp_head_t const **child, request_t *request, xlat_exp_head_t const *head, xlat_exp_t const **in, void *env_data, fr_value_box_list_t *result)
 Process the result of a previous nested expansion. More...
 
xlat_action_t xlat_frame_eval_resume (TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_exp_head_t const **child, request_t *request, xlat_exp_head_t const *head, xlat_exp_t const **in, fr_value_box_list_t *result, xlat_func_t resume, void *rctx)
 Call an xlat's resumption method. More...
 
static xlat_action_t xlat_null_resume (UNUSED TALLOC_CTX *ctx, UNUSED fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, UNUSED request_t *request, UNUSED fr_value_box_list_t *in)
 
static xlat_action_t xlat_process_arg_list (TALLOC_CTX *ctx, fr_value_box_list_t *list, request_t *request, char const *name, xlat_arg_parser_t const *arg, unsigned int arg_num)
 Process an individual xlat argument value box group. More...
 
static xlat_action_t xlat_process_args (TALLOC_CTX *ctx, fr_value_box_list_t *list, request_t *request, xlat_t const *func)
 Process list of boxed values provided as input to an xlat. More...
 
static bool xlat_process_return (request_t *request, xlat_t const *func, fr_value_box_list_t const *returned, fr_value_box_t *pos)
 Validate that the return values from an xlat function match what it registered. More...
 
void xlat_signal (xlat_func_signal_t signal, xlat_exp_t const *exp, request_t *request, void *rctx, fr_signal_t action)
 Signal an xlat function. More...
 
fr_dict_attr_t const * xlat_time_res_attr (char const *res)
 

Variables

fr_dict_attr_t const * attr_cast_base
 
static fr_dict_attr_t const * attr_cast_time_res_csec
 
static fr_dict_attr_t const * attr_cast_time_res_day
 
static fr_dict_attr_t const * attr_cast_time_res_hour
 
static fr_dict_attr_t const * attr_cast_time_res_min
 
static fr_dict_attr_t const * attr_cast_time_res_month
 
static fr_dict_attr_t const * attr_cast_time_res_msec
 
static fr_dict_attr_t const * attr_cast_time_res_nsec
 
static fr_dict_attr_t const * attr_cast_time_res_sec
 
static fr_dict_attr_t const * attr_cast_time_res_usec
 
static fr_dict_attr_t const * attr_cast_time_res_week
 
static fr_dict_attr_t const * attr_cast_time_res_year
 
fr_dict_attr_t const * attr_expr_bool_enum
 
static fr_dict_t const * dict_freeradius
 
static int instance_count = 0
 
fr_table_num_sorted_t const xlat_action_table []
 
size_t xlat_action_table_len = NUM_ELEMENTS(xlat_action_table)
 
static fr_dict_autoload_t xlat_eval_dict []
 
static fr_dict_attr_autoload_t xlat_eval_dict_attr []
 
static fr_table_ptr_ordered_t const xlat_time_precision_table []
 
static size_t xlat_time_precision_table_len = NUM_ELEMENTS(xlat_time_precision_table)
 

Detailed Description

String expansion ("translation").

Id
3067beba4496312be1f25c95d42146f22c17db29

Evaluation of pre-parsed xlat expansions.

Definition in file xlat_eval.c.


Data Structure Documentation

◆ xlat_exec_rctx_t

struct xlat_exec_rctx_t

Definition at line 805 of file xlat_eval.c.

Data Fields
fr_value_box_list_t list
int status

Macro Definition Documentation

◆ ESCAPE

#define ESCAPE (   _arg,
  _vb,
  _arg_num 
)
Value:
do { \
if ((_arg)->func && (!(_vb)->safe_for || !fr_value_box_is_safe_for((_vb), (_arg)->safe_for) || (_arg)->always_escape)) { \
if ((_arg)->func(request, _vb, (_arg)->uctx) < 0) { \
RPEDEBUG("Function \"%s\" failed escaping argument %u", name, _arg_num); \
return XLAT_ACTION_FAIL; \
} \
fr_value_box_mark_safe_for((_vb), (_arg)->safe_for); \
} \
} while (0)
fr_dcursor_eval_t void const * uctx
Definition: dcursor.h:546
static char const * name
@ XLAT_ACTION_FAIL
An xlat function failed.
Definition: xlat.h:42
#define fr_value_box_is_safe_for(_box, _safe_for)
Definition: value.h:1055

Function Documentation

◆ _xlat_eval()

static ssize_t _xlat_eval ( TALLOC_CTX *  ctx,
char **  out,
size_t  outlen,
request_t request,
char const *  fmt,
xlat_escape_legacy_t  escape,
void const *  escape_ctx 
)
static

Replace whatever in a string.

See 'doc/unlang/xlat.adoc' for more information.

Parameters
[in]ctxto allocate expansion buffers in.
[out]outWhere to write pointer to output buffer.
[in]outlenSize of out.
[in]requestcurrent request.
[in]fmtstring to expand.
[in]escapefunction to escape final value e.g. SQL quoting.
[in]escape_ctxpointer to pass to escape function.
Returns
length of string written
Bug:
should really have -1 for failure.

Definition at line 1480 of file xlat_eval.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _xlat_eval_compiled()

static ssize_t _xlat_eval_compiled ( TALLOC_CTX *  ctx,
char **  out,
size_t  outlen,
request_t request,
xlat_exp_head_t const *  head,
xlat_escape_legacy_t  escape,
void const *  escape_ctx 
)
static

Replace whatever in a string.

See 'doc/unlang/xlat.adoc' for more information.

Parameters
[in]ctxto allocate expansion buffers in.
[out]outWhere to write pointer to output buffer.
[in]outlenSize of out.
[in]requestcurrent request.
[in]headthe xlat structure to expand
[in]escapefunction to escape final value e.g. SQL quoting.
[in]escape_ctxpointer to pass to escape function.
Returns
length of string written
Bug:
should really have -1 for failure.

Definition at line 1427 of file xlat_eval.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xlat_aeval()

ssize_t xlat_aeval ( TALLOC_CTX *  ctx,
char **  out,
request_t request,
char const *  fmt,
xlat_escape_legacy_t  escape,
void const *  escape_ctx 
)

Definition at line 1545 of file xlat_eval.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xlat_aeval_compiled()

ssize_t xlat_aeval_compiled ( TALLOC_CTX *  ctx,
char **  out,
request_t request,
xlat_exp_head_t const *  xlat,
xlat_escape_legacy_t  escape,
void const *  escape_ctx 
)

Definition at line 1554 of file xlat_eval.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xlat_aeval_compiled_argv()

int xlat_aeval_compiled_argv ( TALLOC_CTX *  ctx,
char ***  argv,
request_t request,
xlat_exp_head_t const *  head,
xlat_escape_legacy_t  escape,
void const *  escape_ctx 
)

Synchronous compile xlat_tokenize_argv() into argv[] array.

This is mostly for synchronous evaluation.

Parameters
ctxThe talloc_ctx
[out]argvthe argv array of resulting strings, size is argc + 1
requestthe request
headfrom xlat_tokenize_argv()
escapeescape function
escape_ctxcontext for escape function
Returns
  • <=0 on error number indicates which argument caused the problem
  • >0 on success which is argc to the corresponding argv

Definition at line 1578 of file xlat_eval.c.

+ Here is the call graph for this function:

◆ xlat_debug_log_expansion()

static void xlat_debug_log_expansion ( request_t request,
xlat_exp_t const *  node,
fr_value_box_list_t const *  args,
UNUSED int  line 
)
inlinestatic

Output what we're currently expanding.

Parameters
[in]requestThe current request.
[in]nodeBeing processed.
[in]argsfrom previous expansion.
[in]lineUnused

Definition at line 224 of file xlat_eval.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xlat_debug_log_list_result()

static void xlat_debug_log_list_result ( request_t request,
xlat_exp_t const *  node,
fr_value_box_list_t const *  result 
)
inlinestatic

Output the list result of an expansion.

Parameters
[in]requestThe current request.
[in]nodewhich was expanded.
[in]resultof the expansion.

Definition at line 257 of file xlat_eval.c.

+ Here is the caller graph for this function:

◆ xlat_debug_log_result()

static void xlat_debug_log_result ( request_t request,
xlat_exp_t const *  node,
fr_value_box_t const *  result 
)
inlinestatic

Output the result of an expansion.

Parameters
[in]requestThe current request.
[in]nodewhich was expanded.
[in]resultof the expansion.

Definition at line 272 of file xlat_eval.c.

+ Here is the caller graph for this function:

◆ xlat_eval()

ssize_t xlat_eval ( char *  out,
size_t  outlen,
request_t request,
char const *  fmt,
xlat_escape_legacy_t  escape,
void const *  escape_ctx 
)

Definition at line 1529 of file xlat_eval.c.

+ Here is the call graph for this function:

◆ xlat_eval_compiled()

ssize_t xlat_eval_compiled ( char *  out,
size_t  outlen,
request_t request,
xlat_exp_head_t const *  xlat,
xlat_escape_legacy_t  escape,
void const *  escape_ctx 
)

Definition at line 1537 of file xlat_eval.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xlat_eval_free()

void xlat_eval_free ( void  )

Definition at line 1739 of file xlat_eval.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xlat_eval_init()

int xlat_eval_init ( void  )

Definition at line 1714 of file xlat_eval.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xlat_eval_one_letter()

static xlat_action_t xlat_eval_one_letter ( TALLOC_CTX *  ctx,
fr_value_box_list_t *  out,
request_t request,
char  letter 
)
inlinestatic

One letter expansions.

Parameters
[in]ctxto allocate boxed value, and buffers in.
[out]outWhere to write the boxed value.
[in]requestThe current request.
[in]letterto expand.
Returns

Definition at line 619 of file xlat_eval.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xlat_eval_sync()

static ssize_t xlat_eval_sync ( TALLOC_CTX *  ctx,
char **  out,
request_t request,
xlat_exp_head_t const *const  head,
xlat_escape_legacy_t  escape,
void const *  escape_ctx 
)
static

Definition at line 1328 of file xlat_eval.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xlat_eval_walk()

int xlat_eval_walk ( xlat_exp_head_t head,
xlat_walker_t  walker,
xlat_type_t  type,
void *  uctx 
)

Walk over all xlat nodes (depth first) in a xlat expansion, calling a callback.

Parameters
[in]headto evaluate.
[in]walkercallback to pass nodes to.
[in]typeif > 0 a mask of types to call walker for.
[in]uctxto pass to walker.
Returns
  • 0 on success (walker always returned 0).
  • <0 if walker returned <0.

Definition at line 1650 of file xlat_eval.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xlat_exec_resume()

static xlat_action_t xlat_exec_resume ( UNUSED TALLOC_CTX *  ctx,
fr_dcursor_t out,
xlat_ctx_t const *  xctx,
UNUSED request_t request,
UNUSED fr_value_box_list_t *  in 
)
static

Definition at line 810 of file xlat_eval.c.

+ Here is the caller graph for this function:

◆ xlat_flatten_compiled_argv()

int xlat_flatten_compiled_argv ( TALLOC_CTX *  ctx,
xlat_exp_head_t ***  argv,
xlat_exp_head_t head 
)

Turn xlat_tokenize_argv() into an argv[] array, and nuke the input list.

This is mostly for async use.

Definition at line 1613 of file xlat_eval.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xlat_fmt_print()

static fr_slen_t xlat_fmt_print ( fr_sbuff_t out,
xlat_exp_t const *  node 
)
static

Reconstruct the original expansion string from an xlat tree.

Parameters
[in]outsbuff to print result in.
[in]nodein the tree to start printing.
Returns
  • The original expansion string on success.
  • NULL on error.

Definition at line 155 of file xlat_eval.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xlat_frame_eval()

xlat_action_t xlat_frame_eval ( TALLOC_CTX *  ctx,
fr_dcursor_t out,
xlat_exp_head_t const **  child,
request_t request,
xlat_exp_head_t const *  head,
xlat_exp_t const **  in 
)

Converts xlat nodes to value boxes.

Evaluates a single level of expansions.

Parameters
[in]ctxto allocate value boxes in.
[out]outa list of fr_value_box_t to append to.
[out]childto evaluate. If a child needs to be evaluated by the caller, we return XLAT_ACTION_PUSH_CHILD and place the child to be evaluated here. Once evaluation is complete, the caller should call us with the same xlat_exp_t and the result of the nested evaluation in result.
[in]requestthe current request.
[in]headof the list to evaluate
[in,out]inxlat node to evaluate. Advanced as we process additional xlat_exp_t.
Returns
  • XLAT_ACTION_PUSH_CHILD if we need to evaluate a deeper level of nested. child will be filled with the node that needs to be evaluated. call xlat_frame_eval_repeat on this node, once there are results from the nested expansion.
  • XLAT_ACTION_YIELD a resumption frame was pushed onto the stack by an xlat function and we need to wait for the request to be resumed before continuing.
  • XLAT_ACTION_DONE we're done, pop the frame.
  • XLAT_ACTION_FAIL an xlat module failed.

Definition at line 1110 of file xlat_eval.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xlat_frame_eval_repeat()

xlat_action_t xlat_frame_eval_repeat ( TALLOC_CTX *  ctx,
fr_dcursor_t out,
xlat_exp_head_t const **  child,
request_t request,
xlat_exp_head_t const *  head,
xlat_exp_t const **  in,
void *  env_data,
fr_value_box_list_t *  result 
)

Process the result of a previous nested expansion.

Parameters
[in]ctxto allocate value boxes in.
[out]outa list of fr_value_box_t to append to.
[out]childto evaluate. If a child needs to be evaluated by the caller, we return XLAT_ACTION_PUSH_CHILD and place the child to be evaluated here. Once evaluation is complete, the caller should call us with the same xlat_exp_t and the result of the nested evaluation in result.
[in]requestthe current request.
[in]headof the list to evaluate
[in,out]inxlat node to evaluate. Advanced as we process additional xlat_exp_t.
[in]env_dataExpanded call env.
[in]resultof a previous nested evaluation.

Definition at line 944 of file xlat_eval.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xlat_frame_eval_resume()

xlat_action_t xlat_frame_eval_resume ( TALLOC_CTX *  ctx,
fr_dcursor_t out,
xlat_exp_head_t const **  child,
request_t request,
xlat_exp_head_t const *  head,
xlat_exp_t const **  in,
fr_value_box_list_t *  result,
xlat_func_t  resume,
void *  rctx 
)

Call an xlat's resumption method.

Parameters
[in]ctxto allocate value boxes in.
[out]outa list of fr_value_box_t to append to.
[out]childto evaluate. If a child needs to be evaluated by the caller, we return XLAT_ACTION_PUSH_CHILD and place the child to be evaluated here. Once evaluation is complete, the caller should call us with the same xlat_exp_t and the result of the nested evaluation in result.
[in]requestthe current request.
[in]headof the list to evaluate
[in,out]inxlat node to evaluate. Advanced as we process additional xlat_exp_t.
[in]resultPreviously expanded arguments to this xlat function.
[in]resumefunction to call.
[in]rctxOpaque (to us), resume ctx provided by xlat function when it yielded.

Definition at line 870 of file xlat_eval.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xlat_null_resume()

static xlat_action_t xlat_null_resume ( UNUSED TALLOC_CTX *  ctx,
UNUSED fr_dcursor_t out,
UNUSED xlat_ctx_t const *  xctx,
UNUSED request_t request,
UNUSED fr_value_box_list_t *  in 
)
static

Definition at line 844 of file xlat_eval.c.

+ Here is the caller graph for this function:

◆ xlat_process_arg_list()

static xlat_action_t xlat_process_arg_list ( TALLOC_CTX *  ctx,
fr_value_box_list_t *  list,
request_t request,
char const *  name,
xlat_arg_parser_t const *  arg,
unsigned int  arg_num 
)
static

Process an individual xlat argument value box group.

Parameters
[in]ctxto allocate any additional buffers in
[in,out]listof value boxes representing one argument
[in]requestcurrently being processed
[in]nameof the function being called
[in]argspecification of current argument
[in]arg_numnumber of current argument in the argument specifications
Returns
  • XLAT_ACTION_DONE on success.
  • XLAT_ACTION_FAIL on failure.

Definition at line 293 of file xlat_eval.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xlat_process_args()

static xlat_action_t xlat_process_args ( TALLOC_CTX *  ctx,
fr_value_box_list_t *  list,
request_t request,
xlat_t const *  func 
)
inlinestatic

Process list of boxed values provided as input to an xlat.

Ensures that the value boxes passed to an xlat function match the requirements listed in its "args", and escapes any tainted boxes using the specified escaping routine.

Parameters
[in]ctxin which to allocate any buffers.
[in,out]listvalue boxes provided as input. List will be modified in accordance to rules provided in the args array.
[in]requestbeing processed.
[in]functo call

Definition at line 409 of file xlat_eval.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xlat_process_return()

static bool xlat_process_return ( request_t request,
xlat_t const *  func,
fr_value_box_list_t const *  returned,
fr_value_box_t pos 
)
inlinestatic

Validate that the return values from an xlat function match what it registered.

Parameters
[in]requestThe current request.
[in]functhat was called.
[in]returnedthe output list of the function.
[in]poscurrent position in the output list.
Returns
  • true - If return values were correct.
  • false - If the return values were incorrect.

Definition at line 571 of file xlat_eval.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xlat_signal()

void xlat_signal ( xlat_func_signal_t  signal,
xlat_exp_t const *  exp,
request_t request,
void *  rctx,
fr_signal_t  action 
)

Signal an xlat function.

Parameters
[in]signalfunction to call.
[in]expXlat node that previously yielded.
[in]requestThe current request.
[in]rctxOpaque (to us), resume ctx provided by the xlat function when it yielded.
[in]actionWhat the request should do (the type of signal).

Definition at line 836 of file xlat_eval.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xlat_time_res_attr()

fr_dict_attr_t const* xlat_time_res_attr ( char const *  res)

Definition at line 134 of file xlat_eval.c.

+ Here is the caller graph for this function:

Variable Documentation

◆ attr_cast_base

fr_dict_attr_t const* attr_cast_base

Definition at line 50 of file xlat_eval.c.

◆ attr_cast_time_res_csec

fr_dict_attr_t const* attr_cast_time_res_csec
static

Definition at line 59 of file xlat_eval.c.

◆ attr_cast_time_res_day

fr_dict_attr_t const* attr_cast_time_res_day
static

Definition at line 55 of file xlat_eval.c.

◆ attr_cast_time_res_hour

fr_dict_attr_t const* attr_cast_time_res_hour
static

Definition at line 54 of file xlat_eval.c.

◆ attr_cast_time_res_min

fr_dict_attr_t const* attr_cast_time_res_min
static

Definition at line 53 of file xlat_eval.c.

◆ attr_cast_time_res_month

fr_dict_attr_t const* attr_cast_time_res_month
static

Definition at line 57 of file xlat_eval.c.

◆ attr_cast_time_res_msec

fr_dict_attr_t const* attr_cast_time_res_msec
static

Definition at line 60 of file xlat_eval.c.

◆ attr_cast_time_res_nsec

fr_dict_attr_t const* attr_cast_time_res_nsec
static

Definition at line 62 of file xlat_eval.c.

◆ attr_cast_time_res_sec

fr_dict_attr_t const* attr_cast_time_res_sec
static

Definition at line 52 of file xlat_eval.c.

◆ attr_cast_time_res_usec

fr_dict_attr_t const* attr_cast_time_res_usec
static

Definition at line 61 of file xlat_eval.c.

◆ attr_cast_time_res_week

fr_dict_attr_t const* attr_cast_time_res_week
static

Definition at line 56 of file xlat_eval.c.

◆ attr_cast_time_res_year

fr_dict_attr_t const* attr_cast_time_res_year
static

Definition at line 58 of file xlat_eval.c.

◆ attr_expr_bool_enum

fr_dict_attr_t const* attr_expr_bool_enum

Definition at line 49 of file xlat_eval.c.

◆ dict_freeradius

fr_dict_t const* dict_freeradius
static

Definition at line 42 of file xlat_eval.c.

◆ instance_count

int instance_count = 0
static

Definition at line 40 of file xlat_eval.c.

◆ xlat_action_table

fr_table_num_sorted_t const xlat_action_table[]
Initial value:
= {
{ L("done"), XLAT_ACTION_DONE },
{ L("fail"), XLAT_ACTION_FAIL },
{ L("push-child"), XLAT_ACTION_PUSH_CHILD },
{ L("yield"), XLAT_ACTION_YIELD }
}
#define L(_str)
Helper for initialising arrays of string literals.
Definition: build.h:207
@ XLAT_ACTION_YIELD
An xlat function pushed a resume frame onto the stack.
Definition: xlat.h:40
@ XLAT_ACTION_PUSH_CHILD
A deeper level of nesting needs to be evaluated.
Definition: xlat.h:36
@ XLAT_ACTION_DONE
We're done evaluating this level of nesting.
Definition: xlat.h:41

Definition at line 83 of file xlat_eval.c.

◆ xlat_action_table_len

size_t xlat_action_table_len = NUM_ELEMENTS(xlat_action_table)

Definition at line 89 of file xlat_eval.c.

◆ xlat_eval_dict

fr_dict_autoload_t xlat_eval_dict[]
static
Initial value:
= {
{ .out = &dict_freeradius, .proto = "freeradius" },
{ NULL }
}
static fr_dict_t const * dict_freeradius
Definition: xlat_eval.c:42

Definition at line 44 of file xlat_eval.c.

◆ xlat_eval_dict_attr

fr_dict_attr_autoload_t xlat_eval_dict_attr[]
static
Initial value:
= {
{ .out = &attr_expr_bool_enum, .name = "Expr-Bool-Enum", .type = FR_TYPE_BOOL, .dict = &dict_freeradius },
{ .out = &attr_cast_base, .name = "Cast-Base", .type = FR_TYPE_UINT8, .dict = &dict_freeradius },
{ .out = &attr_cast_time_res_sec, .name = "Cast-Time-Res-Sec", .type = FR_TYPE_TIME_DELTA, .dict = &dict_freeradius },
{ .out = &attr_cast_time_res_min, .name = "Cast-Time-Res-Min", .type = FR_TYPE_TIME_DELTA, .dict = &dict_freeradius },
{ .out = &attr_cast_time_res_hour, .name = "Cast-Time-Res-Hour", .type = FR_TYPE_TIME_DELTA, .dict = &dict_freeradius },
{ .out = &attr_cast_time_res_day, .name = "Cast-Time-Res-Day", .type = FR_TYPE_TIME_DELTA, .dict = &dict_freeradius },
{ .out = &attr_cast_time_res_week, .name = "Cast-Time-Res-Week", .type = FR_TYPE_TIME_DELTA, .dict = &dict_freeradius },
{ .out = &attr_cast_time_res_month, .name = "Cast-Time-Res-Month", .type = FR_TYPE_TIME_DELTA, .dict = &dict_freeradius },
{ .out = &attr_cast_time_res_year, .name = "Cast-Time-Res-Year", .type = FR_TYPE_TIME_DELTA, .dict = &dict_freeradius },
{ .out = &attr_cast_time_res_csec, .name = "Cast-Time-Res-Centi-Sec", .type = FR_TYPE_TIME_DELTA, .dict = &dict_freeradius },
{ .out = &attr_cast_time_res_msec, .name = "Cast-Time-Res-Milli-Sec", .type = FR_TYPE_TIME_DELTA, .dict = &dict_freeradius },
{ .out = &attr_cast_time_res_usec, .name = "Cast-Time-Res-Micro-Sec", .type = FR_TYPE_TIME_DELTA, .dict = &dict_freeradius },
{ .out = &attr_cast_time_res_nsec, .name = "Cast-Time-Res-Nano-Sec", .type = FR_TYPE_TIME_DELTA, .dict = &dict_freeradius },
{ NULL }
}
@ FR_TYPE_TIME_DELTA
A period of time measured in nanoseconds.
Definition: merged_model.c:113
@ FR_TYPE_UINT8
8 Bit unsigned integer.
Definition: merged_model.c:97
@ FR_TYPE_BOOL
A truth value.
Definition: merged_model.c:95
static fr_dict_attr_t const * attr_cast_time_res_week
Definition: xlat_eval.c:56
static fr_dict_attr_t const * attr_cast_time_res_year
Definition: xlat_eval.c:58
static fr_dict_attr_t const * attr_cast_time_res_nsec
Definition: xlat_eval.c:62
static fr_dict_attr_t const * attr_cast_time_res_month
Definition: xlat_eval.c:57
static fr_dict_attr_t const * attr_cast_time_res_usec
Definition: xlat_eval.c:61
fr_dict_attr_t const * attr_expr_bool_enum
Definition: xlat_eval.c:49
static fr_dict_attr_t const * attr_cast_time_res_csec
Definition: xlat_eval.c:59
static fr_dict_attr_t const * attr_cast_time_res_msec
Definition: xlat_eval.c:60
fr_dict_attr_t const * attr_cast_base
Definition: xlat_eval.c:50
static fr_dict_attr_t const * attr_cast_time_res_sec
Definition: xlat_eval.c:52
static fr_dict_attr_t const * attr_cast_time_res_day
Definition: xlat_eval.c:55
static fr_dict_attr_t const * attr_cast_time_res_min
Definition: xlat_eval.c:53
static fr_dict_attr_t const * attr_cast_time_res_hour
Definition: xlat_eval.c:54

Definition at line 64 of file xlat_eval.c.

◆ xlat_time_precision_table

fr_table_ptr_ordered_t const xlat_time_precision_table[]
static

Definition at line 94 of file xlat_eval.c.

◆ xlat_time_precision_table_len

size_t xlat_time_precision_table_len = NUM_ELEMENTS(xlat_time_precision_table)
static

Definition at line 132 of file xlat_eval.c.