The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions | Variables
cf_parse.h File Reference

API to parse internal format configuration items into native C types. More...

#include <unistd.h>
#include <sys/time.h>
#include <freeradius-devel/util/rb.h>
#include <freeradius-devel/util/table.h>
#include <freeradius-devel/util/value.h>
#include <freeradius-devel/server/cf_util.h>
+ Include dependency graph for cf_parse.h:

Go to the source code of this file.

Data Structures

struct  cf_table_parse_ctx_t
 
struct  cf_time_delta_bounds_t
 Bounds for cf_parse_time_delta_bounded, passed as the rule's uctx. More...
 
struct  conf_parser_s
 Defines a CONF_PAIR to C data type mapping. More...
 
union  conf_parser_s.__unnamed70__
 Where to write status if FR_TYPE_IS_DEFAULT is set. More...
 
union  conf_parser_s.__unnamed72__
 
struct  conf_parser_s.__unnamed72__.__unnamed74__
 
struct  conf_parser_s.__unnamed72__.__unnamed76__
 

Macros

#define CF_FILE_CONFIG   (1 << 2)
 
#define CF_FILE_ERROR   (1)
 
#define CF_FILE_MODULE   (1 << 3)
 
#define CF_FILE_NONE   (0)
 
#define cf_section_rule_push(_cs, _rule)   _cf_section_rule_push(_cs, _rule, __FILE__, __LINE__)
 
#define cf_section_rules_push(_cs, _rule)   _cf_section_rules_push(_cs, _rule, __FILE__, __LINE__)
 
#define CONF_CTYPE_TO_FLAGS(_ct)
 
#define CONF_PARSER_PARTIAL_TERMINATOR
 
#define CONF_PARSER_TERMINATOR
 
#define FR_CONF_FLAG_CHECK(_type, _flags, _c_type, _ptr_or_offset)   _ptr_or_offset
 
#define FR_CONF_OFFSET(_name, _struct, _field)
 conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
 
#define FR_CONF_OFFSET_FLAGS(_name, _flags, _struct, _field)
 conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
 
#define FR_CONF_OFFSET_HINT_TYPE(_name, _type, _struct, _field)
 conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
 
#define FR_CONF_OFFSET_IS_SET(_name, _type, _flags, _struct, _field)
 conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct, recording if a default was used in <_field>_is_set
 
#define FR_CONF_OFFSET_REF(_struct, _field, _subcs)
 conf_parser_t which populates a sub-struct using a CONF_SECTION
 
#define FR_CONF_OFFSET_SUBSECTION(_name, _flags, _struct, _field, _subcs)
 conf_parser_t which populates a sub-struct using a CONF_SECTION
 
#define FR_CONF_OFFSET_SUBSECTION_IS_SET(_name, _flags, _struct, _field, _is_set_field, _subcs)
 conf_parser_t which populates a sub-struct using a CONF_SECTION, recording if the CONF_SECTION was found in <_is_set_field>
 
#define FR_CONF_OFFSET_TYPE_FLAGS(_name, _type, _flags, _struct, _field)
 conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
 
#define FR_CONF_PAIR_GLOBAL(_name, _type, _flags, _func, _dflt_func)
 conf_parser_t entry which doesn't fill in a pointer or offset, but relies on functions to record values
 
#define FR_CONF_POINTER(_name, _type, _flags, _res_p)
 conf_parser_t which parses a single CONF_PAIR producing a single global result
 
#define FR_CONF_POINTER_IS_SET(_name, _type, _flags, _res_p)
 conf_parser_t which parses a single CONF_PAIR producing a single global result, recording if a default was used in <_res_p>_is_set
 
#define FR_CONF_SUBSECTION_ALLOC(_name, _flags, _struct, _field, _subcs)
 conf_parser_t which allocates a struct and populates it from a subsection
 
#define FR_CONF_SUBSECTION_ALLOC_MULTI(_name, _flags, _struct, _field, _subcs)
 conf_parser_t which allocates one struct for each instance of a subsection
 
#define FR_CONF_SUBSECTION_GLOBAL(_name, _flags, _subcs)
 conf_parser_t entry which runs conf_parser_t entries for a subsection without any output
 
#define FR_CONF_V3_DEPRECATED(_name, _struct, _field)
 conf_parser_t entry which raises an error if a deprecated v3 item is found
 
#define FR_INTEGER_BOUND_CHECK(_name, _var, _op, _bound)   FR_INTEGER_COND_CHECK(_name, _var, (_var _op _bound), _bound)
 
#define FR_INTEGER_COND_CHECK(_name, _var, _cond, _new)
 
#define FR_ITEM_POINTER(_type, _res_p)   _type, FR_CONF_FLAG_CHECK((_type), 0, (_res_p), _res_p)
 
#define FR_SIZE_BOUND_CHECK(_name, _var, _op, _bound)   FR_SIZE_COND_CHECK(_name, _var, (_var _op _bound), _bound)
 
#define FR_SIZE_COND_CHECK(_name, _var, _cond, _new)
 
#define FR_TIME_DELTA_BOUND_CHECK(_name, _var, _op, _bound)
 
#define FR_TIME_DELTA_COND_CHECK(_name, _var, _cond, _new)
 

Typedefs

typedef int(* cf_dflt_t) (CONF_PAIR **out, void *parent, CONF_SECTION *cs, fr_token_t quote, conf_parser_t const *rule)
 Callback for producing dynamic defaults from 3rd party libraries.
 
typedef int(* cf_parse_t) (TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
 Callback for performing custom parsing of a CONF_SECTION or CONF_PAIR.
 
typedef struct conf_parser_s conf_parser_t
 

Functions

int _cf_section_rule_push (CONF_SECTION *cs, conf_parser_t const *rule, char const *filename, int lineno)
 Add a single rule to a CONF_SECTION.
 
int _cf_section_rules_push (CONF_SECTION *cs, conf_parser_t const *rules, char const *filename, int lineno)
 Add an array of parse rules to a CONF_SECTION.
 
int cf_null_on_read (TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
 
void cf_pair_debug_log (CONF_SECTION const *cs, CONF_PAIR *cp, conf_parser_t const *rule)
 
int cf_pair_parse (TALLOC_CTX *ctx, CONF_SECTION *cs, char const *name, unsigned int type, void *data, char const *dflt, fr_token_t dflt_quote))
 Parses a CONF_PAIR into a C data type, with a default value.
 
int cf_pair_parse_value (TALLOC_CTX *ctx, void *out, void *base, CONF_ITEM *ci, conf_parser_t const *rule))
 
int cf_pair_to_value_box (TALLOC_CTX *ctx, fr_value_box_t *out, CONF_PAIR *cp, conf_parser_t const *rule))
 Parses a CONF_PAIR into a boxed value.
 
int cf_parse_gid (TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
 
int cf_parse_permissions (TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
 
int cf_parse_time_delta_bounded (TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
 Parse a time delta, and force it within the bounds passed as the rule's uctx.
 
int cf_parse_uid (TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
 
char const * cf_parser_flag_to_enum_str (conf_parser_flags_t mask)
 Return the source-identifier name for a single CONF_FLAG_* bit.
 
int cf_section_parse (TALLOC_CTX *ctx, void *base, CONF_SECTION *cs)
 Parse a configuration section into user-supplied variables.
 
int cf_section_parse_pass2 (void *base, CONF_SECTION *cs)
 Fixup xlat expansions and attributes.
 

Variables

cf_time_delta_bounds_t const cf_time_delta_bounds_int_msec
 Bounds which keep a time delta within an int of milliseconds, for libraries which take one.
 
cf_time_delta_bounds_t const cf_time_delta_bounds_int_sec
 Bounds which keep a time delta within an int of seconds, for libraries which take one.
 
bool check_config
 

#conf_parser_t flags checks

#define fr_rule_dflt(_rule)   ((_rule)->dflt || (_rule)->dflt_func)
 
#define fr_rule_file_exists(_rule)   ((_rule)->flags & CONF_FLAG_FILE_EXISTS)
 
#define fr_rule_file_readable(_rule)   ((_rule)->flags & CONF_FLAG_FILE_READABLE)
 
#define fr_rule_file_socket(_rule)   ((_rule)->flags & CONF_FLAG_FILE_SOCKET)
 
#define fr_rule_file_writable(_rule)   ((_rule)->flags & CONF_FLAG_FILE_WRITABLE)
 
#define fr_rule_is_attribute(_rule)   ((_rule)->flags & CONF_FLAG_ATTRIBUTE)
 
#define fr_rule_is_set(_rule)   ((_rule)->flags & CONF_FLAG_IS_SET)
 
#define fr_rule_is_static(_rule)   ((_rule)->flags & CONF_FLAG_STATIC)
 
#define fr_rule_is_tmpl(_rule)   ((_rule)->flags & CONF_FLAG_TMPL)
 
#define fr_rule_is_xlat(_rule)   ((_rule)->flags & CONF_FLAG_XLAT)
 
#define fr_rule_multi(_rule)   ((_rule)->flags & CONF_FLAG_MULTI)
 
#define fr_rule_not_empty(_rule)   ((_rule)->flags & CONF_FLAG_NOT_EMPTY)
 
#define fr_rule_ok_missing(_rule)   ((_rule)->flags & CONF_FLAG_OK_MISSING)
 
#define fr_rule_required(_rule)   ((_rule)->flags & CONF_FLAG_REQUIRED)
 
#define fr_rule_secret(_rule)   ((_rule)->flags & CONF_FLAG_SECRET)
 
#define fr_rule_v3_deprecated(_rule)   ((_rule)->flags & CONF_FLAG_V3_DEPRECATED)
 

#conf_parser_t type flags

These flags should be or'd with another FR_TYPE_* value to create validation rules for the cf_pair_parse function.

enum  conf_parser_flags_t : uint32_t {
  CONF_FLAG_NONE = 0 ,
  CONF_FLAG_SUBSECTION = (1 << 1) ,
  CONF_FLAG_V3_DEPRECATED = (1 << 10) ,
  CONF_FLAG_REQUIRED = (1 << 11) ,
  CONF_FLAG_ATTRIBUTE = (1 << 12) ,
  CONF_FLAG_SECRET = (1 << 13) ,
  CONF_FLAG_FILE_READABLE = (1 << 14) ,
  CONF_FLAG_FILE_WRITABLE = (1 << 15) ,
  CONF_FLAG_FILE_SOCKET = (1 << 16) ,
  CONF_FLAG_FILE_EXISTS = (1 << 17) ,
  CONF_FLAG_XLAT = (1 << 18) ,
  CONF_FLAG_TMPL = (1 << 19) ,
  CONF_FLAG_MULTI = (1 << 20) ,
  CONF_FLAG_NOT_EMPTY = (1 << 21) ,
  CONF_FLAG_IS_SET = (1 << 22) ,
  CONF_FLAG_OK_MISSING = (1 << 23) ,
  CONF_FLAG_HIDDEN = (1 << 24) ,
  CONF_FLAG_REF = (1 << 25) ,
  CONF_FLAG_OPTIONAL = (1 << 26) ,
  CONF_FLAG_ALWAYS_PARSE = (1 << 27) ,
  CONF_FLAG_NO_OUTPUT = (1 << 28) ,
  CONF_FLAG_STATIC = (1 << 29)
}
 

Table lookups, one function per field type

Each function resolves the CONF_PAIR value in the table passed as the rule's uctx, and writes the result as the type in its name.

Use the function matching the field's type. An enum field gets the function matching the enum's fixed underlying type.

int cf_table_parse_int (UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
 
int cf_table_parse_int16 (UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
 
int cf_table_parse_int32 (UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
 
int cf_table_parse_int8 (UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
 
int cf_table_parse_uint16 (UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
 
int cf_table_parse_uint32 (UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
 
int cf_table_parse_uint8 (UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
 

Detailed Description

API to parse internal format configuration items into native C types.

Id
167dd9c277bc7be1431f936547bc091340bebbbe

Definition in file cf_parse.h.


Data Structure Documentation

◆ cf_table_parse_ctx_t

struct cf_table_parse_ctx_t

Definition at line 707 of file cf_parse.h.

+ Collaboration diagram for cf_table_parse_ctx_t:
Data Fields
size_t * len
fr_table_num_sorted_t const * table

◆ cf_time_delta_bounds_t

struct cf_time_delta_bounds_t

Bounds for cf_parse_time_delta_bounded, passed as the rule's uctx.

Definition at line 714 of file cf_parse.h.

+ Collaboration diagram for cf_time_delta_bounds_t:
Data Fields
fr_time_delta_t max Largest value accepted. 0 means no maximum.
fr_time_delta_t min Smallest value accepted.

◆ conf_parser_s

struct conf_parser_s

Defines a CONF_PAIR to C data type mapping.

Is typically used to define mappings between module sections, and module instance structs. May also be used to set global configuration options.

Offset/data values should be set using FR_CONF_OFFSET or FR_CONF_POINTER.

Example with FR_CONF_OFFSET :

{ FR_CONF_OFFSET_TYPE_FLAGS("example", FR_TYPE_STRING | CONF_FLAG_NOT_EMPTY, 0, 0, example_instance_t, example), .dflt = "default_value" },
}
#define CONF_PARSER_TERMINATOR
Definition cf_parse.h:722
@ CONF_FLAG_NOT_EMPTY
CONF_PAIR is required to have a non zero length value.
Definition cf_parse.h:484
#define FR_CONF_OFFSET_TYPE_FLAGS(_name, _type, _flags, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
Definition cf_parse.h:238
Defines a CONF_PAIR to C data type mapping.
Definition cf_parse.h:649
@ FR_TYPE_STRING
String of printable characters.
static const conf_parser_t module_config[]
Definition rlm_always.c:58

Example with FR_CONF_POINTER :

static conf_parser_t global_config[] = {
{ FR_CONF_POINTER("example", FR_TYPE_STRING | CONF_FLAG_NOT_EMPTY, 0, 0, 0, &my_global), .dflt = "default_value" },
}
#define FR_CONF_POINTER(_name, _type, _flags, _res_p)
conf_parser_t which parses a single CONF_PAIR producing a single global result
Definition cf_parse.h:350
See also
FR_CONF_OFFSET
FR_CONF_POINTER
cf_section_parse
cf_pair_parse

Definition at line 649 of file cf_parse.h.

+ Collaboration diagram for conf_parser_s:
Data Fields
union conf_parser_s.__unnamed70__ __unnamed__ Where to write status if FR_TYPE_IS_DEFAULT is set.
Note
Which field is used, is determined by whether data ptr is set.
union conf_parser_s.__unnamed72__ __unnamed__
void * data Pointer to a static variable to write the parsed value to.
Note
Must be used exclusively to offset.
conf_parser_flags_t flags Flags which control parsing behaviour.
cf_parse_t func Override default parsing behaviour for the specified type with a custom parsing function.
char const * name1 Name of the CONF_ITEM to parse.
char const * name2 Second identifier for CONF_SECTION.
size_t offset Relative offset of field or structure to write the parsed value to.

When flags is set to CONF_FLAG_SUBSECTION, may be used to specify a base offset to add to all offsets contained within the subsection.

Note
Must be used exclusively to data.
cf_parse_t on_read Function to call as the item is being read, just after it has been allocated and initialized.
fr_token_t quote Quoting around the default value. Only used for templates.
fr_type_t type An fr_type_t value, controls the output type.
void const * uctx User data accessible by the cf_parse_t func.

Useful for building reusable functions.

◆ conf_parser_s.__unnamed70__

union conf_parser_s.__unnamed70__

Where to write status if FR_TYPE_IS_DEFAULT is set.

Note
Which field is used, is determined by whether data ptr is set.

Definition at line 680 of file cf_parse.h.

Data Fields
size_t is_set_offset If type contains FR_TYPE_IS_DEFAULT write status to bool.

at this address.

void * is_set_ptr If type contains FR_TYPE_IS_DEFAULT write status to ptr at this address.

◆ conf_parser_s.__unnamed72__

union conf_parser_s.__unnamed72__

Definition at line 687 of file cf_parse.h.

Data Fields
struct conf_parser_s.__unnamed72__.__unnamed74__ __unnamed__
struct conf_parser_s.__unnamed72__.__unnamed76__ __unnamed__

◆ conf_parser_s.__unnamed72__.__unnamed74__

struct conf_parser_s.__unnamed72__.__unnamed74__

Definition at line 688 of file cf_parse.h.

Data Fields
char const * dflt Default as it would appear in radiusd.conf.
cf_dflt_t dflt_func Function to produce dynamic defaults.

◆ conf_parser_s.__unnamed72__.__unnamed76__

struct conf_parser_s.__unnamed72__.__unnamed76__

Definition at line 694 of file cf_parse.h.

Data Fields
conf_parser_t const * subcs When CONF_FLAG_SUBSECTION is set, should be a pointer to the start of another array of conf_parser_t structs, forming the subsection.
size_t subcs_size If non-zero, allocate structs of this size to hold the parsed data.
char const * subcs_type Set a specific talloc type for subcs structures.

Macro Definition Documentation

◆ CF_FILE_CONFIG

#define CF_FILE_CONFIG   (1 << 2)

Definition at line 730 of file cf_parse.h.

◆ CF_FILE_ERROR

#define CF_FILE_ERROR   (1)

Definition at line 729 of file cf_parse.h.

◆ CF_FILE_MODULE

#define CF_FILE_MODULE   (1 << 3)

Definition at line 731 of file cf_parse.h.

◆ CF_FILE_NONE

#define CF_FILE_NONE   (0)

Definition at line 728 of file cf_parse.h.

◆ cf_section_rule_push

#define cf_section_rule_push (   _cs,
  _rule 
)    _cf_section_rule_push(_cs, _rule, __FILE__, __LINE__)

Definition at line 752 of file cf_parse.h.

◆ cf_section_rules_push

#define cf_section_rules_push (   _cs,
  _rule 
)    _cf_section_rules_push(_cs, _rule, __FILE__, __LINE__)

Definition at line 754 of file cf_parse.h.

◆ CONF_CTYPE_TO_FLAGS

#define CONF_CTYPE_TO_FLAGS (   _ct)

Definition at line 187 of file cf_parse.h.

◆ CONF_PARSER_PARTIAL_TERMINATOR

#define CONF_PARSER_PARTIAL_TERMINATOR
Value:
{ .name1 = NULL, .type = (fr_type_t)~(UINT32_MAX - 1), \
.offset = 1, .data = NULL, .dflt = NULL, .quote = T_INVALID }
fr_type_t
@ T_INVALID
Definition token.h:37

Definition at line 725 of file cf_parse.h.

◆ CONF_PARSER_TERMINATOR

#define CONF_PARSER_TERMINATOR
Value:
{ .name1 = NULL, .type = (fr_type_t)~(UINT32_MAX - 1), \
.offset = 0, .data = NULL, .dflt = NULL, .quote = T_INVALID }

Definition at line 722 of file cf_parse.h.

◆ FR_CONF_FLAG_CHECK

#define FR_CONF_FLAG_CHECK (   _type,
  _flags,
  _c_type,
  _ptr_or_offset 
)    _ptr_or_offset

Definition at line 184 of file cf_parse.h.

◆ FR_CONF_OFFSET

#define FR_CONF_OFFSET (   _name,
  _struct,
  _field 
)
Value:
FR_CTYPE_TO_TYPE((((_struct *)NULL)->_field)), \
CONF_CTYPE_TO_FLAGS((((_struct *)NULL)->_field)),\
_struct, _field)
#define CONF_CTYPE_TO_FLAGS(_ct)
Definition cf_parse.h:187
#define FR_CTYPE_TO_TYPE(_ct)
Given a variable, return the equivalent FR_TYPE_* value.
Definition types.h:406

conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct

Parameters
[in]_nameof the CONF_PAIR to search for.
[in]_structcontaining the field to write the result to.
[in]_fieldto write the result to.

Definition at line 280 of file cf_parse.h.

◆ FR_CONF_OFFSET_FLAGS

#define FR_CONF_OFFSET_FLAGS (   _name,
  _flags,
  _struct,
  _field 
)
Value:
FR_CTYPE_TO_TYPE((((_struct *)NULL)->_field)), \
(_flags) | CONF_CTYPE_TO_FLAGS((((_struct *)NULL)->_field)),\
_struct, _field)

conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct

This variant takes additional flags, and will add CONF_FLAG_MULTI automatically if the field is an array.

Parameters
[in]_nameof the CONF_PAIR to search for.
[in]_flagscontrolling parsing behaviour.
[in]_structcontaining the field to write the result to.
[in]_fieldto write the result to.

Definition at line 268 of file cf_parse.h.

◆ FR_CONF_OFFSET_HINT_TYPE

#define FR_CONF_OFFSET_HINT_TYPE (   _name,
  _type,
  _struct,
  _field 
)
Value:
.name1 = _name, \
.type = (fr_type_t)(_type), \
.flags = CONF_FLAG_TMPL, \
.offset = FR_CONF_FLAG_CHECK(FR_TYPE_VOID, CONF_FLAG_TMPL, &(((_struct *)NULL)->_field), offsetof(_struct, _field))
#define FR_CONF_FLAG_CHECK(_type, _flags, _c_type, _ptr_or_offset)
Definition cf_parse.h:184
@ CONF_FLAG_TMPL
CONF_PAIR should be parsed as a template.
Definition cf_parse.h:481
@ FR_TYPE_VOID
User data.

conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct

This variant takes output hint type. If the type is a bare word, it MUST be of the relevant data type.

Parameters
[in]_nameof the CONF_PAIR to search for.
[in]_typeto parse the CONF_PAIR as.
[in]_structcontaining the field to write the result to.
[in]_fieldto write the result to.

Definition at line 253 of file cf_parse.h.

◆ FR_CONF_OFFSET_IS_SET

#define FR_CONF_OFFSET_IS_SET (   _name,
  _type,
  _flags,
  _struct,
  _field 
)
Value:
.name1 = _name, \
.type = (fr_type_t)(_type), \
.flags = (conf_parser_flags_t)(CONF_FLAG_IS_SET | (_flags)), \
.offset = FR_CONF_FLAG_CHECK((_type), (_flags), &(((_struct *)NULL)->_field), offsetof(_struct, _field)), \
.is_set_offset = offsetof(_struct, _field ## _is_set)
conf_parser_flags_t
Definition cf_parse.h:458
@ CONF_FLAG_IS_SET
Write whether this config item was left as the default to is_set_offset or is_set_ptr.
Definition cf_parse.h:488

conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct, recording if a default was used in <_field>_is_set

Parameters
[in]_nameof the CONF_PAIR to search for.
[in]_typeto parse the CONF_PAIR as.
[in]_flagscontrolling parsing behaviour.
[in]_structcontaining the field to write the result to.
[in]_fieldto write the result to.

Definition at line 294 of file cf_parse.h.

◆ FR_CONF_OFFSET_REF

#define FR_CONF_OFFSET_REF (   _struct,
  _field,
  _subcs 
)
Value:
.name1 = CF_IDENT_ANY, \
.flags = CONF_FLAG_REF, \
.offset = offsetof(_struct, _field), \
.subcs = _subcs
@ CONF_FLAG_REF
reference another conf_parser_t inline in this one
Definition cf_parse.h:494
#define CF_IDENT_ANY
Definition cf_util.h:80

conf_parser_t which populates a sub-struct using a CONF_SECTION

Parameters
[in]_structcontaining the sub-struct to populate.
[in]_fieldcontaining the sub-struct to populate.
[in]_subcsconf_parser_t to include in-line in this section

Definition at line 337 of file cf_parse.h.

◆ FR_CONF_OFFSET_SUBSECTION

#define FR_CONF_OFFSET_SUBSECTION (   _name,
  _flags,
  _struct,
  _field,
  _subcs 
)
Value:
.name1 = _name, \
.flags = (conf_parser_flags_t)(CONF_FLAG_SUBSECTION | (_flags)), \
.offset = offsetof(_struct, _field), \
.subcs = _subcs
@ CONF_FLAG_SUBSECTION
Instead of putting the information into a configuration structure, the configuration file routines MA...
Definition cf_parse.h:460

conf_parser_t which populates a sub-struct using a CONF_SECTION

Parameters
[in]_nameof the CONF_SECTION to search for.
[in]_flagscontrolling parsing behaviour.
[in]_structcontaining the sub-struct to populate.
[in]_fieldcontaining the sub-struct to populate.
[in]_subcsCONF_SECTION to parse.

Definition at line 309 of file cf_parse.h.

◆ FR_CONF_OFFSET_SUBSECTION_IS_SET

#define FR_CONF_OFFSET_SUBSECTION_IS_SET (   _name,
  _flags,
  _struct,
  _field,
  _is_set_field,
  _subcs 
)
Value:
.name1 = _name, \
.offset = offsetof(_struct, _field), \
.is_set_offset = offsetof(_struct, _is_set_field), \
.subcs = _subcs

conf_parser_t which populates a sub-struct using a CONF_SECTION, recording if the CONF_SECTION was found in <_is_set_field>

Parameters
[in]_nameof the CONF_SECTION to search for.
[in]_flagscontrolling parsing behaviour.
[in]_structcontaining the sub-struct to populate.
[in]_fieldcontaining the sub-struct to populate.
[in]_is_set_fieldbool to write the is set state to.
[in]_subcsCONF_SECTION to parse.

Definition at line 324 of file cf_parse.h.

◆ FR_CONF_OFFSET_TYPE_FLAGS

#define FR_CONF_OFFSET_TYPE_FLAGS (   _name,
  _type,
  _flags,
  _struct,
  _field 
)
Value:
.name1 = _name, \
.type = (fr_type_t)(_type), \
.flags = (conf_parser_flags_t)(_flags), \
.offset = FR_CONF_FLAG_CHECK((_type), (_flags), &(((_struct *)NULL)->_field), offsetof(_struct, _field))

conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct

This variant takes output type and flags manually, instead of determining them automatically.

Parameters
[in]_nameof the CONF_PAIR to search for.
[in]_typeto parse the CONF_PAIR as.
[in]_flagscontrolling parsing behaviour.
[in]_structcontaining the field to write the result to.
[in]_fieldto write the result to.

Definition at line 238 of file cf_parse.h.

◆ FR_CONF_PAIR_GLOBAL

#define FR_CONF_PAIR_GLOBAL (   _name,
  _type,
  _flags,
  _func,
  _dflt_func 
)
Value:
.name1 = _name, \
.type = (fr_type_t)(_type), \
.flags = (conf_parser_flags_t)(CONF_FLAG_NO_OUTPUT | (_flags)), \
.func = _func, \
.dflt_func = _dflt_func
@ CONF_FLAG_NO_OUTPUT
Rule has no framework-managed output destination.
Definition cf_parse.h:501

conf_parser_t entry which doesn't fill in a pointer or offset, but relies on functions to record values

Parameters
[in]_namename of pair to search for.
[in]_typebase type to parse pair as.
[in]_flagsflags controlling parsing behaviour.
[in]_functo use to record value.
[in]_dflt_functo use to get defaults from a 3rd party library.

Definition at line 418 of file cf_parse.h.

◆ FR_CONF_POINTER

#define FR_CONF_POINTER (   _name,
  _type,
  _flags,
  _res_p 
)
Value:
.name1 = _name, \
.type = (fr_type_t)(_type), \
.flags = (conf_parser_flags_t)(_flags), \
.data = FR_CONF_FLAG_CHECK((_type), (_flags), (_res_p), _res_p)

conf_parser_t which parses a single CONF_PAIR producing a single global result

Parameters
[in]_nameof the CONF_PAIR to search for.
[in]_typeto parse the CONF_PAIR as.
[in]_flagscontrolling parsing behaviour.
[out]_res_ppointer to a global var, where the result will be written.

Definition at line 350 of file cf_parse.h.

◆ FR_CONF_POINTER_IS_SET

#define FR_CONF_POINTER_IS_SET (   _name,
  _type,
  _flags,
  _res_p 
)
Value:
.name1 = _name, \
.type = (fr_type_t)(_type), \
.flags = (conf_parser_flags_t)(CONF_FLAG_IS_SET | (_flags)), \
.data = FR_CONF_FLAG_CHECK((_type), (_flags), (_res_p), _res_p), \
.is_set_ptr = _res_p ## _is_set
static fr_slen_t data
Definition value.h:1366

conf_parser_t which parses a single CONF_PAIR producing a single global result, recording if a default was used in <_res_p>_is_set

Note
is set state is recorded in variable <_res_p>_is_set.
Parameters
[in]_nameof the CONF_PAIR to search for.
[in]_typeto parse the CONF_PAIR as.
[in]_flagscontrolling parsing behaviour.
[out]_res_ppointer to a global var, where the result will be written.

Definition at line 365 of file cf_parse.h.

◆ FR_CONF_SUBSECTION_ALLOC

#define FR_CONF_SUBSECTION_ALLOC (   _name,
  _flags,
  _struct,
  _field,
  _subcs 
)
Value:
.name1 = _name, \
.flags = (conf_parser_flags_t)(CONF_FLAG_SUBSECTION | (_flags)), \
.offset = offsetof(_struct, _field), \
.subcs = _subcs, \
.subcs_size = sizeof(*(((_struct *)0)->_field))

conf_parser_t which allocates a struct and populates it from a subsection

The parser allocates the struct, so _field is a pointer to the struct. Set .subcs_type on the rule to name the talloc chunk.

Parameters
[in]_namename of subsection to search for.
[in]_flagsflags controlling parsing behaviour.
[in]_structinstance data struct.
[in]_fieldpointer field in instance data struct.
[in]_subcsconf_parser_t array to use to parse subsection data.

Definition at line 384 of file cf_parse.h.

◆ FR_CONF_SUBSECTION_ALLOC_MULTI

#define FR_CONF_SUBSECTION_ALLOC_MULTI (   _name,
  _flags,
  _struct,
  _field,
  _subcs 
)
Value:
.name1 = _name, \
.offset = offsetof(_struct, _field), \
.subcs = _subcs, \
.subcs_size = sizeof(**(((_struct *)0)->_field))
@ CONF_FLAG_MULTI
CONF_PAIR can have multiple copies.
Definition cf_parse.h:483

conf_parser_t which allocates one struct for each instance of a subsection

The parser allocates an array of pointers with one struct per matching subsection, so _field is a pointer to a pointer to the struct. Set .subcs_type on the rule to name the talloc chunks.

Parameters
[in]_namename of subsection to search for.
[in]_flagsflags controlling parsing behaviour.
[in]_structinstance data struct.
[in]_fieldarray field in instance data struct.
[in]_subcsconf_parser_t array to use to parse subsection data.

Definition at line 403 of file cf_parse.h.

◆ FR_CONF_SUBSECTION_GLOBAL

#define FR_CONF_SUBSECTION_GLOBAL (   _name,
  _flags,
  _subcs 
)
Value:
.name1 = _name, \
.subcs = _subcs

conf_parser_t entry which runs conf_parser_t entries for a subsection without any output

Parameters
[in]_nameof pair to search for.
[in]_flagsflags controlling parsing behaviour.
[in]_subcsto use to get defaults from a 3rd party library.

Definition at line 431 of file cf_parse.h.

◆ FR_CONF_V3_DEPRECATED

#define FR_CONF_V3_DEPRECATED (   _name,
  _struct,
  _field 
)
Value:
.name1 = _name, \
@ CONF_FLAG_V3_DEPRECATED
If a matching CONF_PAIR is found, error out with a deprecated message.
Definition cf_parse.h:464

conf_parser_t entry which raises an error if a deprecated v3 item is found

We don't want to include v3 compatibility support forever. But we do want to catch the cases where people use the v3 config. So we add CONF_PARSER entries for the old config, and then produce errors when they're seen.

Parameters
[in]_nameof pair to search for.
[in]_structwhere the result was previously written.
[in]_fieldin the struct where the result was previously written.

Definition at line 446 of file cf_parse.h.

◆ FR_INTEGER_BOUND_CHECK

#define FR_INTEGER_BOUND_CHECK (   _name,
  _var,
  _op,
  _bound 
)    FR_INTEGER_COND_CHECK(_name, _var, (_var _op _bound), _bound)

Definition at line 572 of file cf_parse.h.

◆ FR_INTEGER_COND_CHECK

#define FR_INTEGER_COND_CHECK (   _name,
  _var,
  _cond,
  _new 
)
Value:
do {\
if (!(_cond)) {\
WARN("Ignoring \"" _name " = %u\", forcing to \"" _name " = %u\"", (unsigned int) (_var), (unsigned int) (_new));\
_var = _new;\
}\
} while (0)

Definition at line 564 of file cf_parse.h.

◆ FR_ITEM_POINTER

#define FR_ITEM_POINTER (   _type,
  _res_p 
)    _type, FR_CONF_FLAG_CHECK((_type), 0, (_res_p), _res_p)

Definition at line 371 of file cf_parse.h.

◆ fr_rule_dflt

#define fr_rule_dflt (   _rule)    ((_rule)->dflt || (_rule)->dflt_func)

Definition at line 543 of file cf_parse.h.

◆ fr_rule_file_exists

#define fr_rule_file_exists (   _rule)    ((_rule)->flags & CONF_FLAG_FILE_EXISTS)

Definition at line 533 of file cf_parse.h.

◆ fr_rule_file_readable

#define fr_rule_file_readable (   _rule)    ((_rule)->flags & CONF_FLAG_FILE_READABLE)

Definition at line 527 of file cf_parse.h.

◆ fr_rule_file_socket

#define fr_rule_file_socket (   _rule)    ((_rule)->flags & CONF_FLAG_FILE_SOCKET)

Definition at line 531 of file cf_parse.h.

◆ fr_rule_file_writable

#define fr_rule_file_writable (   _rule)    ((_rule)->flags & CONF_FLAG_FILE_WRITABLE)

Definition at line 529 of file cf_parse.h.

◆ fr_rule_is_attribute

#define fr_rule_is_attribute (   _rule)    ((_rule)->flags & CONF_FLAG_ATTRIBUTE)

Definition at line 545 of file cf_parse.h.

◆ fr_rule_is_set

#define fr_rule_is_set (   _rule)    ((_rule)->flags & CONF_FLAG_IS_SET)

Definition at line 539 of file cf_parse.h.

◆ fr_rule_is_static

#define fr_rule_is_static (   _rule)    ((_rule)->flags & CONF_FLAG_STATIC)

Definition at line 551 of file cf_parse.h.

◆ fr_rule_is_tmpl

#define fr_rule_is_tmpl (   _rule)    ((_rule)->flags & CONF_FLAG_TMPL)

Definition at line 549 of file cf_parse.h.

◆ fr_rule_is_xlat

#define fr_rule_is_xlat (   _rule)    ((_rule)->flags & CONF_FLAG_XLAT)

Definition at line 547 of file cf_parse.h.

◆ fr_rule_multi

#define fr_rule_multi (   _rule)    ((_rule)->flags & CONF_FLAG_MULTI)

Definition at line 535 of file cf_parse.h.

◆ fr_rule_not_empty

#define fr_rule_not_empty (   _rule)    ((_rule)->flags & CONF_FLAG_NOT_EMPTY)

Definition at line 537 of file cf_parse.h.

◆ fr_rule_ok_missing

#define fr_rule_ok_missing (   _rule)    ((_rule)->flags & CONF_FLAG_OK_MISSING)

Definition at line 541 of file cf_parse.h.

◆ fr_rule_required

#define fr_rule_required (   _rule)    ((_rule)->flags & CONF_FLAG_REQUIRED)

Definition at line 523 of file cf_parse.h.

◆ fr_rule_secret

#define fr_rule_secret (   _rule)    ((_rule)->flags & CONF_FLAG_SECRET)

Definition at line 525 of file cf_parse.h.

◆ fr_rule_v3_deprecated

#define fr_rule_v3_deprecated (   _rule)    ((_rule)->flags & CONF_FLAG_V3_DEPRECATED)

Definition at line 521 of file cf_parse.h.

◆ FR_SIZE_BOUND_CHECK

#define FR_SIZE_BOUND_CHECK (   _name,
  _var,
  _op,
  _bound 
)    FR_SIZE_COND_CHECK(_name, _var, (_var _op _bound), _bound)

Definition at line 562 of file cf_parse.h.

◆ FR_SIZE_COND_CHECK

#define FR_SIZE_COND_CHECK (   _name,
  _var,
  _cond,
  _new 
)
Value:
do {\
if (!(_cond)) {\
WARN("Ignoring \"" _name " = %zu\", forcing to \"" _name " = %zu\"", _var, _new);\
_var = _new;\
}\
} while (0)

Definition at line 554 of file cf_parse.h.

◆ FR_TIME_DELTA_BOUND_CHECK

#define FR_TIME_DELTA_BOUND_CHECK (   _name,
  _var,
  _op,
  _bound 
)
Value:
do {\
if (!fr_time_delta_cond(_var, _op, _bound)) { \
WARN("Ignoring \"" _name " = %pV\", forcing to \"" _name " = %pV\"",\
fr_box_time_delta(_bound));\
_var = _bound;\
}\
} while (0)
#define fr_time_delta_cond(_a, _op, _b)
Definition time.h:282
#define fr_box_time_delta(_val)
Definition value.h:397

Definition at line 583 of file cf_parse.h.

◆ FR_TIME_DELTA_COND_CHECK

#define FR_TIME_DELTA_COND_CHECK (   _name,
  _var,
  _cond,
  _new 
)
Value:
do {\
if (!(_cond)) {\
WARN("Ignoring \"" _name " = %pV\", forcing to \"" _name " = %pV\"", \
_var = _new;\
}\
} while (0)

Definition at line 574 of file cf_parse.h.

Typedef Documentation

◆ cf_dflt_t

typedef int(* cf_dflt_t) (CONF_PAIR **out, void *parent, CONF_SECTION *cs, fr_token_t quote, conf_parser_t const *rule)

Callback for producing dynamic defaults from 3rd party libraries.

Parameters
[out]outWhere to write default conf pair.
[in]parentbeing populated.
[in]csto allocate pair in.
[in]quoteto use when allocing the pair. Provided as a convenience.
[in]ruleto produce default for.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 619 of file cf_parse.h.

◆ cf_parse_t

typedef int(* cf_parse_t) (TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule)

Callback for performing custom parsing of a CONF_SECTION or CONF_PAIR.

Parameters
[in]ctxto allocate any data in.
[out]outWhere to write the result of parsing.
[in]parentThe base address of the structure.
[in]ciThe CONF_SECTION or CONF_PAIR to parse.
[in]ruleParse rules - How the CONF_PAIR or CONF_SECTION should be converted.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 606 of file cf_parse.h.

◆ conf_parser_t

typedef struct conf_parser_s conf_parser_t

Definition at line 28 of file cf_parse.h.

Enumeration Type Documentation

◆ conf_parser_flags_t

Enumerator
CONF_FLAG_NONE 

No special flags.

CONF_FLAG_SUBSECTION 

Instead of putting the information into a configuration structure, the configuration file routines MAY just parse it directly into user-supplied variables.

CONF_FLAG_V3_DEPRECATED 

If a matching CONF_PAIR is found, error out with a deprecated message.

CONF_FLAG_REQUIRED 

Error out if no matching CONF_PAIR is found, and no dflt value is set.

CONF_FLAG_ATTRIBUTE 

Value must resolve to attribute in dict (deprecated, use CONF_FLAG_TMPL).

CONF_FLAG_SECRET 

Only print value if debug level >= 3.

CONF_FLAG_FILE_READABLE 

File matching value must exist, and must be readable.

CONF_FLAG_FILE_WRITABLE 

File matching value must exist, and must be writable.

CONF_FLAG_FILE_SOCKET 

File matching value must exist, and must be a unix socket.

CONF_FLAG_FILE_EXISTS 

File matching value must exist.

CONF_FLAG_XLAT 

string will be dynamically expanded.

CONF_FLAG_TMPL 

CONF_PAIR should be parsed as a template.

CONF_FLAG_MULTI 

CONF_PAIR can have multiple copies.

CONF_FLAG_NOT_EMPTY 

CONF_PAIR is required to have a non zero length value.

CONF_FLAG_IS_SET 

Write whether this config item was left as the default to is_set_offset or is_set_ptr.

CONF_FLAG_OK_MISSING 

OK if it's missing.

CONF_FLAG_HIDDEN 

Used by scripts to omit items from the generated documentation.

CONF_FLAG_REF 

reference another conf_parser_t inline in this one

CONF_FLAG_OPTIONAL 

subsection is pushed only if a non-optional matching one is pushed

CONF_FLAG_ALWAYS_PARSE 

Run this rule even against items already marked parsed.

Useful for CF_IDENT_ANY observer rules that want to see every item, not just the leftovers, or for a second-pass rule that needs to re-examine something an earlier rule already claimed.

CONF_FLAG_NO_OUTPUT 

Rule has no framework-managed output destination.

The parse function owns its own side effects - the framework will not pre-zero base + offset for strings, nor write a MULTI array pointer through that offset. Set automatically by FR_CONF_PAIR_GLOBAL so its default offset = 0 doesn't clobber the first field of base.

CONF_FLAG_STATIC 

The tmpl_t must hold a fixed value.

The code that reads the value does not expand the tmpl at runtime, so an expansion, an attribute reference or an exec is a configuration error.

Definition at line 458 of file cf_parse.h.

Function Documentation

◆ _cf_section_rule_push()

int _cf_section_rule_push ( CONF_SECTION *  cs,
conf_parser_t const *  rule,
char const *  filename,
int  lineno 
)

Add a single rule to a CONF_SECTION.

Parameters
[in]csto add rules to.
[in]ruleto add.
[in]filenamewhere the rule was pushed.
[in]linenowhere the rule was pushed.
Returns
  • 0 on success.
  • -1 if the rules added conflict.

Definition at line 1662 of file cf_parse.c.

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

◆ _cf_section_rules_push()

int _cf_section_rules_push ( CONF_SECTION *  cs,
conf_parser_t const *  rules,
char const *  filename,
int  lineno 
)

Add an array of parse rules to a CONF_SECTION.

Parameters
[in]csto add rules to.
[in]rulesto add. Last element should have NULL name field.
[in]filenamewhere the rule was pushed.
[in]linenowhere the rule was pushed.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 1776 of file cf_parse.c.

+ Here is the call graph for this function:

◆ cf_null_on_read()

int cf_null_on_read ( TALLOC_CTX *  ctx,
void *  out,
void *  parent,
CONF_ITEM *  ci,
conf_parser_t const *  rule 
)

◆ cf_pair_debug_log()

void cf_pair_debug_log ( CONF_SECTION const *  cs,
CONF_PAIR *  cp,
conf_parser_t const *  rule 
)

Definition at line 50 of file cf_parse.c.

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

◆ cf_pair_parse()

int cf_pair_parse ( TALLOC_CTX *  ctx,
CONF_SECTION *  cs,
char const *  name,
unsigned int  type,
void *  data,
char const *  dflt,
fr_token_t  dflt_quote 
)

Parses a CONF_PAIR into a C data type, with a default value.

Takes fields from a conf_parser_t struct and uses them to parse the string value of a CONF_PAIR into a C data type matching the type argument.

The format of the types are the same as fr_value_box_t types.

Note
The dflt value will only be used if no matching CONF_PAIR is found. Empty strings will not result in the dflt value being used.

fr_type_t to data type mappings

fr_type_t Data type Dynamically allocated
FR_TYPE_BOOL bool No
FR_TYPE_UINT32 uint32_t No
FR_TYPE_UINT16 uint16_t No
FR_TYPE_UINT64 uint64_t No
FR_TYPE_INT32 int32_t No
FR_TYPE_STRING char const * Yes
FR_TYPE_IPV4_ADDR fr_ipaddr_t No
FR_TYPE_IPV4_PREFIX fr_ipaddr_t No
FR_TYPE_IPV6_ADDR fr_ipaddr_t No
FR_TYPE_IPV6_PREFIX fr_ipaddr_t No
FR_TYPE_COMBO_IP_ADDR fr_ipaddr_t No
FR_TYPE_COMBO_IP_PREFIX fr_ipaddr_t No
FR_TYPE_TIME_DELTA fr_time_delta_t No
Parameters
[in]ctxTo allocate arrays and values in.
[in]csto search for matching CONF_PAIR in.
[in]nameof CONF_PAIR to search for.
[in]typeData type to parse CONF_PAIR value as. Should be one of the following data types, and one or more of the following flag types or'd together:

Definition at line 844 of file cf_parse.c.

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

◆ cf_pair_parse_value()

int cf_pair_parse_value ( TALLOC_CTX *  ctx,
void *  out,
void *  base,
CONF_ITEM *  ci,
conf_parser_t const *  rule 
)

◆ cf_pair_to_value_box()

int cf_pair_to_value_box ( TALLOC_CTX *  ctx,
fr_value_box_t *  out,
CONF_PAIR *  cp,
conf_parser_t const *  rule 
)

Parses a CONF_PAIR into a boxed value.

Return the value of a CONF_PAIR.

See also
cf_pair_value
Parameters
[in]ctxto allocate any dynamic buffers in.
[out]outWhere to write the parsed value.
[in]cpto parse.
[in]ruleto parse to. May contain flags.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 127 of file cf_parse.c.

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

◆ cf_parse_gid()

int cf_parse_gid ( TALLOC_CTX *  ctx,
void *  out,
UNUSED void *  parent,
CONF_ITEM *  ci,
conf_parser_t const *  rule 
)

◆ cf_parse_permissions()

int cf_parse_permissions ( TALLOC_CTX *  ctx,
void *  out,
UNUSED void *  parent,
CONF_ITEM *  ci,
conf_parser_t const *  rule 
)

◆ cf_parse_time_delta_bounded()

int cf_parse_time_delta_bounded ( TALLOC_CTX *  ctx,
void *  out,
void *  parent,
CONF_ITEM *  ci,
conf_parser_t const *  rule 
)

Parse a time delta, and force it within the bounds passed as the rule's uctx.

Type should be FR_TYPE_TIME_DELTA, and the rule's uctx a cf_time_delta_bounds_t. A value outside the bounds is replaced by the nearest bound, with a warning.

Parameters
[in]ctxto allocate data in.
[out]outthe fr_time_delta_t to write.
[in]parentBase structure address.
[in]ciCONF_PAIR to parse.
[in]rulewhose uctx holds the bounds.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 1909 of file cf_parse.c.

+ Here is the call graph for this function:

◆ cf_parse_uid()

int cf_parse_uid ( TALLOC_CTX *  ctx,
void *  out,
UNUSED void *  parent,
CONF_ITEM *  ci,
conf_parser_t const *  rule 
)

◆ cf_parser_flag_to_enum_str()

char const * cf_parser_flag_to_enum_str ( conf_parser_flags_t  mask)

Return the source-identifier name for a single CONF_FLAG_* bit.

mask MUST be a single-bit mask from conf_parser_flags_t (e.g. CONF_FLAG_REQUIRED). Used by tooling that wants to stringify a flag set bit-by-bit (radmod2json).

Parameters
[in]masksingle-bit CONF_FLAG_* value.
Returns
the enum-identifier name, or NULL if mask is not a known flag bit.

Definition at line 1988 of file cf_parse.c.

+ Here is the caller graph for this function:

◆ cf_section_parse()

int cf_section_parse ( TALLOC_CTX *  ctx,
void *  base,
CONF_SECTION *  cs 
)

Parse a configuration section into user-supplied variables.

Parameters
[in]ctxto allocate any strings, or additional structures in. Usually the same as base, unless base is a nested struct.
[out]basepointer to a struct to fill with data.
[in]csto parse.
Returns
  • 0 on success.
  • -1 on general error.
  • -2 if a deprecated CONF_ITEM was found.

Definition at line 1360 of file cf_parse.c.

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

◆ cf_section_parse_pass2()

int cf_section_parse_pass2 ( void *  base,
CONF_SECTION *  cs 
)

Fixup xlat expansions and attributes.

Parameters
[out]basestart of structure to write tmpl_t s to.
[in]csCONF_SECTION to fixup.
Returns
  • 0 on success.
  • -1 on failure (parse errors etc...).

Definition at line 1470 of file cf_parse.c.

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

◆ cf_table_parse_int()

int cf_table_parse_int ( UNUSED TALLOC_CTX *  ctx,
void *  out,
UNUSED void *  parent,
CONF_ITEM *  ci,
conf_parser_t const *  rule 
)

◆ cf_table_parse_int16()

int cf_table_parse_int16 ( UNUSED TALLOC_CTX *  ctx,
void *  out,
UNUSED void *  parent,
CONF_ITEM *  ci,
conf_parser_t const *  rule 
)

◆ cf_table_parse_int32()

int cf_table_parse_int32 ( UNUSED TALLOC_CTX *  ctx,
void *  out,
UNUSED void *  parent,
CONF_ITEM *  ci,
conf_parser_t const *  rule 
)

◆ cf_table_parse_int8()

int cf_table_parse_int8 ( UNUSED TALLOC_CTX *  ctx,
void *  out,
UNUSED void *  parent,
CONF_ITEM *  ci,
conf_parser_t const *  rule 
)

◆ cf_table_parse_uint16()

int cf_table_parse_uint16 ( UNUSED TALLOC_CTX *  ctx,
void *  out,
UNUSED void *  parent,
CONF_ITEM *  ci,
conf_parser_t const *  rule 
)

◆ cf_table_parse_uint32()

int cf_table_parse_uint32 ( UNUSED TALLOC_CTX *  ctx,
void *  out,
UNUSED void *  parent,
CONF_ITEM *  ci,
conf_parser_t const *  rule 
)

◆ cf_table_parse_uint8()

int cf_table_parse_uint8 ( UNUSED TALLOC_CTX *  ctx,
void *  out,
UNUSED void *  parent,
CONF_ITEM *  ci,
conf_parser_t const *  rule 
)
+ Here is the caller graph for this function:

Variable Documentation

◆ cf_time_delta_bounds_int_msec

cf_time_delta_bounds_t const cf_time_delta_bounds_int_msec
extern

Bounds which keep a time delta within an int of milliseconds, for libraries which take one.

Definition at line 1885 of file cf_parse.c.

◆ cf_time_delta_bounds_int_sec

cf_time_delta_bounds_t const cf_time_delta_bounds_int_sec
extern

Bounds which keep a time delta within an int of seconds, for libraries which take one.

Definition at line 1891 of file cf_parse.c.

◆ check_config

bool check_config
extern

Definition at line 61 of file cf_file.c.