5 * conffile.h Defines for the conffile parsing routines.
14 * Export the minimum amount of information about these structs
16 typedef struct conf_item CONF_ITEM;
17 typedef struct conf_pair CONF_PAIR;
18 typedef struct conf_part CONF_SECTION;
21 * Instead of putting the information into a configuration structure,
22 * the configuration file routines MAY just parse it directly into
23 * user-supplied variables.
25 #define PW_TYPE_STRING_PTR 100
26 #define PW_TYPE_BOOLEAN 101
27 #define PW_TYPE_SUBSECTION 102
29 typedef struct CONF_PARSER {
31 int type; /* PW_TYPE_STRING, etc. */
32 void *data; /* pointer to where to put it */
33 const char *dflt; /* default as it would appear in radiusd.conf */
36 /* This preprocessor trick will be useful in initializing CONF_PARSER struct */
37 #define XStringify(x) #x
38 #define Stringify(x) XStringify(x)
40 void cf_pair_free(CONF_PAIR **cp);
41 void cf_section_free(CONF_SECTION **cp);
42 int cf_section_parse(CONF_SECTION *cs, const CONF_PARSER *variables);
44 /* JLN -- Newly added */
46 CONF_PAIR *cf_pair_find(CONF_SECTION *section, const char *name);
47 CONF_PAIR *cf_pair_find_next(CONF_SECTION *section, CONF_PAIR *pair, const char *name);
48 CONF_SECTION *cf_section_find(const char *name);
49 CONF_SECTION *cf_section_sub_find(CONF_SECTION *section, const char *name);
50 char *cf_section_value_find(CONF_SECTION *section, const char *attr);
52 int read_radius_conf_file(void);
54 char *cf_pair_attr(CONF_PAIR *pair);
55 char *cf_pair_value(CONF_PAIR *pair);
56 char *cf_section_name1(CONF_SECTION *section);
57 char *cf_section_name2(CONF_SECTION *section);
58 int dump_config(void);
59 CONF_SECTION *cf_subsection_find_next(CONF_SECTION *section,
60 CONF_SECTION *subsection,
62 int cf_section_lineno(CONF_SECTION *section);
63 int cf_pair_lineno(CONF_PAIR *pair);
64 CONF_ITEM *cf_item_find_next(CONF_SECTION *section, CONF_ITEM *item);
65 int cf_item_is_section(CONF_ITEM *item);
66 CONF_PAIR *cf_itemtopair(CONF_ITEM *item);
67 CONF_SECTION *cf_itemtosection(CONF_ITEM *item);
68 CONF_ITEM *cf_pairtoitem(CONF_PAIR *cp);
69 CONF_ITEM *cf_sectiontoitem(CONF_SECTION *cs);
70 #endif /* _CONFFILE_H */