mirror of
https://gitlab.labs.nic.cz/labs/bird.git
synced 2024-05-11 16:54:54 +00:00
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
This commit is contained in:
11
nest/proto.c
11
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)
|
||||
|
Reference in New Issue
Block a user