The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Macros | Functions | Variables
users_file.c File Reference
#include <freeradius-devel/server/log.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/server/users_file.h>
#include <freeradius-devel/util/misc.h>
#include <freeradius-devel/util/pair_legacy.h>
#include <freeradius-devel/util/syserror.h>
#include <sys/stat.h>
#include <ctype.h>
#include <fcntl.h>
+ Include dependency graph for users_file.c:

Go to the source code of this file.

Macros

#define ERROR_MARKER(_sbuff, _error)   line_error_marker(__FILE__, __LINE__, file, lineno, _sbuff, _error)
 Print out a line oriented error marker at the current position of the sbuff. More...
 
#define ERROR_MARKER_ADJ(_sbuff, _idx, _error)   line_error_marker_adj(__FILE__, __LINE__, file, lineno, _sbuff, _idx, _error)
 Print out a line oriented error marker relative to the current position of the sbuff. More...
 

Functions

static void line_error_marker (char const *src_file, int src_line, char const *user_file, int user_line, fr_sbuff_t *sbuff, char const *error)
 
static void line_error_marker_adj (char const *src_file, int src_line, char const *user_file, int user_line, fr_sbuff_t *sbuff, ssize_t marker_idx, char const *error)
 
int pairlist_read (TALLOC_CTX *ctx, fr_dict_t const *dict, char const *file, PAIR_LIST_LIST *list)
 
static int pairlist_read_internal (TALLOC_CTX *ctx, fr_dict_t const *dict, char const *file, PAIR_LIST_LIST *list, bool complain, int *order)
 
static int users_include (TALLOC_CTX *ctx, fr_dict_t const *dict, fr_sbuff_t *sbuff, PAIR_LIST_LIST *list, char const *file, int lineno, int *order)
 

Variables

static fr_table_num_sorted_t const check_cmp_op_table []
 
static size_t check_cmp_op_table_len = NUM_ELEMENTS(check_cmp_op_table)
 
static const fr_sbuff_term_t name_terms
 
static fr_sbuff_parse_rules_t const rhs_term
 

Macro Definition Documentation

◆ ERROR_MARKER

#define ERROR_MARKER (   _sbuff,
  _error 
)    line_error_marker(__FILE__, __LINE__, file, lineno, _sbuff, _error)

Print out a line oriented error marker at the current position of the sbuff.

Parameters
[in]_sbuffto print error for.
[in]_errormessage.

Definition at line 65 of file users_file.c.

◆ ERROR_MARKER_ADJ

#define ERROR_MARKER_ADJ (   _sbuff,
  _idx,
  _error 
)    line_error_marker_adj(__FILE__, __LINE__, file, lineno, _sbuff, _idx, _error)

Print out a line oriented error marker relative to the current position of the sbuff.

Parameters
[in]_sbuffto print error for.
[in]_idxWhere the error occurred.
[in]_errormessage.

Definition at line 90 of file users_file.c.

Function Documentation

◆ line_error_marker()

static void line_error_marker ( char const *  src_file,
int  src_line,
char const *  user_file,
int  user_line,
fr_sbuff_t sbuff,
char const *  error 
)
inlinestatic

Definition at line 43 of file users_file.c.

+ Here is the call graph for this function:

◆ line_error_marker_adj()

static void line_error_marker_adj ( char const *  src_file,
int  src_line,
char const *  user_file,
int  user_line,
fr_sbuff_t sbuff,
ssize_t  marker_idx,
char const *  error 
)
inlinestatic

Definition at line 67 of file users_file.c.

+ Here is the call graph for this function:

◆ pairlist_read()

int pairlist_read ( TALLOC_CTX *  ctx,
fr_dict_t const *  dict,
char const *  file,
PAIR_LIST_LIST list 
)

Definition at line 235 of file users_file.c.

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

◆ pairlist_read_internal()

static int pairlist_read_internal ( TALLOC_CTX *  ctx,
fr_dict_t const *  dict,
char const *  file,
PAIR_LIST_LIST list,
bool  complain,
int *  order 
)
static

Definition at line 245 of file users_file.c.

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

◆ users_include()

static int users_include ( TALLOC_CTX *  ctx,
fr_dict_t const *  dict,
fr_sbuff_t sbuff,
PAIR_LIST_LIST list,
char const *  file,
int  lineno,
int *  order 
)
static

Definition at line 143 of file users_file.c.

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

Variable Documentation

◆ check_cmp_op_table

fr_table_num_sorted_t const check_cmp_op_table[]
static
Initial value:
= {
{ L("!*"), T_OP_CMP_FALSE },
{ L("!="), T_OP_NE },
{ L("!~"), T_OP_REG_NE },
{ L("+="), T_OP_ADD_EQ },
{ L(":="), T_OP_SET },
{ L("<"), T_OP_LT },
{ L("<="), T_OP_LE },
{ L("="), T_OP_EQ },
{ L("=*"), T_OP_CMP_TRUE },
{ L("=="), T_OP_CMP_EQ },
{ L("=~"), T_OP_REG_EQ },
{ L(">"), T_OP_GT },
{ L(">="), T_OP_GE }
}
#define L(_str)
Helper for initialising arrays of string literals.
Definition: build.h:207
@ T_OP_CMP_TRUE
Definition: token.h:104
@ T_OP_EQ
Definition: token.h:83
@ T_OP_SET
Definition: token.h:84
@ T_OP_NE
Definition: token.h:97
@ T_OP_ADD_EQ
Definition: token.h:69
@ T_OP_CMP_FALSE
Definition: token.h:105
@ T_OP_REG_EQ
Definition: token.h:102
@ T_OP_CMP_EQ
Definition: token.h:106
@ T_OP_LE
Definition: token.h:100
@ T_OP_GE
Definition: token.h:98
@ T_OP_GT
Definition: token.h:99
@ T_OP_LT
Definition: token.h:101
@ T_OP_REG_NE
Definition: token.h:103

Definition at line 92 of file users_file.c.

◆ check_cmp_op_table_len

size_t check_cmp_op_table_len = NUM_ELEMENTS(check_cmp_op_table)
static

Definition at line 107 of file users_file.c.

◆ name_terms

const fr_sbuff_term_t name_terms
static
Initial value:
L("\t"),
L("\n"),
L(" "),
L("#"),
)
#define FR_SBUFF_TERMS(...)
Initialise a terminal structure with a list of sorted strings.
Definition: sbuff.h:167

Definition at line 109 of file users_file.c.

◆ rhs_term

fr_sbuff_parse_rules_t const rhs_term
static
Initial value:
= {
.chr = '\\',
.subs = {
['\t'] = '\t',
['\n'] = '\n',
[' '] = ' '
},
.do_hex = true,
.do_oct = false
},
.terminals = &FR_SBUFF_TERMS(
L(""),
L("\t"),
L("\n"),
L("#"),
L(","),
)
}
Set of parsing rules for *unescape_until functions.
Definition: merged_model.c:163

Definition at line 116 of file users_file.c.