The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
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.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/util/types.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. More...
 
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. More...
 
xlat_exp_t_xlat_exp_alloc_null (NDEBUG_LOCATION_ARGS TALLOC_CTX *ctx)
 Allocate an xlat node with no name, and no type set. More...
 
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. More...
 
static xlat_exp_txlat_exp_alloc_pool (NDEBUG_LOCATION_ARGS TALLOC_CTX *ctx, unsigned int extra_hdrs, size_t extra)
 
void xlat_exp_set_name (xlat_exp_t *node, char const *fmt, size_t len)
 Set the format string for an xlat node. More...
 
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. More...
 
void xlat_exp_set_name_buffer_shallow (xlat_exp_t *node, char const *fmt)
 Set the format string for an xlat node from a pre-existing buffer. More...
 

Detailed Description

Functions to allocate different types of xlat nodes.

Id
d2c9ccc7454fb1d258a48ddcf10d82e26a433328

Definition in file xlat_alloc.c.

Macro Definition Documentation

◆ _XLAT_PRIVATE

#define _XLAT_PRIVATE

Definition at line 32 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 314 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 228 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 138 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 125 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 35 of file xlat_alloc.c.

+ Here is the call graph for this function:
+ 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 58 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 105 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()

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 191 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 202 of file xlat_alloc.c.

+ Here is the call graph for this function:

◆ xlat_exp_set_name_buffer_shallow()

void xlat_exp_set_name_buffer_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 213 of file xlat_alloc.c.

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