From: Daniel Walton Date: Fri, 30 Sep 2016 14:37:36 +0000 (+0000) Subject: bgpd: combine special cases for vrf "all" X-Git-Tag: frr-3.0-branchpoint~129^2~119 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=273f77435b834646057fea7b4d585701adc05a35;p=matthieu%2Ffrr.git bgpd: combine special cases for vrf "all" Signed-off-by: Daniel Walton --- diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 68a1ca7a3d..eca6a4a7b3 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -7923,31 +7923,26 @@ DEFUN (show_ip_bgp_route, DEFUN (show_ip_bgp_instance_all, show_ip_bgp_instance_all_cmd, - "show ip bgp all [json]", + "show [ip] bgp all [< [unicast]|ipv4 multicast|vpnv4 unicast>] [json]", SHOW_STR IP_STR BGP_STR BGP_INSTANCE_ALL_HELP_STR "JavaScript Object Notation\n") { - u_char uj = use_json(argc, argv); - - /* CHECK ME we need to revisit all of the bgp_show_all_ commands */ - bgp_show_all_instances_routes_vty (vty, AFI_IP, SAFI_UNICAST, uj); - return CMD_SUCCESS; -} + int idx_view_vrf = 3; + int idx_vrf = 4; + int idx_afi; + int idx_safi; + afi_t afi; + safi_t safi; -DEFUN (show_bgp_instance_all, - show_bgp_instance_all_cmd, - "show bgp all [json]", - SHOW_STR - BGP_STR - BGP_INSTANCE_ALL_HELP_STR - "JavaScript Object Notation\n") -{ u_char uj = use_json(argc, argv); + bgp_get_argv_vrf (argc, argv, &afi, &safi, &idx_view_vrf, &idx_vrf, &idx_afi); + idx_safi = idx_afi + 1; + bgp_get_argv_afi_safi (argc, argv, idx_afi, idx_safi, &afi, &safi, NULL); - bgp_show_all_instances_routes_vty (vty, AFI_IP6, SAFI_UNICAST, uj); + bgp_show_all_instances_routes_vty (vty, afi, safi, uj); return CMD_SUCCESS; } @@ -10299,14 +10294,6 @@ bgp_route_init (void) install_element (BGP_IPV6M_NODE, &ipv6_bgp_network_cmd); install_element (BGP_IPV6M_NODE, &no_ipv6_bgp_network_cmd); - /* Old config IPv6 BGP commands. */ - install_element (VIEW_NODE, &show_bgp_instance_all_cmd); - - /* Restricted: - * VIEW_NODE - (set of dangerous commands) - (commands dependent on prev) - */ - install_element (ENABLE_NODE, &show_bgp_instance_all_cmd); - /* Statistics */ install_element (ENABLE_NODE, &show_bgp_statistics_cmd); install_element (ENABLE_NODE, &show_bgp_statistics_view_cmd);