Skip to content

Commit

Permalink
bgpd: bmp adj-rib-out monitoring
Browse files Browse the repository at this point in the history
bgpd: changed bmp config to include bmp monitor rib-out
bgpd: added rib-out pre-policy & post-policy monitoring
bgpd: bmp sync for rib-out pre and post
bgpd: added missing out-pre hook bump bmp sessions on bmp reconfigure to run sync immediately
lib, bgpd: added pullwr_timeout, added bmp startup-delay command
bgpd: bmp added bmp session state to bmp show
doc: bmp updated documentation with new commands
bgpd: bmp add rib-out post-policy stats
bgpd: bmp add adj-rib-in stats
bgpd: bmp add loc-rib stats

Signed-off-by: Maxence Younsi <[email protected]>
  • Loading branch information
mxyns committed Nov 16, 2023
1 parent d6940cc commit 5279db9
Show file tree
Hide file tree
Showing 13 changed files with 1,277 additions and 223 deletions.
15 changes: 9 additions & 6 deletions bgpd/bgp_advertise.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ bool bgp_adj_out_lookup(struct peer *peer, struct bgp_dest *dest,
}


void bgp_adj_in_set(struct bgp_dest *dest, struct peer *peer, struct attr *attr,
uint32_t addpath_id)
void bgp_adj_in_set(struct bgp_dest *dest, afi_t afi, safi_t safi,
struct peer *peer, struct attr *attr, uint32_t addpath_id)
{
struct bgp_adj_in *adj;

Expand All @@ -178,24 +178,27 @@ void bgp_adj_in_set(struct bgp_dest *dest, struct peer *peer, struct attr *attr,
}
adj = XCALLOC(MTYPE_BGP_ADJ_IN, sizeof(struct bgp_adj_in));
adj->peer = peer_lock(peer); /* adj_in peer reference */
adj->peer->stat_adj_in_count[afi][safi]++;
adj->attr = bgp_attr_intern(attr);
adj->uptime = monotime(NULL);
adj->addpath_rx_id = addpath_id;
BGP_ADJ_IN_ADD(dest, adj);
bgp_dest_lock_node(dest);
}

void bgp_adj_in_remove(struct bgp_dest **dest, struct bgp_adj_in *bai)
void bgp_adj_in_remove(struct bgp_dest **dest, afi_t afi, safi_t safi,
struct bgp_adj_in *bai)
{
bgp_attr_unintern(&bai->attr);
BGP_ADJ_IN_DEL(*dest, bai);
bai->peer->stat_adj_in_count[afi][safi]--;
*dest = bgp_dest_unlock_node(*dest);
peer_unlock(bai->peer); /* adj_in peer reference */
XFREE(MTYPE_BGP_ADJ_IN, bai);
}

bool bgp_adj_in_unset(struct bgp_dest **dest, struct peer *peer,
uint32_t addpath_id)
bool bgp_adj_in_unset(struct bgp_dest **dest, afi_t afi, safi_t safi,
struct peer *peer, uint32_t addpath_id)
{
struct bgp_adj_in *adj;
struct bgp_adj_in *adj_next;
Expand All @@ -209,7 +212,7 @@ bool bgp_adj_in_unset(struct bgp_dest **dest, struct peer *peer,
adj_next = adj->next;

if (adj->peer == peer && adj->addpath_rx_id == addpath_id)
bgp_adj_in_remove(dest, adj);
bgp_adj_in_remove(dest, afi, safi, adj);

adj = adj_next;

Expand Down
12 changes: 7 additions & 5 deletions bgpd/bgp_advertise.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,13 @@ struct bgp_synchronize {
/* Prototypes. */
extern bool bgp_adj_out_lookup(struct peer *peer, struct bgp_dest *dest,
uint32_t addpath_tx_id);
extern void bgp_adj_in_set(struct bgp_dest *dest, struct peer *peer,
struct attr *attr, uint32_t addpath_id);
extern bool bgp_adj_in_unset(struct bgp_dest **dest, struct peer *peer,
uint32_t addpath_id);
extern void bgp_adj_in_remove(struct bgp_dest **dest, struct bgp_adj_in *bai);
extern void bgp_adj_in_set(struct bgp_dest *dest, afi_t afi, safi_t safi,
struct peer *peer, struct attr *attr,
uint32_t addpath_id);
extern bool bgp_adj_in_unset(struct bgp_dest **dest, afi_t afi, safi_t safi,
struct peer *peer, uint32_t addpath_id);
extern void bgp_adj_in_remove(struct bgp_dest **dest, afi_t afi, safi_t safi,
struct bgp_adj_in *bai);

extern unsigned int bgp_advertise_attr_hash_key(const void *p);
extern bool bgp_advertise_attr_hash_cmp(const void *p1, const void *p2);
Expand Down
Loading

0 comments on commit 5279db9

Please sign in to comment.