From f3dd00510fc406621278d50791eb9b5548c4f4b5 Mon Sep 17 00:00:00 2001 From: Cassiano Campes Date: Mon, 11 Mar 2024 22:33:16 -0300 Subject: [PATCH 1/3] bgpd: add missing white-space between route short status and network columns When running `show ip bgp` command, the 'route short status' and 'network' columns do not have white-space between them. Old show: Network Next Hop Metric LocPrf Weight Path *>i1.1.1.1/32 10.1.12.111 0 100 0 i New show: Network Next Hop Metric LocPrf Weight Path *>i 1.1.1.1/32 10.1.12.111 0 100 0 i Added white-space to enhance readability between them. Signed-off-by: Cassiano Campes --- bgpd/bgp_route.c | 3 +++ bgpd/bgp_route.h | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index d726edcc9f9a..f30b31cdd9ed 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -9046,6 +9046,9 @@ static void route_vty_short_status_out(struct vty *vty, vty_out(vty, "i"); else vty_out(vty, " "); + + /* adding space between next column */ + vty_out(vty, " "); } static char *bgp_nexthop_hostname(struct peer *peer, diff --git a/bgpd/bgp_route.h b/bgpd/bgp_route.h index 2d82f0f206f7..9be3f063f385 100644 --- a/bgpd/bgp_route.h +++ b/bgpd/bgp_route.h @@ -66,8 +66,8 @@ enum bgp_show_adj_route_type { #define BGP_SHOW_NCODE_HEADER "Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self\n" #define BGP_SHOW_RPKI_HEADER \ "RPKI validation codes: V valid, I invalid, N Not found\n\n" -#define BGP_SHOW_HEADER " Network Next Hop Metric LocPrf Weight Path\n" -#define BGP_SHOW_HEADER_WIDE " Network Next Hop Metric LocPrf Weight Path\n" +#define BGP_SHOW_HEADER " Network Next Hop Metric LocPrf Weight Path\n" +#define BGP_SHOW_HEADER_WIDE " Network Next Hop Metric LocPrf Weight Path\n" /* Maximum number of labels we can process or send with a prefix. We * really do only 1 for MPLS (BGP-LU) but we can do 2 for EVPN-VxLAN. From c490a8f1e6705ae22dce9f0fa8499155d381ed21 Mon Sep 17 00:00:00 2001 From: Cassiano Campes Date: Tue, 19 Mar 2024 08:02:58 -0300 Subject: [PATCH 2/3] bgpd: Updated topotests with new changes Updated the topotests to contemplate the new `show ip bgp` outputs. Signed-off-by: Cassiano Campes --- .../all_protocol_startup/r1/show_bgp_ipv4-post4.1.ref | 4 ++-- .../all_protocol_startup/r1/show_bgp_ipv4-post5.0.ref | 4 ++-- .../all_protocol_startup/r1/show_bgp_ipv4-post6.1.ref | 4 ++-- tests/topotests/all_protocol_startup/r1/show_bgp_ipv4.ref | 4 ++-- .../all_protocol_startup/r1/show_bgp_ipv6-post4.1.ref | 4 ++-- tests/topotests/all_protocol_startup/r1/show_bgp_ipv6.ref | 4 ++-- .../all_protocol_startup/r1/show_bgp_ipv6_post6.1.ref | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/topotests/all_protocol_startup/r1/show_bgp_ipv4-post4.1.ref b/tests/topotests/all_protocol_startup/r1/show_bgp_ipv4-post4.1.ref index b2e8de5ce13b..80c727c7e7a4 100644 --- a/tests/topotests/all_protocol_startup/r1/show_bgp_ipv4-post4.1.ref +++ b/tests/topotests/all_protocol_startup/r1/show_bgp_ipv4-post4.1.ref @@ -5,5 +5,5 @@ Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found - Network Next Hop Metric LocPrf Weight Path - *> 192.168.0.0 0.0.0.0 0 32768 i + Network Next Hop Metric LocPrf Weight Path + *> 192.168.0.0 0.0.0.0 0 32768 i diff --git a/tests/topotests/all_protocol_startup/r1/show_bgp_ipv4-post5.0.ref b/tests/topotests/all_protocol_startup/r1/show_bgp_ipv4-post5.0.ref index 7bee704182ed..6a837f5ae746 100644 --- a/tests/topotests/all_protocol_startup/r1/show_bgp_ipv4-post5.0.ref +++ b/tests/topotests/all_protocol_startup/r1/show_bgp_ipv4-post5.0.ref @@ -5,5 +5,5 @@ Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found - Network Next Hop Metric LocPrf Weight Path - *> 192.168.0.0/24 0.0.0.0 0 32768 i + Network Next Hop Metric LocPrf Weight Path + *> 192.168.0.0/24 0.0.0.0 0 32768 i diff --git a/tests/topotests/all_protocol_startup/r1/show_bgp_ipv4-post6.1.ref b/tests/topotests/all_protocol_startup/r1/show_bgp_ipv4-post6.1.ref index 31071e760d46..cc3c09851846 100644 --- a/tests/topotests/all_protocol_startup/r1/show_bgp_ipv4-post6.1.ref +++ b/tests/topotests/all_protocol_startup/r1/show_bgp_ipv4-post6.1.ref @@ -6,5 +6,5 @@ Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found - Network Next Hop Metric LocPrf Weight Path - *> 192.168.0.0/24 0.0.0.0 0 32768 i + Network Next Hop Metric LocPrf Weight Path + *> 192.168.0.0/24 0.0.0.0 0 32768 i diff --git a/tests/topotests/all_protocol_startup/r1/show_bgp_ipv4.ref b/tests/topotests/all_protocol_startup/r1/show_bgp_ipv4.ref index 53c4793bf4ce..9b6f2f1c9419 100644 --- a/tests/topotests/all_protocol_startup/r1/show_bgp_ipv4.ref +++ b/tests/topotests/all_protocol_startup/r1/show_bgp_ipv4.ref @@ -3,5 +3,5 @@ Status codes: s suppressed, d damped, h history, * valid, > best, = multipath, i internal, r RIB-failure, S Stale, R Removed Origin codes: i - IGP, e - EGP, ? - incomplete - Network Next Hop Metric LocPrf Weight Path - *> 192.168.0.0 0.0.0.0 0 32768 i + Network Next Hop Metric LocPrf Weight Path + *> 192.168.0.0 0.0.0.0 0 32768 i diff --git a/tests/topotests/all_protocol_startup/r1/show_bgp_ipv6-post4.1.ref b/tests/topotests/all_protocol_startup/r1/show_bgp_ipv6-post4.1.ref index fe3f0720d814..5fe04bfa2305 100644 --- a/tests/topotests/all_protocol_startup/r1/show_bgp_ipv6-post4.1.ref +++ b/tests/topotests/all_protocol_startup/r1/show_bgp_ipv6-post4.1.ref @@ -5,5 +5,5 @@ Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found - Network Next Hop Metric LocPrf Weight Path - *> fc00::/64 :: 0 32768 i + Network Next Hop Metric LocPrf Weight Path + *> fc00::/64 :: 0 32768 i diff --git a/tests/topotests/all_protocol_startup/r1/show_bgp_ipv6.ref b/tests/topotests/all_protocol_startup/r1/show_bgp_ipv6.ref index 363b4f5349e2..c4469d2230ec 100644 --- a/tests/topotests/all_protocol_startup/r1/show_bgp_ipv6.ref +++ b/tests/topotests/all_protocol_startup/r1/show_bgp_ipv6.ref @@ -3,5 +3,5 @@ Status codes: s suppressed, d damped, h history, * valid, > best, = multipath, i internal, r RIB-failure, S Stale, R Removed Origin codes: i - IGP, e - EGP, ? - incomplete - Network Next Hop Metric LocPrf Weight Path - *> fc00::/64 :: 0 32768 i + Network Next Hop Metric LocPrf Weight Path + *> fc00::/64 :: 0 32768 i diff --git a/tests/topotests/all_protocol_startup/r1/show_bgp_ipv6_post6.1.ref b/tests/topotests/all_protocol_startup/r1/show_bgp_ipv6_post6.1.ref index 8c3229b45d00..6ca07ec01d9c 100644 --- a/tests/topotests/all_protocol_startup/r1/show_bgp_ipv6_post6.1.ref +++ b/tests/topotests/all_protocol_startup/r1/show_bgp_ipv6_post6.1.ref @@ -6,5 +6,5 @@ Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found - Network Next Hop Metric LocPrf Weight Path - *> fc00::/64 :: 0 32768 i + Network Next Hop Metric LocPrf Weight Path + *> fc00::/64 :: 0 32768 i From 6859414ebffdc88843078feb2d89fc00d5d381a1 Mon Sep 17 00:00:00 2001 From: Cassiano Campes Date: Tue, 19 Mar 2024 16:35:06 -0300 Subject: [PATCH 3/3] bgpd: Adjusted topotests to reflect the new "show ip bgp" output Topotests changed to consider the extra wite space added in "show ip bgp" output. Signed-off-by: Cassiano Campes --- .../scripts/add_routes.py | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/topotests/bgp_l3vpn_to_bgp_direct/scripts/add_routes.py b/tests/topotests/bgp_l3vpn_to_bgp_direct/scripts/add_routes.py index 0deb181f3e5c..c98d837069a7 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_direct/scripts/add_routes.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_direct/scripts/add_routes.py @@ -9,9 +9,9 @@ luCommand( "r4", 'vtysh -c "show bgp next"', "99.0.0.. valid", "wait", "See CE static NH" ) -luCommand("r1", 'vtysh -c "show bgp ipv4 uni"', "i5.*i5", "wait", "See CE routes") -luCommand("r3", 'vtysh -c "show bgp ipv4 uni"', "i5.*i5", "wait", "See CE routes") -luCommand("r4", 'vtysh -c "show bgp ipv4 uni"', "i5.*i5", "wait", "See CE routes") +luCommand("r1", 'vtysh -c "show bgp ipv4 uni"', "i 5.*i 5", "wait", "See CE routes") +luCommand("r3", 'vtysh -c "show bgp ipv4 uni"', "i 5.*i 5", "wait", "See CE routes") +luCommand("r4", 'vtysh -c "show bgp ipv4 uni"', "i 5.*i 5", "wait", "See CE routes") luCommand("ce1", 'vtysh -c "show bgp ipv4 uni 5.1.0.0/24"', "", "none", "See CE routes") luCommand("r1", 'vtysh -c "show bgp ipv4 uni 5.1.0.0/24"', "", "none", "See CE routes") luCommand("ce2", 'vtysh -c "show bgp ipv4 uni 5.1.0.0/24"', "", "none", "See CE routes") @@ -39,22 +39,22 @@ luCommand( "r3", 'vtysh -c "show bgp ipv4 vpn"', - "i99.0.0.1/32", + "i 99.0.0.1/32", "wait", "See R1s static address", ) luCommand( "r4", 'vtysh -c "show bgp ipv4 vpn"', - "i99.0.0.1/32", + "i 99.0.0.1/32", "wait", "See R1s static address", ) luCommand( - "r3", 'vtysh -c "show bgp ipv4 vpn rd 10:1"', "i5.*i5", "wait", "See R1s imports" + "r3", 'vtysh -c "show bgp ipv4 vpn rd 10:1"', "i 5.*i 5", "wait", "See R1s imports" ) luCommand( - "r4", 'vtysh -c "show bgp ipv4 vpn rd 10:1"', "i5.*i5", "wait", "See R1s imports" + "r4", 'vtysh -c "show bgp ipv4 vpn rd 10:1"', "i 5.*i 5", "wait", "See R1s imports" ) luCommand( @@ -86,14 +86,14 @@ luCommand( "r1", 'vtysh -c "show bgp ipv4 vpn"', - "i99.0.0.2/32", + "i 99.0.0.2/32", "wait", "See R3s static address", ) luCommand( "r4", 'vtysh -c "show bgp ipv4 vpn"', - "i99.0.0.2/32", + "i 99.0.0.2/32", "wait", "See R3s static address", ) @@ -101,14 +101,14 @@ luCommand( "r1", 'vtysh -c "show bgp ipv4 vpn rd 10:3"', - "i5.*i5", + "i 5.*i 5", "none", "See R3s imports", ) luCommand( "r4", 'vtysh -c "show bgp ipv4 vpn rd 10:3"', - "i5.*i5", + "i 5.*i 5", "none", "See R3s imports", ) @@ -133,22 +133,22 @@ luCommand( "r1", 'vtysh -c "show bgp ipv4 vpn"', - "i99.0.0.3/32", + "i 99.0.0.3/32", "wait", "See R4s static address", ) luCommand( "r3", 'vtysh -c "show bgp ipv4 vpn"', - "i99.0.0.3/32", + "i 99.0.0.3/32", "wait", "See R4s static address", ) luCommand( - "r1", 'vtysh -c "show bgp ipv4 vpn rd 10:4"', "i5.*i5", "wait", "See R4s imports" + "r1", 'vtysh -c "show bgp ipv4 vpn rd 10:4"', "i 5.*i 5", "wait", "See R4s imports" ) luCommand( - "r3", 'vtysh -c "show bgp ipv4 vpn rd 10:4"', "i5.*i5", "wait", "See R4s imports" + "r3", 'vtysh -c "show bgp ipv4 vpn rd 10:4"', "i 5.*i 5", "wait", "See R4s imports" )