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_prev(_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...
 

Typedefs

typedef enum conf_type CONF_ITEM_TYPE
 

Enumerations

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
02d0f3d44876c616b253005ed86af8e1e346fa73

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 113 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 124 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 89 of file cf_priv.h.

+ Collaboration diagram for cf_section:
Data Fields
bool allow_locals allow local variables
int allow_unlang depth at which we allow unlang
int argc number of additional arguments
char const ** argv additional arguments
fr_token_t * argv_quote
bool attr is this thing an attribute definition?
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

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 138 of file cf_priv.h.

◆ cf_item_foreach_prev

#define cf_item_foreach_prev (   _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 148 of file cf_priv.h.

Typedef Documentation

◆ CONF_ITEM_TYPE

typedef enum conf_type CONF_ITEM_TYPE

Enumeration Type Documentation

◆ 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 158 of file cf_priv.h.

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