version 1.1, 2017/08/22 12:33:54
|
version 1.1.1.2, 2021/03/17 19:50:23
|
Line 11
|
Line 11
|
|
|
#include "lib/resource.h" |
#include "lib/resource.h" |
#include "lib/timer.h" |
#include "lib/timer.h" |
|
#include "lib/hash.h" |
|
|
|
|
/* Configuration structure */ |
/* Configuration structure */ |
Line 47 struct config {
|
Line 48 struct config {
|
u32 watchdog_timeout; /* Watchdog timeout (in seconds, 0 = disabled) */ |
u32 watchdog_timeout; /* Watchdog timeout (in seconds, 0 = disabled) */ |
char *err_msg; /* Parser error message */ |
char *err_msg; /* Parser error message */ |
int err_lino; /* Line containing error */ |
int err_lino; /* Line containing error */ |
|
int err_chno; /* Character where the parser stopped */ |
char *err_file_name; /* File name containing error */ |
char *err_file_name; /* File name containing error */ |
char *file_name; /* Name of main configuration file */ |
char *file_name; /* Name of main configuration file */ |
int file_fd; /* File descriptor of main configuration file */ |
int file_fd; /* File descriptor of main configuration file */ |
struct symbol **sym_hash; /* Lexer: symbol hash table */ | HASH(struct symbol) sym_hash; /* Lexer: symbol hash table */ |
struct symbol **sym_fallback; /* Lexer: fallback symbol hash table */ | struct config *fallback; /* Link to regular config for CLI parsing */ |
int obstacle_count; /* Number of items blocking freeing of this config */ |
int obstacle_count; /* Number of items blocking freeing of this config */ |
int shutdown; /* This is a pseudo-config for daemon shutdown */ |
int shutdown; /* This is a pseudo-config for daemon shutdown */ |
bird_clock_t load_time; /* When we've got this configuration */ |
bird_clock_t load_time; /* When we've got this configuration */ |
Line 112 struct symbol {
|
Line 114 struct symbol {
|
char name[1]; |
char name[1]; |
}; |
}; |
|
|
|
struct sym_scope { |
|
struct sym_scope *next; /* Next on scope stack */ |
|
struct symbol *name; /* Name of this scope */ |
|
int active; /* Currently entered */ |
|
}; |
|
|
#define SYM_MAX_LEN 64 |
#define SYM_MAX_LEN 64 |
|
|
/* Remember to update cf_symbol_class_name() */ |
/* Remember to update cf_symbol_class_name() */ |
Line 134 struct include_file_stack {
|
Line 142 struct include_file_stack {
|
char *file_name; /* File name */ |
char *file_name; /* File name */ |
int fd; /* File descriptor */ |
int fd; /* File descriptor */ |
int lino; /* Current line num */ |
int lino; /* Current line num */ |
|
int chno; /* Current char num (on current line) */ |
|
int toklen; /* Current token length */ |
int depth; /* Include depth, 0 = cannot include */ |
int depth; /* Include depth, 0 = cannot include */ |
|
|
struct include_file_stack *prev; /* Previous record in stack */ |
struct include_file_stack *prev; /* Previous record in stack */ |
Line 142 struct include_file_stack {
|
Line 152 struct include_file_stack {
|
|
|
extern struct include_file_stack *ifs; |
extern struct include_file_stack *ifs; |
|
|
|
|
int cf_lex(void); |
int cf_lex(void); |
void cf_lex_init(int is_cli, struct config *c); |
void cf_lex_init(int is_cli, struct config *c); |
void cf_lex_unwind(void); |
void cf_lex_unwind(void); |
Line 154 struct symbol *cf_default_name(char *template, int *co
|
Line 163 struct symbol *cf_default_name(char *template, int *co
|
struct symbol *cf_define_symbol(struct symbol *symbol, int type, void *def); |
struct symbol *cf_define_symbol(struct symbol *symbol, int type, void *def); |
void cf_push_scope(struct symbol *); |
void cf_push_scope(struct symbol *); |
void cf_pop_scope(void); |
void cf_pop_scope(void); |
struct symbol *cf_walk_symbols(struct config *cf, struct symbol *sym, int *pos); |
|
char *cf_symbol_class_name(struct symbol *sym); |
char *cf_symbol_class_name(struct symbol *sym); |
|
|
static inline int cf_symbol_is_constant(struct symbol *sym) |
static inline int cf_symbol_is_constant(struct symbol *sym) |