mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 23:58:44 +00:00
bgpd: Simplify the code for show command
Keep the common code for command: "show ip bgp summary [wide]". Signed-off-by: anlan_cs <vic.lan@pica8.com>
This commit is contained in:
parent
e618cc7b21
commit
344c7da04e
@ -11676,37 +11676,22 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
|
|||||||
vty_out(vty, "4 ");
|
vty_out(vty, "4 ");
|
||||||
vty_out(vty, ASN_FORMAT_SPACE(bgp->asnotation),
|
vty_out(vty, ASN_FORMAT_SPACE(bgp->asnotation),
|
||||||
&peer->as);
|
&peer->as);
|
||||||
if (show_wide) {
|
if (show_wide)
|
||||||
vty_out(vty,
|
vty_out(vty,
|
||||||
ASN_FORMAT_SPACE(
|
ASN_FORMAT_SPACE(
|
||||||
bgp->asnotation),
|
bgp->asnotation),
|
||||||
peer->change_local_as
|
peer->change_local_as
|
||||||
? &peer->change_local_as
|
? &peer->change_local_as
|
||||||
: &peer->local_as);
|
: &peer->local_as);
|
||||||
vty_out(vty,
|
vty_out(vty,
|
||||||
" %9u %9u %8" PRIu64
|
" %9u %9u %8" PRIu64 " %4zu %4zu %8s",
|
||||||
" %4zu %4zu %8s",
|
PEER_TOTAL_RX(peer),
|
||||||
PEER_TOTAL_RX(peer),
|
PEER_TOTAL_TX(peer),
|
||||||
PEER_TOTAL_TX(peer),
|
peer->version[afi][safi], inq_count,
|
||||||
peer->version[afi][safi],
|
outq_count,
|
||||||
inq_count, outq_count,
|
peer_uptime(peer->uptime, timebuf,
|
||||||
peer_uptime(peer->uptime,
|
BGP_UPTIME_LEN, 0, NULL));
|
||||||
timebuf,
|
|
||||||
BGP_UPTIME_LEN, 0,
|
|
||||||
NULL));
|
|
||||||
} else {
|
|
||||||
vty_out(vty,
|
|
||||||
" %9u %9u %8" PRIu64
|
|
||||||
" %4zu %4zu %8s",
|
|
||||||
PEER_TOTAL_RX(peer),
|
|
||||||
PEER_TOTAL_TX(peer),
|
|
||||||
peer->version[afi][safi],
|
|
||||||
inq_count, outq_count,
|
|
||||||
peer_uptime(peer->uptime,
|
|
||||||
timebuf,
|
|
||||||
BGP_UPTIME_LEN, 0,
|
|
||||||
NULL));
|
|
||||||
}
|
|
||||||
if (peer_established(peer)) {
|
if (peer_established(peer)) {
|
||||||
if (peer->afc_recv[afi][safi]) {
|
if (peer->afc_recv[afi][safi]) {
|
||||||
if (CHECK_FLAG(
|
if (CHECK_FLAG(
|
||||||
|
Loading…
Reference in New Issue
Block a user