The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Macros | Typedefs | Enumerations | Functions
cf_priv.h File Reference

Private data structures and types for cf_*.c. More...

#include <stdint.h>
#include <sys/stat.h>
#include <freeradius-devel/server/cf_parse.h>
#include <freeradius-devel/util/rb.h>
#include <freeradius-devel/util/dlist.h>
+ Include dependency graph for cf_priv.h:

Go to the source code of this file.

Data Structures

struct  cf_data
 Internal data that is associated with a configuration section. More...
 
struct  cf_file_t
 
struct  cf_item
 Common header for all CONF_* types. More...
 
struct  cf_pair
 Configuration AVP similar to a fr_pair_t. More...
 
struct  cf_section
 A section grouping multiple CONF_PAIR. More...
 

Macros

#define cf_item_foreach(_ci, _iter)    for (CONF_ITEM *_iter = fr_dlist_head(&(_ci)->children); _iter; _iter = fr_dlist_next(&(_ci)->children, _iter))
 Iterate over the contents of a list. More...
 
#define cf_item_foreach_next(_ci, _iter, _prev)    for (CONF_ITEM *_iter = fr_dlist_next(&(_ci)->children, _prev); _iter; _iter = fr_dlist_next(&(_ci)->children, _iter))
 Iterate over the contents of a list. More...
 
#define cf_item_foreach_prev(_ci, _iter, _prev)    for (CONF_ITEM *_iter = fr_dlist_prev(&(_ci)->children, _prev); _iter; _iter = fr_dlist_prev(&(_ci)->children, _iter))
 Iterate over the contents of a list in reverse order. More...
 

Typedefs

typedef enum conf_type CONF_ITEM_TYPE
 

Enumerations

enum  cf_unlang_t {
  CF_UNLANG_NONE = 0 ,
  CF_UNLANG_ALLOW ,
  CF_UNLANG_SERVER ,
  CF_UNLANG_POLICY ,
  CF_UNLANG_MODULES ,
  CF_UNLANG_EDIT ,
  CF_UNLANG_ASSIGNMENT ,
  CF_UNLANG_DICTIONARY ,
  CF_UNLANG_CAN_HAVE_UPDATE
}
 
enum  conf_type {
  CONF_ITEM_INVALID = 0 ,
  CONF_ITEM_PAIR ,
  CONF_ITEM_SECTION ,
  CONF_ITEM_DATA
}
 

Functions

static bool cf_item_has_no_children (CONF_ITEM const *ci)
 Check if the CONF_ITEM has no children. More...
 

Detailed Description

Private data structures and types for cf_*.c.

Id
3746f12944f929e147bcb19aa352981c0894113e

Definition in file cf_priv.h.


Data Structure Documentation

◆ cf_data

struct cf_data

Internal data that is associated with a configuration section.

Definition at line 124 of file cf_priv.h.

+ Collaboration diagram for cf_data:
Data Fields
void const * data User data.
bool free If true, free data with talloc if parent node is freed.
bool is_talloced If true we can do extra checks.
CONF_ITEM item Common set of fields.
char const * name Additional qualification of type.
char const * type C type of data being stored.

◆ cf_file_t

struct cf_file_t

Definition at line 135 of file cf_priv.h.

+ Collaboration diagram for cf_file_t:
Data Fields
struct stat buf stat about the file
CONF_SECTION * cs CONF_SECTION associated with the file.
char const * filename name of the file
bool from_dir was read from a directory
fr_rb_node_t node

◆ cf_item

struct cf_item

Common header for all CONF_* types.

Definition at line 49 of file cf_priv.h.

+ Collaboration diagram for cf_item:
Data Fields
fr_dlist_head_t children The head of the ordered list of children.
fr_dlist_t entry Entry in dlist.
char const * filename The file the config item was parsed from.
fr_rb_tree_t * ident1 Tree to store the first identifier (name1 || type || attr).
fr_rb_node_t ident1_node Entry in the ident1 tree.
fr_rb_tree_t * ident2 Tree to store the second identifier (name2 || name).
fr_rb_node_t ident2_node Entry in the ident2 tree.
int lineno The line number the config item began on.
CONF_ITEM * parent Parent.
CONF_ITEM_TYPE type Whether the config item is a config_pair, conf_section or cf_data.

◆ cf_pair

struct cf_pair

Configuration AVP similar to a fr_pair_t.

Definition at line 70 of file cf_priv.h.

+ Collaboration diagram for cf_pair:
Data Fields
char const * attr Attribute name.
CONF_ITEM item Common set of fields.
fr_token_t lhs_quote Name quoting style T_(DOUBLE|SINGLE|BACK)_QUOTE_STRING or T_BARE_WORD.
fr_token_t op Operator e.g. =, :=.
bool parsed Was this item used during parsing?
bool pass2 do expansion in pass2.
bool printed Was this item printed already in debug mode?
bool referenced Was this item referenced in the config?
fr_token_t rhs_quote Value Quoting style T_(DOUBLE|SINGLE|BACK)_QUOTE_STRING or T_BARE_WORD.
char const * value Attribute value.

◆ cf_section

struct cf_section

A section grouping multiple CONF_PAIR.

Definition at line 101 of file cf_priv.h.

+ Collaboration diagram for cf_section:
Data Fields
bool allow_locals allow local variables
int argc number of additional arguments
char const ** argv additional arguments
fr_token_t * argv_quote
void * base
int depth
CONF_ITEM item Common set of fields.
char const * name1 First name token. Given foo bar {} would be foo.
char const * name2 Second name token. Given foo bar {} would be bar.
fr_token_t name2_quote The type of quoting around name2.
CONF_SECTION * template
cf_unlang_t unlang

Macro Definition Documentation

◆ cf_item_foreach

#define cf_item_foreach (   _ci,
  _iter 
)     for (CONF_ITEM *_iter = fr_dlist_head(&(_ci)->children); _iter; _iter = fr_dlist_next(&(_ci)->children, _iter))

Iterate over the contents of a list.

Parameters
[in]_cito iterate over.
[in]_iterName of iteration variable. Will be declared in the scope of the loop.

Definition at line 149 of file cf_priv.h.

◆ cf_item_foreach_next

#define cf_item_foreach_next (   _ci,
  _iter,
  _prev 
)     for (CONF_ITEM *_iter = fr_dlist_next(&(_ci)->children, _prev); _iter; _iter = fr_dlist_next(&(_ci)->children, _iter))

Iterate over the contents of a list.

Parameters
[in]_cito iterate over.
[in]_iterName of iteration variable. Will be declared in the scope of the loop.
[in]_prevprevious pointer

Definition at line 159 of file cf_priv.h.

◆ cf_item_foreach_prev

#define cf_item_foreach_prev (   _ci,
  _iter,
  _prev 
)     for (CONF_ITEM *_iter = fr_dlist_prev(&(_ci)->children, _prev); _iter; _iter = fr_dlist_prev(&(_ci)->children, _iter))

Iterate over the contents of a list in reverse order.

Parameters
[in]_cito iterate over.
[in]_iterName of iteration variable. Will be declared in the scope of the loop.
[in]_prevprevious pointer

Definition at line 169 of file cf_priv.h.

Typedef Documentation

◆ CONF_ITEM_TYPE

typedef enum conf_type CONF_ITEM_TYPE

Enumeration Type Documentation

◆ cf_unlang_t

Enumerator
CF_UNLANG_NONE 

no unlang

CF_UNLANG_ALLOW 

allow unlang in this section

CF_UNLANG_SERVER 

this section is a virtual server, allow unlang 2 down

CF_UNLANG_POLICY 

this section is a policy, allow unlang 2 down

CF_UNLANG_MODULES 

this section is in "modules", allow unlang 2 down

CF_UNLANG_EDIT 

only edit commands

CF_UNLANG_ASSIGNMENT 

only assignments inside of map / update

CF_UNLANG_DICTIONARY 

only local variable definitions

CF_UNLANG_CAN_HAVE_UPDATE 

can have "update"

Definition at line 86 of file cf_priv.h.

◆ conf_type

enum conf_type
Enumerator
CONF_ITEM_INVALID 
CONF_ITEM_PAIR 
CONF_ITEM_SECTION 
CONF_ITEM_DATA 

Definition at line 39 of file cf_priv.h.

Function Documentation

◆ cf_item_has_no_children()

static bool cf_item_has_no_children ( CONF_ITEM const *  ci)
inlinestatic

Check if the CONF_ITEM has no children.

Which is the common use-case

Parameters
[in]cito check
Returns
true/false

Definition at line 179 of file cf_priv.h.

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