#include "lib_errors.h"
#include "stream.h"
#include "libfrr.h"
-#include "version.h"
+#include "lib/version.h"
#include "jhash.h"
#include "termtable.h"
return jhash(&e->bgp, sizeof(e->bgp), 0x55aa5a5a);
}
-DECLARE_HASH(bmp_bgph, struct bmp_bgp, bbi, bmp_bgp_cmp, bmp_bgp_hash)
+DECLARE_HASH(bmp_bgph, struct bmp_bgp, bbi, bmp_bgp_cmp, bmp_bgp_hash);
struct bmp_bgph_head bmp_bgph;
}
DECLARE_HASH(bmp_peerh, struct bmp_bgp_peer, bpi,
- bmp_bgp_peer_cmp, bmp_bgp_peer_hash)
+ bmp_bgp_peer_cmp, bmp_bgp_peer_hash);
struct bmp_peerh_head bmp_peerh;
-DECLARE_LIST(bmp_mirrorq, struct bmp_mirrorq, bmi)
+DECLARE_LIST(bmp_mirrorq, struct bmp_mirrorq, bmi);
/* listener management */
return 0;
}
-DECLARE_SORTLIST_UNIQ(bmp_listeners, struct bmp_listener, bli, bmp_listener_cmp)
+DECLARE_SORTLIST_UNIQ(bmp_listeners, struct bmp_listener, bli,
+ bmp_listener_cmp);
static int bmp_targets_cmp(const struct bmp_targets *a,
const struct bmp_targets *b)
return strcmp(a->name, b->name);
}
-DECLARE_SORTLIST_UNIQ(bmp_targets, struct bmp_targets, bti, bmp_targets_cmp)
+DECLARE_SORTLIST_UNIQ(bmp_targets, struct bmp_targets, bti, bmp_targets_cmp);
-DECLARE_LIST(bmp_session, struct bmp, bsi)
+DECLARE_LIST(bmp_session, struct bmp, bsi);
-DECLARE_DLIST(bmp_qlist, struct bmp_queue_entry, bli)
+DECLARE_DLIST(bmp_qlist, struct bmp_queue_entry, bli);
static int bmp_qhash_cmp(const struct bmp_queue_entry *a,
const struct bmp_queue_entry *b)
}
DECLARE_HASH(bmp_qhash, struct bmp_queue_entry, bhi,
- bmp_qhash_cmp, bmp_qhash_hkey)
+ bmp_qhash_cmp, bmp_qhash_hkey);
static int bmp_active_cmp(const struct bmp_active *a,
const struct bmp_active *b)
return 0;
}
-DECLARE_SORTLIST_UNIQ(bmp_actives, struct bmp_active, bai, bmp_active_cmp)
+DECLARE_SORTLIST_UNIQ(bmp_actives, struct bmp_active, bai, bmp_active_cmp);
static struct bmp *bmp_new(struct bmp_targets *bt, int bmp_sock)
{
#define BGP_BMP_MAX_PACKET_SIZE 1024
s = stream_new(BGP_MAX_PACKET_SIZE);
- if (peer->status == Established && !down) {
+ if (peer_established(peer) && !down) {
struct bmp_bgp_peer *bbpeer;
bmp_common_hdr(s, BMP_VERSION_3,
zlog_info("bmp: skipping queued item for deleted peer");
goto out;
}
- if (peer->status != Established)
+ if (!peer_established(peer))
goto out;
bn = bgp_node_lookup(bmp->targets->bgp->rib[afi][safi], &bqe->p);
for (ALL_LIST_ELEMENTS_RO(bt->bgp->peer, node, peer)) {
size_t count = 0, count_pos, len;
- if (peer->status != Established)
+ if (!peer_established(peer))
continue;
s = stream_new(BGP_MAX_PACKET_SIZE);
frr_each (bmp_actives, &bt->actives, ba)
vty_out(vty, " bmp connect %s port %u min-retry %u max-retry %u\n",
ba->hostname, ba->port, ba->minretry, ba->maxretry);
+
+ vty_out(vty, " exit\n");
}
return 0;
FRR_MODULE_SETUP(.name = "bgpd_bmp", .version = FRR_VERSION,
.description = "bgpd BMP module",
- .init = bgp_bmp_module_init)
+ .init = bgp_bmp_module_init,
+);