mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 01:40:16 +00:00
bgpd: Show PfxSnt for show bgp <afi> <safi>
command
JSON output was already in, just printing in CLI as well. ``` root@exit1-debian-9:~# vtysh -c 'show bgp ipv4 summary' IPv4 Unicast Summary: BGP router identifier 10.10.10.1, local AS number 65001 vrf-id 0 BGP table version 100003 RIB entries 200005, using 37 MiB of memory Peers 1, using 21 KiB of memory ... MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt ... 64 157 0 0 0 00:01:18 0 100003 Total number of neighbors 1 ``` JSON: ``` root@exit1-debian-9:~# vtysh -c 'show bgp ipv4 summary json' \ | > jq '.ipv4Unicast.peers."192.168.0.2".pfxSnt' 100003 ``` Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
This commit is contained in:
parent
86ac1facf3
commit
776e7cf5ce
@ -9047,10 +9047,12 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
|
|||||||
vty_out(vty, "EstdCnt DropCnt ResetTime Reason\n");
|
vty_out(vty, "EstdCnt DropCnt ResetTime Reason\n");
|
||||||
else
|
else
|
||||||
vty_out(vty,
|
vty_out(vty,
|
||||||
"V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd\n");
|
"V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
paf = peer_af_find(peer, afi, pfx_rcd_safi);
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
/* Works for both failed & successful cases */
|
/* Works for both failed & successful cases */
|
||||||
if (peer_dynamic_neighbor(peer))
|
if (peer_dynamic_neighbor(peer))
|
||||||
@ -9106,7 +9108,6 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
|
|||||||
json_object_int_add(json_peer, "pfxRcd",
|
json_object_int_add(json_peer, "pfxRcd",
|
||||||
peer->pcount[afi][pfx_rcd_safi]);
|
peer->pcount[afi][pfx_rcd_safi]);
|
||||||
|
|
||||||
paf = peer_af_find(peer, afi, pfx_rcd_safi);
|
|
||||||
if (paf && PAF_SUBGRP(paf))
|
if (paf && PAF_SUBGRP(paf))
|
||||||
json_object_int_add(json_peer,
|
json_object_int_add(json_peer,
|
||||||
"pfxSnt",
|
"pfxSnt",
|
||||||
@ -9192,7 +9193,7 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
|
|||||||
peer_uptime(peer->uptime, timebuf,
|
peer_uptime(peer->uptime, timebuf,
|
||||||
BGP_UPTIME_LEN, 0, NULL));
|
BGP_UPTIME_LEN, 0, NULL));
|
||||||
|
|
||||||
if (peer->status == Established)
|
if (peer->status == Established) {
|
||||||
if (peer->afc_recv[afi][safi])
|
if (peer->afc_recv[afi][safi])
|
||||||
vty_out(vty, " %12" PRIu32,
|
vty_out(vty, " %12" PRIu32,
|
||||||
peer->pcount
|
peer->pcount
|
||||||
@ -9200,7 +9201,12 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
|
|||||||
[pfx_rcd_safi]);
|
[pfx_rcd_safi]);
|
||||||
else
|
else
|
||||||
vty_out(vty, " NoNeg");
|
vty_out(vty, " NoNeg");
|
||||||
else {
|
|
||||||
|
if (paf && PAF_SUBGRP(paf))
|
||||||
|
vty_out(vty, " %8" PRIu32,
|
||||||
|
(PAF_SUBGRP(paf))
|
||||||
|
->scount);
|
||||||
|
} else {
|
||||||
if (CHECK_FLAG(peer->flags, PEER_FLAG_SHUTDOWN))
|
if (CHECK_FLAG(peer->flags, PEER_FLAG_SHUTDOWN))
|
||||||
vty_out(vty, " Idle (Admin)");
|
vty_out(vty, " Idle (Admin)");
|
||||||
else if (CHECK_FLAG(
|
else if (CHECK_FLAG(
|
||||||
@ -9211,6 +9217,8 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
|
|||||||
vty_out(vty, " %12s",
|
vty_out(vty, " %12s",
|
||||||
lookup_msg(bgp_status_msg,
|
lookup_msg(bgp_status_msg,
|
||||||
peer->status, NULL));
|
peer->status, NULL));
|
||||||
|
|
||||||
|
vty_out(vty, " %8" PRIu32, 0);
|
||||||
}
|
}
|
||||||
vty_out(vty, "\n");
|
vty_out(vty, "\n");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user