[quagga-dev 7802] [PATCH] Show Commands Multicast BGP IPv6 cleanup and modifications

Balaji G balajig81 at gmail.com
Thu Feb 18 17:13:28 GMT 2010


From: Balaji <balaji at localhost.localdomain>

---
 bgpd/bgp_route.c |  138 +++++++++++++-----------------------------------------
 bgpd/bgp_vty.c   |   61 ++++++------------------
 2 files changed, 48 insertions(+), 151 deletions(-)

diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index a92ca4e..ffcb553 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -6850,25 +6850,6 @@ DEFUN (show_bgp,
                    NULL);
 }
 
-ALIAS (show_bgp,
-       show_bgp_ipv6_cmd,
-       "show bgp ipv6",
-       SHOW_STR
-       BGP_STR
-       "Address family\n")
-
-/* old command */
-DEFUN (show_ipv6_bgp,
-       show_ipv6_bgp_cmd,
-       "show ipv6 bgp",
-       SHOW_STR
-       IP_STR
-       BGP_STR)
-{
-  return bgp_show (vty, NULL, AFI_IP6, SAFI_UNICAST, bgp_show_type_normal,
-                   NULL);
-}
-
 DEFUN (show_bgp_route,
        show_bgp_route_cmd,
        "show bgp X:X::X:X",
@@ -6879,14 +6860,6 @@ DEFUN (show_bgp_route,
   return bgp_show_route (vty, NULL, argv[0], AFI_IP6, SAFI_UNICAST, NULL, 0);
 }
 
-ALIAS (show_bgp_route,
-       show_bgp_ipv6_route_cmd,
-       "show bgp ipv6 X:X::X:X",
-       SHOW_STR
-       BGP_STR
-       "Address family\n"
-       "Network in the BGP routing table to display\n")
-
 /* old command */
 DEFUN (show_ipv6_bgp_route,
        show_ipv6_bgp_route_cmd,
@@ -6909,14 +6882,6 @@ DEFUN (show_bgp_prefix,
   return bgp_show_route (vty, NULL, argv[0], AFI_IP6, SAFI_UNICAST, NULL, 1);
 }
 
-ALIAS (show_bgp_prefix,
-       show_bgp_ipv6_prefix_cmd,
-       "show bgp ipv6 X:X::X:X/M",
-       SHOW_STR
-       BGP_STR
-       "Address family\n"
-       "IPv6 prefix <network>/<length>\n")
-
 /* old command */
 DEFUN (show_ipv6_bgp_prefix,
        show_ipv6_bgp_prefix_cmd,
@@ -7003,40 +6968,38 @@ ALIAS (show_bgp_view_prefix,
        "Address family\n"
        "IPv6 prefix <network>/<length>\n")  
 
-/* old command */
-DEFUN (show_ipv6_mbgp,
-       show_ipv6_mbgp_cmd,
-       "show ipv6 mbgp",
+DEFUN (show_bgp_ipv6, 
+       show_bgp_ipv6_cmd,
+       "show bgp ipv6 (unicast|multicast)",
        SHOW_STR
-       IP_STR
-       MBGP_STR)
+       MBGP_STR
+       IPV6_STR
+       "Address Family modifier\n"
+       "Address Family modifier\n")
 {
-  return bgp_show (vty, NULL, AFI_IP6, SAFI_MULTICAST, bgp_show_type_normal,
+  if (strncmp (argv[0], "m", 1) == 0)
+    return bgp_show (vty, NULL, AFI_IP6, SAFI_MULTICAST, bgp_show_type_normal,
                    NULL);
-}
 
-/* old command */
-DEFUN (show_ipv6_mbgp_route,
-       show_ipv6_mbgp_route_cmd,
-       "show ipv6 mbgp X:X::X:X",
-       SHOW_STR
-       IP_STR
-       MBGP_STR
-       "Network in the MBGP routing table to display\n")
-{
-  return bgp_show_route (vty, NULL, argv[0], AFI_IP6, SAFI_MULTICAST, NULL, 0);
+    return bgp_show (vty, NULL, AFI_IP6, SAFI_UNICAST, bgp_show_type_normal,
+                   NULL);
 }
 
 /* old command */
-DEFUN (show_ipv6_mbgp_prefix,
-       show_ipv6_mbgp_prefix_cmd,
-       "show ipv6 mbgp X:X::X:X/M",
+DEFUN (show_bgp_ipv6_prefix, 
+       show_bgp_ipv6_prefix_cmd,
+       "show bgp ipv6 (unicast|multicast) X:X::X:X/M",
        SHOW_STR
-       IP_STR
        MBGP_STR
+       IPV6_STR
+       "Address Family modifier\n"
+       "Address Family modifier\n"
        "IPv6 prefix <network>/<length>, e.g., 3ffe::/16\n")
 {
-  return bgp_show_route (vty, NULL, argv[0], AFI_IP6, SAFI_MULTICAST, NULL, 1);
+  if (strncmp (argv[0], "m", 1) == 0)
+    return bgp_show_route (vty, NULL, argv[0], AFI_IP6, SAFI_MULTICAST, NULL, 1);
+
+  return bgp_show_route (vty, NULL, argv[0], AFI_IP6, SAFI_UNICAST, NULL, 1);
 }
 #endif
 
@@ -9851,36 +9814,15 @@ ALIAS (show_bgp_view_neighbor_advertised_route,
        "Neighbor to display information about\n"
        "Display the routes advertised to a BGP neighbor\n")
        
-ALIAS (show_bgp_view_neighbor_advertised_route,
-       show_bgp_ipv6_neighbor_advertised_route_cmd,
-       "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X) advertised-routes",
-       SHOW_STR
-       BGP_STR
-       "Address family\n"
-       "Detailed information on TCP and BGP neighbor connections\n"
-       "Neighbor to display information about\n"
-       "Neighbor to display information about\n"
-       "Display the routes advertised to a BGP neighbor\n")
 
-/* old command */
-ALIAS (show_bgp_view_neighbor_advertised_route,
-       ipv6_bgp_neighbor_advertised_route_cmd,
-       "show ipv6 bgp neighbors (A.B.C.D|X:X::X:X) advertised-routes",
-       SHOW_STR
-       IPV6_STR
-       BGP_STR
-       "Detailed information on TCP and BGP neighbor connections\n"
-       "Neighbor to display information about\n"
-       "Neighbor to display information about\n"
-       "Display the routes advertised to a BGP neighbor\n")
-  
-/* old command */
-DEFUN (ipv6_mbgp_neighbor_advertised_route,
-       ipv6_mbgp_neighbor_advertised_route_cmd,
-       "show ipv6 mbgp neighbors (A.B.C.D|X:X::X:X) advertised-routes",
+DEFUN (show_bgp_ipv6_neighbor_advertised_route, 
+       show_bgp_ipv6_neighbor_advertised_route_cmd,
+       "show bgp ipv6 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X) advertised-routes",
        SHOW_STR
-       IPV6_STR
        MBGP_STR
+       IPV6_STR
+       "Address Family modifier\n"
+       "Address Family modifier\n"
        "Detailed information on TCP and BGP neighbor connections\n"
        "Neighbor to display information about\n"
        "Neighbor to display information about\n"
@@ -9892,7 +9834,7 @@ DEFUN (ipv6_mbgp_neighbor_advertised_route,
   if (! peer)
     return CMD_WARNING;  
 
-  return peer_adj_routes (vty, peer, AFI_IP6, SAFI_MULTICAST, 0);
+  return peer_adj_routes (vty, peer, AFI_IP6, bgp_node_safi(vty), 0);
 }
 #endif /* HAVE_IPV6 */
 
@@ -11989,10 +11931,9 @@ bgp_route_init (void)
   install_element (BGP_NODE, &old_no_ipv6_aggregate_address_cmd);
   install_element (BGP_NODE, &old_no_ipv6_aggregate_address_summary_only_cmd);
 
+  
   install_element (VIEW_NODE, &show_bgp_cmd);
-  install_element (VIEW_NODE, &show_bgp_ipv6_cmd);
   install_element (VIEW_NODE, &show_bgp_route_cmd);
-  install_element (VIEW_NODE, &show_bgp_ipv6_route_cmd);
   install_element (VIEW_NODE, &show_bgp_prefix_cmd);
   install_element (VIEW_NODE, &show_bgp_ipv6_prefix_cmd);
   install_element (VIEW_NODE, &show_bgp_regexp_cmd);
@@ -12068,7 +12009,6 @@ bgp_route_init (void)
    * VIEW_NODE - (set of dangerous commands) - (commands dependent on prev) 
    */
   install_element (RESTRICTED_NODE, &show_bgp_route_cmd);
-  install_element (RESTRICTED_NODE, &show_bgp_ipv6_route_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_prefix_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_ipv6_prefix_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_community_cmd);
@@ -12099,9 +12039,7 @@ bgp_route_init (void)
   install_element (RESTRICTED_NODE, &show_bgp_view_rsclient_prefix_cmd);
 
   install_element (ENABLE_NODE, &show_bgp_cmd);
-  install_element (ENABLE_NODE, &show_bgp_ipv6_cmd);
   install_element (ENABLE_NODE, &show_bgp_route_cmd);
-  install_element (ENABLE_NODE, &show_bgp_ipv6_route_cmd);
   install_element (ENABLE_NODE, &show_bgp_prefix_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv6_prefix_cmd);
   install_element (ENABLE_NODE, &show_bgp_regexp_cmd);
@@ -12180,7 +12118,6 @@ bgp_route_init (void)
   install_element (ENABLE_NODE, &show_bgp_statistics_view_vpnv4_cmd);
   
   /* old command */
-  install_element (VIEW_NODE, &show_ipv6_bgp_cmd);
   install_element (VIEW_NODE, &show_ipv6_bgp_route_cmd);
   install_element (VIEW_NODE, &show_ipv6_bgp_prefix_cmd);
   install_element (VIEW_NODE, &show_ipv6_bgp_regexp_cmd);
@@ -12198,9 +12135,8 @@ bgp_route_init (void)
   install_element (VIEW_NODE, &show_ipv6_bgp_community_list_cmd);
   install_element (VIEW_NODE, &show_ipv6_bgp_community_list_exact_cmd);
   install_element (VIEW_NODE, &show_ipv6_bgp_prefix_longer_cmd);
-  install_element (VIEW_NODE, &show_ipv6_mbgp_cmd);
-  install_element (VIEW_NODE, &show_ipv6_mbgp_route_cmd);
-  install_element (VIEW_NODE, &show_ipv6_mbgp_prefix_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_prefix_cmd);
   install_element (VIEW_NODE, &show_ipv6_mbgp_regexp_cmd);
   install_element (VIEW_NODE, &show_ipv6_mbgp_prefix_list_cmd);
   install_element (VIEW_NODE, &show_ipv6_mbgp_filter_list_cmd);
@@ -12218,7 +12154,6 @@ bgp_route_init (void)
   install_element (VIEW_NODE, &show_ipv6_mbgp_prefix_longer_cmd);
   
   /* old command */
-  install_element (ENABLE_NODE, &show_ipv6_bgp_cmd);
   install_element (ENABLE_NODE, &show_ipv6_bgp_route_cmd);
   install_element (ENABLE_NODE, &show_ipv6_bgp_prefix_cmd);
   install_element (ENABLE_NODE, &show_ipv6_bgp_regexp_cmd);
@@ -12236,9 +12171,8 @@ bgp_route_init (void)
   install_element (ENABLE_NODE, &show_ipv6_bgp_community_list_cmd);
   install_element (ENABLE_NODE, &show_ipv6_bgp_community_list_exact_cmd);
   install_element (ENABLE_NODE, &show_ipv6_bgp_prefix_longer_cmd);
-  install_element (ENABLE_NODE, &show_ipv6_mbgp_cmd);
-  install_element (ENABLE_NODE, &show_ipv6_mbgp_route_cmd);
-  install_element (ENABLE_NODE, &show_ipv6_mbgp_prefix_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_prefix_cmd);
   install_element (ENABLE_NODE, &show_ipv6_mbgp_regexp_cmd);
   install_element (ENABLE_NODE, &show_ipv6_mbgp_prefix_list_cmd);
   install_element (ENABLE_NODE, &show_ipv6_mbgp_filter_list_cmd);
@@ -12256,12 +12190,6 @@ bgp_route_init (void)
   install_element (ENABLE_NODE, &show_ipv6_mbgp_prefix_longer_cmd);
 
   /* old command */
-  install_element (VIEW_NODE, &ipv6_bgp_neighbor_advertised_route_cmd);
-  install_element (ENABLE_NODE, &ipv6_bgp_neighbor_advertised_route_cmd);
-  install_element (VIEW_NODE, &ipv6_mbgp_neighbor_advertised_route_cmd);
-  install_element (ENABLE_NODE, &ipv6_mbgp_neighbor_advertised_route_cmd);
-
-  /* old command */
   install_element (VIEW_NODE, &ipv6_bgp_neighbor_received_routes_cmd);
   install_element (ENABLE_NODE, &ipv6_bgp_neighbor_received_routes_cmd);
   install_element (VIEW_NODE, &ipv6_mbgp_neighbor_received_routes_cmd);
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 88be52e..eb9ec9a 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -6921,15 +6921,6 @@ DEFUN (show_ip_bgp_vpnv4_rd_summary,
 }
 
 #ifdef HAVE_IPV6
-DEFUN (show_bgp_summary, 
-       show_bgp_summary_cmd,
-       "show bgp summary",
-       SHOW_STR
-       BGP_STR
-       "Summary of BGP neighbor status\n")
-{
-  return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST);
-}
 
 DEFUN (show_bgp_instance_summary,
        show_bgp_instance_summary_cmd,
@@ -6943,46 +6934,31 @@ DEFUN (show_bgp_instance_summary,
   return bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST);
 }
 
-ALIAS (show_bgp_summary, 
-       show_bgp_ipv6_summary_cmd,
-       "show bgp ipv6 summary",
-       SHOW_STR
-       BGP_STR
-       "Address family\n"
-       "Summary of BGP neighbor status\n")
-
 ALIAS (show_bgp_instance_summary,
        show_bgp_instance_ipv6_summary_cmd,
-       "show bgp view WORD ipv6 summary",
+       "show bgp ipv6 (unicast|multicast) view WORD summary",
        SHOW_STR
-       BGP_STR
+       MBGP_STR
+       IPV6_STR
+       "Address Family modifier\n"
        "BGP view\n"
        "View name\n"
-       "Address family\n"
        "Summary of BGP neighbor status\n")
 
-/* old command */
-DEFUN (show_ipv6_bgp_summary, 
-       show_ipv6_bgp_summary_cmd,
-       "show ipv6 bgp summary",
+DEFUN (show_bgp_ipv6_summary, 
+       show_bgp_ipv6_summary_cmd,
+       "show bgp ipv6 (unicast|multicast) summary",
        SHOW_STR
+       MBGP_STR
        IPV6_STR
-       BGP_STR
+       "Address Family modifier\n"
+       "Address Family modifier\n"
        "Summary of BGP neighbor status\n")
 {
-  return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST);
-}
+  if (strncmp (argv[0], "m", 1) == 0)
+    return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST);
 
-/* old command */
-DEFUN (show_ipv6_mbgp_summary, 
-       show_ipv6_mbgp_summary_cmd,
-       "show ipv6 mbgp summary",
-       SHOW_STR
-       IPV6_STR
-       MBGP_STR
-       "Summary of BGP neighbor status\n")
-{
-  return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST);
+  return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST);
 }
 #endif /* HAVE_IPV6 */
 
@@ -9756,9 +9732,7 @@ bgp_vty_init (void)
   install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_summary_cmd);
   install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_summary_cmd);
 #ifdef HAVE_IPV6
-  install_element (VIEW_NODE, &show_bgp_summary_cmd);
   install_element (VIEW_NODE, &show_bgp_instance_summary_cmd);
-  install_element (VIEW_NODE, &show_bgp_ipv6_summary_cmd);
   install_element (VIEW_NODE, &show_bgp_instance_ipv6_summary_cmd);
 #endif /* HAVE_IPV6 */
   install_element (RESTRICTED_NODE, &show_ip_bgp_summary_cmd);
@@ -9768,7 +9742,6 @@ bgp_vty_init (void)
   install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_all_summary_cmd);
   install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_rd_summary_cmd);
 #ifdef HAVE_IPV6
-  install_element (RESTRICTED_NODE, &show_bgp_summary_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_instance_summary_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_ipv6_summary_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_summary_cmd);
@@ -9780,9 +9753,7 @@ bgp_vty_init (void)
   install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_all_summary_cmd);
   install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_rd_summary_cmd);
 #ifdef HAVE_IPV6
-  install_element (ENABLE_NODE, &show_bgp_summary_cmd);
   install_element (ENABLE_NODE, &show_bgp_instance_summary_cmd);
-  install_element (ENABLE_NODE, &show_bgp_ipv6_summary_cmd);
   install_element (ENABLE_NODE, &show_bgp_instance_ipv6_summary_cmd);
 #endif /* HAVE_IPV6 */
 
@@ -9836,10 +9807,8 @@ bgp_vty_init (void)
   install_element (ENABLE_NODE, &show_bgp_instance_ipv6_neighbors_peer_cmd);
 
   /* Old commands.  */
-  install_element (VIEW_NODE, &show_ipv6_bgp_summary_cmd);
-  install_element (VIEW_NODE, &show_ipv6_mbgp_summary_cmd);
-  install_element (ENABLE_NODE, &show_ipv6_bgp_summary_cmd);
-  install_element (ENABLE_NODE, &show_ipv6_mbgp_summary_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_summary_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_summary_cmd);
 #endif /* HAVE_IPV6 */
 
   /* "show ip bgp rsclient" commands. */
-- 
1.6.6




More information about the Quagga-dev mailing list