summaryrefslogtreecommitdiff
path: root/nest/config.Y
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2019-08-13 18:22:07 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2019-08-14 06:02:33 +0200
commitb7d7599ce3576f28310af18b403fed49a0840b67 (patch)
tree7d7dc8f052d564c3fdbc49eea529f22850ab44ff /nest/config.Y
parentdfe63ed84d42178a53b01071c64f23250e74d6d9 (diff)
BGP: implement Adj-RIB-Out
The patch implements optional internal export table to a channel and hooks it to BGP so it can be used as Adj-RIB-Out. When enabled, all exported (post-filtered) routes are stored there. An export table can be examined using e.g. 'show route export table bgp1.ipv4'.
Diffstat (limited to 'nest/config.Y')
-rw-r--r--nest/config.Y11
1 files changed, 11 insertions, 0 deletions
diff --git a/nest/config.Y b/nest/config.Y
index e1a932d4..c62501a3 100644
--- a/nest/config.Y
+++ b/nest/config.Y
@@ -567,6 +567,17 @@ r_args:
rt_show_add_table($$, c->in_table);
$$->tables_defined_by = RSD_TDB_DIRECT;
}
+ | r_args EXPORT TABLE CF_SYM_KNOWN '.' r_args_channel {
+ cf_assert_symbol($4, SYM_PROTO);
+ $$ = $1;
+ struct proto_config *cf = $4->proto;
+ if (!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->out_table) cf_error("No export table in channel %s.%s", $4->name, $6);
+ rt_show_add_table($$, c->out_table);
+ $$->tables_defined_by = RSD_TDB_DIRECT;
+ }
| r_args FILTER filter {
$$ = $1;
if ($$->filter != FILTER_ACCEPT) cf_error("Filter specified twice");