All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
parser.c File Reference
#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/parser.h>
#include <freeradius-devel/rad_assert.h>
#include <ctype.h>
+ Include dependency graph for parser.c:

Go to the source code of this file.

Macros

#define PW_CAST_BASE   (1850)
 
#define return_0(_x)   *error = _x;goto return_0
 
#define return_lhs(_x)   *error = _x;goto return_lhs
 
#define return_P(_x)   *error = _x;goto return_p
 
#define return_rhs(_x)   *error = _x;goto return_rhs
 
#define return_SLEN   goto return_slen
 

Functions

static bool condition_check_types (fr_cond_t *c, PW_TYPE lhs_type)
 
static ssize_t condition_tokenize (TALLOC_CTX *ctx, CONF_ITEM *ci, char const *start, bool brace, fr_cond_t **pcond, char const **error, int flags)
 Tokenize a conditional check. More...
 
static ssize_t condition_tokenize_cast (char const *start, fr_dict_attr_t const **pda, char const **error)
 
static ssize_t condition_tokenize_string (TALLOC_CTX *ctx, char **out, char const **error, char const *start, FR_TOKEN *op)
 
static ssize_t condition_tokenize_word (TALLOC_CTX *ctx, char const *start, char **out, FR_TOKEN *op, char const **error)
 
size_t fr_cond_snprint (char *out, size_t outlen, fr_cond_t const *in)
 
ssize_t fr_condition_tokenize (TALLOC_CTX *ctx, CONF_ITEM *ci, char const *start, fr_cond_t **head, char const **error, int flags)
 Tokenize a conditional check. More...
 
bool fr_condition_walk (fr_cond_t *c, bool(*callback)(void *, fr_cond_t *), void *ctx)
 

Variables

static const FR_NAME_NUMBER allowed_return_codes []
 

Macro Definition Documentation

#define PW_CAST_BASE   (1850)

Definition at line 31 of file parser.c.

#define return_0 (   _x)    *error = _x;goto return_0

Definition at line 425 of file parser.c.

#define return_lhs (   _x)    *error = _x;goto return_lhs

Definition at line 426 of file parser.c.

#define return_P (   _x)    *error = _x;goto return_p

Definition at line 424 of file parser.c.

#define return_rhs (   _x)    *error = _x;goto return_rhs

Definition at line 427 of file parser.c.

#define return_SLEN   goto return_slen

Definition at line 428 of file parser.c.

Function Documentation

static bool condition_check_types ( fr_cond_t c,
PW_TYPE  lhs_type 
)
static

Definition at line 338 of file parser.c.

+ Here is the caller graph for this function:

static ssize_t condition_tokenize ( TALLOC_CTX *  ctx,
CONF_ITEM ci,
char const *  start,
bool  brace,
fr_cond_t **  pcond,
char const **  error,
int  flags 
)
static

Tokenize a conditional check.

Parameters
[in]ctxfor talloc
[in]cifor CONF_ITEM
[in]startthe start of the string to process. Should be "(..."
[in]bracelook for a closing brace
[out]pcondpointer to the returned condition structure
[out]errorthe parse error (if any)
[in]flagsdo one/two pass
Returns
  • Length of the string skipped.
  • < 0 (the offset to the offending error) on error.

Definition at line 444 of file parser.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ssize_t condition_tokenize_cast ( char const *  start,
fr_dict_attr_t const **  pda,
char const **  error 
)
static

Definition at line 284 of file parser.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ssize_t condition_tokenize_string ( TALLOC_CTX *  ctx,
char **  out,
char const **  error,
char const *  start,
FR_TOKEN op 
)
static

Definition at line 145 of file parser.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ssize_t condition_tokenize_word ( TALLOC_CTX *  ctx,
char const *  start,
char **  out,
FR_TOKEN op,
char const **  error 
)
static

Definition at line 225 of file parser.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t fr_cond_snprint ( char *  out,
size_t  outlen,
fr_cond_t const *  in 
)

Definition at line 50 of file parser.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ssize_t fr_condition_tokenize ( TALLOC_CTX *  ctx,
CONF_ITEM ci,
char const *  start,
fr_cond_t **  head,
char const **  error,
int  flags 
)

Tokenize a conditional check.

Parameters
[in]ctxfor talloc
[in]cifor CONF_ITEM
[in]startthe start of the string to process. Should be "(..."
[out]headthe parsed condition structure
[out]errorthe parse error (if any)
[in]flagsdo one/two pass
Returns
  • Length of the string skipped.
  • < 0 (the offset to the offending error) on error.

Definition at line 1711 of file parser.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool fr_condition_walk ( fr_cond_t c,
bool(*)(void *, fr_cond_t *)  callback,
void *  ctx 
)

Definition at line 1720 of file parser.c.

+ Here is the caller graph for this function:

Variable Documentation

const FR_NAME_NUMBER allowed_return_codes[]
static
Initial value:
= {
{ "reject", 1 },
{ "fail", 1 },
{ "ok", 1 },
{ "handled", 1 },
{ "invalid", 1 },
{ "userlock", 1 },
{ "notfound", 1 },
{ "noop", 1 },
{ "updated", 1 },
{ NULL, 0 }
}

Definition at line 33 of file parser.c.