API to parse FreeRADIUS configuration file format, and convert string values to native C datatypes. More...
#include <stddef.h>
#include <freeradius-devel/token.h>
#include <sys/time.h>
Go to the source code of this file.
Data Structures | |
struct | CONF_PARSER |
Defines a CONF_PAIR to C data type mapping. More... | |
Macros | |
#define | FR_CONF_DEPRECATED(_n, _t, _p, _f) |
#define | FR_CONF_OFFSET(_n, _t, _s, _f) |
#define | FR_CONF_POINTER(_n, _t, _p) |
#define | FR_ITEM_POINTER(_t, _p) .type = _t, .data = _p |
#define | PW_TYPE_SUBSECTION 102 |
Typedefs | |
typedef struct conf_data | CONF_DATA |
CONF_ITEM used to associate arbitrary data with a CONF_PAIR or CONF_SECTION. More... | |
typedef struct conf_item | CONF_ITEM |
Generic configuration element, extended to become a CONF_PAIR, a CONF_SECTION or CONF_DATA. More... | |
typedef struct conf_pair | CONF_PAIR |
CONF_ITEM with an attribute, an operator and a value. More... | |
typedef struct conf_part | CONF_SECTION |
CONF_ITEM used to group multiple CONF_PAIR and CONF_SECTION, together. More... | |
typedef void | conf_type_invalid |
Dummy type used to indicate invalid PW_TYPE_*. More... | |
typedef void | conf_type_mismatch |
Dummy type used to indicate PW_TYPE_*/C type mismatch. More... | |
#CONF_PARSER type flags | |
These flags should be or'd with another PW_TYPE_* value to create validation rules for the cf_pair_parse function.
| |
#define | PW_TYPE_DEPRECATED (1 << 10) |
If a matching CONF_PAIR is found, error out with a deprecated message. More... | |
#define | PW_TYPE_REQUIRED (1 << 11) |
Error out if no matching CONF_PAIR is found, and no dflt value is set. More... | |
#define | PW_TYPE_ATTRIBUTE (1 << 12) |
Value must resolve to attribute in dict (deprecated, use PW_TYPE_TMPL). More... | |
#define | PW_TYPE_SECRET (1 << 13) |
Only print value if debug level >= 3. More... | |
#define | PW_TYPE_FILE_INPUT ((1 << 14) | PW_TYPE_STRING) |
File matching value must exist, and must be readable. More... | |
#define | PW_TYPE_FILE_OUTPUT ((1 << 15) | PW_TYPE_STRING) |
File matching value must exist, and must be writeable. More... | |
#define | PW_TYPE_XLAT (1 << 16) |
string will be dynamically expanded. More... | |
#define | PW_TYPE_TMPL (1 << 17) |
CONF_PAIR should be parsed as a template. More... | |
#define | PW_TYPE_MULTI (1 << 18) |
CONF_PAIR can have multiple copies. More... | |
#define | PW_TYPE_NOT_EMPTY (1 << 19) |
CONF_PAIR is required to have a non zero length value. More... | |
#define | FR_INTEGER_COND_CHECK(_name, _var, _cond, _new) |
#define | FR_INTEGER_BOUND_CHECK(_name, _var, _op, _bound) FR_INTEGER_COND_CHECK(_name, _var, (_var _op _bound), _bound) |
#define | FR_TIMEVAL_BOUND_CHECK(_name, _var, _op, _bound_sec, _bound_usec) |
#define | FR_TIMEVAL_TO_MS(_x) (((_x)->tv_usec / 1000) + ((_x)->tv_sec * (uint64_t)1000)) |
#define | FR_TIMESPEC_TO_MS(_x) (((_x)->tv_usec / 1000000) + ((_x)->tv_sec * (uint64_t)1000)) |
#define | CONF_PARSER_TERMINATOR { NULL, -1, 0, NULL, NULL, T_INVALID } |
#define | CF_FILE_NONE (0) |
#define | CF_FILE_ERROR (1) |
#define | CF_FILE_CONFIG (1 << 2) |
#define | CF_FILE_MODULE (1 << 3) |
typedef struct CONF_PARSER | CONF_PARSER |
Defines a CONF_PAIR to C data type mapping. More... | |
bool | check_config |
CONF_PAIR * | cf_pair_alloc (CONF_SECTION *parent, char const *attr, char const *value, FR_TOKEN op, FR_TOKEN lhs_type, FR_TOKEN rhs_type) |
Allocate a CONF_PAIR. More... | |
CONF_PAIR * | cf_pair_dup (CONF_SECTION *parent, CONF_PAIR *cp) |
Duplicate a CONF_PAIR. More... | |
void | cf_pair_add (CONF_SECTION *parent, CONF_PAIR *cp) |
Add a configuration pair to a section. More... | |
CONF_SECTION * | cf_section_alloc (CONF_SECTION *parent, char const *name1, char const *name2) |
Allocate a CONF_SECTION. More... | |
CONF_SECTION * | cf_section_dup (CONF_SECTION *parent, CONF_SECTION const *cs, char const *name1, char const *name2, bool copy_meta) |
Duplicate a configuration section. More... | |
void | cf_section_add (CONF_SECTION *parent, CONF_SECTION *cs) |
int | cf_pair_replace (CONF_SECTION *cs, CONF_PAIR *cp, char const *value) |
Replace pair in a given section with a new pair, of the given value. More... | |
int | cf_pair_parse (CONF_SECTION *cs, char const *name, unsigned int type, void *data, char const *dflt, FR_TOKEN dflt_quote) |
Parses a CONF_PAIR into a C data type, with a default value. More... | |
int | cf_section_parse (CONF_SECTION *, void *base, CONF_PARSER const *variables) |
Parse a configuration section into user-supplied variables. More... | |
int | cf_section_parse_pass2 (CONF_SECTION *, void *base, CONF_PARSER const *variables) |
const CONF_PARSER * | cf_section_parse_table (CONF_SECTION *cs) |
int | cf_file_read (CONF_SECTION *cs, char const *file) |
void | cf_file_free (CONF_SECTION *cs) |
CONF_PAIR * | cf_pair_find (CONF_SECTION const *, char const *name) |
CONF_PAIR * | cf_pair_find_next (CONF_SECTION const *, CONF_PAIR const *, char const *name) |
Find a pair with a name matching attr, after specified pair. More... | |
CONF_SECTION * | cf_section_find_name2 (CONF_SECTION const *section, char const *name1, char const *name2) |
CONF_SECTION * | cf_section_sub_find (CONF_SECTION const *, char const *name) |
Find a sub-section in a section. More... | |
CONF_SECTION * | cf_section_sub_find_name2 (CONF_SECTION const *, char const *name1, char const *name2) |
Find a CONF_SECTION with both names. More... | |
char const * | cf_section_value_find (CONF_SECTION const *, char const *attr) |
CONF_SECTION * | cf_top_section (CONF_SECTION *cs) |
void * | cf_data_find (CONF_SECTION const *, char const *) |
int | cf_data_add (CONF_SECTION *, char const *, void *, void(*)(void *)) |
void * | cf_data_remove (CONF_SECTION *cs, char const *name) |
Remove named data from a configuration section. More... | |
char const * | cf_pair_attr (CONF_PAIR const *pair) |
char const * | cf_pair_value (CONF_PAIR const *pair) |
FR_TOKEN | cf_pair_operator (CONF_PAIR const *pair) |
FR_TOKEN | cf_pair_attr_type (CONF_PAIR const *pair) |
Return the value (lhs) type. More... | |
FR_TOKEN | cf_pair_value_type (CONF_PAIR const *pair) |
Return the value (rhs) type. More... | |
VALUE_PAIR * | cf_pairtovp (CONF_PAIR *pair) |
char const * | cf_section_name1 (CONF_SECTION const *cs) |
char const * | cf_section_name2 (CONF_SECTION const *cs) |
char const * | cf_section_name (CONF_SECTION const *cs) |
Return name2 if set, else name1. More... | |
char const * | cf_section_argv (CONF_SECTION const *cs, int argc) |
FR_TOKEN | cf_section_name2_type (CONF_SECTION const *cs) |
FR_TOKEN | cf_section_argv_type (CONF_SECTION const *cs, int argc) |
int | dump_config (CONF_SECTION const *cs) |
CONF_SECTION * | cf_subsection_find_next (CONF_SECTION const *section, CONF_SECTION const *subsection, char const *name1) |
CONF_SECTION * | cf_section_find_next (CONF_SECTION const *section, CONF_SECTION const *subsection, char const *name1) |
int | cf_section_lineno (CONF_SECTION const *section) |
int | cf_pair_lineno (CONF_PAIR const *pair) |
char const * | cf_pair_filename (CONF_PAIR const *pair) |
char const * | cf_section_filename (CONF_SECTION const *section) |
CONF_ITEM * | cf_item_find_next (CONF_SECTION const *section, CONF_ITEM const *item) |
Return the next item after a CONF_ITEM. More... | |
int | cf_pair_count (CONF_SECTION const *cs) |
Count the number of conf pairs beneath a section. More... | |
CONF_SECTION * | cf_item_parent (CONF_ITEM const *ci) |
bool | cf_item_is_section (CONF_ITEM const *item) |
bool | cf_item_is_pair (CONF_ITEM const *item) |
CONF_PAIR * | cf_item_to_pair (CONF_ITEM const *item) |
Cast a CONF_ITEM to a CONF_PAIR. More... | |
CONF_SECTION * | cf_item_to_section (CONF_ITEM const *item) |
Cast a CONF_ITEM to a CONF_SECTION. More... | |
CONF_ITEM * | cf_pair_to_item (CONF_PAIR const *cp) |
Cast a CONF_PAIR to a CONF_ITEM. More... | |
CONF_ITEM * | cf_section_to_item (CONF_SECTION const *cs) |
Cast a CONF_SECTION to a CONF_ITEM. More... | |
void | cf_log_err (CONF_ITEM const *ci, char const *fmt,...) CC_HINT(format(printf |
void void | cf_log_err_cs (CONF_SECTION const *cs, char const *fmt,...) CC_HINT(format(printf |
void void void | cf_log_err_cp (CONF_PAIR const *cp, char const *fmt,...) CC_HINT(format(printf |
void void void void | cf_log_info (CONF_SECTION const *cs, char const *fmt,...) CC_HINT(format(printf |
void void void void void | cf_log_module (CONF_SECTION const *cs, char const *fmt,...) CC_HINT(format(printf |
void void void void void void | cf_item_add (CONF_SECTION *cs, CONF_ITEM *ci) |
CONF_ITEM * | cf_reference_item (CONF_SECTION const *parentcs, CONF_SECTION *outercs, char const *ptr) |
int | cf_file_changed (CONF_SECTION *cs, rb_walker_t callback) |
API to parse FreeRADIUS configuration file format, and convert string values to native C datatypes.
Definition in file conffile.h.
struct CONF_PARSER |
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 :
Example with FR_CONF_POINTER :
Definition at line 267 of file conffile.h.
Data Fields | ||
---|---|---|
void * | data |
Pointer to a static variable to write the parsed value to.
|
const void * | dflt |
Default as it would appear in radiusd.conf. When type is set to PW_TYPE_SUBSECTION, should be a pointer to the start of another array of CONF_PARSER structs, forming the subsection. |
char const * | name | Name of the CONF_ITEM to parse. |
size_t | offset |
Relative offset of field or structure to write the parsed value to. When type is set to PW_TYPE_SUBSECTION, may be used to specify a base offset to add to all offsets contained within the subsection.
|
FR_TOKEN | quote | Quoting around the default value. Only used for templates. |
int | type |
A PW_TYPE value, may be or'd with one or more PW_TYPE_* flags.
|
#define CF_FILE_CONFIG (1 << 2) |
Definition at line 371 of file conffile.h.
#define CF_FILE_ERROR (1) |
Definition at line 370 of file conffile.h.
#define CF_FILE_MODULE (1 << 3) |
Definition at line 372 of file conffile.h.
#define CF_FILE_NONE (0) |
Definition at line 369 of file conffile.h.
#define CONF_PARSER_TERMINATOR { NULL, -1, 0, NULL, NULL, T_INVALID } |
Definition at line 289 of file conffile.h.
#define FR_CONF_DEPRECATED | ( | _n, | |
_t, | |||
_p, | |||
_f | |||
) |
Definition at line 179 of file conffile.h.
#define FR_CONF_OFFSET | ( | _n, | |
_t, | |||
_s, | |||
_f | |||
) |
Definition at line 168 of file conffile.h.
#define FR_CONF_POINTER | ( | _n, | |
_t, | |||
_p | |||
) |
Definition at line 172 of file conffile.h.
#define FR_INTEGER_BOUND_CHECK | ( | _name, | |
_var, | |||
_op, | |||
_bound | |||
) | FR_INTEGER_COND_CHECK(_name, _var, (_var _op _bound), _bound) |
Definition at line 222 of file conffile.h.
#define FR_INTEGER_COND_CHECK | ( | _name, | |
_var, | |||
_cond, | |||
_new | |||
) |
#define FR_ITEM_POINTER | ( | _t, | |
_p | |||
) | .type = _t, .data = _p |
Definition at line 176 of file conffile.h.
#define FR_TIMESPEC_TO_MS | ( | _x | ) | (((_x)->tv_usec / 1000000) + ((_x)->tv_sec * (uint64_t)1000)) |
Definition at line 236 of file conffile.h.
#define FR_TIMEVAL_BOUND_CHECK | ( | _name, | |
_var, | |||
_op, | |||
_bound_sec, | |||
_bound_usec | |||
) |
Definition at line 224 of file conffile.h.
#define FR_TIMEVAL_TO_MS | ( | _x | ) | (((_x)->tv_usec / 1000) + ((_x)->tv_sec * (uint64_t)1000)) |
Definition at line 235 of file conffile.h.
#define PW_TYPE_ATTRIBUTE (1 << 12) |
Value must resolve to attribute in dict (deprecated, use PW_TYPE_TMPL).
Definition at line 201 of file conffile.h.
#define PW_TYPE_DEPRECATED (1 << 10) |
If a matching CONF_PAIR is found, error out with a deprecated message.
Definition at line 199 of file conffile.h.
#define PW_TYPE_FILE_INPUT ((1 << 14) | PW_TYPE_STRING) |
File matching value must exist, and must be readable.
Definition at line 204 of file conffile.h.
#define PW_TYPE_FILE_OUTPUT ((1 << 15) | PW_TYPE_STRING) |
File matching value must exist, and must be writeable.
Definition at line 205 of file conffile.h.
#define PW_TYPE_MULTI (1 << 18) |
CONF_PAIR can have multiple copies.
Definition at line 210 of file conffile.h.
#define PW_TYPE_NOT_EMPTY (1 << 19) |
CONF_PAIR is required to have a non zero length value.
Definition at line 211 of file conffile.h.
#define PW_TYPE_REQUIRED (1 << 11) |
Error out if no matching CONF_PAIR is found, and no dflt value is set.
Definition at line 200 of file conffile.h.
#define PW_TYPE_SECRET (1 << 13) |
Only print value if debug level >= 3.
Definition at line 202 of file conffile.h.
#define PW_TYPE_SUBSECTION 102 |
Definition at line 188 of file conffile.h.
#define PW_TYPE_TMPL (1 << 17) |
CONF_PAIR should be parsed as a template.
Definition at line 208 of file conffile.h.
#define PW_TYPE_XLAT (1 << 16) |
string will be dynamically expanded.
Definition at line 207 of file conffile.h.
CONF_ITEM used to associate arbitrary data with a CONF_PAIR or CONF_SECTION.
Definition at line 44 of file conffile.h.
Generic configuration element, extended to become a CONF_PAIR, a CONF_SECTION or CONF_DATA.
Definition at line 40 of file conffile.h.
CONF_ITEM with an attribute, an operator and a value.
Definition at line 42 of file conffile.h.
typedef struct CONF_PARSER CONF_PARSER |
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 :
Example with FR_CONF_POINTER :
typedef struct conf_part CONF_SECTION |
CONF_ITEM used to group multiple CONF_PAIR and CONF_SECTION, together.
Definition at line 43 of file conffile.h.
typedef void conf_type_invalid |
Dummy type used to indicate invalid PW_TYPE_*.
Definition at line 49 of file conffile.h.
typedef void conf_type_mismatch |
Dummy type used to indicate PW_TYPE_*/C type mismatch.
Definition at line 48 of file conffile.h.
int cf_data_add | ( | CONF_SECTION * | , |
char const * | , | ||
void * | , | ||
void(*)(void *) | |||
) |
Definition at line 4018 of file conffile.c.
void* cf_data_find | ( | CONF_SECTION const * | , |
char const * | |||
) |
Definition at line 3981 of file conffile.c.
void* cf_data_remove | ( | CONF_SECTION * | cs, |
char const * | name | ||
) |
Remove named data from a configuration section.
Definition at line 4027 of file conffile.c.
int cf_file_changed | ( | CONF_SECTION * | cs, |
rb_walker_t | callback | ||
) |
Definition at line 486 of file conffile.c.
void cf_file_free | ( | CONF_SECTION * | cs | ) |
int cf_file_read | ( | CONF_SECTION * | cs, |
char const * | file | ||
) |
Definition at line 3421 of file conffile.c.
void void void void void void cf_item_add | ( | CONF_SECTION * | cs, |
CONF_ITEM * | ci | ||
) |
Definition at line 803 of file conffile.c.
CONF_ITEM* cf_item_find_next | ( | CONF_SECTION const * | section, |
CONF_ITEM const * | item | ||
) |
Return the next item after a CONF_ITEM.
Definition at line 3850 of file conffile.c.
bool cf_item_is_pair | ( | CONF_ITEM const * | item | ) |
bool cf_item_is_section | ( | CONF_ITEM const * | item | ) |
CONF_SECTION* cf_item_parent | ( | CONF_ITEM const * | ci | ) |
Cast a CONF_ITEM to a CONF_PAIR.
Definition at line 181 of file conffile.c.
CONF_SECTION* cf_item_to_section | ( | CONF_ITEM const * | ci | ) |
Cast a CONF_ITEM to a CONF_SECTION.
Definition at line 196 of file conffile.c.
void cf_log_err | ( | CONF_ITEM const * | ci, |
char const * | fmt, | ||
... | |||
) |
void void void cf_log_err_cp | ( | CONF_PAIR const * | cp, |
char const * | fmt, | ||
... | |||
) |
void void cf_log_err_cs | ( | CONF_SECTION const * | cs, |
char const * | fmt, | ||
... | |||
) |
void void void void cf_log_info | ( | CONF_SECTION const * | cs, |
char const * | fmt, | ||
... | |||
) |
void void void void void cf_log_module | ( | CONF_SECTION const * | cs, |
char const * | fmt, | ||
... | |||
) |
void cf_pair_add | ( | CONF_SECTION * | parent, |
CONF_PAIR * | cp | ||
) |
Add a configuration pair to a section.
parent | section to add pair to. |
cp | to add. |
Definition at line 612 of file conffile.c.
CONF_PAIR* cf_pair_alloc | ( | CONF_SECTION * | parent, |
char const * | attr, | ||
char const * | value, | ||
FR_TOKEN | op, | ||
FR_TOKEN | lhs_type, | ||
FR_TOKEN | rhs_type | ||
) |
Allocate a CONF_PAIR.
parent | CONF_SECTION to hang this CONF_PAIR off of. |
attr | name. |
value | of CONF_PAIR. |
op | T_OP_EQ, T_OP_SET etc. |
lhs_type | T_BARE_WORD, T_DOUBLE_QUOTED_STRING, T_BACK_QUOTED_STRING |
rhs_type | T_BARE_WORD, T_DOUBLE_QUOTED_STRING, T_BACK_QUOTED_STRING |
Definition at line 546 of file conffile.c.
char const* cf_pair_attr | ( | CONF_PAIR const * | pair | ) |
Return the value (lhs) type.
pair | to extract value type from. |
Definition at line 3526 of file conffile.c.
int cf_pair_count | ( | CONF_SECTION const * | cs | ) |
Count the number of conf pairs beneath a section.
[in] | cs | to search for items in. |
Definition at line 3887 of file conffile.c.
CONF_PAIR* cf_pair_dup | ( | CONF_SECTION * | parent, |
CONF_PAIR * | cp | ||
) |
Duplicate a CONF_PAIR.
parent | to allocate new pair in. |
cp | to duplicate. |
Definition at line 589 of file conffile.c.
char const* cf_pair_filename | ( | CONF_PAIR const * | pair | ) |
CONF_PAIR* cf_pair_find | ( | CONF_SECTION const * | , |
char const * | name | ||
) |
Definition at line 3478 of file conffile.c.
CONF_PAIR* cf_pair_find_next | ( | CONF_SECTION const * | cs, |
CONF_PAIR const * | pair, | ||
char const * | attr | ||
) |
Find a pair with a name matching attr, after specified pair.
cs | to search in. |
pair | to search from (may be NULL). |
attr | to find (may be NULL in which case any attribute matches). |
Definition at line 3673 of file conffile.c.
int cf_pair_lineno | ( | CONF_PAIR const * | pair | ) |
int cf_pair_parse | ( | CONF_SECTION * | cs, |
char const * | name, | ||
unsigned int | type, | ||
void * | data, | ||
char const * | dflt, | ||
FR_TOKEN | dflt_quote | ||
) |
Parses a CONF_PAIR into a C data type, with a default value.
Takes fields from a CONF_PARSER 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 value_data_t types.
PW_TYPE to data type mappings
PW_TYPE | Data type | Dynamically allocated |
---|---|---|
PW_TYPE_TMPL | vp_tmpl_t | Yes |
PW_TYPE_BOOLEAN | bool | No |
PW_TYPE_INTEGER | uint32_t | No |
PW_TYPE_SHORT | uint16_t | No |
PW_TYPE_INTEGER64 | uint64_t | No |
PW_TYPE_SIGNED | int32_t | No |
PW_TYPE_STRING | char const * | Yes |
PW_TYPE_IPV4_ADDR | fr_ipaddr_t | No |
PW_TYPE_IPV4_PREFIX | fr_ipaddr_t | No |
PW_TYPE_IPV6_ADDR | fr_ipaddr_t | No |
PW_TYPE_IPV6_PREFIX | fr_ipaddr_t | No |
PW_TYPE_COMBO_IP_ADDR | fr_ipaddr_t | No |
PW_TYPE_COMBO_IP_PREFIX | fr_ipaddr_t | No |
PW_TYPE_TIMEVAL | struct timeval | No |
cs | to search for matching CONF_PAIR in. |
name | of CONF_PAIR to search for. |
type | Data 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:
|
data | Pointer to a global variable, or pointer to a field in the struct being populated with values. |
dflt | value to use, if no CONF_PAIR is found. |
dflt_quote | around the dflt value. |
Definition at line 1968 of file conffile.c.
int cf_pair_replace | ( | CONF_SECTION * | cs, |
CONF_PAIR * | cp, | ||
char const * | value | ||
) |
Replace pair in a given section with a new pair, of the given value.
cs | to replace pair in. |
cp | to replace. |
value | New value to assign to cp. |
Definition at line 768 of file conffile.c.
Cast a CONF_PAIR to a CONF_ITEM.
Definition at line 211 of file conffile.c.
char const* cf_pair_value | ( | CONF_PAIR const * | pair | ) |
Return the value (rhs) type.
pair | to extract value type from. |
Definition at line 3541 of file conffile.c.
VALUE_PAIR* cf_pairtovp | ( | CONF_PAIR * | pair | ) |
CONF_ITEM* cf_reference_item | ( | CONF_SECTION const * | parentcs, |
CONF_SECTION * | outercs, | ||
char const * | ptr | ||
) |
Definition at line 906 of file conffile.c.
void cf_section_add | ( | CONF_SECTION * | parent, |
CONF_SECTION * | cs | ||
) |
Definition at line 754 of file conffile.c.
CONF_SECTION* cf_section_alloc | ( | CONF_SECTION * | parent, |
char const * | name1, | ||
char const * | name2 | ||
) |
Allocate a CONF_SECTION.
parent | CONF_SECTION to hang this CONF_SECTION off of. |
name1 | Primary name. |
name2 | Secondary name. |
Definition at line 626 of file conffile.c.
char const* cf_section_argv | ( | CONF_SECTION const * | cs, |
int | argc | ||
) |
FR_TOKEN cf_section_argv_type | ( | CONF_SECTION const * | cs, |
int | argc | ||
) |
CONF_SECTION* cf_section_dup | ( | CONF_SECTION * | parent, |
CONF_SECTION const * | cs, | ||
char const * | name1, | ||
char const * | name2, | ||
bool | copy_meta | ||
) |
Duplicate a configuration section.
parent | section (may be NULL). |
cs | to duplicate. |
name1 | of new section. |
name2 | of new section. |
copy_meta | Copy additional meta data for a section (like template, base, depth and variables). |
Definition at line 697 of file conffile.c.
char const* cf_section_filename | ( | CONF_SECTION const * | section | ) |
CONF_SECTION* cf_section_find_name2 | ( | CONF_SECTION const * | section, |
char const * | name1, | ||
char const * | name2 | ||
) |
CONF_SECTION* cf_section_find_next | ( | CONF_SECTION const * | section, |
CONF_SECTION const * | subsection, | ||
char const * | name1 | ||
) |
Definition at line 3836 of file conffile.c.
int cf_section_lineno | ( | CONF_SECTION const * | section | ) |
char const* cf_section_name | ( | CONF_SECTION const * | cs | ) |
Return name2 if set, else name1.
Definition at line 3609 of file conffile.c.
char const* cf_section_name1 | ( | CONF_SECTION const * | cs | ) |
char const* cf_section_name2 | ( | CONF_SECTION const * | cs | ) |
FR_TOKEN cf_section_name2_type | ( | CONF_SECTION const * | cs | ) |
int cf_section_parse | ( | CONF_SECTION * | cs, |
void * | base, | ||
CONF_PARSER const * | variables | ||
) |
Parse a configuration section into user-supplied variables.
cs | to parse. |
base | pointer to a struct to fill with data. Any buffers will also be talloced using this parent as a pointer. |
variables | mappings between struct fields and CONF_ITEM s. |
Definition at line 2234 of file conffile.c.
int cf_section_parse_pass2 | ( | CONF_SECTION * | , |
void * | base, | ||
CONF_PARSER const * | variables | ||
) |
const CONF_PARSER* cf_section_parse_table | ( | CONF_SECTION * | cs | ) |
CONF_SECTION* cf_section_sub_find | ( | CONF_SECTION const * | cs, |
char const * | name | ||
) |
Find a sub-section in a section.
This finds ANY section having the same first name. The second name is ignored.
Definition at line 3708 of file conffile.c.
CONF_SECTION* cf_section_sub_find_name2 | ( | CONF_SECTION const * | , |
char const * | name1, | ||
char const * | name2 | ||
) |
Find a CONF_SECTION with both names.
Definition at line 3728 of file conffile.c.
CONF_ITEM* cf_section_to_item | ( | CONF_SECTION const * | cs | ) |
Cast a CONF_SECTION to a CONF_ITEM.
Definition at line 224 of file conffile.c.
char const* cf_section_value_find | ( | CONF_SECTION const * | , |
char const * | attr | ||
) |
CONF_SECTION* cf_subsection_find_next | ( | CONF_SECTION const * | section, |
CONF_SECTION const * | subsection, | ||
char const * | name1 | ||
) |
Definition at line 3799 of file conffile.c.
CONF_SECTION* cf_top_section | ( | CONF_SECTION * | cs | ) |
int dump_config | ( | CONF_SECTION const * | cs | ) |
bool check_config |
Definition at line 45 of file conffile.c.