mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-29 15:07:51 +00:00
bgpd: modify VRF/view display in show bgp summary
Modify VRF/view display in show bgp summary: - to be more concise - to display on which VRF/view no neighbor was found Before patch: ubuntu# show bgp vrf all summary Instance default: IPv4 Unicast Summary: BGP router identifier XX.XX.XX.XX, local AS number XXXX vrf-id 0 (...) IPv6 Unicast Summary: Instance private: IPv4 Unicast Summary: ubuntu# show bgp vrf all ipv4 multicast summary % No BGP neighbors found % No BGP neighbors found After patch: ubuntu# show bgp vrf all summary IPv4 Unicast Summary (VRF default): BGP router identifier XX.XX.XX.XX, local AS number XXXX vrf-id 0 (...) IPv6 Unicast Summary (VRF default): (...) IPv4 Unicast Summary (VRF private): (...) ubuntu# show bgp vrf all ipv4 multicast summary % No BGP neighbors found in VRF default % No BGP neighbors found in VRF private Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
This commit is contained in:
parent
7ff6a42763
commit
6cac2fcc47
@ -11440,10 +11440,12 @@ static void bgp_show_summary_afi_safi(struct vty *vty, struct bgp *bgp, int afi,
|
||||
safi,
|
||||
true));
|
||||
} else {
|
||||
vty_out(vty, "\n%s Summary:\n",
|
||||
vty_out(vty,
|
||||
"\n%s Summary (%s):\n",
|
||||
get_afi_safi_str(afi,
|
||||
safi,
|
||||
false));
|
||||
false),
|
||||
bgp->name_pretty);
|
||||
}
|
||||
}
|
||||
bgp_show_summary(vty, bgp, afi, safi, fpeer,
|
||||
@ -11464,7 +11466,8 @@ static void bgp_show_summary_afi_safi(struct vty *vty, struct bgp *bgp, int afi,
|
||||
if (use_json)
|
||||
vty_out(vty, "{}\n");
|
||||
else
|
||||
vty_out(vty, "%% No BGP neighbors found\n");
|
||||
vty_out(vty, "%% No BGP neighbors found in %s\n",
|
||||
bgp->name_pretty);
|
||||
}
|
||||
}
|
||||
|
||||
@ -11496,11 +11499,6 @@ static void bgp_show_all_instances_summary_vty(struct vty *vty, afi_t afi,
|
||||
(bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT)
|
||||
? VRF_DEFAULT_NAME
|
||||
: bgp->name);
|
||||
} else {
|
||||
vty_out(vty, "\nInstance %s:\n",
|
||||
(bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT)
|
||||
? VRF_DEFAULT_NAME
|
||||
: bgp->name);
|
||||
}
|
||||
if (neighbor) {
|
||||
fpeer = peer_lookup_in_view(vty, bgp, neighbor,
|
||||
|
@ -442,7 +442,7 @@ Require policy on EBGP
|
||||
|
||||
exit1# show bgp summary
|
||||
|
||||
IPv4 Unicast Summary:
|
||||
IPv4 Unicast Summary (VRF default):
|
||||
BGP router identifier 10.10.10.1, local AS number 65001 vrf-id 0
|
||||
BGP table version 4
|
||||
RIB entries 7, using 1344 bytes of memory
|
||||
@ -3245,7 +3245,7 @@ structure is extended with :clicmd:`show bgp [afi] [safi]`.
|
||||
|
||||
exit1# show ip bgp summary wide
|
||||
|
||||
IPv4 Unicast Summary:
|
||||
IPv4 Unicast Summary (VRF default):
|
||||
BGP router identifier 192.168.100.1, local AS number 65534 vrf-id 0
|
||||
BGP table version 3
|
||||
RIB entries 5, using 920 bytes of memory
|
||||
|
@ -928,21 +928,21 @@ def test_bgp_summary():
|
||||
actual = re.sub(r"Total number.*", "", actual)
|
||||
actual = re.sub(r"Displayed.*", "", actual)
|
||||
# Remove IPv4 Unicast Summary (Title only)
|
||||
actual = re.sub(r"IPv4 Unicast Summary:", "", actual)
|
||||
actual = re.sub(r"IPv4 Unicast Summary \(VRF default\):", "", actual)
|
||||
# Remove IPv4 Multicast Summary (all of it)
|
||||
actual = re.sub(r"IPv4 Multicast Summary:", "", actual)
|
||||
actual = re.sub(r"IPv4 Multicast Summary \(VRF default\):", "", actual)
|
||||
actual = re.sub(r"No IPv4 Multicast neighbor is configured", "", actual)
|
||||
# Remove IPv4 VPN Summary (all of it)
|
||||
actual = re.sub(r"IPv4 VPN Summary:", "", actual)
|
||||
actual = re.sub(r"IPv4 VPN Summary \(VRF default\):", "", actual)
|
||||
actual = re.sub(r"No IPv4 VPN neighbor is configured", "", actual)
|
||||
# Remove IPv4 Encap Summary (all of it)
|
||||
actual = re.sub(r"IPv4 Encap Summary:", "", actual)
|
||||
actual = re.sub(r"IPv4 Encap Summary \(VRF default\):", "", actual)
|
||||
actual = re.sub(r"No IPv4 Encap neighbor is configured", "", actual)
|
||||
# Remove Unknown Summary (all of it)
|
||||
actual = re.sub(r"Unknown Summary:", "", actual)
|
||||
actual = re.sub(r"Unknown Summary \(VRF default\):", "", actual)
|
||||
actual = re.sub(r"No Unknown neighbor is configured", "", actual)
|
||||
|
||||
actual = re.sub(r"IPv4 labeled-unicast Summary:", "", actual)
|
||||
actual = re.sub(r"IPv4 labeled-unicast Summary \(VRF default\):", "", actual)
|
||||
actual = re.sub(
|
||||
r"No IPv4 labeled-unicast neighbor is configured", "", actual
|
||||
)
|
||||
@ -1067,22 +1067,22 @@ def test_bgp_ipv6_summary():
|
||||
actual = re.sub(r"Total number.*", "", actual)
|
||||
actual = re.sub(r"Displayed.*", "", actual)
|
||||
# Remove IPv4 Unicast Summary (Title only)
|
||||
actual = re.sub(r"IPv6 Unicast Summary:", "", actual)
|
||||
actual = re.sub(r"IPv6 Unicast Summary \(VRF default\):", "", actual)
|
||||
# Remove IPv4 Multicast Summary (all of it)
|
||||
actual = re.sub(r"IPv6 Multicast Summary:", "", actual)
|
||||
actual = re.sub(r"IPv6 Multicast Summary \(VRF default\):", "", actual)
|
||||
actual = re.sub(r"No IPv6 Multicast neighbor is configured", "", actual)
|
||||
# Remove IPv4 VPN Summary (all of it)
|
||||
actual = re.sub(r"IPv6 VPN Summary:", "", actual)
|
||||
actual = re.sub(r"IPv6 VPN Summary \(VRF default\):", "", actual)
|
||||
actual = re.sub(r"No IPv6 VPN neighbor is configured", "", actual)
|
||||
# Remove IPv4 Encap Summary (all of it)
|
||||
actual = re.sub(r"IPv6 Encap Summary:", "", actual)
|
||||
actual = re.sub(r"IPv6 Encap Summary \(VRF default\):", "", actual)
|
||||
actual = re.sub(r"No IPv6 Encap neighbor is configured", "", actual)
|
||||
# Remove Unknown Summary (all of it)
|
||||
actual = re.sub(r"Unknown Summary:", "", actual)
|
||||
actual = re.sub(r"Unknown Summary \(VRF default\):", "", actual)
|
||||
actual = re.sub(r"No Unknown neighbor is configured", "", actual)
|
||||
|
||||
# Remove Labeled Unicast Summary (all of it)
|
||||
actual = re.sub(r"IPv6 labeled-unicast Summary:", "", actual)
|
||||
actual = re.sub(r"IPv6 labeled-unicast Summary \(VRF default\):", "", actual)
|
||||
actual = re.sub(
|
||||
r"No IPv6 labeled-unicast neighbor is configured", "", actual
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user