diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2018-11-20 17:38:19 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2018-11-20 17:45:35 +0100 |
commit | 863ecfc78538657e51f1ec67441aec32261aa405 (patch) | |
tree | 73b8628fbca9e04a554c5d08fe18bae4c647a51e /proto/bgp/bgp.c | |
parent | 6712e77271fb3cb4a3c48cd7b027b39c5cea00a2 (diff) |
The MRT protocol
The new MRT protocol is responsible for periodic RIB table dumps in the
MRT format (RFC 6396). Also the existing code for BGP4MP MRT dumps is
refactored and splitted between BGP to MRT protocols, will be more
integrated into MRT in the future.
Example:
protocol mrt {
table "*";
filename "%N_%F_%T.mrt";
period 60;
}
It is partially based on the old MRT code from Pavel Tvrdik.
Diffstat (limited to 'proto/bgp/bgp.c')
-rw-r--r-- | proto/bgp/bgp.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c index e2a57137..7f2eb4d0 100644 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@ -477,7 +477,7 @@ static inline void bgp_conn_set_state(struct bgp_conn *conn, uint new_state) { if (conn->bgp->p.mrtdump & MD_STATES) - mrt_dump_bgp_state_change(conn, conn->state, new_state); + bgp_dump_state_change(conn, conn->state, new_state); conn->state = new_state; } @@ -528,6 +528,9 @@ bgp_conn_enter_established_state(struct bgp_conn *conn) /* Number of active channels */ int num = 0; + /* Summary state of ADD_PATH RX for active channels */ + uint summary_add_path_rx = 0; + WALK_LIST(c, p->p.channels) { const struct bgp_af_caps *loc = bgp_find_af_caps(local, c->afi); @@ -586,6 +589,9 @@ bgp_conn_enter_established_state(struct bgp_conn *conn) c->add_path_rx = (loc->add_path & BGP_ADD_PATH_RX) && (rem->add_path & BGP_ADD_PATH_TX); c->add_path_tx = (loc->add_path & BGP_ADD_PATH_TX) && (rem->add_path & BGP_ADD_PATH_RX); + if (active) + summary_add_path_rx |= !c->add_path_rx ? 1 : 2; + /* Update RA mode */ if (c->add_path_tx) c->c.ra_mode = RA_ANY; @@ -598,6 +604,7 @@ bgp_conn_enter_established_state(struct bgp_conn *conn) p->afi_map = mb_alloc(p->p.pool, num * sizeof(u32)); p->channel_map = mb_alloc(p->p.pool, num * sizeof(void *)); p->channel_count = num; + p->summary_add_path_rx = summary_add_path_rx; WALK_LIST(c, p->p.channels) { |