summaryrefslogtreecommitdiff
path: root/proto/bgp/bgp.c
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 /proto/bgp/bgp.c
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 'proto/bgp/bgp.c')
-rw-r--r--proto/bgp/bgp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index c08e5ee9..01f61e81 100644
--- a/proto/bgp/bgp.c
+++ b/proto/bgp/bgp.c
@@ -1721,6 +1721,9 @@ bgp_channel_start(struct channel *C)
if (c->cf->import_table)
channel_setup_in_table(C);
+ if (c->cf->export_table)
+ channel_setup_out_table(C);
+
c->stale_timer = tm_new_init(c->pool, bgp_long_lived_stale_timeout, c, 0, 0);
c->next_hop_addr = c->cf->next_hop_addr;
@@ -2067,6 +2070,7 @@ bgp_channel_reconfigure(struct channel *C, struct channel_config *CC, int *impor
(new->ext_next_hop != old->ext_next_hop) ||
(new->add_path != old->add_path) ||
(new->import_table != old->import_table) ||
+ (new->export_table != old->export_table) ||
(IGP_TABLE(new, ip4) != IGP_TABLE(old, ip4)) ||
(IGP_TABLE(new, ip6) != IGP_TABLE(old, ip6)))
return 0;