diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2018-09-27 22:57:55 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2018-12-12 14:46:24 +0100 |
commit | 682d3f7de0905ca2e853844734cce7ff65f7d77d (patch) | |
tree | e84ab31b4c5b7e99a283cf4c2faf2523dd5d884c /nest/config.Y | |
parent | 01fd00f5ed9298ab5829403cd7a8a9ba22bcc96a (diff) |
BGP: implement Adj-RIB-In
The patch implements optional internal import table to a channel and
hooks it to BGP so it can be used as Adj-RIB-In. When enabled, all
received (pre-filtered) routes are stored there and import filters can
be re-evaluated without explicit route refresh. An import table can be
examined using e.g. 'show route import table bgp1.ipv4'.
Diffstat (limited to 'nest/config.Y')
-rw-r--r-- | nest/config.Y | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/nest/config.Y b/nest/config.Y index 34bde3fa..aef5ed46 100644 --- a/nest/config.Y +++ b/nest/config.Y @@ -558,6 +558,16 @@ r_args: rt_show_add_table($$, t->table); $$->tables_defined_by = RSD_TDB_ALL; } + | r_args IMPORT TABLE SYM '.' r_args_channel { + $$ = $1; + struct proto_config *cf = (void *) $4->def; + if ($4->class != SYM_PROTO || !cf->proto) cf_error("%s is not a protocol", $4->name); + struct channel *c = proto_find_channel_by_name(cf->proto, $6); + if (!c) cf_error("Channel %s.%s not found", $4->name, $6); + if (!c->in_table) cf_error("No import table in channel %s.%s", $4->name, $6); + rt_show_add_table($$, c->in_table); + $$->tables_defined_by = RSD_TDB_DIRECT; + } | r_args FILTER filter { $$ = $1; if ($$->filter != FILTER_ACCEPT) cf_error("Filter specified twice"); |