From e0835db4f137c1686c26165053ec9c0578b94009 Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Mon, 8 Apr 2019 17:05:07 +0200 Subject: BGP: Dynamic BGP Support for dynamically spawning BGP protocols for incoming connections. Use 'neighbor range' to specify range of valid neighbor addresses, then incoming connections from these addresses spawn new BGP instances. --- conf/cf-lex.l | 5 +++-- conf/conf.h | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'conf') diff --git a/conf/cf-lex.l b/conf/cf-lex.l index 9bbb3660..63c76940 100644 --- a/conf/cf-lex.l +++ b/conf/cf-lex.l @@ -87,7 +87,7 @@ HASH_DEFINE_REHASH_FN(SYM, struct symbol) HASH(struct keyword) kw_hash; -static struct sym_scope *conf_this_scope; +struct sym_scope *conf_this_scope; linpool *cfg_mem; @@ -673,7 +673,8 @@ cf_lex_init(int is_cli, struct config *c) else BEGIN(INITIAL); - conf_this_scope = cfg_allocz(sizeof(struct sym_scope)); + c->root_scope = cfg_allocz(sizeof(struct sym_scope)); + conf_this_scope = c->root_scope; conf_this_scope->active = 1; } diff --git a/conf/conf.h b/conf/conf.h index 427569fd..354a4da8 100644 --- a/conf/conf.h +++ b/conf/conf.h @@ -52,6 +52,7 @@ struct config { int file_fd; /* File descriptor of main configuration file */ HASH(struct symbol) sym_hash; /* Lexer: symbol hash table */ struct config *fallback; /* Link to regular config for CLI parsing */ + struct sym_scope *root_scope; /* Scope for root symbols */ int obstacle_count; /* Number of items blocking freeing of this config */ int shutdown; /* This is a pseudo-config for daemon shutdown */ btime load_time; /* When we've got this configuration */ @@ -152,6 +153,8 @@ struct include_file_stack { extern struct include_file_stack *ifs; +extern struct sym_scope *conf_this_scope; + int cf_lex(void); void cf_lex_init(int is_cli, struct config *c); void cf_lex_unwind(void); -- cgit v1.2.3