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

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

#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/parser.h>
#include <freeradius-devel/rad_assert.h>
#include <freeradius-devel/base64.h>
#include <ctype.h>
+ Include dependency graph for xlat.c:

Go to the source code of this file.

Data Structures

struct  xlat_exp
 
struct  xlat_out
 
struct  xlat_redundant_t
 
struct  xlat_t
 

Macros

#define XLAT_DEBUG(...)
 
#define XLAT_REGISTER(_x)
 

Typedefs

typedef struct xlat_out xlat_out_t
 
typedef struct xlat_redundant_t xlat_redundant_t
 
typedef enum xlat_redundant_type_t xlat_redundant_type_t
 
typedef struct xlat_t xlat_t
 

Enumerations

enum  xlat_redundant_type_t {
  XLAT_INVALID = 0,
  XLAT_REDUNDANT,
  XLAT_LOAD_BALANCE,
  XLAT_REDUNDANT_LOAD_BALANCE
}
 
enum  xlat_state_t {
  XLAT_LITERAL,
  XLAT_PERCENT,
  XLAT_MODULE,
  XLAT_VIRTUAL,
  XLAT_ATTRIBUTE,
  XLAT_ALTERNATE
}
 

Functions

ssize_t radius_axlat (char **out, REQUEST *request, char const *fmt, xlat_escape_t escape, void *ctx)
 
ssize_t radius_axlat_struct (char **out, REQUEST *request, xlat_exp_t const *xlat, xlat_escape_t escape, void *ctx)
 
ssize_t radius_xlat (char *out, size_t outlen, REQUEST *request, char const *fmt, xlat_escape_t escape, void *ctx)
 
ssize_t radius_xlat_struct (char *out, size_t outlen, REQUEST *request, xlat_exp_t const *xlat, xlat_escape_t escape, void *ctx)
 
static char * xlat_aprint (TALLOC_CTX *ctx, REQUEST *request, xlat_exp_t const *const node, xlat_escape_t escape, void *escape_ctx, int lvl)
 
static ssize_t xlat_attr (char **out, size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt)
 Return the attribute name of an attribute reference. More...
 
static ssize_t xlat_attr_num (char **out, size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt)
 Return the attribute number of an attribute reference. More...
 
static int xlat_cmp (void const *one, void const *two)
 
static ssize_t xlat_debug (char **out, size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt)
 Dynamically change the debugging level for the current request. More...
 
static ssize_t xlat_debug_attr (UNUSED char **out, UNUSED size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt)
 Print out attribute info. More...
 
static ssize_t xlat_expand (char **out, size_t outlen, REQUEST *request, char const *fmt, xlat_escape_t escape, void *escape_ctx)
 Replace whatever in a string. More...
 
static ssize_t xlat_expand_struct (char **out, size_t outlen, REQUEST *request, xlat_exp_t const *node, xlat_escape_t escape, void *escape_ctx)
 Replace whatever in a string. More...
 
static xlat_txlat_find (char const *name)
 
ssize_t xlat_fmt_to_ref (uint8_t const **out, REQUEST *request, char const *fmt)
 Crappy temporary function to add attribute ref support to xlats. More...
 
static ssize_t xlat_foreach (char **out, size_t outlen, void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, UNUSED char const *fmt)
 Implements the Foreach-Variable-X. More...
 
void xlat_free (void)
 De-register all xlat functions, used mainly for debugging. More...
 
xlat_exp_txlat_from_tmpl_attr (TALLOC_CTX *ctx, vp_tmpl_t *vpt)
 Try to convert attr tmpl to an xlat for &attr[*] and artificially constructing expansions. More...
 
static char * xlat_getvp (TALLOC_CTX *ctx, REQUEST *request, vp_tmpl_t const *vpt, bool escape, bool return_null)
 
static ssize_t xlat_hex (char **out, size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt)
 Print data as hex, not as VALUE. More...
 
static ssize_t xlat_integer (char **out, size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt)
 Print data as integer, not as VALUE. More...
 
static ssize_t xlat_length (char **out, size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt)
 Print the size of the attribute in bytes. More...
 
static ssize_t xlat_load_balance (char **out, size_t outlen, void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt)
 
static ssize_t xlat_map (char **out, size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt)
 Processes fmt as a map string and applies it to the current request. More...
 
static ssize_t xlat_module (char **out, size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, UNUSED char const *fmt)
 Prints the current module processing the request. More...
 
static size_t xlat_process (char **out, REQUEST *request, xlat_exp_t const *const head, xlat_escape_t escape, void *escape_ctx)
 
static ssize_t xlat_redundant (char **out, size_t outlen, void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt)
 
int xlat_register (void *mod_inst, char const *name, xlat_func_t func, xlat_escape_t escape, xlat_instantiate_t instantiate, size_t inst_size, size_t buf_len)
 Register an xlat function. More...
 
bool xlat_register_redundant (CONF_SECTION *cs)
 
size_t xlat_snprint (char *buffer, size_t bufsize, xlat_exp_t const *node)
 
static ssize_t xlat_string (char **out, size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt)
 Print data as string, if possible. More...
 
static ssize_t xlat_strlen (char **out, size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, UNUSED REQUEST *request, char const *fmt)
 Print length of its RHS. More...
 
static ssize_t xlat_tag (char **out, size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt)
 Return the tag of an attribute reference. More...
 
vp_tmpl_txlat_to_tmpl_attr (TALLOC_CTX *ctx, xlat_exp_t *node)
 Try to convert an xlat to a tmpl for efficiency. More...
 
ssize_t xlat_tokenize (TALLOC_CTX *ctx, char *fmt, xlat_exp_t **head, char const **error)
 
static ssize_t xlat_tokenize_alternation (TALLOC_CTX *ctx, char *fmt, xlat_exp_t **head, char const **error)
 
static void xlat_tokenize_debug (xlat_exp_t const *node, int lvl)
 
static ssize_t xlat_tokenize_expansion (TALLOC_CTX *ctx, char *fmt, xlat_exp_t **head, char const **error)
 
static ssize_t xlat_tokenize_literal (TALLOC_CTX *ctx, char *fmt, xlat_exp_t **head, bool brace, char const **error)
 
static ssize_t xlat_tokenize_request (REQUEST *request, char const *fmt, xlat_exp_t **head)
 Tokenize an xlat expansion. More...
 
void xlat_unregister (void *mod_inst, char const *name, UNUSED xlat_func_t func)
 Unregister an xlat function. More...
 
static int xlat_unregister_callback (void *mod_inst, void *data)
 
void xlat_unregister_module (void *instance)
 
static ssize_t xlat_vendor (char **out, size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt)
 Return the vendor of an attribute reference. More...
 
static ssize_t xlat_vendor_num (char **out, size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt)
 Return the vendor number of an attribute reference. More...
 
static ssize_t xlat_xlat (char **out, size_t outlen, UNUSED void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt)
 xlat expand string attribute value More...
 

Variables

static int xlat_foreach_inst [] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }
 
static char const *const xlat_foreach_names []
 
static rbtree_txlat_root = NULL
 
static char const xlat_tabs [] = " "
 

Detailed Description

String expansion ("translation").

Id:
e4d9329085e75c7006d7c4311a6e5b82913c4fac

Implements Attribute -> value

Definition in file xlat.c.


Data Structure Documentation

struct xlat_exp

Definition at line 60 of file xlat.c.

+ Collaboration diagram for xlat_exp:
Data Fields
xlat_exp_t * alternate Alternative expansion if this one expanded to a zero length string.
vp_tmpl_t attr An attribute template.
xlat_exp_t * child Nested expansion.
char const * fmt The format string.
size_t len Length of the format string.
xlat_exp_t * next Next in the list.
xlat_state_t type type of this expansion.
xlat_t const * xlat The xlat expansion to expand format with.
struct xlat_out

Definition at line 74 of file xlat.c.

Data Fields
size_t len Length of the output string.
char const * out Output data.
struct xlat_redundant_t

Definition at line 892 of file xlat.c.

+ Collaboration diagram for xlat_redundant_t:
Data Fields
uint32_t count
CONF_SECTION * cs
xlat_redundant_type_t type
struct xlat_t

Definition at line 36 of file xlat.c.

+ Collaboration diagram for xlat_t:
Data Fields
size_t buf_len Length of output buffer to pre-allocate.
xlat_escape_t escape Escape function to apply to dynamic input to func.
xlat_func_t func xlat function.
size_t inst_size Length of instance data to pre-allocate.
xlat_instantiate_t instantiate Instantiation function.
bool internal If true, cannot be redefined.
int length Length of name.
void * mod_inst Module instance passed to xlat and escape functions.
char name[MAX_STRING_LEN] Name of the xlat expansion.

Macro Definition Documentation

#define XLAT_DEBUG (   ...)

Definition at line 1155 of file xlat.c.

#define XLAT_REGISTER (   _x)
Value:
xlat_register(NULL, STRINGIFY(_x), xlat_ ## _x, NULL, NULL, 0, XLAT_DEFAULT_BUF_LEN); \
c = xlat_find(STRINGIFY(_x)); \
rad_assert(c != NULL); \
c->internal = true
#define XLAT_DEFAULT_BUF_LEN
Definition: xlat.h:89
#define rad_assert(expr)
Definition: rad_assert.h:38
#define STRINGIFY(x)
Definition: build.h:34
static xlat_t * xlat_find(char const *name)
Definition: xlat.c:692
int xlat_register(void *mod_inst, char const *name, xlat_func_t func, xlat_escape_t escape, xlat_instantiate_t instantiate, size_t inst_size, size_t buf_len)
Register an xlat function.
Definition: xlat.c:717

Typedef Documentation

typedef struct xlat_out xlat_out_t
typedef struct xlat_t xlat_t

Enumeration Type Documentation

Enumerator
XLAT_INVALID 
XLAT_REDUNDANT 
XLAT_LOAD_BALANCE 
XLAT_REDUNDANT_LOAD_BALANCE 

Definition at line 885 of file xlat.c.

Enumerator
XLAT_LITERAL 

Literal string.

XLAT_PERCENT 

Literal string with v.

XLAT_MODULE 

xlat module

XLAT_VIRTUAL 

virtual attribute

XLAT_ATTRIBUTE 

xlat attribute

XLAT_ALTERNATE 

xlat conditional syntax :-

Definition at line 48 of file xlat.c.

Function Documentation

ssize_t radius_axlat ( char **  out,
REQUEST request,
char const *  fmt,
xlat_escape_t  escape,
void *  ctx 
)

Definition at line 2651 of file xlat.c.

+ Here is the call graph for this function:

ssize_t radius_axlat_struct ( char **  out,
REQUEST request,
xlat_exp_t const *  xlat,
xlat_escape_t  escape,
void *  ctx 
)

Definition at line 2656 of file xlat.c.

+ Here is the call graph for this function:

ssize_t radius_xlat ( char *  out,
size_t  outlen,
REQUEST request,
char const *  fmt,
xlat_escape_t  escape,
void *  ctx 
)

Definition at line 2641 of file xlat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ssize_t radius_xlat_struct ( char *  out,
size_t  outlen,
REQUEST request,
xlat_exp_t const *  xlat,
xlat_escape_t  escape,
void *  ctx 
)

Definition at line 2646 of file xlat.c.

+ Here is the call graph for this function:

static char* xlat_aprint ( TALLOC_CTX *  ctx,
REQUEST request,
xlat_exp_t const *const  node,
xlat_escape_t  escape,
void *  escape_ctx,
int  lvl 
)
static

Definition at line 2139 of file xlat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ssize_t xlat_attr ( char **  out,
size_t  outlen,
UNUSED void const *  mod_inst,
UNUSED void const *  xlat_inst,
REQUEST request,
char const *  fmt 
)
static

Return the attribute name of an attribute reference.

Definition at line 325 of file xlat.c.

+ Here is the call graph for this function:

static ssize_t xlat_attr_num ( char **  out,
size_t  outlen,
UNUSED void const *  mod_inst,
UNUSED void const *  xlat_inst,
REQUEST request,
char const *  fmt 
)
static

Return the attribute number of an attribute reference.

Definition at line 342 of file xlat.c.

+ Here is the call graph for this function:

static int xlat_cmp ( void const *  one,
void const *  two 
)
static

Definition at line 676 of file xlat.c.

+ Here is the caller graph for this function:

static ssize_t xlat_debug ( char **  out,
size_t  outlen,
UNUSED void const *  mod_inst,
UNUSED void const *  xlat_inst,
REQUEST request,
char const *  fmt 
)
static

Dynamically change the debugging level for the current request.

Example %{debug:3}

Definition at line 641 of file xlat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ssize_t xlat_debug_attr ( UNUSED char **  out,
UNUSED size_t  outlen,
UNUSED void const *  mod_inst,
UNUSED void const *  xlat_inst,
REQUEST request,
char const *  fmt 
)
static

Print out attribute info.

Prints out all instances of a current attribute, or all attributes in a list.

At higher debugging levels, also prints out alternative decodings of the same value. This is helpful to determine types for unknown attributes of long passed vendors, or just crazy/broken NAS.

This expands to a zero length string.

Definition at line 365 of file xlat.c.

+ Here is the call graph for this function:

static ssize_t static ssize_t xlat_expand ( char **  out,
size_t  outlen,
REQUEST request,
char const *  fmt,
xlat_escape_t  escape,
void *  escape_ctx 
)
static

Replace whatever in a string.

See 'doc/configuration/variables.rst' for more information.

Parameters
[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 2556 of file xlat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ssize_t xlat_expand_struct ( char **  out,
size_t  outlen,
REQUEST request,
xlat_exp_t const *  node,
xlat_escape_t  escape,
void *  escape_ctx 
)
static

Replace whatever in a string.

See 'doc/configuration/variables.rst' for more information.

Parameters
[out]outWhere to write pointer to output buffer.
[in]outlenSize of out.
[in]requestcurrent request.
[in]nodethe 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 2507 of file xlat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static xlat_t* xlat_find ( char const *  name)
static

Definition at line 692 of file xlat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ssize_t xlat_fmt_to_ref ( uint8_t const **  out,
REQUEST request,
char const *  fmt 
)

Crappy temporary function to add attribute ref support to xlats.

This needs to die, and hopefully will die, when xlat functions accept xlat node structures.

Provides either a pointer to a buffer which contains the value of the reference VALUE_PAIR in an architecture independent format. Or a pointer to the start of the fmt string.

The pointer is only guaranteed to be valid between calls to xlat_fmt_to_ref, and so long as the source VALUE_PAIR is not freed.

Parameters
outwhere to write a pointer to the buffer to the data the xlat function needs to work on.
requestcurrent request.
fmtstring.
Returns
  • The length of the data.
  • -1 on failure.

Definition at line 1125 of file xlat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ssize_t xlat_foreach ( char **  out,
size_t  outlen,
void const *  mod_inst,
UNUSED void const *  xlat_inst,
REQUEST request,
UNUSED char const *  fmt 
)
static

Implements the Foreach-Variable-X.

See Also
modcall()

Definition at line 543 of file xlat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void xlat_free ( void  )

De-register all xlat functions, used mainly for debugging.

Definition at line 1147 of file xlat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

xlat_exp_t* xlat_from_tmpl_attr ( TALLOC_CTX *  ctx,
vp_tmpl_t vpt 
)

Try to convert attr tmpl to an xlat for &attr[*] and artificially constructing expansions.

Parameters
ctxto allocate new xlat_expt_t in.
vptto convert.
Returns
  • NULL if unable to convert (not necessarily error).
  • a new vp_tmpl_t.

Definition at line 2626 of file xlat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static char* xlat_getvp ( TALLOC_CTX *  ctx,
REQUEST request,
vp_tmpl_t const *  vpt,
bool  escape,
bool  return_null 
)
static

Definition at line 1853 of file xlat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ssize_t xlat_hex ( char **  out,
size_t  outlen,
UNUSED void const *  mod_inst,
UNUSED void const *  xlat_inst,
REQUEST request,
char const *  fmt 
)
static

Print data as hex, not as VALUE.

Definition at line 212 of file xlat.c.

+ Here is the call graph for this function:

static ssize_t xlat_integer ( char **  out,
size_t  outlen,
UNUSED void const *  mod_inst,
UNUSED void const *  xlat_inst,
REQUEST request,
char const *  fmt 
)
static

Print data as integer, not as VALUE.

Definition at line 129 of file xlat.c.

+ Here is the call graph for this function:

static ssize_t xlat_length ( char **  out,
size_t  outlen,
UNUSED void const *  mod_inst,
UNUSED void const *  xlat_inst,
REQUEST request,
char const *  fmt 
)
static

Print the size of the attribute in bytes.

Definition at line 112 of file xlat.c.

+ Here is the call graph for this function:

static ssize_t xlat_load_balance ( char **  out,
size_t  outlen,
void const *  mod_inst,
UNUSED void const *  xlat_inst,
REQUEST request,
char const *  fmt 
)
static

Definition at line 950 of file xlat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ssize_t xlat_map ( char **  out,
size_t  outlen,
UNUSED void const *  mod_inst,
UNUSED void const *  xlat_inst,
REQUEST request,
char const *  fmt 
)
static

Processes fmt as a map string and applies it to the current request.

e.g. "%{map:&User-Name := 'foo'}"

Allows sets of modifications to be cached and then applied. Useful for processing generic attributes from LDAP.

Definition at line 481 of file xlat.c.

+ Here is the call graph for this function:

static ssize_t xlat_module ( char **  out,
size_t  outlen,
UNUSED void const *  mod_inst,
UNUSED void const *  xlat_inst,
REQUEST request,
UNUSED char const *  fmt 
)
static

Prints the current module processing the request.

Definition at line 507 of file xlat.c.

+ Here is the call graph for this function:

static size_t xlat_process ( char **  out,
REQUEST request,
xlat_exp_t const *const  head,
xlat_escape_t  escape,
void *  escape_ctx 
)
static

Definition at line 2413 of file xlat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ssize_t xlat_redundant ( char **  out,
size_t  outlen,
void const *  mod_inst,
UNUSED void const *  xlat_inst,
REQUEST request,
char const *  fmt 
)
static

Definition at line 899 of file xlat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int xlat_register ( void *  mod_inst,
char const *  name,
xlat_func_t  func,
xlat_escape_t  escape,
xlat_instantiate_t  instantiate,
size_t  inst_size,
size_t  buf_len 
)

Register an xlat function.

Parameters
[in]mod_instInstance of module that's registering the xlat function.
[in]namexlat name.
[in]funcxlat function to be called.
[in]escapefunction to sanitize any sub expansions passed to the xlat function.
[in]instantiatefunction to pre-parse any xlat specific data.
[in]inst_sizesizeof() this xlat's instance data.
[in]buf_lenSize of the output buffer to allocate when calling the function. May be 0 if the function allocates its own buffer.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 717 of file xlat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool xlat_register_redundant ( CONF_SECTION cs)

Definition at line 1041 of file xlat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t xlat_snprint ( char *  buffer,
size_t  bufsize,
xlat_exp_t const *  node 
)

Definition at line 1659 of file xlat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ssize_t xlat_string ( char **  out,
size_t  outlen,
UNUSED void const *  mod_inst,
UNUSED void const *  xlat_inst,
REQUEST request,
char const *  fmt 
)
static

Print data as string, if possible.

If attribute "Foo" is defined as "octets" it will normally be printed as 0x0a0a0a. The xlat "%{string:Foo}" will instead expand to "\n\n\n"

Definition at line 572 of file xlat.c.

+ Here is the call graph for this function:

static ssize_t xlat_strlen ( char **  out,
size_t  outlen,
UNUSED void const *  mod_inst,
UNUSED void const *  xlat_inst,
UNUSED REQUEST request,
char const *  fmt 
)
static

Print length of its RHS.

Definition at line 101 of file xlat.c.

+ Here is the call graph for this function:

static ssize_t xlat_tag ( char **  out,
size_t  outlen,
UNUSED void const *  mod_inst,
UNUSED void const *  xlat_inst,
REQUEST request,
char const *  fmt 
)
static

Return the tag of an attribute reference.

Definition at line 270 of file xlat.c.

+ Here is the call graph for this function:

vp_tmpl_t* xlat_to_tmpl_attr ( TALLOC_CTX *  ctx,
xlat_exp_t node 
)

Try to convert an xlat to a tmpl for efficiency.

Parameters
ctxto allocate new vp_tmpl_t in.
nodeto convert.
Returns
  • NULL if unable to convert (not necessarily error).
  • A new vp_tmpl_t.

Definition at line 2597 of file xlat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ssize_t xlat_tokenize ( TALLOC_CTX *  ctx,
char *  fmt,
xlat_exp_t **  head,
char const **  error 
)

Definition at line 1784 of file xlat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ssize_t xlat_tokenize_alternation ( TALLOC_CTX *  ctx,
char *  fmt,
xlat_exp_t **  head,
char const **  error 
)
static

Definition at line 1165 of file xlat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void xlat_tokenize_debug ( xlat_exp_t const *  node,
int  lvl 
)
static

Definition at line 1582 of file xlat.c.

+ Here is the caller graph for this function:

static ssize_t xlat_tokenize_expansion ( TALLOC_CTX *  ctx,
char *  fmt,
xlat_exp_t **  head,
char const **  error 
)
static

Definition at line 1235 of file xlat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ssize_t xlat_tokenize_literal ( TALLOC_CTX *  ctx,
char *  fmt,
xlat_exp_t **  head,
bool  brace,
char const **  error 
)
static

Definition at line 1413 of file xlat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ssize_t xlat_tokenize_request ( REQUEST request,
char const *  fmt,
xlat_exp_t **  head 
)
static

Tokenize an xlat expansion.

Parameters
[in]requestthe input request. Memory will be attached here.
[in]fmtthe format string to expand
[out]headthe head of the xlat list / tree structure.

Definition at line 1797 of file xlat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void xlat_unregister ( void *  mod_inst,
char const *  name,
UNUSED xlat_func_t  func 
)

Unregister an xlat function.

We can only have one function to call per name, so the passing of "func" here is extraneous.

Parameters
[in]mod_instdata.
[in]namexlat to unregister.
[in]funcunused.

Definition at line 850 of file xlat.c.

+ Here is the call graph for this function:

static int xlat_unregister_callback ( void *  mod_inst,
void *  data 
)
static

Definition at line 868 of file xlat.c.

+ Here is the caller graph for this function:

void xlat_unregister_module ( void *  instance)

Definition at line 877 of file xlat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ssize_t xlat_vendor ( char **  out,
size_t  outlen,
UNUSED void const *  mod_inst,
UNUSED void const *  xlat_inst,
REQUEST request,
char const *  fmt 
)
static

Return the vendor of an attribute reference.

Definition at line 288 of file xlat.c.

+ Here is the call graph for this function:

static ssize_t xlat_vendor_num ( char **  out,
size_t  outlen,
UNUSED void const *  mod_inst,
UNUSED void const *  xlat_inst,
REQUEST request,
char const *  fmt 
)
static

Return the vendor number of an attribute reference.

Definition at line 309 of file xlat.c.

+ Here is the call graph for this function:

static ssize_t xlat_xlat ( char **  out,
size_t  outlen,
UNUSED void const *  mod_inst,
UNUSED void const *  xlat_inst,
REQUEST request,
char const *  fmt 
)
static

xlat expand string attribute value

Definition at line 619 of file xlat.c.

+ Here is the call graph for this function:

Variable Documentation

int xlat_foreach_inst[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }
static

Definition at line 96 of file xlat.c.

char const* const xlat_foreach_names[]
static
Initial value:
= {"Foreach-Variable-0",
"Foreach-Variable-1",
"Foreach-Variable-2",
"Foreach-Variable-3",
"Foreach-Variable-4",
"Foreach-Variable-5",
"Foreach-Variable-6",
"Foreach-Variable-7",
"Foreach-Variable-8",
"Foreach-Variable-9",
NULL}

Definition at line 82 of file xlat.c.

rbtree_t* xlat_root = NULL
static

Definition at line 79 of file xlat.c.

char const xlat_tabs[] = " "
static

Definition at line 1580 of file xlat.c.