From 8386ac4390f8fbe8daee8240766019f457fa0483 Mon Sep 17 00:00:00 2001 From: vivek Date: Wed, 9 Mar 2016 03:39:38 +0000 Subject: [PATCH] BGP: Update commands for VRF support Ensure commands dealing with update-groups and peer-groups support VRFs. Also implement a new command "show bgp vrfs" to show summary information of all configured VRFs. Some additional code cleanup in this area. Signed-off-by: Vivek Venkatraman Ticket: CM-9247 Reviewed By: CCR-4267 Testing Done: Manual --- bgpd/bgp_nexthop.c | 27 +- bgpd/bgp_route.c | 772 +++++++++++++++++++++------------------------ bgpd/bgp_vty.c | 484 +++++++++++++++++++++------- bgpd/bgp_vty.h | 2 + 4 files changed, 752 insertions(+), 533 deletions(-) diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c index 586a636868..534f29de55 100644 --- a/bgpd/bgp_nexthop.c +++ b/bgpd/bgp_nexthop.c @@ -42,6 +42,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA #include "bgpd/bgp_debug.h" #include "bgpd/bgp_damp.h" #include "bgpd/bgp_fsm.h" +#include "bgpd/bgp_vty.h" #include "zebra/rib.h" #include "zebra/zserv.h" /* For ZEBRA_SERV_PATH. */ @@ -483,27 +484,25 @@ DEFUN (show_ip_bgp_nexthop_detail, return show_ip_bgp_nexthop_table (vty, NULL, 1); } -DEFUN (show_ip_bgp_view_nexthop, - show_ip_bgp_view_nexthop_cmd, - "show ip bgp (view|vrf) WORD nexthop", +DEFUN (show_ip_bgp_instance_nexthop, + show_ip_bgp_instance_nexthop_cmd, + "show ip bgp " BGP_INSTANCE_CMD " nexthop", SHOW_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "BGP nexthop table\n") { return show_ip_bgp_nexthop_table (vty, argv[1], 0); } -DEFUN (show_ip_bgp_view_nexthop_detail, - show_ip_bgp_view_nexthop_detail_cmd, - "show ip bgp (view|vrf) WORD nexthop detail", +DEFUN (show_ip_bgp_instance_nexthop_detail, + show_ip_bgp_instance_nexthop_detail_cmd, + "show ip bgp " BGP_INSTANCE_CMD " nexthop detail", SHOW_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "BGP nexthop table\n") { return show_ip_bgp_nexthop_table (vty, argv[1], 1); @@ -531,10 +530,10 @@ bgp_scan_vty_init (void) install_element (VIEW_NODE, &show_ip_bgp_nexthop_cmd); install_element (VIEW_NODE, &show_ip_bgp_nexthop_detail_cmd); install_element (ENABLE_NODE, &show_ip_bgp_nexthop_detail_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_view_nexthop_cmd); - install_element (VIEW_NODE, &show_ip_bgp_view_nexthop_cmd); - install_element (VIEW_NODE, &show_ip_bgp_view_nexthop_detail_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_view_nexthop_detail_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_instance_nexthop_cmd); + install_element (VIEW_NODE, &show_ip_bgp_instance_nexthop_cmd); + install_element (VIEW_NODE, &show_ip_bgp_instance_nexthop_detail_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_instance_nexthop_detail_cmd); } void diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 426b3156aa..d745dfdfd8 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -60,6 +60,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA #include "bgpd/bgp_mpath.h" #include "bgpd/bgp_nht.h" #include "bgpd/bgp_updgrp.h" +#include "bgpd/bgp_vty.h" /* Extern from bgp_dump.c */ extern const char *bgp_origin_str[]; @@ -7879,13 +7880,12 @@ DEFUN (show_ip_bgp_vpnv4_rd_prefix, } DEFUN (show_ip_bgp_view, - show_ip_bgp_view_cmd, - "show ip bgp (view|vrf) WORD {json}", + show_ip_bgp_instance_cmd, + "show ip bgp " BGP_INSTANCE_CMD " {json}", SHOW_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "JavaScript Object Notation\n") { struct bgp *bgp; @@ -7901,28 +7901,26 @@ DEFUN (show_ip_bgp_view, return bgp_show (vty, bgp, AFI_IP, SAFI_UNICAST, bgp_show_type_normal, NULL, use_json(argc, argv)); } -DEFUN (show_ip_bgp_view_route, - show_ip_bgp_view_route_cmd, - "show ip bgp (view|vrf) WORD A.B.C.D {json}", +DEFUN (show_ip_bgp_instance_route, + show_ip_bgp_instance_route_cmd, + "show ip bgp " BGP_INSTANCE_CMD " A.B.C.D {json}", SHOW_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Network in the BGP routing table to display\n" "JavaScript Object Notation\n") { return bgp_show_route (vty, argv[1], argv[2], AFI_IP, SAFI_UNICAST, NULL, 0, BGP_PATH_ALL, use_json(argc, argv)); } -DEFUN (show_ip_bgp_view_route_pathtype, - show_ip_bgp_view_route_pathtype_cmd, - "show ip bgp (view|vrf) WORD A.B.C.D (bestpath|multipath) {json}", +DEFUN (show_ip_bgp_instance_route_pathtype, + show_ip_bgp_instance_route_pathtype_cmd, + "show ip bgp " BGP_INSTANCE_CMD " A.B.C.D (bestpath|multipath) {json}", SHOW_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Network in the BGP routing table to display\n" "Display only the bestpath\n" "Display only multipaths\n" @@ -7936,28 +7934,26 @@ DEFUN (show_ip_bgp_view_route_pathtype, return bgp_show_route (vty, argv[1], argv[2], AFI_IP, SAFI_UNICAST, NULL, 0, BGP_PATH_MULTIPATH, uj); } -DEFUN (show_ip_bgp_view_prefix, - show_ip_bgp_view_prefix_cmd, - "show ip bgp (view|vrf) WORD A.B.C.D/M {json}", +DEFUN (show_ip_bgp_instance_prefix, + show_ip_bgp_instance_prefix_cmd, + "show ip bgp " BGP_INSTANCE_CMD " A.B.C.D/M {json}", SHOW_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "IP prefix /, e.g., 35.0.0.0/8\n" "JavaScript Object Notation\n") { return bgp_show_route (vty, argv[1], argv[2], AFI_IP, SAFI_UNICAST, NULL, 1, BGP_PATH_ALL, use_json(argc, argv)); } -DEFUN (show_ip_bgp_view_prefix_pathtype, - show_ip_bgp_view_prefix_pathtype_cmd, - "show ip bgp (view|vrf) WORD A.B.C.D/M (bestpath|multipath) {json}", +DEFUN (show_ip_bgp_instance_prefix_pathtype, + show_ip_bgp_instance_prefix_pathtype_cmd, + "show ip bgp " BGP_INSTANCE_CMD " A.B.C.D/M (bestpath|multipath) {json}", SHOW_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "IP prefix /, e.g., 35.0.0.0/8\n" "Display only the bestpath\n" "Display only multipaths\n" @@ -8243,12 +8239,11 @@ DEFUN (show_ipv6_bgp_prefix, } DEFUN (show_bgp_view, - show_bgp_view_cmd, - "show bgp (view|vrf) WORD {json}", + show_bgp_instance_cmd, + "show bgp " BGP_INSTANCE_CMD " {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "JavaScript Object Notation\n") { struct bgp *bgp; @@ -8265,46 +8260,42 @@ DEFUN (show_bgp_view, } ALIAS (show_bgp_view, - show_bgp_view_ipv6_cmd, - "show bgp (view|vrf) WORD ipv6 {json}", + show_bgp_instance_ipv6_cmd, + "show bgp " BGP_INSTANCE_CMD " ipv6 {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" "JavaScript Object Notation\n") -DEFUN (show_bgp_view_route, - show_bgp_view_route_cmd, - "show bgp (view|vrf) WORD X:X::X:X {json}", +DEFUN (show_bgp_instance_route, + show_bgp_instance_route_cmd, + "show bgp " BGP_INSTANCE_CMD " X:X::X:X {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Network in the BGP routing table to display\n" "JavaScript Object Notation\n") { return bgp_show_route (vty, argv[1], argv[2], AFI_IP6, SAFI_UNICAST, NULL, 0, BGP_PATH_ALL, use_json(argc, argv)); } -ALIAS (show_bgp_view_route, - show_bgp_view_ipv6_route_cmd, - "show bgp (view|vrf) WORD ipv6 X:X::X:X {json}", +ALIAS (show_bgp_instance_route, + show_bgp_instance_ipv6_route_cmd, + "show bgp " BGP_INSTANCE_CMD " ipv6 X:X::X:X {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" "Network in the BGP routing table to display\n" "JavaScript Object Notation\n") -DEFUN (show_bgp_view_route_pathtype, - show_bgp_view_route_pathtype_cmd, - "show bgp (view|vrf) WORD X:X::X:X (bestpath|multipath) {json}", +DEFUN (show_bgp_instance_route_pathtype, + show_bgp_instance_route_pathtype_cmd, + "show bgp " BGP_INSTANCE_CMD " X:X::X:X (bestpath|multipath) {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Network in the BGP routing table to display\n" "Display only the bestpath\n" "Display only multipaths\n" @@ -8317,50 +8308,46 @@ DEFUN (show_bgp_view_route_pathtype, return bgp_show_route (vty, argv[1], argv[2], AFI_IP6, SAFI_UNICAST, NULL, 0, BGP_PATH_MULTIPATH, uj); } -ALIAS (show_bgp_view_route_pathtype, - show_bgp_view_ipv6_route_pathtype_cmd, - "show bgp (view|vrf) WORD ipv6 X:X::X:X (bestpath|multipath) {json}", +ALIAS (show_bgp_instance_route_pathtype, + show_bgp_instance_ipv6_route_pathtype_cmd, + "show bgp " BGP_INSTANCE_CMD " ipv6 X:X::X:X (bestpath|multipath) {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" "Network in the BGP routing table to display\n" "Display only the bestpath\n" "Display only multipaths\n" "JavaScript Object Notation\n") -DEFUN (show_bgp_view_prefix, - show_bgp_view_prefix_cmd, - "show bgp (view|vrf) WORD X:X::X:X/M {json}", +DEFUN (show_bgp_instance_prefix, + show_bgp_instance_prefix_cmd, + "show bgp " BGP_INSTANCE_CMD " X:X::X:X/M {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "IPv6 prefix /\n" "JavaScript Object Notation\n") { return bgp_show_route (vty, argv[1], argv[2], AFI_IP6, SAFI_UNICAST, NULL, 1, BGP_PATH_ALL, use_json(argc, argv)); } -ALIAS (show_bgp_view_prefix, - show_bgp_view_ipv6_prefix_cmd, - "show bgp (view|vrf) WORD ipv6 X:X::X:X/M {json}", +ALIAS (show_bgp_instance_prefix, + show_bgp_instance_ipv6_prefix_cmd, + "show bgp " BGP_INSTANCE_CMD " ipv6 X:X::X:X/M {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" "IPv6 prefix /\n" "JavaScript Object Notation\n") -DEFUN (show_bgp_view_prefix_pathtype, - show_bgp_view_prefix_pathtype_cmd, - "show bgp (view|vrf) WORD X:X::X:X/M (bestpath|multipath) {json}", +DEFUN (show_bgp_instance_prefix_pathtype, + show_bgp_instance_prefix_pathtype_cmd, + "show bgp " BGP_INSTANCE_CMD " X:X::X:X/M (bestpath|multipath) {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "IPv6 prefix /\n" "Display only the bestpath\n" "Display only multipaths\n" @@ -8373,26 +8360,24 @@ DEFUN (show_bgp_view_prefix_pathtype, return bgp_show_route (vty, argv[1], argv[2], AFI_IP6, SAFI_UNICAST, NULL, 1, BGP_PATH_MULTIPATH, uj); } -ALIAS (show_bgp_view_prefix_pathtype, - show_bgp_view_ipv6_prefix_pathtype_cmd, - "show bgp (view|vrf) WORD ipv6 X:X::X:X/M (bestpath|multipath) {json}", +ALIAS (show_bgp_instance_prefix_pathtype, + show_bgp_instance_ipv6_prefix_pathtype_cmd, + "show bgp " BGP_INSTANCE_CMD " ipv6 X:X::X:X/M (bestpath|multipath) {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" "IPv6 prefix /\n" "Display only the bestpath\n" "Display only multipaths\n" "JavaScript Object Notation\n") -DEFUN (show_bgp_view_prefix_list, - show_bgp_view_prefix_list_cmd, - "show bgp (view|vrf) WORD prefix-list WORD", +DEFUN (show_bgp_instance_prefix_list, + show_bgp_instance_prefix_list_cmd, + "show bgp " BGP_INSTANCE_CMD " prefix-list WORD", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Display routes conforming to the prefix-list\n" "IPv6 prefix-list name\n") { @@ -8400,24 +8385,22 @@ DEFUN (show_bgp_view_prefix_list, bgp_show_type_prefix_list); } -ALIAS (show_bgp_view_prefix_list, - show_bgp_view_ipv6_prefix_list_cmd, - "show bgp (view|vrf) WORD ipv6 prefix-list WORD", +ALIAS (show_bgp_instance_prefix_list, + show_bgp_instance_ipv6_prefix_list_cmd, + "show bgp " BGP_INSTANCE_CMD " ipv6 prefix-list WORD", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" "Display routes conforming to the prefix-list\n" "IPv6 prefix-list name\n") -DEFUN (show_bgp_view_filter_list, - show_bgp_view_filter_list_cmd, - "show bgp (view|vrf) WORD filter-list WORD", +DEFUN (show_bgp_instance_filter_list, + show_bgp_instance_filter_list_cmd, + "show bgp " BGP_INSTANCE_CMD " filter-list WORD", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Display routes conforming to the filter-list\n" "Regular expression access list name\n") { @@ -8425,24 +8408,22 @@ DEFUN (show_bgp_view_filter_list, bgp_show_type_filter_list); } -ALIAS (show_bgp_view_filter_list, - show_bgp_view_ipv6_filter_list_cmd, - "show bgp (view|vrf) WORD ipv6 filter-list WORD", +ALIAS (show_bgp_instance_filter_list, + show_bgp_instance_ipv6_filter_list_cmd, + "show bgp " BGP_INSTANCE_CMD " ipv6 filter-list WORD", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" "Display routes conforming to the filter-list\n" "Regular expression access list name\n") -DEFUN (show_bgp_view_route_map, - show_bgp_view_route_map_cmd, - "show bgp (view|vrf) WORD route-map WORD", +DEFUN (show_bgp_instance_route_map, + show_bgp_instance_route_map_cmd, + "show bgp " BGP_INSTANCE_CMD " route-map WORD", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Display routes matching the route-map\n" "A route-map to match on\n") { @@ -8450,24 +8431,22 @@ DEFUN (show_bgp_view_route_map, bgp_show_type_route_map); } -ALIAS (show_bgp_view_route_map, - show_bgp_view_ipv6_route_map_cmd, - "show bgp (view|vrf) WORD ipv6 route-map WORD", +ALIAS (show_bgp_instance_route_map, + show_bgp_instance_ipv6_route_map_cmd, + "show bgp " BGP_INSTANCE_CMD " ipv6 route-map WORD", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" "Display routes matching the route-map\n" "A route-map to match on\n") -DEFUN (show_bgp_view_community_list, - show_bgp_view_community_list_cmd, - "show bgp (view|vrf) WORD community-list (<1-500>|WORD)", +DEFUN (show_bgp_instance_community_list, + show_bgp_instance_community_list_cmd, + "show bgp " BGP_INSTANCE_CMD " community-list (<1-500>|WORD)", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Display routes matching the community-list\n" "community-list number\n" "community-list name\n") @@ -8475,25 +8454,23 @@ DEFUN (show_bgp_view_community_list, return bgp_show_community_list (vty, argv[1], argv[2], 0, AFI_IP6, SAFI_UNICAST); } -ALIAS (show_bgp_view_community_list, - show_bgp_view_ipv6_community_list_cmd, - "show bgp (view|vrf) WORD ipv6 community-list (<1-500>|WORD)", +ALIAS (show_bgp_instance_community_list, + show_bgp_instance_ipv6_community_list_cmd, + "show bgp " BGP_INSTANCE_CMD " ipv6 community-list (<1-500>|WORD)", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" "Display routes matching the community-list\n" "community-list number\n" "community-list name\n") -DEFUN (show_bgp_view_prefix_longer, - show_bgp_view_prefix_longer_cmd, - "show bgp (view|vrf) WORD X:X::X:X/M longer-prefixes", +DEFUN (show_bgp_instance_prefix_longer, + show_bgp_instance_prefix_longer_cmd, + "show bgp " BGP_INSTANCE_CMD " X:X::X:X/M longer-prefixes", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "IPv6 prefix /\n" "Display route and more specific routes\n") { @@ -8501,13 +8478,12 @@ DEFUN (show_bgp_view_prefix_longer, bgp_show_type_prefix_longer); } -ALIAS (show_bgp_view_prefix_longer, - show_bgp_view_ipv6_prefix_longer_cmd, - "show bgp (view|vrf) WORD ipv6 X:X::X:X/M longer-prefixes", +ALIAS (show_bgp_instance_prefix_longer, + show_bgp_instance_ipv6_prefix_longer_cmd, + "show bgp " BGP_INSTANCE_CMD " ipv6 X:X::X:X/M longer-prefixes", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" "IPv6 prefix /\n" "Display route and more specific routes\n") @@ -8739,14 +8715,13 @@ DEFUN (show_ip_bgp_prefix_list, bgp_show_type_prefix_list); } -DEFUN (show_ip_bgp_view_prefix_list, - show_ip_bgp_view_prefix_list_cmd, - "show ip bgp (view|vrf) WORD prefix-list WORD", +DEFUN (show_ip_bgp_instance_prefix_list, + show_ip_bgp_instance_prefix_list_cmd, + "show ip bgp " BGP_INSTANCE_CMD " prefix-list WORD", SHOW_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Display routes conforming to the prefix-list\n" "IP prefix-list name\n") { @@ -8878,14 +8853,13 @@ DEFUN (show_ip_bgp_filter_list, bgp_show_type_filter_list); } -DEFUN (show_ip_bgp_view_filter_list, - show_ip_bgp_view_filter_list_cmd, - "show ip bgp (view|vrf) WORD filter-list WORD", +DEFUN (show_ip_bgp_instance_filter_list, + show_ip_bgp_instance_filter_list_cmd, + "show ip bgp " BGP_INSTANCE_CMD " filter-list WORD", SHOW_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Display routes conforming to the filter-list\n" "Regular expression access list name\n") { @@ -9018,14 +8992,13 @@ DEFUN (show_ip_bgp_route_map, bgp_show_type_route_map); } -DEFUN (show_ip_bgp_view_route_map, - show_ip_bgp_view_route_map_cmd, - "show ip bgp (view|vrf) WORD route-map WORD", +DEFUN (show_ip_bgp_instance_route_map, + show_ip_bgp_instance_route_map_cmd, + "show ip bgp " BGP_INSTANCE_CMD " route-map WORD", SHOW_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Display routes matching the route-map\n" "A route-map to match on\n") { @@ -9440,17 +9413,16 @@ ALIAS (show_ip_bgp_ipv4_community, "Do not advertise to any peer (well-known community)\n" "Do not export to next AS (well-known community)\n") -DEFUN (show_bgp_view_afi_safi_community_all, - show_bgp_view_afi_safi_community_all_cmd, +DEFUN (show_bgp_instance_afi_safi_community_all, + show_bgp_instance_afi_safi_community_all_cmd, #ifdef HAVE_IPV6 - "show bgp (view|vrf) WORD (ipv4|ipv6) (unicast|multicast) community", + "show bgp " BGP_INSTANCE_CMD " (ipv4|ipv6) (unicast|multicast) community", #else - "show bgp (view|vrf) WORD ipv4 (unicast|multicast) community", + "show bgp " BGP_INSTANCE_CMD " ipv4 (unicast|multicast) community", #endif SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" #ifdef HAVE_IPV6 "Address family\n" @@ -9481,17 +9453,16 @@ DEFUN (show_bgp_view_afi_safi_community_all, return bgp_show (vty, bgp, afi, safi, bgp_show_type_community_all, NULL, 0); } -DEFUN (show_bgp_view_afi_safi_community, - show_bgp_view_afi_safi_community_cmd, +DEFUN (show_bgp_instance_afi_safi_community, + show_bgp_instance_afi_safi_community_cmd, #ifdef HAVE_IPV6 - "show bgp (view|vrf) WORD (ipv4|ipv6) (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export)", + "show bgp " BGP_INSTANCE_CMD " (ipv4|ipv6) (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export)", #else - "show bgp (view|vrf) WORD ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export)", + "show bgp " BGP_INSTANCE_CMD " ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export)", #endif SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" #ifdef HAVE_IPV6 "Address family\n" @@ -9518,17 +9489,16 @@ DEFUN (show_bgp_view_afi_safi_community, #endif } -ALIAS (show_bgp_view_afi_safi_community, - show_bgp_view_afi_safi_community2_cmd, +ALIAS (show_bgp_instance_afi_safi_community, + show_bgp_instance_afi_safi_community2_cmd, #ifdef HAVE_IPV6 - "show bgp (view|vrf) WORD (ipv4|ipv6) (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)", + "show bgp " BGP_INSTANCE_CMD " (ipv4|ipv6) (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)", #else - "show bgp (view|vrf) WORD ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)", + "show bgp " BGP_INSTANCE_CMD " ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)", #endif SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" #ifdef HAVE_IPV6 "Address family\n" @@ -9545,17 +9515,16 @@ ALIAS (show_bgp_view_afi_safi_community, "Do not advertise to any peer (well-known community)\n" "Do not export to next AS (well-known community)\n") -ALIAS (show_bgp_view_afi_safi_community, - show_bgp_view_afi_safi_community3_cmd, +ALIAS (show_bgp_instance_afi_safi_community, + show_bgp_instance_afi_safi_community3_cmd, #ifdef HAVE_IPV6 - "show bgp (view|vrf) WORD (ipv4|ipv6) (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)", + "show bgp " BGP_INSTANCE_CMD " (ipv4|ipv6) (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)", #else - "show bgp (view|vrf) WORD ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)", + "show bgp " BGP_INSTANCE_CMD " ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)", #endif SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" #ifdef HAVE_IPV6 "Address family\n" @@ -9576,17 +9545,16 @@ ALIAS (show_bgp_view_afi_safi_community, "Do not advertise to any peer (well-known community)\n" "Do not export to next AS (well-known community)\n") -ALIAS (show_bgp_view_afi_safi_community, - show_bgp_view_afi_safi_community4_cmd, +ALIAS (show_bgp_instance_afi_safi_community, + show_bgp_instance_afi_safi_community4_cmd, #ifdef HAVE_IPV6 - "show bgp (view|vrf) WORD (ipv4|ipv6) (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)", + "show bgp " BGP_INSTANCE_CMD " (ipv4|ipv6) (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)", #else - "show bgp (view|vrf) WORD ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)", + "show bgp " BGP_INSTANCE_CMD " ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)", #endif SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" #ifdef HAVE_IPV6 "Address family\n" @@ -10448,14 +10416,13 @@ DEFUN (show_ip_bgp_community_list, return bgp_show_community_list (vty, NULL, argv[0], 0, AFI_IP, SAFI_UNICAST); } -DEFUN (show_ip_bgp_view_community_list, - show_ip_bgp_view_community_list_cmd, - "show ip bgp (view|vrf) WORD community-list (<1-500>|WORD)", +DEFUN (show_ip_bgp_instance_community_list, + show_ip_bgp_instance_community_list_cmd, + "show ip bgp " BGP_INSTANCE_CMD " community-list (<1-500>|WORD)", SHOW_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Display routes matching the community-list\n" "community-list number\n" "community-list name\n") @@ -10664,14 +10631,13 @@ DEFUN (show_ip_bgp_prefix_longer, bgp_show_type_prefix_longer); } -DEFUN (show_ip_bgp_view_prefix_longer, - show_ip_bgp_view_prefix_longer_cmd, - "show ip bgp (view|vrf) WORD A.B.C.D/M longer-prefixes", +DEFUN (show_ip_bgp_instance_prefix_longer, + show_ip_bgp_instance_prefix_longer_cmd, + "show ip bgp " BGP_INSTANCE_CMD " A.B.C.D/M longer-prefixes", SHOW_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "IP prefix /, e.g., 35.0.0.0/8\n" "Display route and more specific routes\n") { @@ -11211,10 +11177,10 @@ ALIAS (show_bgp_statistics, DEFUN (show_bgp_statistics_view, show_bgp_statistics_view_cmd, - "show bgp (view|vrf) WORD (ipv4|ipv6) (unicast|multicast) statistics", + "show bgp " BGP_INSTANCE_CMD " (ipv4|ipv6) (unicast|multicast) statistics", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" + BGP_INSTANCE_HELP_STR "Address family\n" "Address family\n" "Address Family modifier\n" @@ -11226,10 +11192,10 @@ DEFUN (show_bgp_statistics_view, ALIAS (show_bgp_statistics_view, show_bgp_statistics_view_vpnv4_cmd, - "show bgp (view|vrf) WORD (ipv4) (vpnv4) statistics", + "show bgp " BGP_INSTANCE_CMD " (ipv4) (vpnv4) statistics", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" + BGP_INSTANCE_HELP_STR "Address family\n" "Address Family modifier\n" "BGP RIB advertisement statistics\n") @@ -11448,14 +11414,13 @@ DEFUN (show_ip_bgp_neighbor_prefix_counts, return bgp_peer_counts (vty, peer, AFI_IP, SAFI_UNICAST, uj); } -DEFUN (show_ip_bgp_view_neighbor_prefix_counts, - show_ip_bgp_view_neighbor_prefix_counts_cmd, - "show ip bgp (view|vrf) WORD neighbors (A.B.C.D|X:X::X:X|WORD) prefix-counts {json}", +DEFUN (show_ip_bgp_instance_neighbor_prefix_counts, + show_ip_bgp_instance_neighbor_prefix_counts_cmd, + "show ip bgp " BGP_INSTANCE_CMD " neighbors (A.B.C.D|X:X::X:X|WORD) prefix-counts {json}", SHOW_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Detailed information on TCP and BGP neighbor connections\n" "Neighbor to display information about\n" "Neighbor to display information about\n" @@ -11496,13 +11461,12 @@ DEFUN (show_bgp_ipv6_neighbor_prefix_counts, return bgp_peer_counts (vty, peer, AFI_IP6, SAFI_UNICAST, uj); } -DEFUN (show_bgp_view_ipv6_neighbor_prefix_counts, - show_bgp_view_ipv6_neighbor_prefix_counts_cmd, - "show bgp (view|vrf) WORD ipv6 neighbors (A.B.C.D|X:X::X:X|WORD) prefix-counts {json}", +DEFUN (show_bgp_instance_ipv6_neighbor_prefix_counts, + show_bgp_instance_ipv6_neighbor_prefix_counts_cmd, + "show bgp " BGP_INSTANCE_CMD " ipv6 neighbors (A.B.C.D|X:X::X:X|WORD) prefix-counts {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" "Detailed information on TCP and BGP neighbor connections\n" "Neighbor to display information about\n" @@ -11816,14 +11780,13 @@ peer_adj_routes (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, return CMD_SUCCESS; } -DEFUN (show_ip_bgp_view_neighbor_advertised_route, - show_ip_bgp_view_neighbor_advertised_route_cmd, - "show ip bgp (view|vrf) WORD neighbors (A.B.C.D|X:X::X:X|WORD) advertised-routes {json}", +DEFUN (show_ip_bgp_instance_neighbor_advertised_route, + show_ip_bgp_instance_neighbor_advertised_route_cmd, + "show ip bgp " BGP_INSTANCE_CMD " neighbors (A.B.C.D|X:X::X:X|WORD) advertised-routes {json}", SHOW_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Detailed information on TCP and BGP neighbor connections\n" "Neighbor to display information about\n" "Neighbor to display information about\n" @@ -11887,14 +11850,13 @@ ALIAS (show_ip_bgp_neighbor_advertised_route, "Display the routes advertised to a BGP neighbor\n" "JavaScript Object Notation\n") -ALIAS (show_ip_bgp_view_neighbor_advertised_route, - show_ip_bgp_view_neighbor_advertised_route_rmap_cmd, - "show ip bgp (view|vrf) WORD neighbors (A.B.C.D|X:X::X:X|WORD) advertised-routes route-map WORD {json}", +ALIAS (show_ip_bgp_instance_neighbor_advertised_route, + show_ip_bgp_instance_neighbor_advertised_route_rmap_cmd, + "show ip bgp " BGP_INSTANCE_CMD " neighbors (A.B.C.D|X:X::X:X|WORD) advertised-routes route-map WORD {json}", SHOW_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Detailed information on TCP and BGP neighbor connections\n" "Neighbor to display information about\n" "Neighbor to display information about\n" @@ -11952,13 +11914,12 @@ ALIAS (show_ip_bgp_ipv4_neighbor_advertised_route, "JavaScript Object Notation\n") #ifdef HAVE_IPV6 -DEFUN (show_bgp_view_neighbor_advertised_route, - show_bgp_view_neighbor_advertised_route_cmd, - "show bgp (view|vrf) WORD neighbors (A.B.C.D|X:X::X:X|WORD) advertised-routes {json}", +DEFUN (show_bgp_instance_neighbor_advertised_route, + show_bgp_instance_neighbor_advertised_route_cmd, + "show bgp " BGP_INSTANCE_CMD " neighbors (A.B.C.D|X:X::X:X|WORD) advertised-routes {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Detailed information on TCP and BGP neighbor connections\n" "Neighbor to display information about\n" "Neighbor to display information about\n" @@ -11980,13 +11941,12 @@ DEFUN (show_bgp_view_neighbor_advertised_route, return peer_adj_routes (vty, peer, AFI_IP6, SAFI_UNICAST, 0, NULL, uj); } -ALIAS (show_bgp_view_neighbor_advertised_route, - show_bgp_view_ipv6_neighbor_advertised_route_cmd, - "show bgp (view|vrf) WORD ipv6 neighbors (A.B.C.D|X:X::X:X|WORD) advertised-routes {json}", +ALIAS (show_bgp_instance_neighbor_advertised_route, + show_bgp_instance_ipv6_neighbor_advertised_route_cmd, + "show bgp " BGP_INSTANCE_CMD " ipv6 neighbors (A.B.C.D|X:X::X:X|WORD) advertised-routes {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" "Detailed information on TCP and BGP neighbor connections\n" "Neighbor to display information about\n" @@ -12077,13 +12037,12 @@ DEFUN (ipv6_mbgp_neighbor_advertised_route, } #endif /* HAVE_IPV6 */ -DEFUN (show_bgp_view_neighbor_received_routes, - show_bgp_view_neighbor_received_routes_cmd, - "show bgp (view|vrf) WORD neighbors (A.B.C.D|X:X::X:X|WORD) received-routes {json}", +DEFUN (show_bgp_instance_neighbor_received_routes, + show_bgp_instance_neighbor_received_routes_cmd, + "show bgp " BGP_INSTANCE_CMD " neighbors (A.B.C.D|X:X::X:X|WORD) received-routes {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Detailed information on TCP and BGP neighbor connections\n" "Neighbor to display information about\n" "Neighbor to display information about\n" @@ -12101,14 +12060,13 @@ DEFUN (show_bgp_view_neighbor_received_routes, return peer_adj_routes (vty, peer, AFI_IP6, SAFI_UNICAST, 1, NULL, uj); } -DEFUN (show_ip_bgp_view_neighbor_received_routes, - show_ip_bgp_view_neighbor_received_routes_cmd, - "show ip bgp (view|vrf) WORD neighbors (A.B.C.D|X:X::X:X|WORD) received-routes {json}", +DEFUN (show_ip_bgp_instance_neighbor_received_routes, + show_ip_bgp_instance_neighbor_received_routes_cmd, + "show ip bgp " BGP_INSTANCE_CMD " neighbors (A.B.C.D|X:X::X:X|WORD) received-routes {json}", SHOW_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Detailed information on TCP and BGP neighbor connections\n" "Neighbor to display information about\n" "Neighbor to display information about\n" @@ -12126,13 +12084,12 @@ DEFUN (show_ip_bgp_view_neighbor_received_routes, return peer_adj_routes (vty, peer, AFI_IP, SAFI_UNICAST, 1, NULL, uj); } -ALIAS (show_bgp_view_neighbor_received_routes, - show_bgp_view_ipv6_neighbor_received_routes_cmd, - "show bgp (view|vrf) WORD ipv6 neighbors (A.B.C.D|X:X::X:X|WORD) received-routes {json}", +ALIAS (show_bgp_instance_neighbor_received_routes, + show_bgp_instance_ipv6_neighbor_received_routes_cmd, + "show bgp " BGP_INSTANCE_CMD " ipv6 neighbors (A.B.C.D|X:X::X:X|WORD) received-routes {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" "Detailed information on TCP and BGP neighbor connections\n" "Neighbor to display information about\n" @@ -12183,14 +12140,13 @@ ALIAS (show_ip_bgp_neighbor_received_routes, "Display the received routes from neighbor\n" "JavaScript Object Notation\n") -ALIAS (show_ip_bgp_view_neighbor_received_routes, - show_ip_bgp_view_neighbor_received_routes_rmap_cmd, - "show ip bgp (view|vrf) WORD neighbors (A.B.C.D|X:X::X:X|WORD) received-routes route-map WORD {json}", +ALIAS (show_ip_bgp_instance_neighbor_received_routes, + show_ip_bgp_instance_neighbor_received_routes_rmap_cmd, + "show ip bgp " BGP_INSTANCE_CMD " neighbors (A.B.C.D|X:X::X:X|WORD) received-routes route-map WORD {json}", SHOW_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Detailed information on TCP and BGP neighbor connections\n" "Neighbor to display information about\n" "Neighbor to display information about\n" @@ -12247,17 +12203,16 @@ ALIAS (show_ip_bgp_ipv4_neighbor_received_routes, "Display the received routes from neighbor\n" "JavaScript Object Notation\n") -DEFUN (show_bgp_view_afi_safi_neighbor_adv_recd_routes, - show_bgp_view_afi_safi_neighbor_adv_recd_routes_cmd, +DEFUN (show_bgp_instance_afi_safi_neighbor_adv_recd_routes, + show_bgp_instance_afi_safi_neighbor_adv_recd_routes_cmd, #ifdef HAVE_IPV6 - "show bgp (view|vrf) WORD (ipv4|ipv6) (unicast|multicast) neighbors (A.B.C.D|X:X::X:X|WORD) (advertised-routes|received-routes) {json}", + "show bgp " BGP_INSTANCE_CMD " (ipv4|ipv6) (unicast|multicast) neighbors (A.B.C.D|X:X::X:X|WORD) (advertised-routes|received-routes) {json}", #else - "show bgp (view|vrf) WORD ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X|WORD) (advertised-routes|received-routes) {json}", + "show bgp " BGP_INSTANCE_CMD " ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X|WORD) (advertised-routes|received-routes) {json}", #endif SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" #ifdef HAVE_IPV6 "Address family\n" @@ -12673,13 +12628,12 @@ DEFUN (ipv6_mbgp_neighbor_received_routes, return peer_adj_routes (vty, peer, AFI_IP6, SAFI_MULTICAST, 1, NULL, uj); } -DEFUN (show_bgp_view_neighbor_received_prefix_filter, - show_bgp_view_neighbor_received_prefix_filter_cmd, - "show bgp (view|vrf) WORD neighbors (A.B.C.D|X:X::X:X|WORD) received prefix-filter {json}", +DEFUN (show_bgp_instance_neighbor_received_prefix_filter, + show_bgp_instance_neighbor_received_prefix_filter_cmd, + "show bgp " BGP_INSTANCE_CMD " neighbors (A.B.C.D|X:X::X:X|WORD) received prefix-filter {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Detailed information on TCP and BGP neighbor connections\n" "Neighbor to display information about\n" "Neighbor to display information about\n" @@ -12766,13 +12720,12 @@ DEFUN (show_bgp_view_neighbor_received_prefix_filter, return CMD_SUCCESS; } -ALIAS (show_bgp_view_neighbor_received_prefix_filter, - show_bgp_view_ipv6_neighbor_received_prefix_filter_cmd, - "show bgp (view|vrf) WORD ipv6 neighbors (A.B.C.D|X:X::X:X|WORD) received prefix-filter {json}", +ALIAS (show_bgp_instance_neighbor_received_prefix_filter, + show_bgp_instance_ipv6_neighbor_received_prefix_filter_cmd, + "show bgp " BGP_INSTANCE_CMD " ipv6 neighbors (A.B.C.D|X:X::X:X|WORD) received prefix-filter {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" "Detailed information on TCP and BGP neighbor connections\n" "Neighbor to display information about\n" @@ -12829,14 +12782,13 @@ DEFUN (show_ip_bgp_neighbor_routes, bgp_show_type_neighbor, uj); } -DEFUN (show_ip_bgp_view_neighbor_routes, - show_ip_bgp_view_neighbor_routes_cmd, - "show ip bgp (view|vrf) WORD neighbors (A.B.C.D|X:X::X:X|WORD) routes {json}", +DEFUN (show_ip_bgp_instance_neighbor_routes, + show_ip_bgp_instance_neighbor_routes_cmd, + "show ip bgp " BGP_INSTANCE_CMD " neighbors (A.B.C.D|X:X::X:X|WORD) routes {json}", SHOW_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Detailed information on TCP and BGP neighbor connections\n" "Neighbor to display information about\n" "Neighbor to display information about\n" @@ -12935,13 +12887,12 @@ DEFUN (show_ip_bgp_ipv4_neighbor_routes, } #ifdef HAVE_IPV6 -DEFUN (show_bgp_view_neighbor_routes, - show_bgp_view_neighbor_routes_cmd, - "show bgp (view|vrf) WORD neighbors (A.B.C.D|X:X::X:X|WORD) routes {json}", +DEFUN (show_bgp_instance_neighbor_routes, + show_bgp_instance_neighbor_routes_cmd, + "show bgp " BGP_INSTANCE_CMD " neighbors (A.B.C.D|X:X::X:X|WORD) routes {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Detailed information on TCP and BGP neighbor connections\n" "Neighbor to display information about\n" "Neighbor to display information about\n" @@ -12960,13 +12911,12 @@ DEFUN (show_bgp_view_neighbor_routes, bgp_show_type_neighbor, uj); } -ALIAS (show_bgp_view_neighbor_routes, - show_bgp_view_ipv6_neighbor_routes_cmd, - "show bgp (view|vrf) WORD ipv6 neighbors (A.B.C.D|X:X::X:X|WORD) routes {json}", +ALIAS (show_bgp_instance_neighbor_routes, + show_bgp_instance_ipv6_neighbor_routes_cmd, + "show bgp " BGP_INSTANCE_CMD " ipv6 neighbors (A.B.C.D|X:X::X:X|WORD) routes {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" "Detailed information on TCP and BGP neighbor connections\n" "Neighbor to display information about\n" @@ -12975,13 +12925,12 @@ ALIAS (show_bgp_view_neighbor_routes, "Display routes learned from neighbor\n" "JavaScript Object Notation\n") -DEFUN (show_bgp_view_neighbor_damp, - show_bgp_view_neighbor_damp_cmd, - "show bgp (view|vrf) WORD neighbors (A.B.C.D|X:X::X:X|WORD) dampened-routes {json}", +DEFUN (show_bgp_instance_neighbor_damp, + show_bgp_instance_neighbor_damp_cmd, + "show bgp " BGP_INSTANCE_CMD " neighbors (A.B.C.D|X:X::X:X|WORD) dampened-routes {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Detailed information on TCP and BGP neighbor connections\n" "Neighbor to display information about\n" "Neighbor to display information about\n" @@ -13005,13 +12954,12 @@ DEFUN (show_bgp_view_neighbor_damp, bgp_show_type_damp_neighbor, uj); } -ALIAS (show_bgp_view_neighbor_damp, - show_bgp_view_ipv6_neighbor_damp_cmd, - "show bgp (view|vrf) WORD ipv6 neighbors (A.B.C.D|X:X::X:X|WORD) dampened-routes {json}", +ALIAS (show_bgp_instance_neighbor_damp, + show_bgp_instance_ipv6_neighbor_damp_cmd, + "show bgp " BGP_INSTANCE_CMD " ipv6 neighbors (A.B.C.D|X:X::X:X|WORD) dampened-routes {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" "Detailed information on TCP and BGP neighbor connections\n" "Neighbor to display information about\n" @@ -13020,13 +12968,12 @@ ALIAS (show_bgp_view_neighbor_damp, "Display the dampened routes received from neighbor\n" "JavaScript Object Notation\n") -DEFUN (show_bgp_view_neighbor_flap, - show_bgp_view_neighbor_flap_cmd, - "show bgp (view|vrf) WORD neighbors (A.B.C.D|X:X::X:X|WORD) flap-statistics {json}", +DEFUN (show_bgp_instance_neighbor_flap, + show_bgp_instance_neighbor_flap_cmd, + "show bgp " BGP_INSTANCE_CMD " neighbors (A.B.C.D|X:X::X:X|WORD) flap-statistics {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Detailed information on TCP and BGP neighbor connections\n" "Neighbor to display information about\n" "Neighbor to display information about\n" @@ -13050,13 +12997,12 @@ DEFUN (show_bgp_view_neighbor_flap, bgp_show_type_flap_neighbor, uj); } -ALIAS (show_bgp_view_neighbor_flap, - show_bgp_view_ipv6_neighbor_flap_cmd, - "show bgp (view|vrf) WORD ipv6 neighbors (A.B.C.D|X:X::X:X|WORD) flap-statistics {json}", +ALIAS (show_bgp_instance_neighbor_flap, + show_bgp_instance_ipv6_neighbor_flap_cmd, + "show bgp " BGP_INSTANCE_CMD " ipv6 neighbors (A.B.C.D|X:X::X:X|WORD) flap-statistics {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" "Detailed information on TCP and BGP neighbor connections\n" "Neighbor to display information about\n" @@ -13142,7 +13088,7 @@ DEFUN (ipv6_mbgp_neighbor_routes, bgp_show_type_neighbor, uj); } -ALIAS (show_bgp_view_neighbor_flap, +ALIAS (show_bgp_instance_neighbor_flap, show_bgp_neighbor_flap_cmd, "show bgp neighbors (A.B.C.D|X:X::X:X|WORD) flap-statistics {json}", SHOW_STR @@ -13154,7 +13100,7 @@ ALIAS (show_bgp_view_neighbor_flap, "Display flap statistics of the routes learned from neighbor\n" "JavaScript Object Notation\n") -ALIAS (show_bgp_view_neighbor_flap, +ALIAS (show_bgp_instance_neighbor_flap, show_bgp_ipv6_neighbor_flap_cmd, "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X|WORD) flap-statistics {json}", SHOW_STR @@ -13167,7 +13113,7 @@ ALIAS (show_bgp_view_neighbor_flap, "Display flap statistics of the routes learned from neighbor\n" "JavaScript Object Notation\n") -ALIAS (show_bgp_view_neighbor_damp, +ALIAS (show_bgp_instance_neighbor_damp, show_bgp_neighbor_damp_cmd, "show bgp neighbors (A.B.C.D|X:X::X:X|WORD) dampened-routes {json}", SHOW_STR @@ -13179,7 +13125,7 @@ ALIAS (show_bgp_view_neighbor_damp, "Display the dampened routes received from neighbor\n" "JavaScript Object Notation\n") -ALIAS (show_bgp_view_neighbor_damp, +ALIAS (show_bgp_instance_neighbor_damp, show_bgp_ipv6_neighbor_damp_cmd, "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X|WORD) dampened-routes {json}", SHOW_STR @@ -14027,39 +13973,39 @@ bgp_route_init (void) install_element (BGP_IPV4M_NODE, &no_aggregate_address_mask_summary_as_set_cmd); install_element (VIEW_NODE, &show_ip_bgp_cmd); - install_element (VIEW_NODE, &show_ip_bgp_view_cmd); + install_element (VIEW_NODE, &show_ip_bgp_instance_cmd); install_element (VIEW_NODE, &show_ip_bgp_ipv4_cmd); install_element (VIEW_NODE, &show_bgp_ipv4_safi_cmd); install_element (VIEW_NODE, &show_ip_bgp_route_cmd); - install_element (VIEW_NODE, &show_ip_bgp_view_route_cmd); + install_element (VIEW_NODE, &show_ip_bgp_instance_route_cmd); install_element (VIEW_NODE, &show_ip_bgp_route_pathtype_cmd); - install_element (VIEW_NODE, &show_ip_bgp_view_route_pathtype_cmd); + install_element (VIEW_NODE, &show_ip_bgp_instance_route_pathtype_cmd); install_element (VIEW_NODE, &show_bgp_ipv4_safi_route_pathtype_cmd); install_element (VIEW_NODE, &show_ip_bgp_ipv4_route_cmd); install_element (VIEW_NODE, &show_bgp_ipv4_safi_route_cmd); install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_route_cmd); install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_route_cmd); install_element (VIEW_NODE, &show_ip_bgp_prefix_cmd); - install_element (VIEW_NODE, &show_ip_bgp_view_prefix_cmd); + install_element (VIEW_NODE, &show_ip_bgp_instance_prefix_cmd); install_element (VIEW_NODE, &show_ip_bgp_ipv4_prefix_cmd); install_element (VIEW_NODE, &show_ip_bgp_ipv4_prefix_pathtype_cmd); install_element (VIEW_NODE, &show_bgp_ipv4_safi_prefix_pathtype_cmd); install_element (VIEW_NODE, &show_bgp_ipv4_safi_prefix_cmd); install_element (VIEW_NODE, &show_ip_bgp_prefix_pathtype_cmd); - install_element (VIEW_NODE, &show_ip_bgp_view_prefix_pathtype_cmd); + install_element (VIEW_NODE, &show_ip_bgp_instance_prefix_pathtype_cmd); install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_prefix_cmd); install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_prefix_cmd); install_element (VIEW_NODE, &show_ip_bgp_regexp_cmd); install_element (VIEW_NODE, &show_ip_bgp_ipv4_regexp_cmd); install_element (VIEW_NODE, &show_ip_bgp_prefix_list_cmd); - install_element (VIEW_NODE, &show_ip_bgp_view_prefix_list_cmd); + install_element (VIEW_NODE, &show_ip_bgp_instance_prefix_list_cmd); install_element (VIEW_NODE, &show_ip_bgp_ipv4_prefix_list_cmd); install_element (VIEW_NODE, &show_ip_bgp_filter_list_cmd); - install_element (VIEW_NODE, &show_ip_bgp_view_filter_list_cmd); + install_element (VIEW_NODE, &show_ip_bgp_instance_filter_list_cmd); install_element (VIEW_NODE, &show_ip_bgp_ipv4_filter_list_cmd); install_element (VIEW_NODE, &show_ip_bgp_route_map_cmd); - install_element (VIEW_NODE, &show_ip_bgp_view_route_map_cmd); + install_element (VIEW_NODE, &show_ip_bgp_instance_route_map_cmd); install_element (VIEW_NODE, &show_ip_bgp_ipv4_route_map_cmd); install_element (VIEW_NODE, &show_ip_bgp_cidr_only_cmd); install_element (VIEW_NODE, &show_ip_bgp_ipv4_cidr_only_cmd); @@ -14073,11 +14019,11 @@ bgp_route_init (void) install_element (VIEW_NODE, &show_ip_bgp_ipv4_community2_cmd); install_element (VIEW_NODE, &show_ip_bgp_ipv4_community3_cmd); install_element (VIEW_NODE, &show_ip_bgp_ipv4_community4_cmd); - install_element (VIEW_NODE, &show_bgp_view_afi_safi_community_all_cmd); - install_element (VIEW_NODE, &show_bgp_view_afi_safi_community_cmd); - install_element (VIEW_NODE, &show_bgp_view_afi_safi_community2_cmd); - install_element (VIEW_NODE, &show_bgp_view_afi_safi_community3_cmd); - install_element (VIEW_NODE, &show_bgp_view_afi_safi_community4_cmd); + install_element (VIEW_NODE, &show_bgp_instance_afi_safi_community_all_cmd); + install_element (VIEW_NODE, &show_bgp_instance_afi_safi_community_cmd); + install_element (VIEW_NODE, &show_bgp_instance_afi_safi_community2_cmd); + install_element (VIEW_NODE, &show_bgp_instance_afi_safi_community3_cmd); + install_element (VIEW_NODE, &show_bgp_instance_afi_safi_community4_cmd); install_element (VIEW_NODE, &show_ip_bgp_community_exact_cmd); install_element (VIEW_NODE, &show_ip_bgp_community2_exact_cmd); install_element (VIEW_NODE, &show_ip_bgp_community3_exact_cmd); @@ -14087,28 +14033,28 @@ bgp_route_init (void) install_element (VIEW_NODE, &show_ip_bgp_ipv4_community3_exact_cmd); install_element (VIEW_NODE, &show_ip_bgp_ipv4_community4_exact_cmd); install_element (VIEW_NODE, &show_ip_bgp_community_list_cmd); - install_element (VIEW_NODE, &show_ip_bgp_view_community_list_cmd); + install_element (VIEW_NODE, &show_ip_bgp_instance_community_list_cmd); install_element (VIEW_NODE, &show_ip_bgp_ipv4_community_list_cmd); install_element (VIEW_NODE, &show_ip_bgp_community_list_exact_cmd); install_element (VIEW_NODE, &show_ip_bgp_ipv4_community_list_exact_cmd); install_element (VIEW_NODE, &show_ip_bgp_prefix_longer_cmd); - install_element (VIEW_NODE, &show_ip_bgp_view_prefix_longer_cmd); + install_element (VIEW_NODE, &show_ip_bgp_instance_prefix_longer_cmd); install_element (VIEW_NODE, &show_ip_bgp_ipv4_prefix_longer_cmd); install_element (VIEW_NODE, &show_ip_bgp_neighbor_advertised_route_cmd); - install_element (VIEW_NODE, &show_ip_bgp_view_neighbor_advertised_route_cmd); + install_element (VIEW_NODE, &show_ip_bgp_instance_neighbor_advertised_route_cmd); install_element (VIEW_NODE, &show_ip_bgp_neighbor_advertised_route_rmap_cmd); - install_element (VIEW_NODE, &show_ip_bgp_view_neighbor_advertised_route_rmap_cmd); + install_element (VIEW_NODE, &show_ip_bgp_instance_neighbor_advertised_route_rmap_cmd); install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbor_advertised_route_cmd); install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbor_advertised_route_rmap_cmd); install_element (VIEW_NODE, &show_ip_bgp_neighbor_received_routes_cmd); - install_element (VIEW_NODE, &show_ip_bgp_view_neighbor_received_routes_cmd); + install_element (VIEW_NODE, &show_ip_bgp_instance_neighbor_received_routes_cmd); install_element (VIEW_NODE, &show_ip_bgp_neighbor_received_routes_rmap_cmd); - install_element (VIEW_NODE, &show_ip_bgp_view_neighbor_received_routes_rmap_cmd); + install_element (VIEW_NODE, &show_ip_bgp_instance_neighbor_received_routes_rmap_cmd); install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbor_received_routes_cmd); install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbor_received_routes_rmap_cmd); - install_element (VIEW_NODE, &show_bgp_view_afi_safi_neighbor_adv_recd_routes_cmd); + install_element (VIEW_NODE, &show_bgp_instance_afi_safi_neighbor_adv_recd_routes_cmd); install_element (VIEW_NODE, &show_ip_bgp_neighbor_routes_cmd); - install_element (VIEW_NODE, &show_ip_bgp_view_neighbor_routes_cmd); + install_element (VIEW_NODE, &show_ip_bgp_instance_neighbor_routes_cmd); install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbor_routes_cmd); install_element (VIEW_NODE, &show_ip_bgp_neighbor_received_prefix_filter_cmd); install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbor_received_prefix_filter_cmd); @@ -14127,25 +14073,25 @@ bgp_route_init (void) /* Restricted node: VIEW_NODE - (set of dangerous commands) */ install_element (RESTRICTED_NODE, &show_ip_bgp_route_cmd); - install_element (RESTRICTED_NODE, &show_ip_bgp_view_route_cmd); + install_element (RESTRICTED_NODE, &show_ip_bgp_instance_route_cmd); install_element (RESTRICTED_NODE, &show_ip_bgp_route_pathtype_cmd); - install_element (RESTRICTED_NODE, &show_ip_bgp_view_route_pathtype_cmd); + install_element (RESTRICTED_NODE, &show_ip_bgp_instance_route_pathtype_cmd); install_element (RESTRICTED_NODE, &show_bgp_ipv4_safi_route_pathtype_cmd); install_element (RESTRICTED_NODE, &show_ip_bgp_ipv4_route_cmd); install_element (RESTRICTED_NODE, &show_bgp_ipv4_safi_route_cmd); install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_rd_route_cmd); install_element (RESTRICTED_NODE, &show_ip_bgp_prefix_cmd); - install_element (RESTRICTED_NODE, &show_ip_bgp_view_prefix_cmd); + install_element (RESTRICTED_NODE, &show_ip_bgp_instance_prefix_cmd); install_element (RESTRICTED_NODE, &show_ip_bgp_ipv4_prefix_cmd); install_element (RESTRICTED_NODE, &show_ip_bgp_ipv4_prefix_pathtype_cmd); install_element (RESTRICTED_NODE, &show_bgp_ipv4_safi_prefix_pathtype_cmd); install_element (RESTRICTED_NODE, &show_bgp_ipv4_safi_prefix_cmd); install_element (RESTRICTED_NODE, &show_ip_bgp_prefix_pathtype_cmd); - install_element (RESTRICTED_NODE, &show_ip_bgp_view_prefix_pathtype_cmd); + install_element (RESTRICTED_NODE, &show_ip_bgp_instance_prefix_pathtype_cmd); install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_all_prefix_cmd); install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_rd_prefix_cmd); - install_element (RESTRICTED_NODE, &show_ip_bgp_view_route_cmd); - install_element (RESTRICTED_NODE, &show_ip_bgp_view_prefix_cmd); + install_element (RESTRICTED_NODE, &show_ip_bgp_instance_route_cmd); + install_element (RESTRICTED_NODE, &show_ip_bgp_instance_prefix_cmd); install_element (RESTRICTED_NODE, &show_ip_bgp_community_cmd); install_element (RESTRICTED_NODE, &show_ip_bgp_community2_cmd); install_element (RESTRICTED_NODE, &show_ip_bgp_community3_cmd); @@ -14154,11 +14100,11 @@ bgp_route_init (void) install_element (RESTRICTED_NODE, &show_ip_bgp_ipv4_community2_cmd); install_element (RESTRICTED_NODE, &show_ip_bgp_ipv4_community3_cmd); install_element (RESTRICTED_NODE, &show_ip_bgp_ipv4_community4_cmd); - install_element (RESTRICTED_NODE, &show_bgp_view_afi_safi_community_all_cmd); - install_element (RESTRICTED_NODE, &show_bgp_view_afi_safi_community_cmd); - install_element (RESTRICTED_NODE, &show_bgp_view_afi_safi_community2_cmd); - install_element (RESTRICTED_NODE, &show_bgp_view_afi_safi_community3_cmd); - install_element (RESTRICTED_NODE, &show_bgp_view_afi_safi_community4_cmd); + install_element (RESTRICTED_NODE, &show_bgp_instance_afi_safi_community_all_cmd); + install_element (RESTRICTED_NODE, &show_bgp_instance_afi_safi_community_cmd); + install_element (RESTRICTED_NODE, &show_bgp_instance_afi_safi_community2_cmd); + install_element (RESTRICTED_NODE, &show_bgp_instance_afi_safi_community3_cmd); + install_element (RESTRICTED_NODE, &show_bgp_instance_afi_safi_community4_cmd); install_element (RESTRICTED_NODE, &show_ip_bgp_community_exact_cmd); install_element (RESTRICTED_NODE, &show_ip_bgp_community2_exact_cmd); install_element (RESTRICTED_NODE, &show_ip_bgp_community3_exact_cmd); @@ -14169,39 +14115,39 @@ bgp_route_init (void) install_element (RESTRICTED_NODE, &show_ip_bgp_ipv4_community4_exact_cmd); install_element (ENABLE_NODE, &show_ip_bgp_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_view_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_instance_cmd); install_element (ENABLE_NODE, &show_ip_bgp_ipv4_cmd); install_element (ENABLE_NODE, &show_bgp_ipv4_safi_cmd); install_element (ENABLE_NODE, &show_ip_bgp_route_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_view_route_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_instance_route_cmd); install_element (ENABLE_NODE, &show_ip_bgp_route_pathtype_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_view_route_pathtype_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_instance_route_pathtype_cmd); install_element (ENABLE_NODE, &show_bgp_ipv4_safi_route_pathtype_cmd); install_element (ENABLE_NODE, &show_ip_bgp_ipv4_route_cmd); install_element (ENABLE_NODE, &show_bgp_ipv4_safi_route_cmd); install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_all_route_cmd); install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_rd_route_cmd); install_element (ENABLE_NODE, &show_ip_bgp_prefix_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_view_prefix_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_instance_prefix_cmd); install_element (ENABLE_NODE, &show_ip_bgp_ipv4_prefix_cmd); install_element (ENABLE_NODE, &show_ip_bgp_ipv4_prefix_pathtype_cmd); install_element (ENABLE_NODE, &show_bgp_ipv4_safi_prefix_pathtype_cmd); install_element (ENABLE_NODE, &show_bgp_ipv4_safi_prefix_cmd); install_element (ENABLE_NODE, &show_ip_bgp_prefix_pathtype_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_view_prefix_pathtype_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_instance_prefix_pathtype_cmd); install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_all_prefix_cmd); install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_rd_prefix_cmd); install_element (ENABLE_NODE, &show_ip_bgp_regexp_cmd); install_element (ENABLE_NODE, &show_ip_bgp_ipv4_regexp_cmd); install_element (ENABLE_NODE, &show_ip_bgp_prefix_list_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_view_prefix_list_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_instance_prefix_list_cmd); install_element (ENABLE_NODE, &show_ip_bgp_ipv4_prefix_list_cmd); install_element (ENABLE_NODE, &show_ip_bgp_filter_list_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_view_filter_list_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_instance_filter_list_cmd); install_element (ENABLE_NODE, &show_ip_bgp_ipv4_filter_list_cmd); install_element (ENABLE_NODE, &show_ip_bgp_route_map_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_view_route_map_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_instance_route_map_cmd); install_element (ENABLE_NODE, &show_ip_bgp_ipv4_route_map_cmd); install_element (ENABLE_NODE, &show_ip_bgp_cidr_only_cmd); install_element (ENABLE_NODE, &show_ip_bgp_ipv4_cidr_only_cmd); @@ -14215,11 +14161,11 @@ bgp_route_init (void) install_element (ENABLE_NODE, &show_ip_bgp_ipv4_community2_cmd); install_element (ENABLE_NODE, &show_ip_bgp_ipv4_community3_cmd); install_element (ENABLE_NODE, &show_ip_bgp_ipv4_community4_cmd); - install_element (ENABLE_NODE, &show_bgp_view_afi_safi_community_all_cmd); - install_element (ENABLE_NODE, &show_bgp_view_afi_safi_community_cmd); - install_element (ENABLE_NODE, &show_bgp_view_afi_safi_community2_cmd); - install_element (ENABLE_NODE, &show_bgp_view_afi_safi_community3_cmd); - install_element (ENABLE_NODE, &show_bgp_view_afi_safi_community4_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_afi_safi_community_all_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_afi_safi_community_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_afi_safi_community2_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_afi_safi_community3_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_afi_safi_community4_cmd); install_element (ENABLE_NODE, &show_ip_bgp_community_exact_cmd); install_element (ENABLE_NODE, &show_ip_bgp_community2_exact_cmd); install_element (ENABLE_NODE, &show_ip_bgp_community3_exact_cmd); @@ -14229,28 +14175,28 @@ bgp_route_init (void) install_element (ENABLE_NODE, &show_ip_bgp_ipv4_community3_exact_cmd); install_element (ENABLE_NODE, &show_ip_bgp_ipv4_community4_exact_cmd); install_element (ENABLE_NODE, &show_ip_bgp_community_list_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_view_community_list_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_instance_community_list_cmd); install_element (ENABLE_NODE, &show_ip_bgp_ipv4_community_list_cmd); install_element (ENABLE_NODE, &show_ip_bgp_community_list_exact_cmd); install_element (ENABLE_NODE, &show_ip_bgp_ipv4_community_list_exact_cmd); install_element (ENABLE_NODE, &show_ip_bgp_prefix_longer_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_view_prefix_longer_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_instance_prefix_longer_cmd); install_element (ENABLE_NODE, &show_ip_bgp_ipv4_prefix_longer_cmd); install_element (ENABLE_NODE, &show_ip_bgp_neighbor_advertised_route_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_view_neighbor_advertised_route_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_instance_neighbor_advertised_route_cmd); install_element (ENABLE_NODE, &show_ip_bgp_neighbor_advertised_route_rmap_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_view_neighbor_advertised_route_rmap_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_instance_neighbor_advertised_route_rmap_cmd); install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbor_advertised_route_cmd); install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbor_advertised_route_rmap_cmd); install_element (ENABLE_NODE, &show_ip_bgp_neighbor_received_routes_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_view_neighbor_received_routes_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_instance_neighbor_received_routes_cmd); install_element (ENABLE_NODE, &show_ip_bgp_neighbor_received_routes_rmap_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_view_neighbor_received_routes_rmap_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_instance_neighbor_received_routes_rmap_cmd); install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbor_received_routes_cmd); install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbor_received_routes_rmap_cmd); - install_element (ENABLE_NODE, &show_bgp_view_afi_safi_neighbor_adv_recd_routes_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_afi_safi_neighbor_adv_recd_routes_cmd); install_element (ENABLE_NODE, &show_ip_bgp_neighbor_routes_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_view_neighbor_routes_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_instance_neighbor_routes_cmd); install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbor_routes_cmd); install_element (ENABLE_NODE, &show_ip_bgp_neighbor_received_prefix_filter_cmd); install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbor_received_prefix_filter_cmd); @@ -14275,12 +14221,12 @@ bgp_route_init (void) /* prefix count */ install_element (ENABLE_NODE, &show_ip_bgp_neighbor_prefix_counts_cmd); - install_element (ENABLE_NODE, &show_ip_bgp_view_neighbor_prefix_counts_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_instance_neighbor_prefix_counts_cmd); install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbor_prefix_counts_cmd); install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_neighbor_prefix_counts_cmd); #ifdef HAVE_IPV6 install_element (ENABLE_NODE, &show_bgp_ipv6_neighbor_prefix_counts_cmd); - install_element (ENABLE_NODE, &show_bgp_view_ipv6_neighbor_prefix_counts_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_ipv6_neighbor_prefix_counts_cmd); /* New config IPv6 BGP commands. */ install_element (BGP_IPV6_NODE, &bgp_table_map_cmd); @@ -14366,38 +14312,38 @@ bgp_route_init (void) install_element (VIEW_NODE, &show_bgp_ipv6_neighbor_flap_cmd); install_element (VIEW_NODE, &show_bgp_neighbor_damp_cmd); install_element (VIEW_NODE, &show_bgp_ipv6_neighbor_damp_cmd); - install_element (VIEW_NODE, &show_bgp_view_cmd); - install_element (VIEW_NODE, &show_bgp_view_ipv6_cmd); - install_element (VIEW_NODE, &show_bgp_view_route_cmd); - install_element (VIEW_NODE, &show_bgp_view_ipv6_route_cmd); - install_element (VIEW_NODE, &show_bgp_view_route_pathtype_cmd); - install_element (VIEW_NODE, &show_bgp_view_ipv6_route_pathtype_cmd); - install_element (VIEW_NODE, &show_bgp_view_prefix_cmd); - install_element (VIEW_NODE, &show_bgp_view_ipv6_prefix_cmd); - install_element (VIEW_NODE, &show_bgp_view_prefix_pathtype_cmd); - install_element (VIEW_NODE, &show_bgp_view_ipv6_prefix_pathtype_cmd); - install_element (VIEW_NODE, &show_bgp_view_prefix_list_cmd); - install_element (VIEW_NODE, &show_bgp_view_ipv6_prefix_list_cmd); - install_element (VIEW_NODE, &show_bgp_view_filter_list_cmd); - install_element (VIEW_NODE, &show_bgp_view_ipv6_filter_list_cmd); - install_element (VIEW_NODE, &show_bgp_view_route_map_cmd); - install_element (VIEW_NODE, &show_bgp_view_ipv6_route_map_cmd); - install_element (VIEW_NODE, &show_bgp_view_community_list_cmd); - install_element (VIEW_NODE, &show_bgp_view_ipv6_community_list_cmd); - install_element (VIEW_NODE, &show_bgp_view_prefix_longer_cmd); - install_element (VIEW_NODE, &show_bgp_view_ipv6_prefix_longer_cmd); - install_element (VIEW_NODE, &show_bgp_view_neighbor_advertised_route_cmd); - install_element (VIEW_NODE, &show_bgp_view_ipv6_neighbor_advertised_route_cmd); - install_element (VIEW_NODE, &show_bgp_view_neighbor_received_routes_cmd); - install_element (VIEW_NODE, &show_bgp_view_ipv6_neighbor_received_routes_cmd); - install_element (VIEW_NODE, &show_bgp_view_neighbor_routes_cmd); - install_element (VIEW_NODE, &show_bgp_view_ipv6_neighbor_routes_cmd); - install_element (VIEW_NODE, &show_bgp_view_neighbor_received_prefix_filter_cmd); - install_element (VIEW_NODE, &show_bgp_view_ipv6_neighbor_received_prefix_filter_cmd); - install_element (VIEW_NODE, &show_bgp_view_neighbor_flap_cmd); - install_element (VIEW_NODE, &show_bgp_view_ipv6_neighbor_flap_cmd); - install_element (VIEW_NODE, &show_bgp_view_neighbor_damp_cmd); - install_element (VIEW_NODE, &show_bgp_view_ipv6_neighbor_damp_cmd); + install_element (VIEW_NODE, &show_bgp_instance_cmd); + install_element (VIEW_NODE, &show_bgp_instance_ipv6_cmd); + install_element (VIEW_NODE, &show_bgp_instance_route_cmd); + install_element (VIEW_NODE, &show_bgp_instance_ipv6_route_cmd); + install_element (VIEW_NODE, &show_bgp_instance_route_pathtype_cmd); + install_element (VIEW_NODE, &show_bgp_instance_ipv6_route_pathtype_cmd); + install_element (VIEW_NODE, &show_bgp_instance_prefix_cmd); + install_element (VIEW_NODE, &show_bgp_instance_ipv6_prefix_cmd); + install_element (VIEW_NODE, &show_bgp_instance_prefix_pathtype_cmd); + install_element (VIEW_NODE, &show_bgp_instance_ipv6_prefix_pathtype_cmd); + install_element (VIEW_NODE, &show_bgp_instance_prefix_list_cmd); + install_element (VIEW_NODE, &show_bgp_instance_ipv6_prefix_list_cmd); + install_element (VIEW_NODE, &show_bgp_instance_filter_list_cmd); + install_element (VIEW_NODE, &show_bgp_instance_ipv6_filter_list_cmd); + install_element (VIEW_NODE, &show_bgp_instance_route_map_cmd); + install_element (VIEW_NODE, &show_bgp_instance_ipv6_route_map_cmd); + install_element (VIEW_NODE, &show_bgp_instance_community_list_cmd); + install_element (VIEW_NODE, &show_bgp_instance_ipv6_community_list_cmd); + install_element (VIEW_NODE, &show_bgp_instance_prefix_longer_cmd); + install_element (VIEW_NODE, &show_bgp_instance_ipv6_prefix_longer_cmd); + install_element (VIEW_NODE, &show_bgp_instance_neighbor_advertised_route_cmd); + install_element (VIEW_NODE, &show_bgp_instance_ipv6_neighbor_advertised_route_cmd); + install_element (VIEW_NODE, &show_bgp_instance_neighbor_received_routes_cmd); + install_element (VIEW_NODE, &show_bgp_instance_ipv6_neighbor_received_routes_cmd); + install_element (VIEW_NODE, &show_bgp_instance_neighbor_routes_cmd); + install_element (VIEW_NODE, &show_bgp_instance_ipv6_neighbor_routes_cmd); + install_element (VIEW_NODE, &show_bgp_instance_neighbor_received_prefix_filter_cmd); + install_element (VIEW_NODE, &show_bgp_instance_ipv6_neighbor_received_prefix_filter_cmd); + install_element (VIEW_NODE, &show_bgp_instance_neighbor_flap_cmd); + install_element (VIEW_NODE, &show_bgp_instance_ipv6_neighbor_flap_cmd); + install_element (VIEW_NODE, &show_bgp_instance_neighbor_damp_cmd); + install_element (VIEW_NODE, &show_bgp_instance_ipv6_neighbor_damp_cmd); /* Restricted: * VIEW_NODE - (set of dangerous commands) - (commands dependent on prev) @@ -14430,14 +14376,14 @@ bgp_route_init (void) install_element (RESTRICTED_NODE, &show_bgp_ipv6_community3_exact_cmd); install_element (RESTRICTED_NODE, &show_bgp_community4_exact_cmd); install_element (RESTRICTED_NODE, &show_bgp_ipv6_community4_exact_cmd); - install_element (RESTRICTED_NODE, &show_bgp_view_route_cmd); - install_element (RESTRICTED_NODE, &show_bgp_view_ipv6_route_cmd); - install_element (RESTRICTED_NODE, &show_bgp_view_route_pathtype_cmd); - install_element (RESTRICTED_NODE, &show_bgp_view_ipv6_route_pathtype_cmd); - install_element (RESTRICTED_NODE, &show_bgp_view_prefix_cmd); - install_element (RESTRICTED_NODE, &show_bgp_view_ipv6_prefix_cmd); - install_element (RESTRICTED_NODE, &show_bgp_view_neighbor_received_prefix_filter_cmd); - install_element (RESTRICTED_NODE, &show_bgp_view_ipv6_neighbor_received_prefix_filter_cmd); + install_element (RESTRICTED_NODE, &show_bgp_instance_route_cmd); + install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_route_cmd); + install_element (RESTRICTED_NODE, &show_bgp_instance_route_pathtype_cmd); + install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_route_pathtype_cmd); + install_element (RESTRICTED_NODE, &show_bgp_instance_prefix_cmd); + install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_prefix_cmd); + install_element (RESTRICTED_NODE, &show_bgp_instance_neighbor_received_prefix_filter_cmd); + install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_neighbor_received_prefix_filter_cmd); install_element (ENABLE_NODE, &show_bgp_cmd); install_element (ENABLE_NODE, &show_bgp_ipv6_cmd); @@ -14498,38 +14444,38 @@ bgp_route_init (void) install_element (ENABLE_NODE, &show_bgp_ipv6_neighbor_flap_cmd); install_element (ENABLE_NODE, &show_bgp_neighbor_damp_cmd); install_element (ENABLE_NODE, &show_bgp_ipv6_neighbor_damp_cmd); - install_element (ENABLE_NODE, &show_bgp_view_cmd); - install_element (ENABLE_NODE, &show_bgp_view_ipv6_cmd); - install_element (ENABLE_NODE, &show_bgp_view_route_cmd); - install_element (ENABLE_NODE, &show_bgp_view_ipv6_route_cmd); - install_element (ENABLE_NODE, &show_bgp_view_route_pathtype_cmd); - install_element (ENABLE_NODE, &show_bgp_view_ipv6_route_pathtype_cmd); - install_element (ENABLE_NODE, &show_bgp_view_prefix_cmd); - install_element (ENABLE_NODE, &show_bgp_view_ipv6_prefix_cmd); - install_element (ENABLE_NODE, &show_bgp_view_prefix_pathtype_cmd); - install_element (ENABLE_NODE, &show_bgp_view_ipv6_prefix_pathtype_cmd); - install_element (ENABLE_NODE, &show_bgp_view_prefix_list_cmd); - install_element (ENABLE_NODE, &show_bgp_view_ipv6_prefix_list_cmd); - install_element (ENABLE_NODE, &show_bgp_view_filter_list_cmd); - install_element (ENABLE_NODE, &show_bgp_view_ipv6_filter_list_cmd); - install_element (ENABLE_NODE, &show_bgp_view_route_map_cmd); - install_element (ENABLE_NODE, &show_bgp_view_ipv6_route_map_cmd); - install_element (ENABLE_NODE, &show_bgp_view_community_list_cmd); - install_element (ENABLE_NODE, &show_bgp_view_ipv6_community_list_cmd); - install_element (ENABLE_NODE, &show_bgp_view_prefix_longer_cmd); - install_element (ENABLE_NODE, &show_bgp_view_ipv6_prefix_longer_cmd); - install_element (ENABLE_NODE, &show_bgp_view_neighbor_advertised_route_cmd); - install_element (ENABLE_NODE, &show_bgp_view_ipv6_neighbor_advertised_route_cmd); - install_element (ENABLE_NODE, &show_bgp_view_neighbor_received_routes_cmd); - install_element (ENABLE_NODE, &show_bgp_view_ipv6_neighbor_received_routes_cmd); - install_element (ENABLE_NODE, &show_bgp_view_neighbor_routes_cmd); - install_element (ENABLE_NODE, &show_bgp_view_ipv6_neighbor_routes_cmd); - install_element (ENABLE_NODE, &show_bgp_view_neighbor_received_prefix_filter_cmd); - install_element (ENABLE_NODE, &show_bgp_view_ipv6_neighbor_received_prefix_filter_cmd); - install_element (ENABLE_NODE, &show_bgp_view_neighbor_flap_cmd); - install_element (ENABLE_NODE, &show_bgp_view_ipv6_neighbor_flap_cmd); - install_element (ENABLE_NODE, &show_bgp_view_neighbor_damp_cmd); - install_element (ENABLE_NODE, &show_bgp_view_ipv6_neighbor_damp_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_ipv6_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_route_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_ipv6_route_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_route_pathtype_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_ipv6_route_pathtype_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_prefix_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_ipv6_prefix_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_prefix_pathtype_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_ipv6_prefix_pathtype_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_prefix_list_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_ipv6_prefix_list_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_filter_list_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_ipv6_filter_list_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_route_map_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_ipv6_route_map_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_community_list_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_ipv6_community_list_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_prefix_longer_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_ipv6_prefix_longer_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_neighbor_advertised_route_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_ipv6_neighbor_advertised_route_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_neighbor_received_routes_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_ipv6_neighbor_received_routes_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_neighbor_routes_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_ipv6_neighbor_routes_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_neighbor_received_prefix_filter_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_ipv6_neighbor_received_prefix_filter_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_neighbor_flap_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_ipv6_neighbor_flap_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_neighbor_damp_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_ipv6_neighbor_damp_cmd); /* Statistics */ install_element (ENABLE_NODE, &show_bgp_statistics_cmd); diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index aa451aafe9..652e835b2c 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -676,7 +676,7 @@ ALIAS (router_bgp, BGP_STR AS_STR "BGP view\nBGP VRF\n" - "view name\n") + "View/VRF name\n") ALIAS (router_bgp, router_bgp_noasn_cmd, @@ -723,7 +723,7 @@ ALIAS (no_router_bgp, BGP_STR AS_STR "BGP view\nBGP VRF\n" - "view name\n") + "View/VRF name\n") /* BGP router-id. */ @@ -5972,21 +5972,19 @@ ALIAS (clear_ip_bgp_all, ALIAS (clear_ip_bgp_all, clear_ip_bgp_instance_all_cmd, - "clear ip bgp (view|vrf) WORD *", + "clear ip bgp " BGP_INSTANCE_CMD " *", CLEAR_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "view name\n" + BGP_INSTANCE_HELP_STR "Clear all peers\n") ALIAS (clear_ip_bgp_all, clear_bgp_instance_all_cmd, - "clear bgp (view|vrf) WORD *", + "clear bgp " BGP_INSTANCE_CMD " *", CLEAR_STR BGP_STR - "BGP view\nBGP VRF\n" - "view name\n" + BGP_INSTANCE_HELP_STR "Clear all peers\n") DEFUN (clear_ip_bgp_peer, @@ -6153,12 +6151,11 @@ ALIAS (clear_ip_bgp_all_soft_out, ALIAS (clear_ip_bgp_all_soft_out, clear_ip_bgp_instance_all_soft_out_cmd, - "clear ip bgp (view|vrf) WORD * soft out", + "clear ip bgp " BGP_INSTANCE_CMD " * soft out", CLEAR_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Clear all peers\n" BGP_SOFT_STR BGP_SOFT_OUT_STR) @@ -6198,12 +6195,11 @@ ALIAS (clear_ip_bgp_all_ipv4_soft_out, DEFUN (clear_ip_bgp_instance_all_ipv4_soft_out, clear_ip_bgp_instance_all_ipv4_soft_out_cmd, - "clear ip bgp (view|vrf) WORD * ipv4 (unicast|multicast) soft out", + "clear ip bgp " BGP_INSTANCE_CMD " * ipv4 (unicast|multicast) soft out", CLEAR_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "view name\n" + BGP_INSTANCE_HELP_STR "Clear all peers\n" "Address family\n" "Address Family modifier\n" @@ -6264,11 +6260,10 @@ DEFUN (clear_bgp_all_soft_out, ALIAS (clear_bgp_all_soft_out, clear_bgp_instance_all_soft_out_cmd, - "clear bgp (view|vrf) WORD * soft out", + "clear bgp " BGP_INSTANCE_CMD " * soft out", CLEAR_STR BGP_STR - "BGP view\nBGP VRF\n" - "view name\n" + BGP_INSTANCE_HELP_STR "Clear all peers\n" BGP_SOFT_STR BGP_SOFT_OUT_STR) @@ -6798,12 +6793,11 @@ DEFUN (clear_ip_bgp_all_soft_in, ALIAS (clear_ip_bgp_all_soft_in, clear_ip_bgp_instance_all_soft_in_cmd, - "clear ip bgp (view|vrf) WORD * soft in", + "clear ip bgp " BGP_INSTANCE_CMD " * soft in", CLEAR_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "view name\n" + BGP_INSTANCE_HELP_STR "Clear all peers\n" BGP_SOFT_STR BGP_SOFT_IN_STR) @@ -6837,12 +6831,11 @@ DEFUN (clear_ip_bgp_all_in_prefix_filter, ALIAS (clear_ip_bgp_all_in_prefix_filter, clear_ip_bgp_instance_all_in_prefix_filter_cmd, - "clear ip bgp (view|vrf) WORD * in prefix-filter", + "clear ip bgp " BGP_INSTANCE_CMD " * in prefix-filter", CLEAR_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "view name\n" + BGP_INSTANCE_HELP_STR "Clear all peers\n" BGP_SOFT_IN_STR "Push out prefix-list ORF and do inbound soft reconfig\n") @@ -6883,12 +6876,11 @@ ALIAS (clear_ip_bgp_all_ipv4_soft_in, DEFUN (clear_ip_bgp_instance_all_ipv4_soft_in, clear_ip_bgp_instance_all_ipv4_soft_in_cmd, - "clear ip bgp (view|vrf) WORD * ipv4 (unicast|multicast) soft in", + "clear ip bgp " BGP_INSTANCE_CMD " * ipv4 (unicast|multicast) soft in", CLEAR_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "view name\n" + BGP_INSTANCE_HELP_STR "Clear all peers\n" "Address family\n" "Address Family modifier\n" @@ -6927,7 +6919,7 @@ DEFUN (clear_ip_bgp_all_ipv4_in_prefix_filter, DEFUN (clear_ip_bgp_instance_all_ipv4_in_prefix_filter, clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd, - "clear ip bgp (view|vrf) WORD * ipv4 (unicast|multicast) in prefix-filter", + "clear ip bgp " BGP_INSTANCE_CMD " * ipv4 (unicast|multicast) in prefix-filter", CLEAR_STR IP_STR BGP_STR @@ -6992,11 +6984,10 @@ DEFUN (clear_bgp_all_soft_in, ALIAS (clear_bgp_all_soft_in, clear_bgp_instance_all_soft_in_cmd, - "clear bgp (view|vrf) WORD * soft in", + "clear bgp " BGP_INSTANCE_CMD " * soft in", CLEAR_STR BGP_STR - "BGP view\nBGP VRF\n" - "view name\n" + BGP_INSTANCE_HELP_STR "Clear all peers\n" BGP_SOFT_STR BGP_SOFT_IN_STR) @@ -7773,12 +7764,11 @@ DEFUN (clear_ip_bgp_all_soft, ALIAS (clear_ip_bgp_all_soft, clear_ip_bgp_instance_all_soft_cmd, - "clear ip bgp (view|vrf) WORD * soft", + "clear ip bgp " BGP_INSTANCE_CMD " * soft", CLEAR_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "view name\n" + BGP_INSTANCE_HELP_STR "Clear all peers\n" BGP_SOFT_STR) @@ -7805,12 +7795,11 @@ DEFUN (clear_ip_bgp_all_ipv4_soft, DEFUN (clear_ip_bgp_instance_all_ipv4_soft, clear_ip_bgp_instance_all_ipv4_soft_cmd, - "clear ip bgp (view|vrf) WORD * ipv4 (unicast|multicast) soft", + "clear ip bgp " BGP_INSTANCE_CMD " * ipv4 (unicast|multicast) soft", CLEAR_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "view name\n" + BGP_INSTANCE_HELP_STR "Clear all peers\n" "Address family\n" "Address Family Modifier\n" @@ -7858,11 +7847,10 @@ DEFUN (clear_bgp_all_soft, ALIAS (clear_bgp_all_soft, clear_bgp_instance_all_soft_cmd, - "clear bgp (view|vrf) WORD * soft", + "clear bgp " BGP_INSTANCE_CMD " * soft", CLEAR_STR BGP_STR - "BGP view\nBGP VRF\n" - "view name\n" + BGP_INSTANCE_HELP_STR "Clear all peers\n" BGP_SOFT_STR) @@ -8145,19 +8133,130 @@ DEFUN (show_bgp_views, if (!bgp_option_check (BGP_OPT_MULTIPLE_INSTANCE)) { - vty_out (vty, "Multiple BGP views are not defined%s", VTY_NEWLINE); + vty_out (vty, "BGP Multiple Instance is not enabled%s", VTY_NEWLINE); return CMD_WARNING; } vty_out (vty, "Defined BGP views:%s", VTY_NEWLINE); for (ALL_LIST_ELEMENTS_RO(inst, node, bgp)) - vty_out (vty, "\t%s (AS%u)%s", - bgp->name ? bgp->name : "(null)", - bgp->as, VTY_NEWLINE); + { + /* Skip VRFs. */ + if (bgp->inst_type == BGP_INSTANCE_TYPE_VRF) + continue; + vty_out (vty, "\t%s (AS%u)%s", + bgp->name ? bgp->name : "(null)", + bgp->as, VTY_NEWLINE); + } return CMD_SUCCESS; } +DEFUN (show_bgp_vrfs, + show_bgp_vrfs_cmd, + "show bgp vrfs {json}", + SHOW_STR + BGP_STR + "Show BGP VRFs\n" + "JavaScript Object Notation\n") +{ + struct list *inst = bm->bgp; + struct listnode *node; + struct bgp *bgp; + u_char uj = use_json(argc, argv); + json_object *json = NULL; + json_object *json_vrfs = NULL; + int count = 0; + static char header[] = "Type Id RouterId #PeersCfg #PeersEstb Name"; + + if (!bgp_option_check (BGP_OPT_MULTIPLE_INSTANCE)) + { + vty_out (vty, "BGP Multiple Instance is not enabled%s", VTY_NEWLINE); + return CMD_WARNING; + } + + if (uj) + { + json = json_object_new_object(); + json_vrfs = json_object_new_object(); + } + + for (ALL_LIST_ELEMENTS_RO(inst, node, bgp)) + { + const char *name, *type; + struct peer *peer; + struct listnode *node, *nnode; + int peers_cfg, peers_estb; + json_object *json_vrf = NULL; + + /* Skip Views. */ + if (bgp->inst_type == BGP_INSTANCE_TYPE_VIEW) + continue; + + count++; + if (!uj && count == 1) + vty_out (vty, "%s%s", header, VTY_NEWLINE); + + peers_cfg = peers_estb = 0; + if (uj) + json_vrf = json_object_new_object(); + + + for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) + { + if (!CHECK_FLAG(peer->flags, PEER_FLAG_CONFIG_NODE)) + continue; + peers_cfg++; + if (peer->status == Established) + peers_estb++; + } + + if (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) + { + name = "Default"; + type = "DFLT"; + } + else + { + name = bgp->name; + type = "VRF"; + } + + if (uj) + { + json_object_string_add(json_vrf, "type", type); + json_object_int_add(json_vrf, "vrfId", bgp->vrf_id); + json_object_string_add(json_vrf, "routerId", inet_ntoa (bgp->router_id)); + json_object_int_add(json_vrf, "numConfiguredPeers", peers_cfg); + json_object_int_add(json_vrf, "numEstablishedPeers", peers_estb); + + json_object_object_add(json_vrfs, name, json_vrf); + } + else + vty_out (vty, "%4s %-5u %-16s %9u %10u %s%s", + type, bgp->vrf_id, inet_ntoa (bgp->router_id), + peers_cfg, peers_estb, name, + VTY_NEWLINE); + } + + if (uj) + { + json_object_object_add(json, "vrfs", json_vrfs); + + json_object_int_add(json, "totalVrfs", count); + + vty_out (vty, "%s%s", json_object_to_json_string(json), VTY_NEWLINE); + json_object_free(json); + } + else + { + if (count) + vty_out (vty, "%sTotal number of VRFs (including default): %d%s", + VTY_NEWLINE, count, VTY_NEWLINE); + } + + return CMD_SUCCESS; +} + DEFUN (show_bgp_memory, show_bgp_memory_cmd, "show bgp memory", @@ -8657,12 +8756,11 @@ DEFUN (show_ip_bgp_summary, DEFUN (show_ip_bgp_instance_summary, show_ip_bgp_instance_summary_cmd, - "show ip bgp (view|vrf) WORD summary {json}", + "show ip bgp " BGP_INSTANCE_CMD " summary {json}", SHOW_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Summary of BGP neighbor status\n" "JavaScript Object Notation\n") { @@ -8787,11 +8885,10 @@ DEFUN (show_bgp_summary, DEFUN (show_bgp_instance_summary, show_bgp_instance_summary_cmd, - "show bgp (view|vrf) WORD summary {json}", + "show bgp " BGP_INSTANCE_CMD " summary {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Summary of BGP neighbor status\n" "JavaScript Object Notation\n") { @@ -8808,11 +8905,10 @@ ALIAS (show_bgp_summary, ALIAS (show_bgp_instance_summary, show_bgp_instance_ipv6_summary_cmd, - "show bgp (view|vrf) WORD ipv6 summary {json}", + "show bgp " BGP_INSTANCE_CMD " ipv6 summary {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" "Summary of BGP neighbor status\n") @@ -8836,11 +8932,10 @@ DEFUN (show_bgp_ipv6_safi_summary, DEFUN (show_bgp_instance_ipv6_safi_summary, show_bgp_instance_ipv6_safi_summary_cmd, - "show bgp (view|vrf) WORD ipv6 (unicast|multicast) summary {json}", + "show bgp " BGP_INSTANCE_CMD " ipv6 (unicast|multicast) summary {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" "Address Family modifier\n" "Address Family modifier\n" @@ -10782,12 +10877,11 @@ ALIAS (show_ip_bgp_neighbors_peer, DEFUN (show_ip_bgp_instance_neighbors, show_ip_bgp_instance_neighbors_cmd, - "show ip bgp (view|vrf) WORD neighbors {json}", + "show ip bgp " BGP_INSTANCE_CMD " neighbors {json}", SHOW_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Detailed information on TCP and BGP neighbor connections\n" "JavaScript Object Notation\n") { @@ -10798,33 +10892,30 @@ DEFUN (show_ip_bgp_instance_neighbors, ALIAS (show_ip_bgp_instance_neighbors, show_bgp_instance_neighbors_cmd, - "show bgp (view|vrf) WORD neighbors {json}", + "show bgp " BGP_INSTANCE_CMD " neighbors {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Detailed information on TCP and BGP neighbor connections\n" "JavaScript Object Notation\n") ALIAS (show_ip_bgp_instance_neighbors, show_bgp_instance_ipv6_neighbors_cmd, - "show bgp (view|vrf) WORD ipv6 neighbors {json}", + "show bgp " BGP_INSTANCE_CMD " ipv6 neighbors {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" "Detailed information on TCP and BGP neighbor connections\n" "JavaScript Object Notation\n") DEFUN (show_ip_bgp_instance_neighbors_peer, show_ip_bgp_instance_neighbors_peer_cmd, - "show ip bgp (view|vrf) WORD neighbors (A.B.C.D|X:X::X:X|WORD) {json}", + "show ip bgp " BGP_INSTANCE_CMD " neighbors (A.B.C.D|X:X::X:X|WORD) {json}", SHOW_STR IP_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Detailed information on TCP and BGP neighbor connections\n" "Neighbor to display information about\n" "Neighbor to display information about\n" @@ -10838,11 +10929,10 @@ DEFUN (show_ip_bgp_instance_neighbors_peer, ALIAS (show_ip_bgp_instance_neighbors_peer, show_bgp_instance_neighbors_peer_cmd, - "show bgp (view|vrf) WORD neighbors (A.B.C.D|X:X::X:X|WORD) {json}", + "show bgp " BGP_INSTANCE_CMD " neighbors (A.B.C.D|X:X::X:X|WORD) {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Detailed information on TCP and BGP neighbor connections\n" "Neighbor to display information about\n" "Neighbor to display information about\n" @@ -10851,11 +10941,10 @@ ALIAS (show_ip_bgp_instance_neighbors_peer, ALIAS (show_ip_bgp_instance_neighbors_peer, show_bgp_instance_ipv6_neighbors_peer_cmd, - "show bgp (view|vrf) WORD ipv6 neighbors (A.B.C.D|X:X::X:X|WORD) {json}", + "show bgp " BGP_INSTANCE_CMD " ipv6 neighbors (A.B.C.D|X:X::X:X|WORD) {json}", SHOW_STR BGP_STR - "BGP view\nBGP VRF\n" - "View/VRF name\n" + BGP_INSTANCE_HELP_STR "Address family\n" "Detailed information on TCP and BGP neighbor connections\n" "Neighbor to display information about\n" @@ -10939,12 +11028,17 @@ DEFUN (show_ip_bgp_attr_info, return CMD_SUCCESS; } -static int bgp_show_update_groups(int afi, int safi, struct vty *vty, +static int bgp_show_update_groups(struct vty *vty, const char *name, + int afi, int safi, u_int64_t subgrp_id) { struct bgp *bgp; - bgp = bgp_get_default(); + if (name) + bgp = bgp_lookup_by_name (name); + else + bgp = bgp_get_default (); + if (bgp) update_group_show(bgp, afi, safi, vty, subgrp_id); return CMD_SUCCESS; @@ -10958,7 +11052,19 @@ DEFUN (show_ip_bgp_updgrps, BGP_STR "Detailed info about dynamic update groups\n") { - return (bgp_show_update_groups(AFI_IP, SAFI_UNICAST, vty, 0)); + return (bgp_show_update_groups(vty, NULL, AFI_IP, SAFI_UNICAST, 0)); +} + +DEFUN (show_ip_bgp_instance_updgrps, + show_ip_bgp_instance_updgrps_cmd, + "show ip bgp " BGP_INSTANCE_CMD " update-groups", + SHOW_STR + IP_STR + BGP_STR + BGP_INSTANCE_HELP_STR + "Detailed info about dynamic update groups\n") +{ + return (bgp_show_update_groups(vty, argv[1], AFI_IP, SAFI_UNICAST, 0)); } DEFUN (show_bgp_ipv6_updgrps, @@ -10968,7 +11074,18 @@ DEFUN (show_bgp_ipv6_updgrps, BGP_STR "Detailed info about v6 dynamic update groups\n") { - return (bgp_show_update_groups(AFI_IP6, SAFI_UNICAST, vty, 0)); + return (bgp_show_update_groups(vty, NULL, AFI_IP6, SAFI_UNICAST, 0)); +} + +DEFUN (show_bgp_instance_ipv6_updgrps, + show_bgp_instance_ipv6_updgrps_cmd, + "show bgp " BGP_INSTANCE_CMD " update-groups", + SHOW_STR + BGP_STR + BGP_INSTANCE_HELP_STR + "Detailed info about v6 dynamic update groups\n") +{ + return (bgp_show_update_groups(vty, argv[1], AFI_IP6, SAFI_UNICAST, 0)); } DEFUN (show_bgp_updgrps, @@ -10987,7 +11104,7 @@ DEFUN (show_bgp_updgrps, afi = (strcmp(argv[0], "ipv4") == 0) ? AFI_IP : AFI_IP6; safi = (strncmp (argv[1], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST; - return (bgp_show_update_groups(afi, safi, vty, 0)); + return (bgp_show_update_groups(vty, NULL, afi, safi, 0)); } DEFUN (show_ip_bgp_updgrps_s, @@ -11002,7 +11119,23 @@ DEFUN (show_ip_bgp_updgrps_s, u_int64_t subgrp_id; VTY_GET_ULL("subgroup-id", subgrp_id, argv[0]); - return (bgp_show_update_groups(AFI_IP, SAFI_UNICAST, vty, subgrp_id)); + return (bgp_show_update_groups(vty, NULL, AFI_IP, SAFI_UNICAST, subgrp_id)); +} + +DEFUN (show_ip_bgp_instance_updgrps_s, + show_ip_bgp_instance_updgrps_s_cmd, + "show ip bgp " BGP_INSTANCE_CMD " update-groups SUBGROUP-ID", + SHOW_STR + IP_STR + BGP_STR + BGP_INSTANCE_HELP_STR + "Detailed info about dynamic update groups\n" + "Specific subgroup to display detailed info for\n") +{ + u_int64_t subgrp_id; + + VTY_GET_ULL("subgroup-id", subgrp_id, argv[2]); + return (bgp_show_update_groups(vty, argv[1], AFI_IP, SAFI_UNICAST, subgrp_id)); } DEFUN (show_bgp_ipv6_updgrps_s, @@ -11016,7 +11149,21 @@ DEFUN (show_bgp_ipv6_updgrps_s, u_int64_t subgrp_id; VTY_GET_ULL("subgroup-id", subgrp_id, argv[0]); - return(bgp_show_update_groups(AFI_IP6, SAFI_UNICAST, vty, subgrp_id)); + return(bgp_show_update_groups(vty, NULL, AFI_IP6, SAFI_UNICAST, subgrp_id)); +} + +DEFUN (show_bgp_instance_ipv6_updgrps_s, + show_bgp_instance_ipv6_updgrps_s_cmd, + "show bgp " BGP_INSTANCE_CMD " update-groups SUBGROUP-ID", + SHOW_STR + BGP_STR + "Detailed info about v6 dynamic update groups\n" + "Specific subgroup to display detailed info for\n") +{ + u_int64_t subgrp_id; + + VTY_GET_ULL("subgroup-id", subgrp_id, argv[2]); + return(bgp_show_update_groups(vty, argv[1], AFI_IP6, SAFI_UNICAST, subgrp_id)); } DEFUN (show_bgp_updgrps_s, @@ -11039,7 +11186,7 @@ DEFUN (show_bgp_updgrps_s, safi = (strncmp (argv[1], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST; VTY_GET_ULL("subgroup-id", subgrp_id, argv[2]); - return(bgp_show_update_groups(afi, safi, vty, subgrp_id)); + return(bgp_show_update_groups(vty, NULL, afi, safi, subgrp_id)); } DEFUN (show_bgp_updgrps_stats, @@ -11059,12 +11206,36 @@ DEFUN (show_bgp_updgrps_stats, return CMD_SUCCESS; } +DEFUN (show_bgp_instance_updgrps_stats, + show_bgp_instance_updgrps_stats_cmd, + "show bgp " BGP_INSTANCE_CMD " update-groups statistics", + SHOW_STR + BGP_STR + BGP_INSTANCE_HELP_STR + "BGP update groups\n" + "Statistics\n") +{ + struct bgp *bgp; + + bgp = bgp_lookup_by_name (argv[1]); + if (bgp) + update_group_show_stats(bgp, vty); + + return CMD_SUCCESS; +} + static void -show_bgp_updgrps_adj_info_aux (struct vty *vty, afi_t afi, safi_t safi, +show_bgp_updgrps_adj_info_aux (struct vty *vty, const char *name, + afi_t afi, safi_t safi, const char *what, u_int64_t subgrp_id) { struct bgp *bgp; - bgp = bgp_get_default(); + + if (name) + bgp = bgp_lookup_by_name (name); + else + bgp = bgp_get_default (); + if (bgp) { if (!strcmp(what, "advertise-queue")) @@ -11088,7 +11259,24 @@ DEFUN (show_ip_bgp_updgrps_adj, "Packet queue\n") { - show_bgp_updgrps_adj_info_aux(vty, AFI_IP, SAFI_UNICAST, argv[0], 0); + show_bgp_updgrps_adj_info_aux(vty, NULL, AFI_IP, SAFI_UNICAST, argv[0], 0); + return CMD_SUCCESS; +} + +DEFUN (show_ip_bgp_instance_updgrps_adj, + show_ip_bgp_instance_updgrps_adj_cmd, + "show ip bgp " BGP_INSTANCE_CMD " update-groups (advertise-queue|advertised-routes|packet-queue)", + SHOW_STR + IP_STR + BGP_STR + BGP_INSTANCE_HELP_STR + "BGP update groups\n" + "Advertisement queue\n" + "Announced routes\n" + "Packet queue\n") + +{ + show_bgp_updgrps_adj_info_aux(vty, argv[1], AFI_IP, SAFI_UNICAST, argv[2], 0); return CMD_SUCCESS; } @@ -11112,7 +11300,7 @@ DEFUN (show_bgp_updgrps_afi_adj, afi = (strcmp(argv[0], "ipv4") == 0) ? AFI_IP : AFI_IP6; safi = (strncmp (argv[1], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST; - show_bgp_updgrps_adj_info_aux(vty, afi, safi, argv[2], 0); + show_bgp_updgrps_adj_info_aux(vty, NULL, afi, safi, argv[2], 0); return CMD_SUCCESS; } @@ -11126,7 +11314,22 @@ DEFUN (show_bgp_updgrps_adj, "Announced routes\n" "Packet queue\n") { - show_bgp_updgrps_adj_info_aux(vty, AFI_IP6, SAFI_UNICAST, argv[0], 0); + show_bgp_updgrps_adj_info_aux(vty, NULL, AFI_IP6, SAFI_UNICAST, argv[0], 0); + return CMD_SUCCESS; +} + +DEFUN (show_bgp_instance_updgrps_adj, + show_bgp_instance_updgrps_adj_cmd, + "show bgp " BGP_INSTANCE_CMD " update-groups (advertise-queue|advertised-routes|packet-queue)", + SHOW_STR + BGP_STR + BGP_INSTANCE_HELP_STR + "BGP update groups\n" + "Advertisement queue\n" + "Announced routes\n" + "Packet queue\n") +{ + show_bgp_updgrps_adj_info_aux(vty, argv[1], AFI_IP6, SAFI_UNICAST, argv[2], 0); return CMD_SUCCESS; } @@ -11147,7 +11350,29 @@ DEFUN (show_ip_bgp_updgrps_adj_s, VTY_GET_ULL("subgroup-id", subgrp_id, argv[0]); - show_bgp_updgrps_adj_info_aux(vty, AFI_IP, SAFI_UNICAST, argv[1], subgrp_id); + show_bgp_updgrps_adj_info_aux(vty, NULL, AFI_IP, SAFI_UNICAST, argv[1], subgrp_id); + return CMD_SUCCESS; +} + +DEFUN (show_ip_bgp_instance_updgrps_adj_s, + show_ip_bgp_instance_updgrps_adj_s_cmd, + "show ip bgp " BGP_INSTANCE_CMD " update-groups SUBGROUP-ID (advertise-queue|advertised-routes|packet-queue)", + SHOW_STR + IP_STR + BGP_STR + BGP_INSTANCE_HELP_STR + "BGP update groups\n" + "Specific subgroup to display info for\n" + "Advertisement queue\n" + "Announced routes\n" + "Packet queue\n") + +{ + u_int64_t subgrp_id; + + VTY_GET_ULL("subgroup-id", subgrp_id, argv[2]); + + show_bgp_updgrps_adj_info_aux(vty, argv[1], AFI_IP, SAFI_UNICAST, argv[3], subgrp_id); return CMD_SUCCESS; } @@ -11175,7 +11400,7 @@ DEFUN (show_bgp_updgrps_afi_adj_s, safi = (strncmp (argv[1], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST; VTY_GET_ULL("subgroup-id", subgrp_id, argv[2]); - show_bgp_updgrps_adj_info_aux(vty, afi, safi, argv[3], subgrp_id); + show_bgp_updgrps_adj_info_aux(vty, NULL, afi, safi, argv[3], subgrp_id); return CMD_SUCCESS; } @@ -11194,10 +11419,31 @@ DEFUN (show_bgp_updgrps_adj_s, VTY_GET_ULL("subgroup-id", subgrp_id, argv[0]); - show_bgp_updgrps_adj_info_aux(vty, AFI_IP6, SAFI_UNICAST, argv[1], subgrp_id); + show_bgp_updgrps_adj_info_aux(vty, NULL, AFI_IP6, SAFI_UNICAST, argv[1], subgrp_id); return CMD_SUCCESS; } +DEFUN (show_bgp_instance_updgrps_adj_s, + show_bgp_instance_updgrps_adj_s_cmd, + "show bgp " BGP_INSTANCE_CMD " update-groups SUBGROUP-ID (advertise-queue|advertised-routes|packet-queue)", + SHOW_STR + BGP_STR + BGP_INSTANCE_HELP_STR + "BGP update groups\n" + "Specific subgroup to display info for\n" + "Advertisement queue\n" + "Announced routes\n" + "Packet queue\n") +{ + u_int64_t subgrp_id; + + VTY_GET_ULL("subgroup-id", subgrp_id, argv[2]); + + show_bgp_updgrps_adj_info_aux(vty, argv[1], AFI_IP6, SAFI_UNICAST, argv[3], subgrp_id); + return CMD_SUCCESS; +} + + static int bgp_show_one_peer_group (struct vty *vty, struct peer_group *group) @@ -11343,20 +11589,17 @@ bgp_show_peer_group_vty (struct vty *vty, const char *name, int ret = CMD_SUCCESS; if (name) - { - bgp = bgp_lookup_by_name (name); + bgp = bgp_lookup_by_name (name); + else + bgp = bgp_get_default (); - if (! bgp) - { - vty_out (vty, "%% No such BGP instance exist%s", VTY_NEWLINE); - return CMD_WARNING; - } + if (! bgp) + { + vty_out (vty, "%% No such BGP instance exist%s", VTY_NEWLINE); + return CMD_WARNING; } - bgp = bgp_get_default (); - - if (bgp) - ret = bgp_show_peer_group (vty, bgp, type, group_name); + ret = bgp_show_peer_group (vty, bgp, type, group_name); return ret; } @@ -11374,14 +11617,14 @@ DEFUN (show_ip_bgp_peer_groups, DEFUN (show_ip_bgp_instance_peer_groups, show_ip_bgp_instance_peer_groups_cmd, - "show ip bgp (view|vrf) WORD peer-group", + "show ip bgp " BGP_INSTANCE_CMD " peer-group", SHOW_STR IP_STR BGP_STR - "BGP View\n" + BGP_INSTANCE_HELP_STR "Detailed information on all BGP peer groups\n") { - return bgp_show_peer_group_vty (vty, argv[0], show_all_groups, NULL); + return bgp_show_peer_group_vty (vty, argv[1], show_all_groups, NULL); } DEFUN (show_ip_bgp_peer_group, @@ -11398,15 +11641,15 @@ DEFUN (show_ip_bgp_peer_group, DEFUN (show_ip_bgp_instance_peer_group, show_ip_bgp_instance_peer_group_cmd, - "show ip bgp (view|vrf) WORD peer-group WORD", + "show ip bgp " BGP_INSTANCE_CMD " peer-group WORD", SHOW_STR IP_STR BGP_STR - "BGP View\n" + BGP_INSTANCE_HELP_STR "BGP peer-group name\n" "Detailed information on a BGP peer group\n") { - return bgp_show_peer_group_vty (vty, argv[0], show_peer_group, argv[1]); + return bgp_show_peer_group_vty (vty, argv[1], show_peer_group, argv[2]); } /* Redistribute VTY commands. */ @@ -13174,16 +13417,24 @@ bgp_vty_init (void) /* "show ip bgp summary" commands. */ install_element (VIEW_NODE, &show_ip_bgp_summary_cmd); install_element (VIEW_NODE, &show_ip_bgp_updgrps_cmd); + install_element (VIEW_NODE, &show_ip_bgp_instance_updgrps_cmd); install_element (VIEW_NODE, &show_bgp_updgrps_cmd); install_element (VIEW_NODE, &show_bgp_ipv6_updgrps_cmd); + install_element (VIEW_NODE, &show_bgp_instance_ipv6_updgrps_cmd); install_element (VIEW_NODE, &show_ip_bgp_updgrps_s_cmd); + install_element (VIEW_NODE, &show_ip_bgp_instance_updgrps_s_cmd); install_element (VIEW_NODE, &show_bgp_updgrps_s_cmd); install_element (VIEW_NODE, &show_bgp_ipv6_updgrps_s_cmd); + install_element (VIEW_NODE, &show_bgp_instance_ipv6_updgrps_s_cmd); install_element (VIEW_NODE, &show_ip_bgp_updgrps_adj_cmd); + install_element (VIEW_NODE, &show_ip_bgp_instance_updgrps_adj_cmd); install_element (VIEW_NODE, &show_bgp_updgrps_adj_cmd); + install_element (VIEW_NODE, &show_bgp_instance_updgrps_adj_cmd); install_element (VIEW_NODE, &show_bgp_updgrps_afi_adj_cmd); install_element (VIEW_NODE, &show_ip_bgp_updgrps_adj_s_cmd); + install_element (VIEW_NODE, &show_ip_bgp_instance_updgrps_adj_s_cmd); install_element (VIEW_NODE, &show_bgp_updgrps_adj_s_cmd); + install_element (VIEW_NODE, &show_bgp_instance_updgrps_adj_s_cmd); install_element (VIEW_NODE, &show_bgp_updgrps_afi_adj_s_cmd); install_element (VIEW_NODE, &show_ip_bgp_instance_summary_cmd); install_element (VIEW_NODE, &show_ip_bgp_ipv4_summary_cmd); @@ -13202,16 +13453,24 @@ bgp_vty_init (void) #endif /* HAVE_IPV6 */ install_element (RESTRICTED_NODE, &show_ip_bgp_summary_cmd); install_element (RESTRICTED_NODE, &show_ip_bgp_updgrps_cmd); + install_element (RESTRICTED_NODE, &show_ip_bgp_instance_updgrps_cmd); install_element (RESTRICTED_NODE, &show_bgp_updgrps_cmd); install_element (RESTRICTED_NODE, &show_bgp_ipv6_updgrps_cmd); + install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_updgrps_cmd); install_element (RESTRICTED_NODE, &show_ip_bgp_updgrps_s_cmd); + install_element (RESTRICTED_NODE, &show_ip_bgp_instance_updgrps_s_cmd); install_element (RESTRICTED_NODE, &show_bgp_updgrps_s_cmd); install_element (RESTRICTED_NODE, &show_bgp_ipv6_updgrps_s_cmd); + install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_updgrps_s_cmd); install_element (RESTRICTED_NODE, &show_ip_bgp_updgrps_adj_cmd); + install_element (RESTRICTED_NODE, &show_ip_bgp_instance_updgrps_adj_cmd); install_element (RESTRICTED_NODE, &show_bgp_updgrps_adj_cmd); + install_element (RESTRICTED_NODE, &show_bgp_instance_updgrps_adj_cmd); install_element (RESTRICTED_NODE, &show_bgp_updgrps_afi_adj_cmd); install_element (RESTRICTED_NODE, &show_ip_bgp_updgrps_adj_s_cmd); + install_element (RESTRICTED_NODE, &show_ip_bgp_instance_updgrps_adj_s_cmd); install_element (RESTRICTED_NODE, &show_bgp_updgrps_adj_s_cmd); + install_element (RESTRICTED_NODE, &show_bgp_instance_updgrps_adj_s_cmd); install_element (RESTRICTED_NODE, &show_bgp_updgrps_afi_adj_s_cmd); install_element (RESTRICTED_NODE, &show_ip_bgp_instance_summary_cmd); install_element (RESTRICTED_NODE, &show_ip_bgp_ipv4_summary_cmd); @@ -13230,16 +13489,24 @@ bgp_vty_init (void) #endif /* HAVE_IPV6 */ install_element (ENABLE_NODE, &show_ip_bgp_summary_cmd); install_element (ENABLE_NODE, &show_ip_bgp_updgrps_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_instance_updgrps_cmd); install_element (ENABLE_NODE, &show_bgp_updgrps_cmd); install_element (ENABLE_NODE, &show_bgp_ipv6_updgrps_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_ipv6_updgrps_cmd); install_element (ENABLE_NODE, &show_ip_bgp_updgrps_s_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_instance_updgrps_s_cmd); install_element (ENABLE_NODE, &show_bgp_updgrps_s_cmd); install_element (ENABLE_NODE, &show_bgp_ipv6_updgrps_s_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_ipv6_updgrps_s_cmd); install_element (ENABLE_NODE, &show_ip_bgp_updgrps_adj_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_instance_updgrps_adj_cmd); install_element (ENABLE_NODE, &show_bgp_updgrps_adj_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_updgrps_adj_cmd); install_element (ENABLE_NODE, &show_bgp_updgrps_afi_adj_cmd); install_element (ENABLE_NODE, &show_ip_bgp_updgrps_adj_s_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_instance_updgrps_adj_s_cmd); install_element (ENABLE_NODE, &show_bgp_updgrps_adj_s_cmd); + install_element (ENABLE_NODE, &show_bgp_instance_updgrps_adj_s_cmd); install_element (ENABLE_NODE, &show_bgp_updgrps_afi_adj_s_cmd); install_element (ENABLE_NODE, &show_ip_bgp_instance_summary_cmd); install_element (ENABLE_NODE, &show_ip_bgp_ipv4_summary_cmd); @@ -13405,6 +13672,11 @@ bgp_vty_init (void) install_element (RESTRICTED_NODE, &show_bgp_views_cmd); install_element (ENABLE_NODE, &show_bgp_views_cmd); + /* "show bgp vrfs" commands. */ + install_element (VIEW_NODE, &show_bgp_vrfs_cmd); + install_element (RESTRICTED_NODE, &show_bgp_vrfs_cmd); + install_element (ENABLE_NODE, &show_bgp_vrfs_cmd); + /* Community-list. */ community_list_vty (); } diff --git a/bgpd/bgp_vty.h b/bgpd/bgp_vty.h index 2e54ccce0e..53456ffcd1 100644 --- a/bgpd/bgp_vty.h +++ b/bgpd/bgp_vty.h @@ -25,6 +25,8 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA #define CMD_AS_RANGE "<1-4294967295>" #define DYNAMIC_NEIGHBOR_LIMIT_RANGE "<1-5000>" +#define BGP_INSTANCE_CMD "(view|vrf) WORD" +#define BGP_INSTANCE_HELP_STR "BGP view\nBGP VRF\nView/VRF name\n" extern void bgp_vty_init (void); extern const char *afi_safi_print (afi_t, safi_t); -- 2.39.5