summaryrefslogtreecommitdiff
path: root/nest/proto.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2023-08-18 03:53:58 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2023-08-18 03:53:58 +0200
commitf4deef89bebae6e41654217e20f2a7531c65bf49 (patch)
tree327e77cb6f41bb5e9b47691575cc7f4f2163e0ba /nest/proto.c
parentaec21cda249f9460d63c14ca83a9fa4210bcc20d (diff)
BMP: Refactor route monitoring
- Manage BMP state through bmp_peer, bmp_stream, bmp_table structures - Use channels and rt_notify() hook for route announcements - Add support for post-policy monitoring - Send End-of-RIB even when there is no routes - Remove rte_update_in_notify() hook from import tables - Update import tables to support channels - Add bmp_hack (no feed / no flush) flag to channels
Diffstat (limited to 'nest/proto.c')
-rw-r--r--nest/proto.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/nest/proto.c b/nest/proto.c
index 885a0b75..16245dca 100644
--- a/nest/proto.c
+++ b/nest/proto.c
@@ -179,6 +179,7 @@ proto_add_channel(struct proto *p, struct channel_config *cf)
c->merge_limit = cf->merge_limit;
c->in_keep_filtered = cf->in_keep_filtered;
c->rpki_reload = cf->rpki_reload;
+ c->bmp_hack = cf->bmp_hack;
c->channel_state = CS_DOWN;
c->export_state = ES_DOWN;
@@ -450,7 +451,10 @@ channel_start_export(struct channel *c)
ASSERT(c->channel_state == CS_UP);
ASSERT(c->export_state == ES_DOWN);
- channel_schedule_feed(c, 1); /* Sets ES_FEEDING */
+ if (!c->bmp_hack)
+ channel_schedule_feed(c, 1); /* Sets ES_FEEDING */
+ else
+ c->export_state = ES_READY;
}
static void
@@ -523,7 +527,7 @@ channel_setup_in_table(struct channel *c)
cf->addr_type = c->net_type;
cf->internal = 1;
- c->in_table = rt_setup(c->proto->pool, cf);
+ c->in_table = cf->table = rt_setup(c->proto->pool, cf);
c->reload_event = ev_new_init(c->proto->pool, channel_reload_loop, c);
}
@@ -574,7 +578,8 @@ channel_do_up(struct channel *c)
static void
channel_do_flush(struct channel *c)
{
- rt_schedule_prune(c->table);
+ if (!c->bmp_hack)
+ rt_schedule_prune(c->table);
c->gr_wait = 0;
if (c->gr_lock)