diff options
Diffstat (limited to 'conf')
-rw-r--r-- | conf/cf-lex.l | 4 | ||||
-rw-r--r-- | conf/conf.c | 4 | ||||
-rw-r--r-- | conf/conf.h | 5 | ||||
-rw-r--r-- | conf/confbase.Y | 2 |
4 files changed, 15 insertions, 0 deletions
diff --git a/conf/cf-lex.l b/conf/cf-lex.l index 6ac3ab20..c32b1c22 100644 --- a/conf/cf-lex.l +++ b/conf/cf-lex.l @@ -915,6 +915,10 @@ cf_symbol_class_name(struct symbol *sym) return "routing table"; case SYM_ATTRIBUTE: return "custom attribute"; + case SYM_MPLS_DOMAIN: + return "MPLS domain"; + case SYM_MPLS_RANGE: + return "MPLS label range"; case SYM_CONSTANT_RANGE: return "constant"; case SYM_VARIABLE_RANGE: diff --git a/conf/conf.c b/conf/conf.c index b9239d9b..d98d421c 100644 --- a/conf/conf.c +++ b/conf/conf.c @@ -49,6 +49,7 @@ #include "nest/route.h" #include "nest/protocol.h" #include "nest/iface.h" +#include "nest/mpls.h" #include "lib/resource.h" #include "lib/string.h" #include "lib/event.h" @@ -139,6 +140,7 @@ config_parse(struct config *c) cf_lex_init(0, c); sysdep_preconfig(c); protos_preconfig(c); + mpls_preconfig(c); rt_preconfig(c); cf_parse(); rt_postconfig(c); @@ -299,6 +301,7 @@ config_do_commit(struct config *c, int type) int force_restart = sysdep_commit(c, old_config); DBG("global_commit\n"); force_restart |= global_commit(c, old_config); + mpls_commit(c, old_config); DBG("rt_commit\n"); rt_commit(c, old_config); DBG("protos_commit\n"); @@ -547,6 +550,7 @@ order_shutdown(int gr) memcpy(c, config, sizeof(struct config)); init_list(&c->protos); init_list(&c->tables); + init_list(&c->mpls_domains); init_list(&c->symbols); memset(c->def_tables, 0, sizeof(c->def_tables)); c->shutdown = 1; diff --git a/conf/conf.h b/conf/conf.h index b07b417c..8fd6713e 100644 --- a/conf/conf.h +++ b/conf/conf.h @@ -21,6 +21,7 @@ struct config { linpool *mem; /* Linear pool containing configuration data */ list protos; /* Configured protocol instances (struct proto_config) */ list tables; /* Configured routing tables (struct rtable_config) */ + list mpls_domains; /* Configured MPLS domains (struct mpls_domain_config) */ list logfiles; /* Configured log files (sysdep) */ list tests; /* Configured unit tests (f_bt_test_suite) */ list symbols; /* Configured symbols in config order */ @@ -128,6 +129,8 @@ struct symbol { const struct filter *filter; /* For SYM_FILTER */ struct rtable_config *table; /* For SYM_TABLE */ struct f_dynamic_attr *attribute; /* For SYM_ATTRIBUTE */ + struct mpls_domain_config *mpls_domain; /* For SYM_MPLS_DOMAIN */ + struct mpls_range_config *mpls_range; /* For SYM_MPLS_RANGE */ struct f_val *val; /* For SYM_CONSTANT */ uint offset; /* For SYM_VARIABLE */ const struct keyword *keyword; /* For SYM_KEYWORD */ @@ -167,6 +170,8 @@ extern linpool *global_root_scope_linpool; #define SYM_ATTRIBUTE 6 #define SYM_KEYWORD 7 #define SYM_METHOD 8 +#define SYM_MPLS_DOMAIN 9 +#define SYM_MPLS_RANGE 10 #define SYM_VARIABLE 0x100 /* 0x100-0x1ff are variable types */ #define SYM_VARIABLE_RANGE SYM_VARIABLE ... (SYM_VARIABLE | 0xff) diff --git a/conf/confbase.Y b/conf/confbase.Y index 69a7676c..63308290 100644 --- a/conf/confbase.Y +++ b/conf/confbase.Y @@ -43,6 +43,8 @@ static inline void cf_assert_symbol(const struct symbol *sym, uint class) { case SYM_FILTER: cf_assert(sym->class == SYM_FILTER, "Filter name required"); break; case SYM_TABLE: cf_assert(sym->class == SYM_TABLE, "Table name required"); break; case SYM_ATTRIBUTE: cf_assert(sym->class == SYM_ATTRIBUTE, "Custom attribute name required"); break; + case SYM_MPLS_DOMAIN: cf_assert(sym->class == SYM_MPLS_DOMAIN, "MPLS domain name required"); break; + case SYM_MPLS_RANGE: cf_assert(sym->class == SYM_MPLS_RANGE, "MPLS range name required"); break; case SYM_VARIABLE: cf_assert((sym->class & ~0xff) == SYM_VARIABLE, "Variable name required"); break; case SYM_CONSTANT: cf_assert((sym->class & ~0xff) == SYM_CONSTANT, "Constant name required"); break; default: bug("This shall not happen"); |