From 682d3f7de0905ca2e853844734cce7ff65f7d77d Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Thu, 27 Sep 2018 22:57:55 +0200 Subject: 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'. --- nest/config.Y | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'nest/config.Y') 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"); -- cgit v1.2.3