The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Loading...
Searching...
No Matches
Macros | Functions
xlat_alloc.c File Reference

Functions to allocate different types of xlat nodes. More...

#include <freeradius-devel/server/base.h>
#include <freeradius-devel/unlang/xlat_priv.h>
+ Include dependency graph for xlat_alloc.c:

Go to the source code of this file.

Macros

#define _XLAT_PRIVATE
 

Functions

int _xlat_copy (NDEBUG_LOCATION_ARGS TALLOC_CTX *ctx, xlat_exp_head_t *out, xlat_exp_head_t const *in)
 
static int _xlat_copy_internal (NDEBUG_LOCATION_ARGS TALLOC_CTX *ctx, xlat_exp_head_t *out, xlat_exp_head_t const *in)
 Copy all nodes in the input list to the output list.
 
xlat_exp_t_xlat_exp_alloc (NDEBUG_LOCATION_ARGS TALLOC_CTX *ctx, xlat_type_t type, char const *in, size_t inlen)
 Allocate an xlat node.
 
xlat_exp_t_xlat_exp_alloc_null (NDEBUG_LOCATION_ARGS TALLOC_CTX *ctx)
 Allocate an xlat node with no name, and no type set.
 
xlat_exp_head_t_xlat_exp_head_alloc (NDEBUG_LOCATION_ARGS TALLOC_CTX *ctx)
 
void _xlat_exp_set_type (NDEBUG_LOCATION_ARGS xlat_exp_t *node, xlat_type_t type)
 Set the type of an xlat node.
 
static xlat_exp_txlat_exp_alloc_pool (NDEBUG_LOCATION_ARGS TALLOC_CTX *ctx, unsigned int extra_hdrs, size_t extra)
 
void xlat_exp_finalize_func (xlat_exp_t *node)
 
void xlat_exp_set_func (xlat_exp_t *node, xlat_t const *func, fr_dict_t const *dict)
 Set the function for a node.
 
void xlat_exp_set_name (xlat_exp_t *node, char const *fmt, size_t len)
 Set the format string for an xlat node.
 
void xlat_exp_set_name_buffer (xlat_exp_t *node, char const *fmt)
 Set the format string for an xlat node, copying from a talloc'd buffer.
 
void xlat_exp_set_name_shallow (xlat_exp_t *node, char const *fmt)
 Set the format string for an xlat node from a pre-existing buffer.
 
void xlat_exp_set_vpt (xlat_exp_t *node, tmpl_t *vpt)
 Set the tmpl for a node, along with flags and the name.
 

Detailed Description

Functions to allocate different types of xlat nodes.

Id
c08ae80128a212f2f942f8e78b058aef654da43f

Definition in file xlat_alloc.c.

Macro Definition Documentation

◆ _XLAT_PRIVATE

#define _XLAT_PRIVATE

Definition at line 29 of file xlat_alloc.c.

Function Documentation

◆ _xlat_copy()

int _xlat_copy ( NDEBUG_LOCATION_ARGS TALLOC_CTX *  ctx,
xlat_exp_head_t out,
xlat_exp_head_t const *  in 
)

Definition at line 434 of file xlat_alloc.c.

+ Here is the call graph for this function:

◆ _xlat_copy_internal()

static int _xlat_copy_internal ( NDEBUG_LOCATION_ARGS TALLOC_CTX *  ctx,
xlat_exp_head_t out,
xlat_exp_head_t const *  in 
)
static

Copy all nodes in the input list to the output list.

Parameters
[in]ctxto allocate new nodes in.
[out]outWhere to write new nodes.
[in]inInput nodes.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 355 of file xlat_alloc.c.

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

◆ _xlat_exp_alloc()

xlat_exp_t * _xlat_exp_alloc ( NDEBUG_LOCATION_ARGS TALLOC_CTX *  ctx,
xlat_type_t  type,
char const *  in,
size_t  inlen 
)

Allocate an xlat node.

Parameters
[in]ctxto allocate node in.
[in]typeof the node.
[in]inoriginal input string.
[in]inlenthe length of the original input string.
Returns
A new xlat node.

Definition at line 198 of file xlat_alloc.c.

+ Here is the call graph for this function:

◆ _xlat_exp_alloc_null()

xlat_exp_t * _xlat_exp_alloc_null ( NDEBUG_LOCATION_ARGS TALLOC_CTX *  ctx)

Allocate an xlat node with no name, and no type set.

Parameters
[in]ctxto allocate node in.
Returns
A new xlat node.

Definition at line 185 of file xlat_alloc.c.

+ Here is the call graph for this function:

◆ _xlat_exp_head_alloc()

xlat_exp_head_t * _xlat_exp_head_alloc ( NDEBUG_LOCATION_ARGS TALLOC_CTX *  ctx)

Definition at line 32 of file xlat_alloc.c.

+ Here is the caller graph for this function:

◆ _xlat_exp_set_type()

void _xlat_exp_set_type ( NDEBUG_LOCATION_ARGS xlat_exp_t node,
xlat_type_t  type 
)

Set the type of an xlat node.

Also initialises any xlat_exp_head necessary

Parameters
[in]nodeto set type for.
[in]typeto set.

Definition at line 55 of file xlat_alloc.c.

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

◆ xlat_exp_alloc_pool()

static xlat_exp_t * xlat_exp_alloc_pool ( NDEBUG_LOCATION_ARGS TALLOC_CTX *  ctx,
unsigned int  extra_hdrs,
size_t  extra 
)
static

Definition at line 165 of file xlat_alloc.c.

+ Here is the caller graph for this function:

◆ xlat_exp_finalize_func()

void xlat_exp_finalize_func ( xlat_exp_t node)

Definition at line 284 of file xlat_alloc.c.

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

◆ xlat_exp_set_func()

void xlat_exp_set_func ( xlat_exp_t node,
xlat_t const *  func,
fr_dict_t const *  dict 
)

Set the function for a node.

Parameters
[in]nodeto set fmt for.
[in]functo set
[in]dictthe dictionary to set

Definition at line 274 of file xlat_alloc.c.

+ Here is the caller graph for this function:

◆ xlat_exp_set_name()

void xlat_exp_set_name ( xlat_exp_t node,
char const *  fmt,
size_t  len 
)

Set the format string for an xlat node.

Parameters
[in]nodeto set fmt for.
[in]fmttalloced buffer to set as the fmt string.
[in]lenof fmt string.

Definition at line 308 of file xlat_alloc.c.

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

◆ xlat_exp_set_name_buffer()

void xlat_exp_set_name_buffer ( xlat_exp_t node,
char const *  fmt 
)

Set the format string for an xlat node, copying from a talloc'd buffer.

Parameters
[in]nodeto set fmt for.
[in]fmttalloced buffer to set as the fmt string.

Definition at line 321 of file xlat_alloc.c.

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

◆ xlat_exp_set_name_shallow()

void xlat_exp_set_name_shallow ( xlat_exp_t node,
char const *  fmt 
)

Set the format string for an xlat node from a pre-existing buffer.

Parameters
[in]nodeto set fmt for.
[in]fmttalloced buffer to set as the fmt string.

Definition at line 338 of file xlat_alloc.c.

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

◆ xlat_exp_set_vpt()

void xlat_exp_set_vpt ( xlat_exp_t node,
tmpl_t vpt 
)

Set the tmpl for a node, along with flags and the name.

Parameters
[in]nodeto set fmt for.
[in]vptthe tmpl to set

Definition at line 252 of file xlat_alloc.c.

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