[prev in list] [next in list] [prev in thread] [next in thread] 

List:       quagga-dev
Subject:    [quagga-dev 14370] [PATCH 24/25] CLI: Add back old forms of 'show <afi> <safi>' for compatibility
From:       Lou Berger <lberger () labn ! net>
Date:       2015-12-24 18:10:29
Message-ID: 1450980630-11805-25-git-send-email-lberger () labn ! net
[Download RAW message or body]

  This patch set adds show commands in the form
       show bgp <afi> <safi> ...

  The patch is submitted to facilitate removal of the old/non-generic
  from of safi commands if/when the decision is made to remove them.
  (Just don't add this patch on top of the earlier patch, and the old forms
  will be gone!)

    Signed-off-by: Lou Berger <lberger@labn.net>
---
 bgpd/bgp_route.c | 6821 +++++++++++++++++++++++++++++++++++++++++-------------
 bgpd/bgp_vty.c   |  459 +++-
 2 files changed, 5703 insertions(+), 1577 deletions(-)

diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 884e1df..c4bbd75 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -6951,6 +6951,248 @@ bgp_show_route (struct vty *vty, const char *view_name, const \
char *ip_str,  }
 
 /* BGP route print out function. */
+DEFUN (show_ip_bgp,
+       show_ip_bgp_cmd,
+       "show ip bgp",
+       SHOW_STR
+       IP_STR
+       BGP_STR)
+{
+  return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST, bgp_show_type_normal, NULL);
+}
+
+DEFUN (show_ip_bgp_ipv4,
+       show_ip_bgp_ipv4_cmd,
+       "show ip bgp ipv4 (unicast|multicast)",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n")
+{
+  if (strncmp (argv[0], "m", 1) == 0)
+    return bgp_show (vty, NULL, AFI_IP, SAFI_MULTICAST, bgp_show_type_normal,
+                     NULL);
+ 
+  return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST, bgp_show_type_normal, NULL);
+}
+
+DEFUN (show_ip_bgp_route,
+       show_ip_bgp_route_cmd,
+       "show ip bgp A.B.C.D",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Network in the BGP routing table to display\n")
+{
+  return bgp_show_route (vty, NULL, argv[0], AFI_IP, SAFI_UNICAST, NULL, 0);
+}
+
+DEFUN (show_ip_bgp_ipv4_route,
+       show_ip_bgp_ipv4_route_cmd,
+       "show ip bgp ipv4 (unicast|multicast) A.B.C.D",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Network in the BGP routing table to display\n")
+{
+  if (strncmp (argv[0], "m", 1) == 0)
+    return bgp_show_route (vty, NULL, argv[1], AFI_IP, SAFI_MULTICAST, NULL, 0);
+
+  return bgp_show_route (vty, NULL, argv[1], AFI_IP, SAFI_UNICAST, NULL, 0);
+}
+
+DEFUN (show_ip_bgp_vpnv4_all_route,
+       show_ip_bgp_vpnv4_all_route_cmd,
+       "show ip bgp vpnv4 all A.B.C.D",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display VPNv4 NLRI specific information\n"
+       "Display information about all VPNv4 NLRIs\n"
+       "Network in the BGP routing table to display\n")
+{
+  return bgp_show_route (vty, NULL, argv[0], AFI_IP, SAFI_MPLS_VPN, NULL, 0);
+}
+
+DEFUN (show_ip_bgp_vpnv4_rd_route,
+       show_ip_bgp_vpnv4_rd_route_cmd,
+       "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn A.B.C.D",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display VPNv4 NLRI specific information\n"
+       "Display information for a route distinguisher\n"
+       "VPN Route Distinguisher\n"
+       "Network in the BGP routing table to display\n")
+{
+  int ret;
+  struct prefix_rd prd;
+
+  ret = str2prefix_rd (argv[0], &prd);
+  if (! ret)
+    {
+      vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+  return bgp_show_route (vty, NULL, argv[1], AFI_IP, SAFI_MPLS_VPN, &prd, 0);
+}
+
+DEFUN (show_ip_bgp_prefix,
+       show_ip_bgp_prefix_cmd,
+       "show ip bgp A.B.C.D/M",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
+{
+  return bgp_show_route (vty, NULL, argv[0], AFI_IP, SAFI_UNICAST, NULL, 1);
+}
+
+DEFUN (show_ip_bgp_ipv4_prefix,
+       show_ip_bgp_ipv4_prefix_cmd,
+       "show ip bgp ipv4 (unicast|multicast) A.B.C.D/M",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
+{
+  if (strncmp (argv[0], "m", 1) == 0)
+    return bgp_show_route (vty, NULL, argv[1], AFI_IP, SAFI_MULTICAST, NULL, 1);
+
+  return bgp_show_route (vty, NULL, argv[1], AFI_IP, SAFI_UNICAST, NULL, 1);
+}
+
+DEFUN (show_ip_bgp_vpnv4_all_prefix,
+       show_ip_bgp_vpnv4_all_prefix_cmd,
+       "show ip bgp vpnv4 all A.B.C.D/M",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display VPNv4 NLRI specific information\n"
+       "Display information about all VPNv4 NLRIs\n"
+       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
+{
+  return bgp_show_route (vty, NULL, argv[0], AFI_IP, SAFI_MPLS_VPN, NULL, 1);
+}
+
+DEFUN (show_ip_bgp_vpnv4_rd_prefix,
+       show_ip_bgp_vpnv4_rd_prefix_cmd,
+       "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn A.B.C.D/M",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display VPNv4 NLRI specific information\n"
+       "Display information for a route distinguisher\n"
+       "VPN Route Distinguisher\n"
+       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
+{
+  int ret;
+  struct prefix_rd prd;
+
+  ret = str2prefix_rd (argv[0], &prd);
+  if (! ret)
+    {
+      vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+  return bgp_show_route (vty, NULL, argv[1], AFI_IP, SAFI_MPLS_VPN, &prd, 1);
+}
+
+DEFUN (show_ip_bgp_view,
+       show_ip_bgp_view_cmd,
+       "show ip bgp view WORD",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n")
+{
+  struct bgp *bgp;
+
+  /* BGP structure lookup. */
+  bgp = bgp_lookup_by_name (argv[0]);
+  if (bgp == NULL)
+	{
+	  vty_out (vty, "Can't find BGP view %s%s", argv[0], VTY_NEWLINE);
+	  return CMD_WARNING;
+	}
+
+  return bgp_show (vty, bgp, AFI_IP, SAFI_UNICAST, bgp_show_type_normal, NULL);
+}
+
+DEFUN (show_ip_bgp_view_route,
+       show_ip_bgp_view_route_cmd,
+       "show ip bgp view WORD A.B.C.D",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "Network in the BGP routing table to display\n")
+{
+  return bgp_show_route (vty, argv[0], argv[1], AFI_IP, SAFI_UNICAST, NULL, 0);
+}
+
+DEFUN (show_ip_bgp_view_prefix,
+       show_ip_bgp_view_prefix_cmd,
+       "show ip bgp view WORD A.B.C.D/M",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
+{
+  return bgp_show_route (vty, argv[0], argv[1], AFI_IP, SAFI_UNICAST, NULL, 1);
+}
+
+DEFUN (show_bgp,
+       show_bgp_cmd,
+       "show bgp",
+       SHOW_STR
+       BGP_STR)
+{
+  return bgp_show (vty, NULL, AFI_IP6, SAFI_UNICAST, bgp_show_type_normal,
+                   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",
+       SHOW_STR
+       BGP_STR
+       "Network in the BGP routing table to display\n")
+{
+  return bgp_show_route (vty, NULL, argv[0], AFI_IP6, SAFI_UNICAST, NULL, 0);
+}
+
 DEFUN (show_bgp_ipv4_safi,
        show_bgp_ipv4_safi_cmd,
        "show bgp ipv4 (unicast|multicast)",
@@ -7444,6 +7686,29 @@ DEFUN (show_bgp_ipv6_safi_route,
   return bgp_show_route (vty, NULL, argv[1], AFI_IP6, SAFI_UNICAST, NULL, 0);
 }
 
+/* old command */
+DEFUN (show_ipv6_bgp_route,
+       show_ipv6_bgp_route_cmd,
+       "show ipv6 bgp X:X::X:X",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Network in the BGP routing table to display\n")
+{
+  return bgp_show_route (vty, NULL, argv[0], AFI_IP6, SAFI_UNICAST, NULL, 0);
+}
+
+DEFUN (show_bgp_prefix,
+       show_bgp_prefix_cmd,
+       "show bgp X:X::X:X/M",
+       SHOW_STR
+       BGP_STR
+       "IPv6 prefix <network>/<length>\n")
+{
+  return bgp_show_route (vty, NULL, argv[0], AFI_IP6, SAFI_UNICAST, NULL, 1);
+}
+
+
 /* new002 */
 DEFUN (show_bgp_ipv6_prefix,
        show_bgp_ipv6_prefix_cmd,
@@ -7471,7 +7736,40 @@ DEFUN (show_bgp_ipv6_safi_prefix,
   return bgp_show_route (vty, NULL, argv[1], AFI_IP6, SAFI_UNICAST, NULL, 1);
 }
 
+/* old command */
+DEFUN (show_ipv6_bgp_prefix,
+       show_ipv6_bgp_prefix_cmd,
+       "show ipv6 bgp X:X::X:X/M",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "IPv6 prefix <network>/<length>, e.g., 3ffe::/16\n")
+{
+  return bgp_show_route (vty, NULL, argv[0], AFI_IP6, SAFI_UNICAST, NULL, 1);
+}
+
 DEFUN (show_bgp_view,
+       show_bgp_view_cmd,
+       "show bgp view WORD",
+       SHOW_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n")
+{
+  struct bgp *bgp;
+
+  /* BGP structure lookup. */
+  bgp = bgp_lookup_by_name (argv[0]);
+  if (bgp == NULL)
+	{
+	  vty_out (vty, "Can't find BGP view %s%s", argv[0], VTY_NEWLINE);
+	  return CMD_WARNING;
+	}
+  
+  return bgp_show (vty, bgp, AFI_IP6, SAFI_UNICAST, bgp_show_type_normal, NULL);
+}
+
+DEFUN (show_bgp_view_ipv6,
        show_bgp_view_ipv6_cmd,
        "show bgp view WORD ipv6",
        SHOW_STR
@@ -7494,6 +7792,18 @@ DEFUN (show_bgp_view,
 }
   
 DEFUN (show_bgp_view_route,
+       show_bgp_view_route_cmd,
+       "show bgp view WORD X:X::X:X",
+       SHOW_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "Network in the BGP routing table to display\n")
+{
+  return bgp_show_route (vty, argv[0], argv[1], AFI_IP6, SAFI_UNICAST, NULL, 0);
+}
+
+DEFUN (show_bgp_view_ipv6_route,
        show_bgp_view_ipv6_route_cmd,
        "show bgp view WORD ipv6 X:X::X:X",
        SHOW_STR
@@ -7506,7 +7816,55 @@ DEFUN (show_bgp_view_route,
   return bgp_show_route (vty, argv[0], argv[1], AFI_IP6, SAFI_UNICAST, NULL, 0);
 }
 
+/* old command */
+DEFUN (show_ipv6_mbgp,
+       show_ipv6_mbgp_cmd,
+       "show ipv6 mbgp",
+       SHOW_STR
+       IP_STR
+       MBGP_STR)
+{
+  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);
+}
+
+/* old command */
+DEFUN (show_ipv6_mbgp_prefix,
+       show_ipv6_mbgp_prefix_cmd,
+       "show ipv6 mbgp X:X::X:X/M",
+       SHOW_STR
+       IP_STR
+       MBGP_STR
+       "IPv6 prefix <network>/<length>, e.g., 3ffe::/16\n")
+{
+  return bgp_show_route (vty, NULL, argv[0], AFI_IP6, SAFI_MULTICAST, NULL, 1);
+}
+
 DEFUN (show_bgp_view_prefix,
+       show_bgp_view_prefix_cmd,
+       "show bgp view WORD X:X::X:X/M",
+       SHOW_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"       
+       "IPv6 prefix <network>/<length>\n")
+{
+  return bgp_show_route (vty, argv[0], argv[1], AFI_IP6, SAFI_UNICAST, NULL, 1); 
+}
+
+DEFUN (show_bgp_view_ipv6_prefix,
        show_bgp_view_ipv6_prefix_cmd,
        "show bgp view WORD ipv6 X:X::X:X/M",
        SHOW_STR
@@ -7567,15 +7925,116 @@ bgp_show_regexp (struct vty *vty, int argc, const char \
**argv, afi_t afi,  return rc;
 }
 
-DEFUN (show_bgp_ipv4_safi_flap_regexp,
-       show_bgp_ipv4_safi_flap_regexp_cmd,
-       "show bgp ipv4 (encap|multicast|unicast|vpn) flap-statistics regexp .LINE",
+
+DEFUN (show_ip_bgp_regexp, 
+       show_ip_bgp_regexp_cmd,
+       "show ip bgp regexp .LINE",
        SHOW_STR
-       BGP_STR
        IP_STR
-       "Address Family Modifier\n"
-       "Address Family Modifier\n"
-       "Address Family Modifier\n"
+       BGP_STR
+       "Display routes matching the AS path regular expression\n"
+       "A regular-expression to match the BGP AS paths\n")
+{
+  return bgp_show_regexp (vty, argc, argv, AFI_IP, SAFI_UNICAST,
+			  bgp_show_type_regexp);
+}
+
+DEFUN (show_ip_bgp_flap_regexp, 
+       show_ip_bgp_flap_regexp_cmd,
+       "show ip bgp flap-statistics regexp .LINE",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display flap statistics of routes\n"
+       "Display routes matching the AS path regular expression\n"
+       "A regular-expression to match the BGP AS paths\n")
+{
+  return bgp_show_regexp (vty, argc, argv, AFI_IP, SAFI_UNICAST,
+			  bgp_show_type_flap_regexp);
+}
+
+ALIAS (show_ip_bgp_flap_regexp,
+       show_ip_bgp_damp_flap_regexp_cmd,
+       "show ip bgp dampening flap-statistics regexp .LINE",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display detailed information about dampening\n"
+       "Display flap statistics of routes\n"
+       "Display routes matching the AS path regular expression\n"
+       "A regular-expression to match the BGP AS paths\n")
+
+DEFUN (show_ip_bgp_ipv4_regexp, 
+       show_ip_bgp_ipv4_regexp_cmd,
+       "show ip bgp ipv4 (unicast|multicast) regexp .LINE",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display routes matching the AS path regular expression\n"
+       "A regular-expression to match the BGP AS paths\n")
+{
+  if (strncmp (argv[0], "m", 1) == 0)
+    return bgp_show_regexp (vty, argc, argv, AFI_IP, SAFI_MULTICAST,
+			    bgp_show_type_regexp);
+
+  return bgp_show_regexp (vty, argc, argv, AFI_IP, SAFI_UNICAST,
+			  bgp_show_type_regexp);
+}
+
+#ifdef HAVE_IPV6
+DEFUN (show_bgp_regexp, 
+       show_bgp_regexp_cmd,
+       "show bgp regexp .LINE",
+       SHOW_STR
+       BGP_STR
+       "Display routes matching the AS path regular expression\n"
+       "A regular-expression to match the BGP AS paths\n")
+{
+  return bgp_show_regexp (vty, argc, argv, AFI_IP6, SAFI_UNICAST,
+			  bgp_show_type_regexp);
+}
+
+/* old command */
+DEFUN (show_ipv6_bgp_regexp, 
+       show_ipv6_bgp_regexp_cmd,
+       "show ipv6 bgp regexp .LINE",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display routes matching the AS path regular expression\n"
+       "A regular-expression to match the BGP AS paths\n")
+{
+  return bgp_show_regexp (vty, argc, argv, AFI_IP6, SAFI_UNICAST,
+			  bgp_show_type_regexp);
+}
+
+/* old command */
+DEFUN (show_ipv6_mbgp_regexp, 
+       show_ipv6_mbgp_regexp_cmd,
+       "show ipv6 mbgp regexp .LINE",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display routes matching the AS path regular expression\n"
+       "A regular-expression to match the MBGP AS paths\n")
+{
+  return bgp_show_regexp (vty, argc, argv, AFI_IP6, SAFI_MULTICAST,
+			  bgp_show_type_regexp);
+}
+#endif /* HAVE_IPV6 */
+
+DEFUN (show_bgp_ipv4_safi_flap_regexp,
+       show_bgp_ipv4_safi_flap_regexp_cmd,
+       "show bgp ipv4 (encap|multicast|unicast|vpn) flap-statistics regexp .LINE",
+       SHOW_STR
+       BGP_STR
+       IP_STR
+       "Address Family Modifier\n"
+       "Address Family Modifier\n"
+       "Address Family Modifier\n"
        "Address Family Modifier\n"
        "Display flap statistics of routes\n"
        "Display routes matching the AS path regular expression\n"
@@ -7724,6 +8183,114 @@ bgp_show_prefix_list (struct vty *vty, const char \
*prefix_list_str, afi_t afi,  
   return bgp_show (vty, NULL, afi, safi, type, plist);
 }
+DEFUN (show_ip_bgp_prefix_list, 
+       show_ip_bgp_prefix_list_cmd,
+       "show ip bgp prefix-list WORD",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display routes conforming to the prefix-list\n"
+       "IP prefix-list name\n")
+{
+  return bgp_show_prefix_list (vty, argv[0], AFI_IP, SAFI_UNICAST,
+			       bgp_show_type_prefix_list);
+}
+
+DEFUN (show_ip_bgp_flap_prefix_list, 
+       show_ip_bgp_flap_prefix_list_cmd,
+       "show ip bgp flap-statistics prefix-list WORD",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display flap statistics of routes\n"
+       "Display routes conforming to the prefix-list\n"
+       "IP prefix-list name\n")
+{
+  return bgp_show_prefix_list (vty, argv[0], AFI_IP, SAFI_UNICAST,
+			       bgp_show_type_flap_prefix_list);
+}
+
+ALIAS (show_ip_bgp_flap_prefix_list,
+       show_ip_bgp_damp_flap_prefix_list_cmd,
+       "show ip bgp dampening flap-statistics prefix-list WORD",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display detailed information about dampening\n"
+       "Display flap statistics of routes\n"
+       "Display routes conforming to the prefix-list\n"
+       "IP prefix-list name\n")
+
+DEFUN (show_ip_bgp_ipv4_prefix_list, 
+       show_ip_bgp_ipv4_prefix_list_cmd,
+       "show ip bgp ipv4 (unicast|multicast) prefix-list WORD",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display routes conforming to the prefix-list\n"
+       "IP prefix-list name\n")
+{
+  if (strncmp (argv[0], "m", 1) == 0)
+    return bgp_show_prefix_list (vty, argv[1], AFI_IP, SAFI_MULTICAST,
+			         bgp_show_type_prefix_list);
+
+  return bgp_show_prefix_list (vty, argv[1], AFI_IP, SAFI_UNICAST,
+			       bgp_show_type_prefix_list);
+}
+
+#ifdef HAVE_IPV6
+DEFUN (show_bgp_prefix_list, 
+       show_bgp_prefix_list_cmd,
+       "show bgp prefix-list WORD",
+       SHOW_STR
+       BGP_STR
+       "Display routes conforming to the prefix-list\n"
+       "IPv6 prefix-list name\n")
+{
+  return bgp_show_prefix_list (vty, argv[0], AFI_IP6, SAFI_UNICAST,
+			       bgp_show_type_prefix_list);
+}
+
+ALIAS (show_bgp_prefix_list, 
+       show_bgp_ipv6_prefix_list_cmd,
+       "show bgp ipv6 prefix-list WORD",
+       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Display routes conforming to the prefix-list\n"
+       "IPv6 prefix-list name\n")
+
+/* old command */
+DEFUN (show_ipv6_bgp_prefix_list, 
+       show_ipv6_bgp_prefix_list_cmd,
+       "show ipv6 bgp prefix-list WORD",
+       SHOW_STR
+       IPV6_STR
+       BGP_STR
+       "Display routes matching the prefix-list\n"
+       "IPv6 prefix-list name\n")
+{
+  return bgp_show_prefix_list (vty, argv[0], AFI_IP6, SAFI_UNICAST,
+			       bgp_show_type_prefix_list);
+}
+
+/* old command */
+DEFUN (show_ipv6_mbgp_prefix_list, 
+       show_ipv6_mbgp_prefix_list_cmd,
+       "show ipv6 mbgp prefix-list WORD",
+       SHOW_STR
+       IPV6_STR
+       MBGP_STR
+       "Display routes matching the prefix-list\n"
+       "IPv6 prefix-list name\n")
+{
+  return bgp_show_prefix_list (vty, argv[0], AFI_IP6, SAFI_MULTICAST,
+			       bgp_show_type_prefix_list);
+}
+#endif /* HAVE_IPV6 */
 
 DEFUN (show_bgp_ipv4_prefix_list, 
        show_bgp_ipv4_prefix_list_cmd,
@@ -7859,19 +8426,6 @@ DEFUN (show_bgp_ipv6_safi_prefix_list,
 			       bgp_show_type_prefix_list);
 }
 
-DEFUN (show_bgp_prefix_list, 
-       show_bgp_ipv6_prefix_list_cmd,
-       "show bgp ipv6 prefix-list WORD",
-       SHOW_STR
-       BGP_STR
-       "Address family\n"
-       "Display routes conforming to the prefix-list\n"
-       "IPv6 prefix-list name\n")
-{
-  return bgp_show_prefix_list (vty, argv[0], AFI_IP6, SAFI_UNICAST,
-			       bgp_show_type_prefix_list);
-}
-
 #endif /* HAVE_IPV6 */
 
 static int
@@ -7890,6 +8444,118 @@ bgp_show_filter_list (struct vty *vty, const char *filter, \
afi_t afi,  return bgp_show (vty, NULL, afi, safi, type, as_list);
 }
 
+DEFUN (show_ip_bgp_filter_list, 
+       show_ip_bgp_filter_list_cmd,
+       "show ip bgp filter-list WORD",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display routes conforming to the filter-list\n"
+       "Regular expression access list name\n")
+{
+  return bgp_show_filter_list (vty, argv[0], AFI_IP, SAFI_UNICAST,
+			       bgp_show_type_filter_list);
+}
+
+DEFUN (show_ip_bgp_flap_filter_list, 
+       show_ip_bgp_flap_filter_list_cmd,
+       "show ip bgp flap-statistics filter-list WORD",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display flap statistics of routes\n"
+       "Display routes conforming to the filter-list\n"
+       "Regular expression access list name\n")
+{
+  return bgp_show_filter_list (vty, argv[0], AFI_IP, SAFI_UNICAST,
+			       bgp_show_type_flap_filter_list);
+}
+
+ALIAS (show_ip_bgp_flap_filter_list, 
+       show_ip_bgp_damp_flap_filter_list_cmd,
+       "show ip bgp dampening flap-statistics filter-list WORD",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display detailed information about dampening\n"
+       "Display flap statistics of routes\n"
+       "Display routes conforming to the filter-list\n"
+       "Regular expression access list name\n")
+
+DEFUN (show_ip_bgp_ipv4_filter_list, 
+       show_ip_bgp_ipv4_filter_list_cmd,
+       "show ip bgp ipv4 (unicast|multicast) filter-list WORD",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display routes conforming to the filter-list\n"
+       "Regular expression access list name\n")
+{
+  if (strncmp (argv[0], "m", 1) == 0)
+    return bgp_show_filter_list (vty, argv[1], AFI_IP, SAFI_MULTICAST,
+			         bgp_show_type_filter_list);
+  
+  return bgp_show_filter_list (vty, argv[1], AFI_IP, SAFI_UNICAST,
+			       bgp_show_type_filter_list);
+}
+
+#ifdef HAVE_IPV6
+DEFUN (show_bgp_filter_list, 
+       show_bgp_filter_list_cmd,
+       "show bgp filter-list WORD",
+       SHOW_STR
+       BGP_STR
+       "Display routes conforming to the filter-list\n"
+       "Regular expression access list name\n")
+{
+  return bgp_show_filter_list (vty, argv[0], AFI_IP6, SAFI_UNICAST,
+			       bgp_show_type_filter_list);
+}
+
+/* old command */
+DEFUN (show_ipv6_bgp_filter_list, 
+       show_ipv6_bgp_filter_list_cmd,
+       "show ipv6 bgp filter-list WORD",
+       SHOW_STR
+       IPV6_STR
+       BGP_STR
+       "Display routes conforming to the filter-list\n"
+       "Regular expression access list name\n")
+{
+  return bgp_show_filter_list (vty, argv[0], AFI_IP6, SAFI_UNICAST,
+			       bgp_show_type_filter_list);
+}
+
+/* old command */
+DEFUN (show_ipv6_mbgp_filter_list, 
+       show_ipv6_mbgp_filter_list_cmd,
+       "show ipv6 mbgp filter-list WORD",
+       SHOW_STR
+       IPV6_STR
+       MBGP_STR
+       "Display routes conforming to the filter-list\n"
+       "Regular expression access list name\n")
+{
+  return bgp_show_filter_list (vty, argv[0], AFI_IP6, SAFI_MULTICAST,
+			       bgp_show_type_filter_list);
+}
+#endif /* HAVE_IPV6 */
+
+DEFUN (show_ip_bgp_dampening_info,
+       show_ip_bgp_dampening_params_cmd,
+       "show ip bgp dampening parameters",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display detailed information about dampening\n"
+       "Display detail of configured dampening parameters\n")
+{
+    return bgp_show_dampening_parameters (vty, AFI_IP, SAFI_UNICAST);
+}
+
 DEFUN (show_bgp_ipv4_filter_list, 
        show_bgp_ipv4_filter_list_cmd,
        "show bgp ipv4 filter-list WORD",
@@ -8026,7 +8692,7 @@ DEFUN (show_bgp_ipv6_safi_filter_list,
 			         bgp_show_type_filter_list);
 }
 
-DEFUN (show_bgp_filter_list, 
+DEFUN (show_bgp_ipv6_filter_list, 
        show_bgp_ipv6_filter_list_cmd,
        "show bgp ipv6 filter-list WORD",
        SHOW_STR
@@ -8041,18 +8707,6 @@ DEFUN (show_bgp_filter_list,
 
 #endif /* HAVE_IPV6 */
 
-DEFUN (show_ip_bgp_dampening_info,
-       show_ip_bgp_dampening_params_cmd,
-       "show ip bgp dampening parameters",
-       SHOW_STR
-       IP_STR
-       BGP_STR
-       "Display detailed information about dampening\n"
-       "Display detail of configured dampening parameters\n")
-{
-    return bgp_show_dampening_parameters (vty, AFI_IP, SAFI_UNICAST);
-}
-
 static int
 bgp_show_route_map (struct vty *vty, const char *rmap_str, afi_t afi,
 		    safi_t safi, enum bgp_show_type type)
@@ -8070,6 +8724,208 @@ bgp_show_route_map (struct vty *vty, const char *rmap_str, \
afi_t afi,  return bgp_show (vty, NULL, afi, safi, type, rmap);
 }
 
+DEFUN (show_ip_bgp_route_map, 
+       show_ip_bgp_route_map_cmd,
+       "show ip bgp route-map WORD",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display routes matching the route-map\n"
+       "A route-map to match on\n")
+{
+  return bgp_show_route_map (vty, argv[0], AFI_IP, SAFI_UNICAST,
+			     bgp_show_type_route_map);
+}
+
+DEFUN (show_ip_bgp_flap_route_map, 
+       show_ip_bgp_flap_route_map_cmd,
+       "show ip bgp flap-statistics route-map WORD",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display flap statistics of routes\n"
+       "Display routes matching the route-map\n"
+       "A route-map to match on\n")
+{
+  return bgp_show_route_map (vty, argv[0], AFI_IP, SAFI_UNICAST,
+			     bgp_show_type_flap_route_map);
+}
+
+ALIAS (show_ip_bgp_flap_route_map, 
+       show_ip_bgp_damp_flap_route_map_cmd,
+       "show ip bgp dampening flap-statistics route-map WORD",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display detailed information about dampening\n"
+       "Display flap statistics of routes\n"
+       "Display routes matching the route-map\n"
+       "A route-map to match on\n")
+
+DEFUN (show_ip_bgp_ipv4_route_map, 
+       show_ip_bgp_ipv4_route_map_cmd,
+       "show ip bgp ipv4 (unicast|multicast) route-map WORD",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display routes matching the route-map\n"
+       "A route-map to match on\n")
+{
+  if (strncmp (argv[0], "m", 1) == 0)
+    return bgp_show_route_map (vty, argv[1], AFI_IP, SAFI_MULTICAST,
+			       bgp_show_type_route_map);
+
+  return bgp_show_route_map (vty, argv[1], AFI_IP, SAFI_UNICAST,
+			     bgp_show_type_route_map);
+}
+
+DEFUN (show_bgp_route_map, 
+       show_bgp_route_map_cmd,
+       "show bgp route-map WORD",
+       SHOW_STR
+       BGP_STR
+       "Display routes matching the route-map\n"
+       "A route-map to match on\n")
+{
+  return bgp_show_route_map (vty, argv[0], AFI_IP6, SAFI_UNICAST,
+			     bgp_show_type_route_map);
+}
+
+DEFUN (show_ip_bgp_cidr_only,
+       show_ip_bgp_cidr_only_cmd,
+       "show ip bgp cidr-only",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display only routes with non-natural netmasks\n")
+{
+    return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST,
+		     bgp_show_type_cidr_only, NULL);
+}
+
+DEFUN (show_ip_bgp_flap_cidr_only,
+       show_ip_bgp_flap_cidr_only_cmd,
+       "show ip bgp flap-statistics cidr-only",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display flap statistics of routes\n"
+       "Display only routes with non-natural netmasks\n")
+{
+  return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST,
+		   bgp_show_type_flap_cidr_only, NULL);
+}
+
+ALIAS (show_ip_bgp_flap_cidr_only,
+       show_ip_bgp_damp_flap_cidr_only_cmd,
+       "show ip bgp dampening flap-statistics cidr-only",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display detailed information about dampening\n"
+       "Display flap statistics of routes\n"
+       "Display only routes with non-natural netmasks\n")
+
+DEFUN (show_ip_bgp_ipv4_cidr_only,
+       show_ip_bgp_ipv4_cidr_only_cmd,
+       "show ip bgp ipv4 (unicast|multicast) cidr-only",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display only routes with non-natural netmasks\n")
+{
+  if (strncmp (argv[0], "m", 1) == 0)
+    return bgp_show (vty, NULL, AFI_IP, SAFI_MULTICAST,
+		     bgp_show_type_cidr_only, NULL);
+
+  return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST,
+		     bgp_show_type_cidr_only, NULL);
+}
+
+DEFUN (show_ip_bgp_community_all,
+       show_ip_bgp_community_all_cmd,
+       "show ip bgp community",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display routes matching the communities\n")
+{
+  return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST,
+		     bgp_show_type_community_all, NULL);
+}
+
+DEFUN (show_ip_bgp_ipv4_community_all,
+       show_ip_bgp_ipv4_community_all_cmd,
+       "show ip bgp ipv4 (unicast|multicast) community",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display routes matching the communities\n")
+{
+  if (strncmp (argv[0], "m", 1) == 0)
+    return bgp_show (vty, NULL, AFI_IP, SAFI_MULTICAST,
+		     bgp_show_type_community_all, NULL);
+ 
+  return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST,
+		   bgp_show_type_community_all, NULL);
+}
+
+#ifdef HAVE_IPV6
+DEFUN (show_bgp_community_all,
+       show_bgp_community_all_cmd,
+       "show bgp community",
+       SHOW_STR
+       BGP_STR
+       "Display routes matching the communities\n")
+{
+  return bgp_show (vty, NULL, AFI_IP6, SAFI_UNICAST,
+		   bgp_show_type_community_all, NULL);
+}
+
+ALIAS (show_bgp_community_all,
+       show_bgp_ipv6_community_all_cmd,
+       "show bgp ipv6 community",
+       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Display routes matching the communities\n")
+
+/* old command */
+DEFUN (show_ipv6_bgp_community_all,
+       show_ipv6_bgp_community_all_cmd,
+       "show ipv6 bgp community",
+       SHOW_STR
+       IPV6_STR
+       BGP_STR
+       "Display routes matching the communities\n")
+{
+  return bgp_show (vty, NULL, AFI_IP6, SAFI_UNICAST,
+		   bgp_show_type_community_all, NULL);
+}
+
+/* old command */
+DEFUN (show_ipv6_mbgp_community_all,
+       show_ipv6_mbgp_community_all_cmd,
+       "show ipv6 mbgp community",
+       SHOW_STR
+       IPV6_STR
+       MBGP_STR
+       "Display routes matching the communities\n")
+{
+  return bgp_show (vty, NULL, AFI_IP6, SAFI_MULTICAST,
+		   bgp_show_type_community_all, NULL);
+}
+#endif /* HAVE_IPV6 */
+
 DEFUN (show_bgp_ipv4_route_map, 
        show_bgp_ipv4_route_map_cmd,
        "show bgp ipv4 route-map WORD",
@@ -8405,12 +9261,12 @@ bgp_show_community (struct vty *vty, const char *view_name, \
int argc,  bgp_show_type_community), com);
 }
 
-DEFUN (show_bgp_ipv4_community,
-       show_bgp_ipv4_community_cmd,
-       "show bgp ipv4 community (AA:NN|local-AS|no-advertise|no-export)",
+DEFUN (show_ip_bgp_community,
+       show_ip_bgp_community_cmd,
+       "show ip bgp community (AA:NN|local-AS|no-advertise|no-export)",
        SHOW_STR
-       BGP_STR
        IP_STR
+       BGP_STR
        "Display routes matching the communities\n"
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
@@ -8420,12 +9276,12 @@ DEFUN (show_bgp_ipv4_community,
   return bgp_show_community (vty, NULL, argc, argv, 0, AFI_IP, SAFI_UNICAST);
 }
 
-ALIAS (show_bgp_ipv4_community,
-       show_bgp_ipv4_community2_cmd,
-       "show bgp ipv4 community (AA:NN|local-AS|no-advertise|no-export) \
(AA:NN|local-AS|no-advertise|no-export)", +ALIAS (show_ip_bgp_community,
+       show_ip_bgp_community2_cmd,
+       "show ip bgp community (AA:NN|local-AS|no-advertise|no-export) \
(AA:NN|local-AS|no-advertise|no-export)",  SHOW_STR
-       BGP_STR
        IP_STR
+       BGP_STR
        "Display routes matching the communities\n"
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
@@ -8436,12 +9292,12 @@ ALIAS (show_bgp_ipv4_community,
        "Do not advertise to any peer (well-known community)\n"
        "Do not export to next AS (well-known community)\n")
 	
-ALIAS (show_bgp_ipv4_community,
-       show_bgp_ipv4_community3_cmd,
-       "show bgp ipv4 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)", \
+ALIAS (show_ip_bgp_community, +       show_ip_bgp_community3_cmd,
+       "show ip bgp 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_STR
-       BGP_STR
        IP_STR
+       BGP_STR
        "Display routes matching the communities\n"
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
@@ -8456,12 +9312,12 @@ ALIAS (show_bgp_ipv4_community,
        "Do not advertise to any peer (well-known community)\n"
        "Do not export to next AS (well-known community)\n")
 	
-ALIAS (show_bgp_ipv4_community,
-       show_bgp_ipv4_community4_cmd,
-       "show bgp ipv4 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)", +ALIAS (show_ip_bgp_community,
+       show_ip_bgp_community4_cmd,
+       "show ip bgp 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_STR
-       BGP_STR
        IP_STR
+       BGP_STR
        "Display routes matching the communities\n"
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
@@ -8480,10 +9336,11 @@ ALIAS (show_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_ipv4_safi_community,
-       show_bgp_ipv4_safi_community_cmd,
-       "show bgp ipv4 (unicast|multicast) community \
(AA:NN|local-AS|no-advertise|no-export)", +DEFUN (show_ip_bgp_ipv4_community,
+       show_ip_bgp_ipv4_community_cmd,
+       "show ip bgp ipv4 (unicast|multicast) community \
(AA:NN|local-AS|no-advertise|no-export)",  SHOW_STR
+       IP_STR
        BGP_STR
        "Address family\n"
        "Address Family modifier\n"
@@ -8500,10 +9357,11 @@ DEFUN (show_bgp_ipv4_safi_community,
   return bgp_show_community (vty, NULL, argc, argv, 0, AFI_IP, SAFI_UNICAST);
 }
 
-ALIAS (show_bgp_ipv4_safi_community,
-       show_bgp_ipv4_safi_community2_cmd,
-       "show bgp ipv4 (unicast|multicast) community \
(AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)", \
+ALIAS (show_ip_bgp_ipv4_community, +       show_ip_bgp_ipv4_community2_cmd,
+       "show ip bgp ipv4 (unicast|multicast) community \
(AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)",  \
SHOW_STR +       IP_STR
        BGP_STR
        "Address family\n"
        "Address Family modifier\n"
@@ -8518,10 +9376,11 @@ ALIAS (show_bgp_ipv4_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_ipv4_safi_community,
-       show_bgp_ipv4_safi_community3_cmd,
-       "show bgp 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)", +ALIAS (show_ip_bgp_ipv4_community,
+       show_ip_bgp_ipv4_community3_cmd,
+       "show ip bgp 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_STR
+       IP_STR
        BGP_STR
        "Address family\n"
        "Address Family modifier\n"
@@ -8540,10 +9399,11 @@ ALIAS (show_bgp_ipv4_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_ipv4_safi_community,
-       show_bgp_ipv4_safi_community4_cmd,
-       "show bgp 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)", \
+ALIAS (show_ip_bgp_ipv4_community, +       show_ip_bgp_ipv4_community4_cmd,
+       "show ip bgp 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_STR +       IP_STR
        BGP_STR
        "Address family\n"
        "Address Family modifier\n"
@@ -8566,101 +9426,28 @@ ALIAS (show_bgp_ipv4_safi_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,
-#ifdef HAVE_IPV6
-       "show bgp view WORD (ipv4|ipv6) (unicast|multicast) community",
-#else
-       "show bgp view WORD ipv4 (unicast|multicast) community",
-#endif
+DEFUN (show_ip_bgp_community_exact,
+       show_ip_bgp_community_exact_cmd,
+       "show ip bgp community (AA:NN|local-AS|no-advertise|no-export) exact-match",
        SHOW_STR
+       IP_STR
        BGP_STR
-       "BGP view\n"
-       "View name\n"
-       "Address family\n"
-#ifdef HAVE_IPV6
-       "Address family\n"
-#endif
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Display routes matching the communities\n")
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
 {
-  int afi;
-  int safi;
-  struct bgp *bgp;
-
-  /* BGP structure lookup. */
-  bgp = bgp_lookup_by_name (argv[0]);
-  if (bgp == NULL)
-    {
-      vty_out (vty, "Can't find BGP view %s%s", argv[0], VTY_NEWLINE);
-      return CMD_WARNING;
-    }
-
-#ifdef HAVE_IPV6
-  afi = (strncmp (argv[1], "ipv6", 4) == 0) ? AFI_IP6 : AFI_IP;
-  safi = (strncmp (argv[2], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
-#else
-  afi = AFI_IP;
-  safi = (strncmp (argv[1], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
-#endif
-  return bgp_show (vty, bgp, afi, safi, bgp_show_type_community_all, NULL);
+  return bgp_show_community (vty, NULL, argc, argv, 1, AFI_IP, SAFI_UNICAST);
 }
 
-DEFUN (show_bgp_view_afi_safi_community,
-       show_bgp_view_afi_safi_community_cmd,
-#ifdef HAVE_IPV6
-       "show bgp view WORD (ipv4|ipv6) (unicast|multicast) community \
                (AA:NN|local-AS|no-advertise|no-export)",
-#else
-       "show bgp view WORD ipv4 (unicast|multicast) community \
                (AA:NN|local-AS|no-advertise|no-export)",
-#endif
+ALIAS (show_ip_bgp_community_exact,
+       show_ip_bgp_community2_exact_cmd,
+       "show ip bgp community (AA:NN|local-AS|no-advertise|no-export) \
(AA:NN|local-AS|no-advertise|no-export) exact-match",  SHOW_STR
+       IP_STR
        BGP_STR
-       "BGP view\n"
-       "View name\n"
-       "Address family\n"
-#ifdef HAVE_IPV6
-       "Address family\n"
-#endif
-       "Address family modifier\n"
-       "Address family modifier\n"
-       "Display routes matching the communities\n"
-       "community number\n"
-       "Do not send outside local AS (well-known community)\n"
-       "Do not advertise to any peer (well-known community)\n"
-       "Do not export to next AS (well-known community)\n")
-{
-  int afi;
-  int safi;
-
-#ifdef HAVE_IPV6
-  afi = (strncmp (argv[1], "ipv6", 4) == 0) ? AFI_IP6 : AFI_IP;
-  safi = (strncmp (argv[2], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
-  return bgp_show_community (vty, argv[0], argc-3, &argv[3], 0, afi, safi);
-#else
-  afi = AFI_IP;
-  safi = (strncmp (argv[1], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
-  return bgp_show_community (vty, argv[0], argc-2, &argv[2], 0, afi, safi);
-#endif
-}
-
-ALIAS (show_bgp_view_afi_safi_community,
-       show_bgp_view_afi_safi_community2_cmd,
-#ifdef HAVE_IPV6
-       "show bgp view WORD (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 WORD 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\n"
-       "View name\n"
-       "Address family\n"
-#ifdef HAVE_IPV6
-       "Address family\n"
-#endif
-       "Address family modifier\n"
-       "Address family modifier\n"
        "Display routes matching the communities\n"
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
@@ -8669,25 +9456,15 @@ ALIAS (show_bgp_view_afi_safi_community,
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
        "Do not advertise to any peer (well-known community)\n"
-       "Do not export to next AS (well-known community)\n")
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
 
-ALIAS (show_bgp_view_afi_safi_community,
-       show_bgp_view_afi_safi_community3_cmd,
-#ifdef HAVE_IPV6
-       "show bgp view 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)",
-#else
-       "show bgp view 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)",
-#endif
+ALIAS (show_ip_bgp_community_exact,
+       show_ip_bgp_community3_exact_cmd,
+       "show ip bgp 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) \
exact-match",  SHOW_STR
+       IP_STR
        BGP_STR
-       "BGP view\n"
-       "View name\n"
-       "Address family\n"
-#ifdef HAVE_IPV6
-       "Address family\n"
-#endif
-       "Address family modifier\n"
-       "Address family modifier\n"
        "Display routes matching the communities\n"
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
@@ -8700,25 +9477,15 @@ ALIAS (show_bgp_view_afi_safi_community,
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
        "Do not advertise to any peer (well-known community)\n"
-       "Do not export to next AS (well-known community)\n")
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
 
-ALIAS (show_bgp_view_afi_safi_community,
-       show_bgp_view_afi_safi_community4_cmd,
-#ifdef HAVE_IPV6
-       "show bgp view 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)",
-#else
-       "show bgp view 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)",
-#endif
+ALIAS (show_ip_bgp_community_exact,
+       show_ip_bgp_community4_exact_cmd,
+       "show ip bgp 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) exact-match",  SHOW_STR
+       IP_STR
        BGP_STR
-       "BGP view\n"
-       "View name\n"
-       "Address family\n"
-#ifdef HAVE_IPV6
-       "Address family\n"
-#endif
-       "Address family modifier\n"
-       "Address family modifier\n"
        "Display routes matching the communities\n"
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
@@ -8735,14 +9502,18 @@ ALIAS (show_bgp_view_afi_safi_community,
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
        "Do not advertise to any peer (well-known community)\n"
-       "Do not export to next AS (well-known community)\n")
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
 
-DEFUN (show_bgp_ipv4_community_exact,
-       show_bgp_ipv4_community_exact_cmd,
-       "show bgp ipv4 community (AA:NN|local-AS|no-advertise|no-export) \
exact-match", +DEFUN (show_ip_bgp_ipv4_community_exact,
+       show_ip_bgp_ipv4_community_exact_cmd,
+       "show ip bgp ipv4 (unicast|multicast) community \
(AA:NN|local-AS|no-advertise|no-export) exact-match",  SHOW_STR
-       BGP_STR
        IP_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
        "Display routes matching the communities\n"
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
@@ -8750,15 +9521,21 @@ DEFUN (show_bgp_ipv4_community_exact,
        "Do not export to next AS (well-known community)\n"
        "Exact match of the communities")
 {
+  if (strncmp (argv[0], "m", 1) == 0)
+    return bgp_show_community (vty, NULL, argc, argv, 1, AFI_IP, SAFI_MULTICAST);
+ 
   return bgp_show_community (vty, NULL, argc, argv, 1, AFI_IP, SAFI_UNICAST);
 }
 
-ALIAS (show_bgp_ipv4_community_exact,
-       show_bgp_ipv4_community2_exact_cmd,
-       "show bgp ipv4 community (AA:NN|local-AS|no-advertise|no-export) \
(AA:NN|local-AS|no-advertise|no-export) exact-match", +ALIAS \
(show_ip_bgp_ipv4_community_exact, +       show_ip_bgp_ipv4_community2_exact_cmd,
+       "show ip bgp ipv4 (unicast|multicast) community \
(AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) \
exact-match",  SHOW_STR
-       BGP_STR
        IP_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
        "Display routes matching the communities\n"
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
@@ -8770,12 +9547,15 @@ ALIAS (show_bgp_ipv4_community_exact,
        "Do not export to next AS (well-known community)\n"
        "Exact match of the communities")
 
-ALIAS (show_bgp_ipv4_community_exact,
-       show_bgp_ipv4_community3_exact_cmd,
-       "show bgp ipv4 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) \
exact-match", +ALIAS (show_ip_bgp_ipv4_community_exact,
+       show_ip_bgp_ipv4_community3_exact_cmd,
+       "show ip bgp 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) exact-match",  SHOW_STR
-       BGP_STR
        IP_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
        "Display routes matching the communities\n"
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
@@ -8790,13 +9570,16 @@ ALIAS (show_bgp_ipv4_community_exact,
        "Do not advertise to any peer (well-known community)\n"
        "Do not export to next AS (well-known community)\n"
        "Exact match of the communities")
-
-ALIAS (show_bgp_ipv4_community_exact,
-       show_bgp_ipv4_community4_exact_cmd,
-       "show bgp ipv4 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) exact-match", +       
+ALIAS (show_ip_bgp_ipv4_community_exact,
+       show_ip_bgp_ipv4_community4_exact_cmd,
+       "show ip bgp 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) \
exact-match",  SHOW_STR
-       BGP_STR
        IP_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
        "Display routes matching the communities\n"
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
@@ -8816,54 +9599,38 @@ ALIAS (show_bgp_ipv4_community_exact,
        "Do not export to next AS (well-known community)\n"
        "Exact match of the communities")
 
-DEFUN (show_bgp_ipv4_safi_community4_exact,
-       show_bgp_ipv4_safi_community_exact_cmd,
-       "show bgp ipv4 (unicast|multicast) community \
(AA:NN|local-AS|no-advertise|no-export) exact-match", +#ifdef HAVE_IPV6
+DEFUN (show_bgp_community,
+       show_bgp_community_cmd,
+       "show bgp community (AA:NN|local-AS|no-advertise|no-export)",
        SHOW_STR
        BGP_STR
-       "Address family\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
        "Display routes matching the communities\n"
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
        "Do not advertise to any peer (well-known community)\n"
-       "Do not export to next AS (well-known community)\n"
-       "Exact match of the communities")
+       "Do not export to next AS (well-known community)\n")
 {
-  if (strncmp (argv[0], "m", 1) == 0)
-    return bgp_show_community (vty, NULL, argc, argv, 1, AFI_IP, SAFI_MULTICAST);
- 
-  return bgp_show_community (vty, NULL, argc, argv, 1, AFI_IP, SAFI_UNICAST);
+  return bgp_show_community (vty, NULL, argc, argv, 0, AFI_IP6, SAFI_UNICAST);
 }
 
-ALIAS (show_bgp_ipv4_safi_community4_exact,
-       show_bgp_ipv4_safi_community2_exact_cmd,
-       "show bgp ipv4 (unicast|multicast) community \
(AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) \
exact-match", +ALIAS (show_bgp_community,
+       show_bgp_ipv6_community_cmd,
+       "show bgp ipv6 community (AA:NN|local-AS|no-advertise|no-export)",
        SHOW_STR
        BGP_STR
        "Address family\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
        "Display routes matching the communities\n"
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
        "Do not advertise to any peer (well-known community)\n"
-       "Do not export to next AS (well-known community)\n"
-       "community number\n"
-       "Do not send outside local AS (well-known community)\n"
-       "Do not advertise to any peer (well-known community)\n"
-       "Do not export to next AS (well-known community)\n"
-       "Exact match of the communities")
+       "Do not export to next AS (well-known community)\n")
 
-ALIAS (show_bgp_ipv4_safi_community4_exact,
-       show_bgp_ipv4_safi_community3_exact_cmd,
-       "show bgp 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) exact-match", +ALIAS (show_bgp_community,
+       show_bgp_community2_cmd,
+       "show bgp community (AA:NN|local-AS|no-advertise|no-export) \
(AA:NN|local-AS|no-advertise|no-export)",  SHOW_STR
        BGP_STR
-       "Address family\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
        "Display routes matching the communities\n"
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
@@ -8872,21 +9639,14 @@ ALIAS (show_bgp_ipv4_safi_community4_exact,
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
        "Do not advertise to any peer (well-known community)\n"
-       "Do not export to next AS (well-known community)\n"
-       "community number\n"
-       "Do not send outside local AS (well-known community)\n"
-       "Do not advertise to any peer (well-known community)\n"
-       "Do not export to next AS (well-known community)\n"
-       "Exact match of the communities")
-       
-ALIAS (show_bgp_ipv4_safi_community4_exact,
-       show_bgp_ipv4_safi_community4_exact_cmd,
-       "show bgp 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) \
exact-match", +       "Do not export to next AS (well-known community)\n")
+
+ALIAS (show_bgp_community,
+       show_bgp_ipv6_community2_cmd,
+       "show bgp ipv6 community (AA:NN|local-AS|no-advertise|no-export) \
(AA:NN|local-AS|no-advertise|no-export)",  SHOW_STR
        BGP_STR
        "Address family\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
        "Display routes matching the communities\n"
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
@@ -8895,7 +9655,14 @@ ALIAS (show_bgp_ipv4_safi_community4_exact,
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
        "Do not advertise to any peer (well-known community)\n"
-       "Do not export to next AS (well-known community)\n"
+       "Do not export to next AS (well-known community)\n")
+
+ALIAS (show_bgp_community,
+       show_bgp_community3_cmd,
+       "show bgp 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_STR +       BGP_STR
+       "Display routes matching the communities\n"
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
        "Do not advertise to any peer (well-known community)\n"
@@ -8904,45 +9671,17 @@ ALIAS (show_bgp_ipv4_safi_community4_exact,
        "Do not send outside local AS (well-known community)\n"
        "Do not advertise to any peer (well-known community)\n"
        "Do not export to next AS (well-known community)\n"
-       "Exact match of the communities")
-
-
-#ifdef HAVE_IPV6
-DEFUN (show_bgp_ipv6_community,
-       show_bgp_ipv6_community_cmd,
-       "show bgp ipv6 (encap|multicast|unicast|vpn) community \
                (AA:NN|local-AS|no-advertise|no-export)",
-       SHOW_STR
-       BGP_STR
-       "Address family\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
-       "Display routes matching the communities\n"
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
        "Do not advertise to any peer (well-known community)\n"
        "Do not export to next AS (well-known community)\n")
-{
-  safi_t	safi;
 
-  if (bgp_parse_safi(argv[0], &safi)) {
-    vty_out (vty, "Error: Bad SAFI: %s%s", argv[0], VTY_NEWLINE);
-    return CMD_WARNING;
-  }
-  return bgp_show_community (vty, NULL, argc-1, argv+1, 0, AFI_IP6, safi);
-}
-
-ALIAS (show_bgp_ipv6_community,
-       show_bgp_ipv6_community2_cmd,
-       "show bgp ipv6 (encap|multicast|unicast|vpn) community \
(AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)", \
+ALIAS (show_bgp_community, +       show_bgp_ipv6_community3_cmd,
+       "show bgp ipv6 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_STR  BGP_STR
        "Address family\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
        "Display routes matching the communities\n"
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
@@ -8951,18 +9690,17 @@ ALIAS (show_bgp_ipv6_community,
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
        "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
        "Do not export to next AS (well-known community)\n")
-	
-ALIAS (show_bgp_ipv6_community,
-       show_bgp_ipv6_community3_cmd,
-       "show bgp ipv6 (encap|multicast|unicast|vpn) 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)", +
+ALIAS (show_bgp_community,
+       show_bgp_community4_cmd,
+       "show bgp 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_STR
        BGP_STR
-       "Address family\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
        "Display routes matching the communities\n"
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
@@ -8975,18 +9713,18 @@ ALIAS (show_bgp_ipv6_community,
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
        "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
        "Do not export to next AS (well-known community)\n")
 
-ALIAS (show_bgp_ipv6_community,
+ALIAS (show_bgp_community,
        show_bgp_ipv6_community4_cmd,
-       "show bgp ipv6 (encap|multicast|unicast|vpn) 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 ipv6 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_STR
        BGP_STR
        "Address family\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
        "Display routes matching the communities\n"
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
@@ -9005,44 +9743,29 @@ ALIAS (show_bgp_ipv6_community,
        "Do not advertise to any peer (well-known community)\n"
        "Do not export to next AS (well-known community)\n")
 
-
-DEFUN (show_bgp_community_exact,
-       show_bgp_ipv6_community_exact_cmd,
-       "show bgp ipv6 (encap|multicast|unicast|vpn) community \
(AA:NN|local-AS|no-advertise|no-export) exact-match", +/* old command */
+DEFUN (show_ipv6_bgp_community,
+       show_ipv6_bgp_community_cmd,
+       "show ipv6 bgp community (AA:NN|local-AS|no-advertise|no-export)",
        SHOW_STR
+       IPV6_STR
        BGP_STR
-       "Address family\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
        "Display routes matching the communities\n"
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
        "Do not advertise to any peer (well-known community)\n"
-       "Do not export to next AS (well-known community)\n"
-       "Exact match of the communities")
+       "Do not export to next AS (well-known community)\n")
 {
-  safi_t	safi;
-
-  if (bgp_parse_safi(argv[0], &safi)) {
-    vty_out (vty, "Error: Bad SAFI: %s%s", argv[0], VTY_NEWLINE);
-    return CMD_WARNING;
-  }
-  return bgp_show_community (vty, NULL, argc-1, argv+1, 1, AFI_IP6, safi);
+  return bgp_show_community (vty, NULL, argc, argv, 0, AFI_IP6, SAFI_UNICAST);
 }
 
-
-ALIAS (show_bgp_community_exact,
-       show_bgp_ipv6_community2_exact_cmd,
-       "show bgp ipv6 (encap|multicast|unicast|vpn) community \
(AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) \
exact-match", +/* old command */
+ALIAS (show_ipv6_bgp_community,
+       show_ipv6_bgp_community2_cmd,
+       "show ipv6 bgp community (AA:NN|local-AS|no-advertise|no-export) \
(AA:NN|local-AS|no-advertise|no-export)",  SHOW_STR
+       IPV6_STR
        BGP_STR
-       "Address family\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
        "Display routes matching the communities\n"
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
@@ -9051,19 +9774,15 @@ ALIAS (show_bgp_community_exact,
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
        "Do not advertise to any peer (well-known community)\n"
-       "Do not export to next AS (well-known community)\n"
-       "Exact match of the communities")
+       "Do not export to next AS (well-known community)\n")
 
-ALIAS (show_bgp_community_exact,
-       show_bgp_ipv6_community3_exact_cmd,
-       "show bgp ipv6 (encap|multicast|unicast|vpn) 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) exact-match", +/* old command */
+ALIAS (show_ipv6_bgp_community,
+       show_ipv6_bgp_community3_cmd,
+       "show ipv6 bgp 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_STR +       IPV6_STR
        BGP_STR
-       "Address family\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
        "Display routes matching the communities\n"
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
@@ -9076,19 +9795,15 @@ ALIAS (show_bgp_community_exact,
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
        "Do not advertise to any peer (well-known community)\n"
-       "Do not export to next AS (well-known community)\n"
-       "Exact match of the communities")
+       "Do not export to next AS (well-known community)\n")
 
-ALIAS (show_bgp_community_exact,
-       show_bgp_ipv6_community4_exact_cmd,
-       "show bgp ipv6 (encap|multicast|unicast|vpn) 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) \
exact-match", +/* old command */
+ALIAS (show_ipv6_bgp_community,
+       show_ipv6_bgp_community4_cmd,
+       "show ipv6 bgp 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_STR
+       IPV6_STR
        BGP_STR
-       "Address family\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
        "Display routes matching the communities\n"
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
@@ -9105,674 +9820,2383 @@ ALIAS (show_bgp_community_exact,
        "community number\n"
        "Do not send outside local AS (well-known community)\n"
        "Do not advertise to any peer (well-known community)\n"
-       "Do not export to next AS (well-known community)\n"
-       "Exact match of the communities")
-
-#endif /* HAVE_IPV6 */
-
-static int
-bgp_show_community_list (struct vty *vty, const char *com, int exact,
-			 afi_t afi, safi_t safi)
-{
-  struct community_list *list;
-
-  list = community_list_lookup (bgp_clist, com, COMMUNITY_LIST_MASTER);
-  if (list == NULL)
-    {
-      vty_out (vty, "%% %s is not a valid community-list name%s", com,
-	       VTY_NEWLINE);
-      return CMD_WARNING;
-    }
-
-  return bgp_show (vty, NULL, afi, safi,
-                   (exact ? bgp_show_type_community_list_exact :
-		            bgp_show_type_community_list), list);
-}
+       "Do not export to next AS (well-known community)\n")
 
-DEFUN (show_bgp_ipv4_community_list,
-       show_bgp_ipv4_community_list_cmd,
-       "show bgp ipv4 community-list (<1-500>|WORD)",
+DEFUN (show_bgp_community_exact,
+       show_bgp_community_exact_cmd,
+       "show bgp community (AA:NN|local-AS|no-advertise|no-export) exact-match",
        SHOW_STR
        BGP_STR
-       IP_STR
-       "Display routes matching the community-list\n"
-       "community-list number\n"
-       "community-list name\n")
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
 {
-  return bgp_show_community_list (vty, argv[0], 0, AFI_IP, SAFI_UNICAST);
+  return bgp_show_community (vty, NULL, argc, argv, 1, AFI_IP6, SAFI_UNICAST);
 }
 
-DEFUN (show_bgp_ipv4_safi_community_list,
-       show_bgp_ipv4_safi_community_list_cmd,
-       "show bgp ipv4 (unicast|multicast) community-list (<1-500>|WORD)",
+ALIAS (show_bgp_community_exact,
+       show_bgp_ipv6_community_exact_cmd,
+       "show bgp ipv6 community (AA:NN|local-AS|no-advertise|no-export) \
exact-match",  SHOW_STR
        BGP_STR
        "Address family\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Display routes matching the community-list\n"
-       "community-list number\n"
-       "community-list name\n")
-{
-  if (strncmp (argv[0], "m", 1) == 0)
-    return bgp_show_community_list (vty, argv[1], 0, AFI_IP, SAFI_MULTICAST);
-  
-  return bgp_show_community_list (vty, argv[1], 0, AFI_IP, SAFI_UNICAST);
-}
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
 
-DEFUN (show_bgp_ipv4_community_list_exact,
-       show_bgp_ipv4_community_list_exact_cmd,
-       "show bgp ipv4 community-list (<1-500>|WORD) exact-match",
+ALIAS (show_bgp_community_exact,
+       show_bgp_community2_exact_cmd,
+       "show bgp community (AA:NN|local-AS|no-advertise|no-export) \
(AA:NN|local-AS|no-advertise|no-export) exact-match",  SHOW_STR
        BGP_STR
-       IP_STR
-       "Display routes matching the community-list\n"
-       "community-list number\n"
-       "community-list name\n"
-       "Exact match of the communities\n")
-{
-  return bgp_show_community_list (vty, argv[0], 1, AFI_IP, SAFI_UNICAST);
-}
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
 
-DEFUN (show_bgp_ipv4_safi_community_list_exact,
-       show_bgp_ipv4_safi_community_list_exact_cmd,
-       "show bgp ipv4 (unicast|multicast) community-list (<1-500>|WORD) \
exact-match", +ALIAS (show_bgp_community_exact,
+       show_bgp_ipv6_community2_exact_cmd,
+       "show bgp ipv6 community (AA:NN|local-AS|no-advertise|no-export) \
(AA:NN|local-AS|no-advertise|no-export) exact-match",  SHOW_STR
        BGP_STR
        "Address family\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Display routes matching the community-list\n"
-       "community-list number\n"
-       "community-list name\n"
-       "Exact match of the communities\n")
-{
-  if (strncmp (argv[0], "m", 1) == 0)
-    return bgp_show_community_list (vty, argv[1], 1, AFI_IP, SAFI_MULTICAST);
- 
-  return bgp_show_community_list (vty, argv[1], 1, AFI_IP, SAFI_UNICAST);
-}
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
 
-#ifdef HAVE_IPV6
-DEFUN (show_bgp_community_list,
-       show_bgp_community_list_cmd,
-       "show bgp ipv6 (encap|multicast|unicast|vpn) community-list (<1-500>|WORD)",
+ALIAS (show_bgp_community_exact,
+       show_bgp_community3_exact_cmd,
+       "show bgp 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) \
exact-match",  SHOW_STR
        BGP_STR
-       "Address family\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
-       "Display routes matching the community-list\n"
-       "community-list number\n"
-       "community-list name\n")
-{
-  safi_t	safi;
-
-  if (bgp_parse_safi(argv[0], &safi)) {
-    vty_out (vty, "Error: Bad SAFI: %s%s", argv[0], VTY_NEWLINE);
-    return CMD_WARNING;
-  }
-  return bgp_show_community_list (vty, argv[1], 0, AFI_IP6, safi);
-}
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
 
-DEFUN (show_bgp_community_list_exact,
-       show_bgp_ipv6_community_list_exact_cmd,
-       "show bgp ipv6 (encap|multicast|unicast|vpn) community-list (<1-500>|WORD) \
exact-match", +ALIAS (show_bgp_community_exact,
+       show_bgp_ipv6_community3_exact_cmd,
+       "show bgp ipv6 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) \
exact-match",  SHOW_STR
        BGP_STR
        "Address family\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
-       "Address family modifier\n"
-       "Display routes matching the community-list\n"
-       "community-list number\n"
-       "community-list name\n"
-       "Exact match of the communities\n")
-{
-  safi_t	safi;
-
-  if (bgp_parse_safi(argv[0], &safi)) {
-    vty_out (vty, "Error: Bad SAFI: %s%s", argv[0], VTY_NEWLINE);
-    return CMD_WARNING;
-  }
-  return bgp_show_community_list (vty, argv[1], 1, AFI_IP6, safi);
-}
-#endif /* HAVE_IPV6 */
-
-static int
-bgp_show_prefix_longer (struct vty *vty, const char *prefix, afi_t afi,
-			safi_t safi, enum bgp_show_type type)
-{
-  int ret;
-  struct prefix *p;
-
-  p = prefix_new();
-
-  ret = str2prefix (prefix, p);
-  if (! ret)
-    {
-      vty_out (vty, "%% Malformed Prefix%s", VTY_NEWLINE);
-      return CMD_WARNING;
-    }
-
-  ret = bgp_show (vty, NULL, afi, safi, type, p);
-  prefix_free(p);
-  return ret;
-}
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
 
-DEFUN (show_bgp_ipv4_prefix_longer,
-       show_bgp_ipv4_prefix_longer_cmd,
-       "show bgp ipv4 A.B.C.D/M longer-prefixes",
+ALIAS (show_bgp_community_exact,
+       show_bgp_community4_exact_cmd,
+       "show bgp 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) exact-match",  SHOW_STR
        BGP_STR
-       IP_STR
-       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
-       "Display route and more specific routes\n")
-{
-  return bgp_show_prefix_longer (vty, argv[0], AFI_IP, SAFI_UNICAST,
-				 bgp_show_type_prefix_longer);
-}
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
 
-DEFUN (show_bgp_ipv4_safi_flap_prefix_longer,
-       show_bgp_ipv4_safi_flap_prefix_longer_cmd,
-       "show bgp ipv4 (encap|multicast|unicast|vpn) flap-statistics A.B.C.D/M \
longer-prefixes", +ALIAS (show_bgp_community_exact,
+       show_bgp_ipv6_community4_exact_cmd,
+       "show bgp ipv6 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) exact-match",  SHOW_STR
        BGP_STR
        "Address family\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Display flap statistics of routes\n"
-       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
-       "Display route and more specific routes\n")
-{
-  safi_t	safi;
-
-  if (bgp_parse_safi(argv[0], &safi)) {
-    vty_out (vty, "Error: Bad SAFI: %s%s", argv[0], VTY_NEWLINE);
-    return CMD_WARNING;
-  }
-  return bgp_show_prefix_longer (vty, argv[1], AFI_IP, safi,
-				 bgp_show_type_flap_prefix_longer);
-}
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
 
-ALIAS (show_bgp_ipv4_safi_flap_prefix_longer,
-       show_bgp_ipv4_safi_damp_flap_prefix_longer_cmd,
-       "show bgp ipv4 (encap|multicast|unicast|vpn) dampening flap-statistics \
A.B.C.D/M longer-prefixes", +/* old command */
+DEFUN (show_ipv6_bgp_community_exact,
+       show_ipv6_bgp_community_exact_cmd,
+       "show ipv6 bgp community (AA:NN|local-AS|no-advertise|no-export) \
exact-match",  SHOW_STR
+       IPV6_STR
        BGP_STR
-       "Address family\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Display detailed information about dampening\n"
-       "Display flap statistics of routes\n"
-       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
-       "Display route and more specific routes\n")
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
+{
+  return bgp_show_community (vty, NULL, argc, argv, 1, AFI_IP6, SAFI_UNICAST);
+}
 
-#ifdef HAVE_IPV6
-DEFUN (show_bgp_ipv6_safi_flap_prefix_longer,
-       show_bgp_ipv6_safi_flap_prefix_longer_cmd,
-       "show bgp ipv6 (encap|multicast|unicast|vpn) flap-statistics X:X::X:X/M \
longer-prefixes", +/* old command */
+ALIAS (show_ipv6_bgp_community_exact,
+       show_ipv6_bgp_community2_exact_cmd,
+       "show ipv6 bgp community (AA:NN|local-AS|no-advertise|no-export) \
(AA:NN|local-AS|no-advertise|no-export) exact-match",  SHOW_STR
+       IPV6_STR
        BGP_STR
-       "Address family\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Display flap statistics of routes\n"
-       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
-       "Display route and more specific routes\n")
-{
-  safi_t	safi;
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
 
-  if (bgp_parse_safi(argv[0], &safi)) {
-    vty_out (vty, "Error: Bad SAFI: %s%s", argv[0], VTY_NEWLINE);
-    return CMD_WARNING;
-  }
-  return bgp_show_prefix_longer (vty, argv[1], AFI_IP6, safi,
-				 bgp_show_type_flap_prefix_longer);
-}
-ALIAS (show_bgp_ipv6_safi_flap_prefix_longer,
-       show_bgp_ipv6_safi_damp_flap_prefix_longer_cmd,
-       "show bgp ipv6 (encap|multicast|unicast|vpn) dampening flap-statistics \
X:X::X:X/M longer-prefixes", +/* old command */
+ALIAS (show_ipv6_bgp_community_exact,
+       show_ipv6_bgp_community3_exact_cmd,
+       "show ipv6 bgp 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) \
exact-match",  SHOW_STR
+       IPV6_STR
        BGP_STR
-       "Address family\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Display detailed information about dampening\n"
-       "Display flap statistics of routes\n"
-       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
-       "Display route and more specific routes\n")
-#endif
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
 
-DEFUN (show_bgp_ipv4_safi_prefix_longer,
-       show_bgp_ipv4_safi_prefix_longer_cmd,
-       "show bgp ipv4 (encap|multicast|unicast|vpn) A.B.C.D/M longer-prefixes",
+/* old command */
+ALIAS (show_ipv6_bgp_community_exact,
+       show_ipv6_bgp_community4_exact_cmd,
+       "show ipv6 bgp 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) exact-match",  SHOW_STR
+       IPV6_STR
        BGP_STR
-       "Address family\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
-       "Display route and more specific routes\n")
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
+ 
+/* old command */
+DEFUN (show_ipv6_mbgp_community,
+       show_ipv6_mbgp_community_cmd,
+       "show ipv6 mbgp community (AA:NN|local-AS|no-advertise|no-export)",
+       SHOW_STR
+       IPV6_STR
+       MBGP_STR
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n")
 {
-  safi_t	safi;
-
-  if (bgp_parse_safi(argv[0], &safi)) {
-    vty_out (vty, "Error: Bad SAFI: %s%s", argv[0], VTY_NEWLINE);
-    return CMD_WARNING;
-  }
-
-  return bgp_show_prefix_longer (vty, argv[1], AFI_IP, safi,
-				   bgp_show_type_prefix_longer);
+  return bgp_show_community (vty, NULL, argc, argv, 0, AFI_IP6, SAFI_MULTICAST);
 }
 
-#ifdef HAVE_IPV6
-DEFUN (show_bgp_ipv6_safi_prefix_longer,
-       show_bgp_ipv6_safi_prefix_longer_cmd,
-       "show bgp ipv6 (encap|multicast|unicast|vpn) X:X::X:X/M longer-prefixes",
+/* old command */
+ALIAS (show_ipv6_mbgp_community,
+       show_ipv6_mbgp_community2_cmd,
+       "show ipv6 mbgp community (AA:NN|local-AS|no-advertise|no-export) \
(AA:NN|local-AS|no-advertise|no-export)",  SHOW_STR
-       BGP_STR
-       "Address family\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
-       "Display route and more specific routes\n")
-{
-  safi_t	safi;
+       IPV6_STR
+       MBGP_STR
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n")
 
-  if (bgp_parse_safi(argv[0], &safi)) {
-    vty_out (vty, "Error: Bad SAFI: %s%s", argv[0], VTY_NEWLINE);
-    return CMD_WARNING;
-  }
+/* old command */
+ALIAS (show_ipv6_mbgp_community,
+       show_ipv6_mbgp_community3_cmd,
+       "show ipv6 mbgp 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_STR +       IPV6_STR
+       MBGP_STR
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n")
 
-  return bgp_show_prefix_longer (vty, argv[1], AFI_IP6, safi,
-				   bgp_show_type_prefix_longer);
-}
-#endif
+/* old command */
+ALIAS (show_ipv6_mbgp_community,
+       show_ipv6_mbgp_community4_cmd,
+       "show ipv6 mbgp 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_STR
+       IPV6_STR
+       MBGP_STR
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n")
 
-DEFUN (show_bgp_ipv4_safi_flap_address,
-       show_bgp_ipv4_safi_flap_address_cmd,
-       "show bgp ipv4 (encap|multicast|unicast|vpn) flap-statistics A.B.C.D",
+/* old command */
+DEFUN (show_ipv6_mbgp_community_exact,
+       show_ipv6_mbgp_community_exact_cmd,
+       "show ipv6 mbgp community (AA:NN|local-AS|no-advertise|no-export) \
exact-match",  SHOW_STR
-       BGP_STR
-       "Address family\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Display flap statistics of routes\n"
-       "Network in the BGP routing table to display\n")
+       IPV6_STR
+       MBGP_STR
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
 {
-  safi_t	safi;
-
-  if (bgp_parse_safi(argv[0], &safi)) {
-    vty_out (vty, "Error: Bad SAFI: %s%s", argv[0], VTY_NEWLINE);
-    return CMD_WARNING;
-  }
-  return bgp_show_prefix_longer (vty, argv[1], AFI_IP, safi,
-				 bgp_show_type_flap_address);
+  return bgp_show_community (vty, NULL, argc, argv, 1, AFI_IP6, SAFI_MULTICAST);
 }
-ALIAS (show_bgp_ipv4_safi_flap_address,
-       show_bgp_ipv4_safi_damp_flap_address_cmd,
-       "show bgp ipv4 (encap|multicast|unicast|vpn) dampening flap-statistics \
A.B.C.D", +
+/* old command */
+ALIAS (show_ipv6_mbgp_community_exact,
+       show_ipv6_mbgp_community2_exact_cmd,
+       "show ipv6 mbgp community (AA:NN|local-AS|no-advertise|no-export) \
(AA:NN|local-AS|no-advertise|no-export) exact-match",  SHOW_STR
-       BGP_STR
-       "Address family\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Display detailed information about dampening\n"
-       "Display flap statistics of routes\n"
-       "Network in the BGP routing table to display\n")
-#ifdef HAVE_IPV6
-DEFUN (show_bgp_ipv6_flap_address,
-       show_bgp_ipv6_flap_address_cmd,
-       "show bgp ipv6 (encap|multicast|unicast|vpn) flap-statistics A.B.C.D",
+       IPV6_STR
+       MBGP_STR
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
+
+/* old command */
+ALIAS (show_ipv6_mbgp_community_exact,
+       show_ipv6_mbgp_community3_exact_cmd,
+       "show ipv6 mbgp 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) \
exact-match",  SHOW_STR
-       BGP_STR
-       "Address family\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Display flap statistics of routes\n"
-       "Network in the BGP routing table to display\n")
-{
-  safi_t	safi;
+       IPV6_STR
+       MBGP_STR
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
 
-  if (bgp_parse_safi(argv[0], &safi)) {
-    vty_out (vty, "Error: Bad SAFI: %s%s", argv[1], VTY_NEWLINE);
-    return CMD_WARNING;
-  }
-  return bgp_show_prefix_longer (vty, argv[1], AFI_IP, safi,
-				 bgp_show_type_flap_address);
-}
-ALIAS (show_bgp_ipv6_flap_address,
-       show_bgp_ipv6_damp_flap_address_cmd,
-       "show bgp ipv6 (encap|multicast|unicast|vpn) dampening flap-statistics \
A.B.C.D", +/* old command */
+ALIAS (show_ipv6_mbgp_community_exact,
+       show_ipv6_mbgp_community4_exact_cmd,
+       "show ipv6 mbgp 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) exact-match",  SHOW_STR
-       BGP_STR
-       "Address family\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Display detailed information about dampening\n"
-       "Display flap statistics of routes\n"
-       "Network in the BGP routing table to display\n")
-#endif
+       IPV6_STR
+       MBGP_STR
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
+#endif /* HAVE_IPV6 */
 
-DEFUN (show_bgp_ipv4_safi_flap_prefix,
-       show_bgp_ipv4_safi_flap_prefix_cmd,
-       "show bgp ipv4 (encap|multicast|unicast|vpn) flap-statistics A.B.C.D/M",
+DEFUN (show_bgp_ipv4_community,
+       show_bgp_ipv4_community_cmd,
+       "show bgp ipv4 community (AA:NN|local-AS|no-advertise|no-export)",
        SHOW_STR
        BGP_STR
-       "Address family\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Display flap statistics of routes\n"
-       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
+       IP_STR
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n")
 {
-  safi_t	safi;
-
-  if (bgp_parse_safi(argv[0], &safi)) {
-    vty_out (vty, "Error: Bad SAFI: %s%s", argv[1], VTY_NEWLINE);
-    return CMD_WARNING;
-  }
-  return bgp_show_prefix_longer (vty, argv[0], AFI_IP, safi,
-				 bgp_show_type_flap_prefix);
+  return bgp_show_community (vty, NULL, argc, argv, 0, AFI_IP, SAFI_UNICAST);
 }
 
-ALIAS (show_bgp_ipv4_safi_flap_prefix,
-       show_bgp_ipv4_safi_damp_flap_prefix_cmd,
-       "show bgp ipv4 (encap|multicast|unicast|vpn) dampening flap-statistics \
A.B.C.D/M", +ALIAS (show_bgp_ipv4_community,
+       show_bgp_ipv4_community2_cmd,
+       "show bgp ipv4 community (AA:NN|local-AS|no-advertise|no-export) \
(AA:NN|local-AS|no-advertise|no-export)",  SHOW_STR
        BGP_STR
-       "Address family\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Display detailed information about dampening\n"
-       "Display flap statistics of routes\n"
-       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
+       IP_STR
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n")
+	
+ALIAS (show_bgp_ipv4_community,
+       show_bgp_ipv4_community3_cmd,
+       "show bgp ipv4 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_STR +       BGP_STR
+       IP_STR
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n")
+	
+ALIAS (show_bgp_ipv4_community,
+       show_bgp_ipv4_community4_cmd,
+       "show bgp ipv4 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_STR
+       BGP_STR
+       IP_STR
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n")
 
-#ifdef HAVE_IPV6
-DEFUN (show_bgp_ipv6_safi_flap_prefix,
-       show_bgp_ipv6_safi_flap_prefix_cmd,
-       "show bgp ipv6 (encap|multicast|unicast|vpn) flap-statistics X:X::X:X/M",
+DEFUN (show_bgp_ipv4_safi_community,
+       show_bgp_ipv4_safi_community_cmd,
+       "show bgp ipv4 (unicast|multicast) community \
(AA:NN|local-AS|no-advertise|no-export)",  SHOW_STR
        BGP_STR
        "Address family\n"
        "Address Family modifier\n"
        "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Display flap statistics of routes\n"
-       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n")
 {
-  safi_t	safi;
-
-  if (bgp_parse_safi(argv[0], &safi)) {
-    vty_out (vty, "Error: Bad SAFI: %s%s", argv[1], VTY_NEWLINE);
-    return CMD_WARNING;
-  }
-  return bgp_show_prefix_longer (vty, argv[0], AFI_IP6, safi,
-				 bgp_show_type_flap_prefix);
+  if (strncmp (argv[0], "m", 1) == 0)
+    return bgp_show_community (vty, NULL, argc, argv, 0, AFI_IP, SAFI_MULTICAST);
+ 
+  return bgp_show_community (vty, NULL, argc, argv, 0, AFI_IP, SAFI_UNICAST);
 }
 
-ALIAS (show_bgp_ipv6_safi_flap_prefix,
-       show_bgp_ipv6_safi_damp_flap_prefix_cmd,
-       "show bgp ipv6 (encap|multicast|unicast|vpn) dampening flap-statistics \
X:X::X:X/M", +ALIAS (show_bgp_ipv4_safi_community,
+       show_bgp_ipv4_safi_community2_cmd,
+       "show bgp ipv4 (unicast|multicast) community \
(AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)",  \
SHOW_STR  BGP_STR
        "Address family\n"
        "Address Family modifier\n"
        "Address Family modifier\n"
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n")
+	
+ALIAS (show_bgp_ipv4_safi_community,
+       show_bgp_ipv4_safi_community3_cmd,
+       "show bgp 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_STR
+       BGP_STR
+       "Address family\n"
        "Address Family modifier\n"
        "Address Family modifier\n"
-       "Display detailed information about dampening\n"
-       "Display flap statistics of routes\n"
-       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
-
-DEFUN (show_bgp_ipv6_prefix_longer,
-       show_bgp_ipv6_prefix_longer_cmd,
-       "show bgp ipv6 X:X::X:X/M longer-prefixes",
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n")
+	
+ALIAS (show_bgp_ipv4_safi_community,
+       show_bgp_ipv4_safi_community4_cmd,
+       "show bgp 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_STR  BGP_STR
        "Address family\n"
-       "IPv6 prefix <network>/<length>\n"
-       "Display route and more specific routes\n")
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "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,
+#ifdef HAVE_IPV6
+       "show bgp view WORD (ipv4|ipv6) (unicast|multicast) community",
+#else
+       "show bgp view WORD ipv4 (unicast|multicast) community",
+#endif
+       SHOW_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "Address family\n"
+#ifdef HAVE_IPV6
+       "Address family\n"
+#endif
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display routes matching the communities\n")
+{
+  int afi;
+  int safi;
+  struct bgp *bgp;
+
+  /* BGP structure lookup. */
+  bgp = bgp_lookup_by_name (argv[0]);
+  if (bgp == NULL)
+    {
+      vty_out (vty, "Can't find BGP view %s%s", argv[0], VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+#ifdef HAVE_IPV6
+  afi = (strncmp (argv[1], "ipv6", 4) == 0) ? AFI_IP6 : AFI_IP;
+  safi = (strncmp (argv[2], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
+#else
+  afi = AFI_IP;
+  safi = (strncmp (argv[1], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
+#endif
+  return bgp_show (vty, bgp, afi, safi, bgp_show_type_community_all, NULL);
+}
+
+DEFUN (show_bgp_view_afi_safi_community,
+       show_bgp_view_afi_safi_community_cmd,
+#ifdef HAVE_IPV6
+       "show bgp view WORD (ipv4|ipv6) (unicast|multicast) community \
(AA:NN|local-AS|no-advertise|no-export)", +#else
+       "show bgp view WORD ipv4 (unicast|multicast) community \
(AA:NN|local-AS|no-advertise|no-export)", +#endif
+       SHOW_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "Address family\n"
+#ifdef HAVE_IPV6
+       "Address family\n"
+#endif
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n")
+{
+  int afi;
+  int safi;
+
+#ifdef HAVE_IPV6
+  afi = (strncmp (argv[1], "ipv6", 4) == 0) ? AFI_IP6 : AFI_IP;
+  safi = (strncmp (argv[2], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
+  return bgp_show_community (vty, argv[0], argc-3, &argv[3], 0, afi, safi);
+#else
+  afi = AFI_IP;
+  safi = (strncmp (argv[1], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
+  return bgp_show_community (vty, argv[0], argc-2, &argv[2], 0, afi, safi);
+#endif
+}
+
+ALIAS (show_bgp_view_afi_safi_community,
+       show_bgp_view_afi_safi_community2_cmd,
+#ifdef HAVE_IPV6
+       "show bgp view WORD (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 WORD 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\n"
+       "View name\n"
+       "Address family\n"
+#ifdef HAVE_IPV6
+       "Address family\n"
+#endif
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "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,
+#ifdef HAVE_IPV6
+       "show bgp view 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)", +#else
+       "show bgp view 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)", +#endif
+       SHOW_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "Address family\n"
+#ifdef HAVE_IPV6
+       "Address family\n"
+#endif
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "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,
+#ifdef HAVE_IPV6
+       "show bgp view 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)", \
+#else +       "show bgp view 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)", \
+#endif +       SHOW_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "Address family\n"
+#ifdef HAVE_IPV6
+       "Address family\n"
+#endif
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n")
+
+DEFUN (show_bgp_ipv4_community_exact,
+       show_bgp_ipv4_community_exact_cmd,
+       "show bgp ipv4 community (AA:NN|local-AS|no-advertise|no-export) \
exact-match", +       SHOW_STR
+       BGP_STR
+       IP_STR
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
+{
+  return bgp_show_community (vty, NULL, argc, argv, 1, AFI_IP, SAFI_UNICAST);
+}
+
+ALIAS (show_bgp_ipv4_community_exact,
+       show_bgp_ipv4_community2_exact_cmd,
+       "show bgp ipv4 community (AA:NN|local-AS|no-advertise|no-export) \
(AA:NN|local-AS|no-advertise|no-export) exact-match", +       SHOW_STR
+       BGP_STR
+       IP_STR
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
+
+ALIAS (show_bgp_ipv4_community_exact,
+       show_bgp_ipv4_community3_exact_cmd,
+       "show bgp ipv4 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) \
exact-match", +       SHOW_STR
+       BGP_STR
+       IP_STR
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
+
+ALIAS (show_bgp_ipv4_community_exact,
+       show_bgp_ipv4_community4_exact_cmd,
+       "show bgp ipv4 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) exact-match", +       SHOW_STR
+       BGP_STR
+       IP_STR
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
+
+DEFUN (show_bgp_ipv4_safi_community4_exact,
+       show_bgp_ipv4_safi_community_exact_cmd,
+       "show bgp ipv4 (unicast|multicast) community \
(AA:NN|local-AS|no-advertise|no-export) exact-match", +       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
+{
+  if (strncmp (argv[0], "m", 1) == 0)
+    return bgp_show_community (vty, NULL, argc, argv, 1, AFI_IP, SAFI_MULTICAST);
+ 
+  return bgp_show_community (vty, NULL, argc, argv, 1, AFI_IP, SAFI_UNICAST);
+}
+
+ALIAS (show_bgp_ipv4_safi_community4_exact,
+       show_bgp_ipv4_safi_community2_exact_cmd,
+       "show bgp ipv4 (unicast|multicast) community \
(AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) \
exact-match", +       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
+
+ALIAS (show_bgp_ipv4_safi_community4_exact,
+       show_bgp_ipv4_safi_community3_exact_cmd,
+       "show bgp 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) exact-match", +       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
+       
+ALIAS (show_bgp_ipv4_safi_community4_exact,
+       show_bgp_ipv4_safi_community4_exact_cmd,
+       "show bgp 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) \
exact-match", +       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
+
+
+#ifdef HAVE_IPV6
+DEFUN (show_bgp_ipv6_safi_community,
+       show_bgp_ipv6_safi_community_cmd,
+       "show bgp ipv6 (encap|multicast|unicast|vpn) community \
(AA:NN|local-AS|no-advertise|no-export)", +       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n")
+{
+  safi_t	safi;
+
+  if (bgp_parse_safi(argv[0], &safi)) {
+    vty_out (vty, "Error: Bad SAFI: %s%s", argv[0], VTY_NEWLINE);
+    return CMD_WARNING;
+  }
+  return bgp_show_community (vty, NULL, argc-1, argv+1, 0, AFI_IP6, safi);
+}
+
+ALIAS (show_bgp_ipv6_safi_community,
+       show_bgp_ipv6_safi_community2_cmd,
+       "show bgp ipv6 (encap|multicast|unicast|vpn) community \
(AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)", +   \
SHOW_STR +       BGP_STR
+       "Address family\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n")
+	
+ALIAS (show_bgp_ipv6_safi_community,
+       show_bgp_ipv6_safi_community3_cmd,
+       "show bgp ipv6 (encap|multicast|unicast|vpn) 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_STR
+       BGP_STR
+       "Address family\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n")
+
+ALIAS (show_bgp_ipv6_safi_community,
+       show_bgp_ipv6_safi_community4_cmd,
+       "show bgp ipv6 (encap|multicast|unicast|vpn) 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_STR +       BGP_STR
+       "Address family\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n")
+
+
+DEFUN (show_bgp_ipv6_safi_community_exact,
+       show_bgp_ipv6_safi_community_exact_cmd,
+       "show bgp ipv6 (encap|multicast|unicast|vpn) community \
(AA:NN|local-AS|no-advertise|no-export) exact-match", +       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
+{
+  safi_t	safi;
+
+  if (bgp_parse_safi(argv[0], &safi)) {
+    vty_out (vty, "Error: Bad SAFI: %s%s", argv[0], VTY_NEWLINE);
+    return CMD_WARNING;
+  }
+  return bgp_show_community (vty, NULL, argc-1, argv+1, 1, AFI_IP6, safi);
+}
+
+
+ALIAS (show_bgp_community_exact,
+       show_bgp_ipv6_safi_community2_exact_cmd,
+       "show bgp ipv6 (encap|multicast|unicast|vpn) community \
(AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) \
exact-match", +       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
+
+ALIAS (show_bgp_community_exact,
+       show_bgp_ipv6_safi_community3_exact_cmd,
+       "show bgp ipv6 (encap|multicast|unicast|vpn) 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) exact-match", +       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
+
+ALIAS (show_bgp_community_exact,
+       show_bgp_ipv6_safi_community4_exact_cmd,
+       "show bgp ipv6 (encap|multicast|unicast|vpn) 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) \
exact-match", +       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Display routes matching the communities\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "community number\n"
+       "Do not send outside local AS (well-known community)\n"
+       "Do not advertise to any peer (well-known community)\n"
+       "Do not export to next AS (well-known community)\n"
+       "Exact match of the communities")
+
+#endif /* HAVE_IPV6 */
+
+static int
+bgp_show_community_list (struct vty *vty, const char *com, int exact,
+			 afi_t afi, safi_t safi)
+{
+  struct community_list *list;
+
+  list = community_list_lookup (bgp_clist, com, COMMUNITY_LIST_MASTER);
+  if (list == NULL)
+    {
+      vty_out (vty, "%% %s is not a valid community-list name%s", com,
+	       VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  return bgp_show (vty, NULL, afi, safi,
+                   (exact ? bgp_show_type_community_list_exact :
+		            bgp_show_type_community_list), list);
+}
+
+DEFUN (show_ip_bgp_community_list,
+       show_ip_bgp_community_list_cmd,
+       "show ip bgp community-list (<1-500>|WORD)",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display routes matching the community-list\n"
+       "community-list number\n"
+       "community-list name\n")
+{
+  return bgp_show_community_list (vty, argv[0], 0, AFI_IP, SAFI_UNICAST);
+}
+
+DEFUN (show_ip_bgp_ipv4_community_list,
+       show_ip_bgp_ipv4_community_list_cmd,
+       "show ip bgp ipv4 (unicast|multicast) community-list (<1-500>|WORD)",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display routes matching the community-list\n"
+       "community-list number\n"
+       "community-list name\n")
+{
+  if (strncmp (argv[0], "m", 1) == 0)
+    return bgp_show_community_list (vty, argv[1], 0, AFI_IP, SAFI_MULTICAST);
+  
+  return bgp_show_community_list (vty, argv[1], 0, AFI_IP, SAFI_UNICAST);
+}
+
+DEFUN (show_ip_bgp_community_list_exact,
+       show_ip_bgp_community_list_exact_cmd,
+       "show ip bgp community-list (<1-500>|WORD) exact-match",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display routes matching the community-list\n"
+       "community-list number\n"
+       "community-list name\n"
+       "Exact match of the communities\n")
+{
+  return bgp_show_community_list (vty, argv[0], 1, AFI_IP, SAFI_UNICAST);
+}
+
+DEFUN (show_ip_bgp_ipv4_community_list_exact,
+       show_ip_bgp_ipv4_community_list_exact_cmd,
+       "show ip bgp ipv4 (unicast|multicast) community-list (<1-500>|WORD) \
exact-match", +       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display routes matching the community-list\n"
+       "community-list number\n"
+       "community-list name\n"
+       "Exact match of the communities\n")
+{
+  if (strncmp (argv[0], "m", 1) == 0)
+    return bgp_show_community_list (vty, argv[1], 1, AFI_IP, SAFI_MULTICAST);
+ 
+  return bgp_show_community_list (vty, argv[1], 1, AFI_IP, SAFI_UNICAST);
+}
+
+#ifdef HAVE_IPV6
+DEFUN (show_bgp_community_list,
+       show_bgp_community_list_cmd,
+       "show bgp community-list (<1-500>|WORD)",
+       SHOW_STR
+       BGP_STR
+       "Display routes matching the community-list\n"
+       "community-list number\n"
+       "community-list name\n")
+{
+  return bgp_show_community_list (vty, argv[0], 0, AFI_IP6, SAFI_UNICAST);
+}
+
+ALIAS (show_bgp_community_list,
+       show_bgp_ipv6_community_list_cmd,
+       "show bgp ipv6 community-list (<1-500>|WORD)",
+       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Display routes matching the community-list\n"
+       "community-list number\n"
+       "community-list name\n")
+
+/* old command */
+DEFUN (show_ipv6_bgp_community_list,
+       show_ipv6_bgp_community_list_cmd,
+       "show ipv6 bgp community-list WORD",
+       SHOW_STR
+       IPV6_STR
+       BGP_STR
+       "Display routes matching the community-list\n"
+       "community-list name\n")
+{
+  return bgp_show_community_list (vty, argv[0], 0, AFI_IP6, SAFI_UNICAST);
+}
+
+/* old command */
+DEFUN (show_ipv6_mbgp_community_list,
+       show_ipv6_mbgp_community_list_cmd,
+       "show ipv6 mbgp community-list WORD",
+       SHOW_STR
+       IPV6_STR
+       MBGP_STR
+       "Display routes matching the community-list\n"
+       "community-list name\n")
+{
+  return bgp_show_community_list (vty, argv[0], 0, AFI_IP6, SAFI_MULTICAST);
+}
+
+DEFUN (show_bgp_community_list_exact,
+       show_bgp_community_list_exact_cmd,
+       "show bgp community-list (<1-500>|WORD) exact-match",
+       SHOW_STR
+       BGP_STR
+       "Display routes matching the community-list\n"
+       "community-list number\n"
+       "community-list name\n"
+       "Exact match of the communities\n")
+{
+  return bgp_show_community_list (vty, argv[0], 1, AFI_IP6, SAFI_UNICAST);
+}
+
+ALIAS (show_bgp_community_list_exact,
+       show_bgp_ipv6_community_list_exact_cmd,
+       "show bgp ipv6 community-list (<1-500>|WORD) exact-match",
+       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Display routes matching the community-list\n"
+       "community-list number\n"
+       "community-list name\n"
+       "Exact match of the communities\n")
+
+/* old command */
+DEFUN (show_ipv6_bgp_community_list_exact,
+       show_ipv6_bgp_community_list_exact_cmd,
+       "show ipv6 bgp community-list WORD exact-match",
+       SHOW_STR
+       IPV6_STR
+       BGP_STR
+       "Display routes matching the community-list\n"
+       "community-list name\n"
+       "Exact match of the communities\n")
+{
+  return bgp_show_community_list (vty, argv[0], 1, AFI_IP6, SAFI_UNICAST);
+}
+
+/* old command */
+DEFUN (show_ipv6_mbgp_community_list_exact,
+       show_ipv6_mbgp_community_list_exact_cmd,
+       "show ipv6 mbgp community-list WORD exact-match",
+       SHOW_STR
+       IPV6_STR
+       MBGP_STR
+       "Display routes matching the community-list\n"
+       "community-list name\n"
+       "Exact match of the communities\n")
+{
+  return bgp_show_community_list (vty, argv[0], 1, AFI_IP6, SAFI_MULTICAST);
+}
+#endif /* HAVE_IPV6 */
+
+DEFUN (show_bgp_ipv4_community_list,
+       show_bgp_ipv4_community_list_cmd,
+       "show bgp ipv4 community-list (<1-500>|WORD)",
+       SHOW_STR
+       BGP_STR
+       IP_STR
+       "Display routes matching the community-list\n"
+       "community-list number\n"
+       "community-list name\n")
+{
+  return bgp_show_community_list (vty, argv[0], 0, AFI_IP, SAFI_UNICAST);
+}
+
+DEFUN (show_bgp_ipv4_safi_community_list,
+       show_bgp_ipv4_safi_community_list_cmd,
+       "show bgp ipv4 (unicast|multicast) community-list (<1-500>|WORD)",
+       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display routes matching the community-list\n"
+       "community-list number\n"
+       "community-list name\n")
+{
+  if (strncmp (argv[0], "m", 1) == 0)
+    return bgp_show_community_list (vty, argv[1], 0, AFI_IP, SAFI_MULTICAST);
+  
+  return bgp_show_community_list (vty, argv[1], 0, AFI_IP, SAFI_UNICAST);
+}
+
+DEFUN (show_bgp_ipv4_community_list_exact,
+       show_bgp_ipv4_community_list_exact_cmd,
+       "show bgp ipv4 community-list (<1-500>|WORD) exact-match",
+       SHOW_STR
+       BGP_STR
+       IP_STR
+       "Display routes matching the community-list\n"
+       "community-list number\n"
+       "community-list name\n"
+       "Exact match of the communities\n")
+{
+  return bgp_show_community_list (vty, argv[0], 1, AFI_IP, SAFI_UNICAST);
+}
+
+DEFUN (show_bgp_ipv4_safi_community_list_exact,
+       show_bgp_ipv4_safi_community_list_exact_cmd,
+       "show bgp ipv4 (unicast|multicast) community-list (<1-500>|WORD) \
exact-match", +       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display routes matching the community-list\n"
+       "community-list number\n"
+       "community-list name\n"
+       "Exact match of the communities\n")
+{
+  if (strncmp (argv[0], "m", 1) == 0)
+    return bgp_show_community_list (vty, argv[1], 1, AFI_IP, SAFI_MULTICAST);
+ 
+  return bgp_show_community_list (vty, argv[1], 1, AFI_IP, SAFI_UNICAST);
+}
+
+#ifdef HAVE_IPV6
+DEFUN (show_bgp_ipv6_safi_community_list,
+       show_bgp_ipv6_safi_community_list_cmd,
+       "show bgp ipv6 (encap|multicast|unicast|vpn) community-list (<1-500>|WORD)",
+       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Display routes matching the community-list\n"
+       "community-list number\n"
+       "community-list name\n")
+{
+  safi_t	safi;
+
+  if (bgp_parse_safi(argv[0], &safi)) {
+    vty_out (vty, "Error: Bad SAFI: %s%s", argv[0], VTY_NEWLINE);
+    return CMD_WARNING;
+  }
+  return bgp_show_community_list (vty, argv[1], 0, AFI_IP6, safi);
+}
+
+DEFUN (show_bgp_ipv6_safi_community_list_exact,
+       show_bgp_ipv6_safi_community_list_exact_cmd,
+       "show bgp ipv6 (encap|multicast|unicast|vpn) community-list (<1-500>|WORD) \
exact-match", +       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Address family modifier\n"
+       "Display routes matching the community-list\n"
+       "community-list number\n"
+       "community-list name\n"
+       "Exact match of the communities\n")
+{
+  safi_t	safi;
+
+  if (bgp_parse_safi(argv[0], &safi)) {
+    vty_out (vty, "Error: Bad SAFI: %s%s", argv[0], VTY_NEWLINE);
+    return CMD_WARNING;
+  }
+  return bgp_show_community_list (vty, argv[1], 1, AFI_IP6, safi);
+}
+#endif /* HAVE_IPV6 */
+
+static int
+bgp_show_prefix_longer (struct vty *vty, const char *prefix, afi_t afi,
+			safi_t safi, enum bgp_show_type type)
+{
+  int ret;
+  struct prefix *p;
+
+  p = prefix_new();
+
+  ret = str2prefix (prefix, p);
+  if (! ret)
+    {
+      vty_out (vty, "%% Malformed Prefix%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  ret = bgp_show (vty, NULL, afi, safi, type, p);
+  prefix_free(p);
+  return ret;
+}
+
+DEFUN (show_ip_bgp_prefix_longer,
+       show_ip_bgp_prefix_longer_cmd,
+       "show ip bgp A.B.C.D/M longer-prefixes",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
+       "Display route and more specific routes\n")
+{
+  return bgp_show_prefix_longer (vty, argv[0], AFI_IP, SAFI_UNICAST,
+				 bgp_show_type_prefix_longer);
+}
+
+DEFUN (show_ip_bgp_flap_prefix_longer,
+       show_ip_bgp_flap_prefix_longer_cmd,
+       "show ip bgp flap-statistics A.B.C.D/M longer-prefixes",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display flap statistics of routes\n"
+       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
+       "Display route and more specific routes\n")
+{
+  return bgp_show_prefix_longer (vty, argv[0], AFI_IP, SAFI_UNICAST,
+				 bgp_show_type_flap_prefix_longer);
+}
+
+ALIAS (show_ip_bgp_flap_prefix_longer,
+       show_ip_bgp_damp_flap_prefix_longer_cmd,
+       "show ip bgp dampening flap-statistics A.B.C.D/M longer-prefixes",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display detailed information about dampening\n"
+       "Display flap statistics of routes\n"
+       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
+       "Display route and more specific routes\n")
+
+DEFUN (show_ip_bgp_ipv4_prefix_longer,
+       show_ip_bgp_ipv4_prefix_longer_cmd,
+       "show ip bgp ipv4 (unicast|multicast) A.B.C.D/M longer-prefixes",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
+       "Display route and more specific routes\n")
+{
+  if (strncmp (argv[0], "m", 1) == 0)
+    return bgp_show_prefix_longer (vty, argv[1], AFI_IP, SAFI_MULTICAST,
+				   bgp_show_type_prefix_longer);
+
+  return bgp_show_prefix_longer (vty, argv[1], AFI_IP, SAFI_UNICAST,
+				 bgp_show_type_prefix_longer);
+}
+
+DEFUN (show_ip_bgp_flap_address,
+       show_ip_bgp_flap_address_cmd,
+       "show ip bgp flap-statistics A.B.C.D",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display flap statistics of routes\n"
+       "Network in the BGP routing table to display\n")
+{
+  return bgp_show_prefix_longer (vty, argv[0], AFI_IP, SAFI_UNICAST,
+				 bgp_show_type_flap_address);
+}
+
+ALIAS (show_ip_bgp_flap_address,
+       show_ip_bgp_damp_flap_address_cmd,
+       "show ip bgp dampening flap-statistics A.B.C.D",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display detailed information about dampening\n"
+       "Display flap statistics of routes\n"
+       "Network in the BGP routing table to display\n")
+
+DEFUN (show_ip_bgp_flap_prefix,
+       show_ip_bgp_flap_prefix_cmd,
+       "show ip bgp flap-statistics A.B.C.D/M",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display flap statistics of routes\n"
+       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
+{
+  return bgp_show_prefix_longer (vty, argv[0], AFI_IP, SAFI_UNICAST,
+				 bgp_show_type_flap_prefix);
+}
+
+ALIAS (show_ip_bgp_flap_prefix,
+       show_ip_bgp_damp_flap_prefix_cmd,
+       "show ip bgp dampening flap-statistics A.B.C.D/M",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display detailed information about dampening\n"
+       "Display flap statistics of routes\n"
+       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
+
+#ifdef HAVE_IPV6
+DEFUN (show_bgp_prefix_longer,
+       show_bgp_prefix_longer_cmd,
+       "show bgp X:X::X:X/M longer-prefixes",
+       SHOW_STR
+       BGP_STR
+       "IPv6 prefix <network>/<length>\n"
+       "Display route and more specific routes\n")
+{
+  return bgp_show_prefix_longer (vty, argv[0], AFI_IP6, SAFI_UNICAST,
+				 bgp_show_type_prefix_longer);
+}
+
+/* old command */
+DEFUN (show_ipv6_bgp_prefix_longer,
+       show_ipv6_bgp_prefix_longer_cmd,
+       "show ipv6 bgp X:X::X:X/M longer-prefixes",
+       SHOW_STR
+       IPV6_STR
+       BGP_STR
+       "IPv6 prefix <network>/<length>, e.g., 3ffe::/16\n"
+       "Display route and more specific routes\n")
+{
+  return bgp_show_prefix_longer (vty, argv[0], AFI_IP6, SAFI_UNICAST,
+				 bgp_show_type_prefix_longer);
+}
+
+/* old command */
+DEFUN (show_ipv6_mbgp_prefix_longer,
+       show_ipv6_mbgp_prefix_longer_cmd,
+       "show ipv6 mbgp X:X::X:X/M longer-prefixes",
+       SHOW_STR
+       IPV6_STR
+       MBGP_STR
+       "IPv6 prefix <network>/<length>, e.g., 3ffe::/16\n"
+       "Display route and more specific routes\n")
+{
+  return bgp_show_prefix_longer (vty, argv[0], AFI_IP6, SAFI_MULTICAST,
+				 bgp_show_type_prefix_longer);
+}
+#endif /* HAVE_IPV6 */
+
+DEFUN (show_bgp_ipv4_prefix_longer,
+       show_bgp_ipv4_prefix_longer_cmd,
+       "show bgp ipv4 A.B.C.D/M longer-prefixes",
+       SHOW_STR
+       BGP_STR
+       IP_STR
+       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
+       "Display route and more specific routes\n")
+{
+  return bgp_show_prefix_longer (vty, argv[0], AFI_IP, SAFI_UNICAST,
+				 bgp_show_type_prefix_longer);
+}
+
+DEFUN (show_bgp_ipv4_safi_flap_prefix_longer,
+       show_bgp_ipv4_safi_flap_prefix_longer_cmd,
+       "show bgp ipv4 (encap|multicast|unicast|vpn) flap-statistics A.B.C.D/M \
longer-prefixes", +       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display flap statistics of routes\n"
+       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
+       "Display route and more specific routes\n")
+{
+  safi_t	safi;
+
+  if (bgp_parse_safi(argv[0], &safi)) {
+    vty_out (vty, "Error: Bad SAFI: %s%s", argv[0], VTY_NEWLINE);
+    return CMD_WARNING;
+  }
+  return bgp_show_prefix_longer (vty, argv[1], AFI_IP, safi,
+				 bgp_show_type_flap_prefix_longer);
+}
+
+ALIAS (show_bgp_ipv4_safi_flap_prefix_longer,
+       show_bgp_ipv4_safi_damp_flap_prefix_longer_cmd,
+       "show bgp ipv4 (encap|multicast|unicast|vpn) dampening flap-statistics \
A.B.C.D/M longer-prefixes", +       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display detailed information about dampening\n"
+       "Display flap statistics of routes\n"
+       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
+       "Display route and more specific routes\n")
+
+#ifdef HAVE_IPV6
+DEFUN (show_bgp_ipv6_safi_flap_prefix_longer,
+       show_bgp_ipv6_safi_flap_prefix_longer_cmd,
+       "show bgp ipv6 (encap|multicast|unicast|vpn) flap-statistics X:X::X:X/M \
longer-prefixes", +       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display flap statistics of routes\n"
+       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
+       "Display route and more specific routes\n")
+{
+  safi_t	safi;
+
+  if (bgp_parse_safi(argv[0], &safi)) {
+    vty_out (vty, "Error: Bad SAFI: %s%s", argv[0], VTY_NEWLINE);
+    return CMD_WARNING;
+  }
+  return bgp_show_prefix_longer (vty, argv[1], AFI_IP6, safi,
+				 bgp_show_type_flap_prefix_longer);
+}
+ALIAS (show_bgp_ipv6_safi_flap_prefix_longer,
+       show_bgp_ipv6_safi_damp_flap_prefix_longer_cmd,
+       "show bgp ipv6 (encap|multicast|unicast|vpn) dampening flap-statistics \
X:X::X:X/M longer-prefixes", +       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display detailed information about dampening\n"
+       "Display flap statistics of routes\n"
+       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
+       "Display route and more specific routes\n")
+#endif
+
+DEFUN (show_bgp_ipv4_safi_prefix_longer,
+       show_bgp_ipv4_safi_prefix_longer_cmd,
+       "show bgp ipv4 (encap|multicast|unicast|vpn) A.B.C.D/M longer-prefixes",
+       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
+       "Display route and more specific routes\n")
+{
+  safi_t	safi;
+
+  if (bgp_parse_safi(argv[0], &safi)) {
+    vty_out (vty, "Error: Bad SAFI: %s%s", argv[0], VTY_NEWLINE);
+    return CMD_WARNING;
+  }
+
+  return bgp_show_prefix_longer (vty, argv[1], AFI_IP, safi,
+				   bgp_show_type_prefix_longer);
+}
+
+#ifdef HAVE_IPV6
+DEFUN (show_bgp_ipv6_safi_prefix_longer,
+       show_bgp_ipv6_safi_prefix_longer_cmd,
+       "show bgp ipv6 (encap|multicast|unicast|vpn) X:X::X:X/M longer-prefixes",
+       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
+       "Display route and more specific routes\n")
+{
+  safi_t	safi;
+
+  if (bgp_parse_safi(argv[0], &safi)) {
+    vty_out (vty, "Error: Bad SAFI: %s%s", argv[0], VTY_NEWLINE);
+    return CMD_WARNING;
+  }
+
+  return bgp_show_prefix_longer (vty, argv[1], AFI_IP6, safi,
+				   bgp_show_type_prefix_longer);
+}
+#endif
+
+DEFUN (show_bgp_ipv4_safi_flap_address,
+       show_bgp_ipv4_safi_flap_address_cmd,
+       "show bgp ipv4 (encap|multicast|unicast|vpn) flap-statistics A.B.C.D",
+       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display flap statistics of routes\n"
+       "Network in the BGP routing table to display\n")
+{
+  safi_t	safi;
+
+  if (bgp_parse_safi(argv[0], &safi)) {
+    vty_out (vty, "Error: Bad SAFI: %s%s", argv[0], VTY_NEWLINE);
+    return CMD_WARNING;
+  }
+  return bgp_show_prefix_longer (vty, argv[1], AFI_IP, safi,
+				 bgp_show_type_flap_address);
+}
+ALIAS (show_bgp_ipv4_safi_flap_address,
+       show_bgp_ipv4_safi_damp_flap_address_cmd,
+       "show bgp ipv4 (encap|multicast|unicast|vpn) dampening flap-statistics \
A.B.C.D", +       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display detailed information about dampening\n"
+       "Display flap statistics of routes\n"
+       "Network in the BGP routing table to display\n")
+#ifdef HAVE_IPV6
+DEFUN (show_bgp_ipv6_flap_address,
+       show_bgp_ipv6_flap_address_cmd,
+       "show bgp ipv6 (encap|multicast|unicast|vpn) flap-statistics A.B.C.D",
+       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display flap statistics of routes\n"
+       "Network in the BGP routing table to display\n")
+{
+  safi_t	safi;
+
+  if (bgp_parse_safi(argv[0], &safi)) {
+    vty_out (vty, "Error: Bad SAFI: %s%s", argv[1], VTY_NEWLINE);
+    return CMD_WARNING;
+  }
+  return bgp_show_prefix_longer (vty, argv[1], AFI_IP, safi,
+				 bgp_show_type_flap_address);
+}
+ALIAS (show_bgp_ipv6_flap_address,
+       show_bgp_ipv6_damp_flap_address_cmd,
+       "show bgp ipv6 (encap|multicast|unicast|vpn) dampening flap-statistics \
A.B.C.D", +       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display detailed information about dampening\n"
+       "Display flap statistics of routes\n"
+       "Network in the BGP routing table to display\n")
+#endif
+
+DEFUN (show_bgp_ipv4_safi_flap_prefix,
+       show_bgp_ipv4_safi_flap_prefix_cmd,
+       "show bgp ipv4 (encap|multicast|unicast|vpn) flap-statistics A.B.C.D/M",
+       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display flap statistics of routes\n"
+       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
+{
+  safi_t	safi;
+
+  if (bgp_parse_safi(argv[0], &safi)) {
+    vty_out (vty, "Error: Bad SAFI: %s%s", argv[1], VTY_NEWLINE);
+    return CMD_WARNING;
+  }
+  return bgp_show_prefix_longer (vty, argv[0], AFI_IP, safi,
+				 bgp_show_type_flap_prefix);
+}
+
+ALIAS (show_bgp_ipv4_safi_flap_prefix,
+       show_bgp_ipv4_safi_damp_flap_prefix_cmd,
+       "show bgp ipv4 (encap|multicast|unicast|vpn) dampening flap-statistics \
A.B.C.D/M", +       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display detailed information about dampening\n"
+       "Display flap statistics of routes\n"
+       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
+
+#ifdef HAVE_IPV6
+DEFUN (show_bgp_ipv6_safi_flap_prefix,
+       show_bgp_ipv6_safi_flap_prefix_cmd,
+       "show bgp ipv6 (encap|multicast|unicast|vpn) flap-statistics X:X::X:X/M",
+       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display flap statistics of routes\n"
+       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
+{
+  safi_t	safi;
+
+  if (bgp_parse_safi(argv[0], &safi)) {
+    vty_out (vty, "Error: Bad SAFI: %s%s", argv[1], VTY_NEWLINE);
+    return CMD_WARNING;
+  }
+  return bgp_show_prefix_longer (vty, argv[0], AFI_IP6, safi,
+				 bgp_show_type_flap_prefix);
+}
+
+ALIAS (show_bgp_ipv6_safi_flap_prefix,
+       show_bgp_ipv6_safi_damp_flap_prefix_cmd,
+       "show bgp ipv6 (encap|multicast|unicast|vpn) dampening flap-statistics \
X:X::X:X/M", +       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Display detailed information about dampening\n"
+       "Display flap statistics of routes\n"
+       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
+
+DEFUN (show_bgp_ipv6_prefix_longer,
+       show_bgp_ipv6_prefix_longer_cmd,
+       "show bgp ipv6 X:X::X:X/M longer-prefixes",
+       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "IPv6 prefix <network>/<length>\n"
+       "Display route and more specific routes\n")
 {
   return bgp_show_prefix_longer (vty, argv[0], AFI_IP6, SAFI_UNICAST,
 				 bgp_show_type_prefix_longer);
 }
 
-#endif /* HAVE_IPV6 */
-
-static struct peer *
-peer_lookup_in_view (struct vty *vty, const char *view_name, 
-                     const char *ip_str)
+#endif /* HAVE_IPV6 */
+
+static struct peer *
+peer_lookup_in_view (struct vty *vty, const char *view_name, 
+                     const char *ip_str)
+{
+  int ret;
+  struct bgp *bgp;
+  struct peer *peer;
+  union sockunion su;
+
+  /* BGP structure lookup. */
+  if (view_name)
+    {
+      bgp = bgp_lookup_by_name (view_name);
+      if (! bgp)
+        {
+          vty_out (vty, "Can't find BGP view %s%s", view_name, VTY_NEWLINE);
+          return NULL;
+        }      
+    }
+  else
+    {
+      bgp = bgp_get_default ();
+      if (! bgp)
+        {
+          vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
+          return NULL;
+        }
+    }
+
+  /* Get peer sockunion. */  
+  ret = str2sockunion (ip_str, &su);
+  if (ret < 0)
+    {
+      vty_out (vty, "Malformed address: %s%s", ip_str, VTY_NEWLINE);
+      return NULL;
+    }
+
+  /* Peer structure lookup. */
+  peer = peer_lookup (bgp, &su);
+  if (! peer)
+    {
+      vty_out (vty, "No such neighbor%s", VTY_NEWLINE);
+      return NULL;
+    }
+  
+  return peer;
+}
+
+enum bgp_stats
+{
+  BGP_STATS_MAXBITLEN = 0,
+  BGP_STATS_RIB,
+  BGP_STATS_PREFIXES,
+  BGP_STATS_TOTPLEN,
+  BGP_STATS_UNAGGREGATEABLE,
+  BGP_STATS_MAX_AGGREGATEABLE,
+  BGP_STATS_AGGREGATES,
+  BGP_STATS_SPACE,
+  BGP_STATS_ASPATH_COUNT,
+  BGP_STATS_ASPATH_MAXHOPS,
+  BGP_STATS_ASPATH_TOTHOPS,
+  BGP_STATS_ASPATH_MAXSIZE,
+  BGP_STATS_ASPATH_TOTSIZE,
+  BGP_STATS_ASN_HIGHEST,
+  BGP_STATS_MAX,
+};
+
+static const char *table_stats_strs[] =
+{
+  [BGP_STATS_PREFIXES]            = "Total Prefixes",
+  [BGP_STATS_TOTPLEN]             = "Average prefix length",
+  [BGP_STATS_RIB]                 = "Total Advertisements",
+  [BGP_STATS_UNAGGREGATEABLE]     = "Unaggregateable prefixes",
+  [BGP_STATS_MAX_AGGREGATEABLE]   = "Maximum aggregateable prefixes",
+  [BGP_STATS_AGGREGATES]          = "BGP Aggregate advertisements",
+  [BGP_STATS_SPACE]               = "Address space advertised",
+  [BGP_STATS_ASPATH_COUNT]        = "Advertisements with paths",
+  [BGP_STATS_ASPATH_MAXHOPS]      = "Longest AS-Path (hops)",
+  [BGP_STATS_ASPATH_MAXSIZE]      = "Largest AS-Path (bytes)",
+  [BGP_STATS_ASPATH_TOTHOPS]      = "Average AS-Path length (hops)",
+  [BGP_STATS_ASPATH_TOTSIZE]      = "Average AS-Path size (bytes)",
+  [BGP_STATS_ASN_HIGHEST]         = "Highest public ASN",
+  [BGP_STATS_MAX] = NULL,
+};
+
+struct bgp_table_stats
+{
+  struct bgp_table *table;
+  unsigned long long counts[BGP_STATS_MAX];
+};
+
+#if 0
+#define TALLY_SIGFIG 100000
+static unsigned long
+ravg_tally (unsigned long count, unsigned long oldavg, unsigned long newval)
+{
+  unsigned long newtot = (count-1) * oldavg + (newval * TALLY_SIGFIG);
+  unsigned long res = (newtot * TALLY_SIGFIG) / count;
+  unsigned long ret = newtot / count;
+  
+  if ((res % TALLY_SIGFIG) > (TALLY_SIGFIG/2))
+    return ret + 1;
+  else
+    return ret;
+}
+#endif
+
+static int
+bgp_table_stats_walker (struct thread *t)
 {
-  int ret;
-  struct bgp *bgp;
-  struct peer *peer;
-  union sockunion su;
+  struct bgp_node *rn;
+  struct bgp_node *top;
+  struct bgp_table_stats *ts = THREAD_ARG (t);
+  unsigned int space = 0;
+  
+  if (!(top = bgp_table_top (ts->table)))
+    return 0;
 
-  /* BGP structure lookup. */
-  if (view_name)
+  switch (top->p.family)
     {
-      bgp = bgp_lookup_by_name (view_name);
-      if (! bgp)
+      case AF_INET:
+        space = IPV4_MAX_BITLEN;
+        break;
+      case AF_INET6:
+        space = IPV6_MAX_BITLEN;
+        break;
+    }
+    
+  ts->counts[BGP_STATS_MAXBITLEN] = space;
+
+  for (rn = top; rn; rn = bgp_route_next (rn))
+    {
+      struct bgp_info *ri;
+      struct bgp_node *prn = bgp_node_parent_nolock (rn);
+      unsigned int rinum = 0;
+      
+      if (rn == top)
+        continue;
+      
+      if (!rn->info)
+        continue;
+      
+      ts->counts[BGP_STATS_PREFIXES]++;
+      ts->counts[BGP_STATS_TOTPLEN] += rn->p.prefixlen;
+
+#if 0
+      ts->counts[BGP_STATS_AVGPLEN]
+        = ravg_tally (ts->counts[BGP_STATS_PREFIXES],
+                      ts->counts[BGP_STATS_AVGPLEN],
+                      rn->p.prefixlen);
+#endif
+      
+      /* check if the prefix is included by any other announcements */
+      while (prn && !prn->info)
+        prn = bgp_node_parent_nolock (prn);
+      
+      if (prn == NULL || prn == top)
         {
-          vty_out (vty, "Can't find BGP view %s%s", view_name, VTY_NEWLINE);
-          return NULL;
-        }      
+          ts->counts[BGP_STATS_UNAGGREGATEABLE]++;
+          /* announced address space */
+          if (space)
+            ts->counts[BGP_STATS_SPACE] += 1 << (space - rn->p.prefixlen);
+        }
+      else if (prn->info)
+        ts->counts[BGP_STATS_MAX_AGGREGATEABLE]++;
+      
+      for (ri = rn->info; ri; ri = ri->next)
+        {
+          rinum++;
+          ts->counts[BGP_STATS_RIB]++;
+          
+          if (ri->attr &&
+              (CHECK_FLAG (ri->attr->flag,
+                           ATTR_FLAG_BIT (BGP_ATTR_ATOMIC_AGGREGATE))))
+            ts->counts[BGP_STATS_AGGREGATES]++;
+          
+          /* as-path stats */
+          if (ri->attr && ri->attr->aspath)
+            {
+              unsigned int hops = aspath_count_hops (ri->attr->aspath);
+              unsigned int size = aspath_size (ri->attr->aspath);
+              as_t highest = aspath_highest (ri->attr->aspath);
+              
+              ts->counts[BGP_STATS_ASPATH_COUNT]++;
+              
+              if (hops > ts->counts[BGP_STATS_ASPATH_MAXHOPS])
+                ts->counts[BGP_STATS_ASPATH_MAXHOPS] = hops;
+              
+              if (size > ts->counts[BGP_STATS_ASPATH_MAXSIZE])
+                ts->counts[BGP_STATS_ASPATH_MAXSIZE] = size;
+              
+              ts->counts[BGP_STATS_ASPATH_TOTHOPS] += hops;
+              ts->counts[BGP_STATS_ASPATH_TOTSIZE] += size;
+#if 0
+              ts->counts[BGP_STATS_ASPATH_AVGHOPS] 
+                = ravg_tally (ts->counts[BGP_STATS_ASPATH_COUNT],
+                              ts->counts[BGP_STATS_ASPATH_AVGHOPS],
+                              hops);
+              ts->counts[BGP_STATS_ASPATH_AVGSIZE]
+                = ravg_tally (ts->counts[BGP_STATS_ASPATH_COUNT],
+                              ts->counts[BGP_STATS_ASPATH_AVGSIZE],
+                              size);
+#endif
+              if (highest > ts->counts[BGP_STATS_ASN_HIGHEST])
+                ts->counts[BGP_STATS_ASN_HIGHEST] = highest;
+            }
+        }
     }
-  else
+  return 0;
+}
+
+static int
+bgp_table_stats (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi)
+{
+  struct bgp_table_stats ts;
+  unsigned int i;
+  
+  if (!bgp->rib[afi][safi])
     {
-      bgp = bgp_get_default ();
-      if (! bgp)
+      vty_out (vty, "%% No RIB exists for the AFI/SAFI%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+  
+  memset (&ts, 0, sizeof (ts));
+  ts.table = bgp->rib[afi][safi];
+  thread_execute (bm->master, bgp_table_stats_walker, &ts, 0);
+
+  vty_out (vty, "BGP %s RIB statistics%s%s",
+           afi_safi_print (afi, safi), VTY_NEWLINE, VTY_NEWLINE);
+  
+  for (i = 0; i < BGP_STATS_MAX; i++)
+    {
+      if (!table_stats_strs[i])
+        continue;
+      
+      switch (i)
         {
-          vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
-          return NULL;
+#if 0
+          case BGP_STATS_ASPATH_AVGHOPS:
+          case BGP_STATS_ASPATH_AVGSIZE:
+          case BGP_STATS_AVGPLEN:
+            vty_out (vty, "%-30s: ", table_stats_strs[i]);
+            vty_out (vty, "%12.2f",
+                     (float)ts.counts[i] / (float)TALLY_SIGFIG);
+            break;
+#endif
+          case BGP_STATS_ASPATH_TOTHOPS:
+          case BGP_STATS_ASPATH_TOTSIZE:
+            vty_out (vty, "%-30s: ", table_stats_strs[i]);
+            vty_out (vty, "%12.2f",
+                     ts.counts[i] ?
+                     (float)ts.counts[i] / 
+                      (float)ts.counts[BGP_STATS_ASPATH_COUNT]
+                     : 0);
+            break;
+          case BGP_STATS_TOTPLEN:
+            vty_out (vty, "%-30s: ", table_stats_strs[i]);
+            vty_out (vty, "%12.2f",
+                     ts.counts[i] ?
+                     (float)ts.counts[i] / 
+                      (float)ts.counts[BGP_STATS_PREFIXES]
+                     : 0);
+            break;
+          case BGP_STATS_SPACE:
+            vty_out (vty, "%-30s: ", table_stats_strs[i]);
+            vty_out (vty, "%12llu%s", ts.counts[i], VTY_NEWLINE);
+            if (ts.counts[BGP_STATS_MAXBITLEN] < 9)
+              break;
+            vty_out (vty, "%30s: ", "%% announced ");
+            vty_out (vty, "%12.2f%s", 
+                     100 * (float)ts.counts[BGP_STATS_SPACE] / 
+                       (float)((uint64_t)1UL << ts.counts[BGP_STATS_MAXBITLEN]),
+                       VTY_NEWLINE);
+            vty_out (vty, "%30s: ", "/8 equivalent ");
+            vty_out (vty, "%12.2f%s", 
+                     (float)ts.counts[BGP_STATS_SPACE] / 
+                       (float)(1UL << (ts.counts[BGP_STATS_MAXBITLEN] - 8)),
+                     VTY_NEWLINE);
+            if (ts.counts[BGP_STATS_MAXBITLEN] < 25)
+              break;
+            vty_out (vty, "%30s: ", "/24 equivalent ");
+            vty_out (vty, "%12.2f", 
+                     (float)ts.counts[BGP_STATS_SPACE] / 
+                       (float)(1UL << (ts.counts[BGP_STATS_MAXBITLEN] - 24)));
+            break;
+          default:
+            vty_out (vty, "%-30s: ", table_stats_strs[i]);
+            vty_out (vty, "%12llu", ts.counts[i]);
         }
+        
+      vty_out (vty, "%s", VTY_NEWLINE);
     }
+  return CMD_SUCCESS;
+}
 
-  /* Get peer sockunion. */  
-  ret = str2sockunion (ip_str, &su);
-  if (ret < 0)
+static int
+bgp_table_stats_vty (struct vty *vty, const char *name,
+                     const char *afi_str, const char *safi_str)
+{
+  struct bgp *bgp;
+  afi_t afi;
+  safi_t safi;
+  
+ if (name)
+    bgp = bgp_lookup_by_name (name);
+  else
+    bgp = bgp_get_default ();
+
+  if (!bgp)
     {
-      vty_out (vty, "Malformed address: %s%s", ip_str, VTY_NEWLINE);
-      return NULL;
+      vty_out (vty, "%% No such BGP instance exists%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+  if (strncmp (afi_str, "ipv", 3) == 0)
+    {
+      if (strncmp (afi_str, "ipv4", 4) == 0)
+        afi = AFI_IP;
+      else if (strncmp (afi_str, "ipv6", 4) == 0)
+        afi = AFI_IP6;
+      else
+        {
+          vty_out (vty, "%% Invalid address family %s%s",
+                   afi_str, VTY_NEWLINE);
+          return CMD_WARNING;
+        }
+      switch (safi_str[0]) {
+	case 'm':
+	    safi = SAFI_MULTICAST;
+	    break;
+	case 'u':
+	    safi = SAFI_UNICAST;
+	    break;
+	case 'v':
+	    safi =  SAFI_MPLS_LABELED_VPN;
+	    break;
+	case 'e':
+	    safi = SAFI_ENCAP;
+	    break;
+	default:
+	    vty_out (vty, "%% Invalid subsequent address family %s%s",
+                   safi_str, VTY_NEWLINE);
+            return CMD_WARNING;
+      }
     }
-
-  /* Peer structure lookup. */
-  peer = peer_lookup (bgp, &su);
-  if (! peer)
+  else
     {
-      vty_out (vty, "No such neighbor%s", VTY_NEWLINE);
-      return NULL;
+      vty_out (vty, "%% Invalid address family \"%s\"%s",
+               afi_str, VTY_NEWLINE);
+      return CMD_WARNING;
     }
-  
-  return peer;
+
+  return bgp_table_stats (vty, bgp, afi, safi);
 }
 
-enum bgp_stats
+DEFUN (show_bgp_statistics,
+       show_bgp_statistics_cmd,
+       "show bgp (ipv4|ipv6) (encap|multicast|unicast|vpn) statistics",
+       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "BGP RIB advertisement statistics\n")
 {
-  BGP_STATS_MAXBITLEN = 0,
-  BGP_STATS_RIB,
-  BGP_STATS_PREFIXES,
-  BGP_STATS_TOTPLEN,
-  BGP_STATS_UNAGGREGATEABLE,
-  BGP_STATS_MAX_AGGREGATEABLE,
-  BGP_STATS_AGGREGATES,
-  BGP_STATS_SPACE,
-  BGP_STATS_ASPATH_COUNT,
-  BGP_STATS_ASPATH_MAXHOPS,
-  BGP_STATS_ASPATH_TOTHOPS,
-  BGP_STATS_ASPATH_MAXSIZE,
-  BGP_STATS_ASPATH_TOTSIZE,
-  BGP_STATS_ASN_HIGHEST,
-  BGP_STATS_MAX,
-};
+  return bgp_table_stats_vty (vty, NULL, argv[0], argv[1]);
+}
 
-static const char *table_stats_strs[] =
+ALIAS (show_bgp_statistics,
+       show_bgp_statistics_vpnv4_cmd,
+       "show bgp (ipv4) (vpnv4) statistics",
+       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "BGP RIB advertisement statistics\n")
+
+DEFUN (show_bgp_statistics_view,
+       show_bgp_statistics_view_cmd,
+       "show bgp view WORD (ipv4|ipv6) (encap|multicast|unicast|vpn) statistics",
+       SHOW_STR
+       BGP_STR
+       "BGP view\n"
+       "Address family\n"
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "BGP RIB advertisement statistics\n")
 {
-  [BGP_STATS_PREFIXES]            = "Total Prefixes",
-  [BGP_STATS_TOTPLEN]             = "Average prefix length",
-  [BGP_STATS_RIB]                 = "Total Advertisements",
-  [BGP_STATS_UNAGGREGATEABLE]     = "Unaggregateable prefixes",
-  [BGP_STATS_MAX_AGGREGATEABLE]   = "Maximum aggregateable prefixes",
-  [BGP_STATS_AGGREGATES]          = "BGP Aggregate advertisements",
-  [BGP_STATS_SPACE]               = "Address space advertised",
-  [BGP_STATS_ASPATH_COUNT]        = "Advertisements with paths",
-  [BGP_STATS_ASPATH_MAXHOPS]      = "Longest AS-Path (hops)",
-  [BGP_STATS_ASPATH_MAXSIZE]      = "Largest AS-Path (bytes)",
-  [BGP_STATS_ASPATH_TOTHOPS]      = "Average AS-Path length (hops)",
-  [BGP_STATS_ASPATH_TOTSIZE]      = "Average AS-Path size (bytes)",
-  [BGP_STATS_ASN_HIGHEST]         = "Highest public ASN",
-  [BGP_STATS_MAX] = NULL,
+  return bgp_table_stats_vty (vty, NULL, argv[0], argv[1]);
+}
+
+ALIAS (show_bgp_statistics_view,
+       show_bgp_statistics_view_vpnv4_cmd,
+       "show bgp view WORD (ipv4) (vpnv4) statistics",
+       SHOW_STR
+       BGP_STR
+       "BGP view\n"
+       "Address family\n"
+       "Address Family modifier\n"
+       "BGP RIB advertisement statistics\n")
+
+enum bgp_pcounts
+{
+  PCOUNT_ADJ_IN = 0,
+  PCOUNT_DAMPED,
+  PCOUNT_REMOVED,
+  PCOUNT_HISTORY,
+  PCOUNT_STALE,
+  PCOUNT_VALID,
+  PCOUNT_ALL,
+  PCOUNT_COUNTED,
+  PCOUNT_PFCNT, /* the figure we display to users */
+  PCOUNT_MAX,
 };
 
-struct bgp_table_stats
+static const char *pcount_strs[] =
 {
-  struct bgp_table *table;
-  unsigned long long counts[BGP_STATS_MAX];
+  [PCOUNT_ADJ_IN]  = "Adj-in",
+  [PCOUNT_DAMPED]  = "Damped",
+  [PCOUNT_REMOVED] = "Removed",
+  [PCOUNT_HISTORY] = "History",
+  [PCOUNT_STALE]   = "Stale",
+  [PCOUNT_VALID]   = "Valid",
+  [PCOUNT_ALL]     = "All RIB",
+  [PCOUNT_COUNTED] = "PfxCt counted",
+  [PCOUNT_PFCNT]   = "Useable",
+  [PCOUNT_MAX]     = NULL,
 };
 
-#if 0
-#define TALLY_SIGFIG 100000
-static unsigned long
-ravg_tally (unsigned long count, unsigned long oldavg, unsigned long newval)
+struct peer_pcounts
 {
-  unsigned long newtot = (count-1) * oldavg + (newval * TALLY_SIGFIG);
-  unsigned long res = (newtot * TALLY_SIGFIG) / count;
-  unsigned long ret = newtot / count;
-  
-  if ((res % TALLY_SIGFIG) > (TALLY_SIGFIG/2))
-    return ret + 1;
-  else
-    return ret;
-}
-#endif
+  unsigned int count[PCOUNT_MAX];
+  const struct peer *peer;
+  const struct bgp_table *table;
+};
 
 static int
-bgp_table_stats_walker (struct thread *t)
+bgp_peer_count_walker (struct thread *t)
 {
   struct bgp_node *rn;
-  struct bgp_node *top;
-  struct bgp_table_stats *ts = THREAD_ARG (t);
-  unsigned int space = 0;
+  struct peer_pcounts *pc = THREAD_ARG (t);
+  const struct peer *peer = pc->peer;
   
-  if (!(top = bgp_table_top (ts->table)))
-    return 0;
-
-  switch (top->p.family)
-    {
-      case AF_INET:
-        space = IPV4_MAX_BITLEN;
-        break;
-      case AF_INET6:
-        space = IPV6_MAX_BITLEN;
-        break;
-    }
-    
-  ts->counts[BGP_STATS_MAXBITLEN] = space;
-
-  for (rn = top; rn; rn = bgp_route_next (rn))
+  for (rn = bgp_table_top (pc->table); rn; rn = bgp_route_next (rn))
     {
+      struct bgp_adj_in *ain;
       struct bgp_info *ri;
-      struct bgp_node *prn = bgp_node_parent_nolock (rn);
-      unsigned int rinum = 0;
-      
-      if (rn == top)
-        continue;
-      
-      if (!rn->info)
-        continue;
       
-      ts->counts[BGP_STATS_PREFIXES]++;
-      ts->counts[BGP_STATS_TOTPLEN] += rn->p.prefixlen;
+      for (ain = rn->adj_in; ain; ain = ain->next)
+        if (ain->peer == peer)
+          pc->count[PCOUNT_ADJ_IN]++;
 
-#if 0
-      ts->counts[BGP_STATS_AVGPLEN]
-        = ravg_tally (ts->counts[BGP_STATS_PREFIXES],
-                      ts->counts[BGP_STATS_AVGPLEN],
-                      rn->p.prefixlen);
-#endif
-      
-      /* check if the prefix is included by any other announcements */
-      while (prn && !prn->info)
-        prn = bgp_node_parent_nolock (prn);
-      
-      if (prn == NULL || prn == top)
-        {
-          ts->counts[BGP_STATS_UNAGGREGATEABLE]++;
-          /* announced address space */
-          if (space)
-            ts->counts[BGP_STATS_SPACE] += 1 << (space - rn->p.prefixlen);
-        }
-      else if (prn->info)
-        ts->counts[BGP_STATS_MAX_AGGREGATEABLE]++;
-      
       for (ri = rn->info; ri; ri = ri->next)
         {
-          rinum++;
-          ts->counts[BGP_STATS_RIB]++;
+          char buf[SU_ADDRSTRLEN];
           
-          if (ri->attr &&
-              (CHECK_FLAG (ri->attr->flag,
-                           ATTR_FLAG_BIT (BGP_ATTR_ATOMIC_AGGREGATE))))
-            ts->counts[BGP_STATS_AGGREGATES]++;
+          if (ri->peer != peer)
+            continue;
           
-          /* as-path stats */
-          if (ri->attr && ri->attr->aspath)
+          pc->count[PCOUNT_ALL]++;
+          
+          if (CHECK_FLAG (ri->flags, BGP_INFO_DAMPED))
+            pc->count[PCOUNT_DAMPED]++;
+          if (CHECK_FLAG (ri->flags, BGP_INFO_HISTORY))
+            pc->count[PCOUNT_HISTORY]++;
+          if (CHECK_FLAG (ri->flags, BGP_INFO_REMOVED))
+            pc->count[PCOUNT_REMOVED]++;
+          if (CHECK_FLAG (ri->flags, BGP_INFO_STALE))
+            pc->count[PCOUNT_STALE]++;
+          if (CHECK_FLAG (ri->flags, BGP_INFO_VALID))
+            pc->count[PCOUNT_VALID]++;
+          if (!CHECK_FLAG (ri->flags, BGP_INFO_UNUSEABLE))
+            pc->count[PCOUNT_PFCNT]++;
+          
+          if (CHECK_FLAG (ri->flags, BGP_INFO_COUNTED))
             {
-              unsigned int hops = aspath_count_hops (ri->attr->aspath);
-              unsigned int size = aspath_size (ri->attr->aspath);
-              as_t highest = aspath_highest (ri->attr->aspath);
-              
-              ts->counts[BGP_STATS_ASPATH_COUNT]++;
-              
-              if (hops > ts->counts[BGP_STATS_ASPATH_MAXHOPS])
-                ts->counts[BGP_STATS_ASPATH_MAXHOPS] = hops;
-              
-              if (size > ts->counts[BGP_STATS_ASPATH_MAXSIZE])
-                ts->counts[BGP_STATS_ASPATH_MAXSIZE] = size;
-              
-              ts->counts[BGP_STATS_ASPATH_TOTHOPS] += hops;
-              ts->counts[BGP_STATS_ASPATH_TOTSIZE] += size;
-#if 0
-              ts->counts[BGP_STATS_ASPATH_AVGHOPS] 
-                = ravg_tally (ts->counts[BGP_STATS_ASPATH_COUNT],
-                              ts->counts[BGP_STATS_ASPATH_AVGHOPS],
-                              hops);
-              ts->counts[BGP_STATS_ASPATH_AVGSIZE]
-                = ravg_tally (ts->counts[BGP_STATS_ASPATH_COUNT],
-                              ts->counts[BGP_STATS_ASPATH_AVGSIZE],
-                              size);
-#endif
-              if (highest > ts->counts[BGP_STATS_ASN_HIGHEST])
-                ts->counts[BGP_STATS_ASN_HIGHEST] = highest;
+              pc->count[PCOUNT_COUNTED]++;
+              if (CHECK_FLAG (ri->flags, BGP_INFO_UNUSEABLE))
+                plog_warn (peer->log,
+                           "%s [pcount] %s/%d is counted but flags 0x%x",
+                           peer->host,
+                           inet_ntop(rn->p.family, &rn->p.u.prefix,
+                                     buf, SU_ADDRSTRLEN),
+                           rn->p.prefixlen,
+                           ri->flags);
+            }
+          else
+            {
+              if (!CHECK_FLAG (ri->flags, BGP_INFO_UNUSEABLE))
+                plog_warn (peer->log,
+                           "%s [pcount] %s/%d not counted but flags 0x%x",
+                           peer->host,
+                           inet_ntop(rn->p.family, &rn->p.u.prefix,
+                                     buf, SU_ADDRSTRLEN),
+                           rn->p.prefixlen,
+                           ri->flags);
             }
         }
     }
@@ -9780,424 +12204,674 @@ bgp_table_stats_walker (struct thread *t)
 }
 
 static int
-bgp_table_stats (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi)
+bgp_peer_counts (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi)
 {
-  struct bgp_table_stats ts;
+  struct peer_pcounts pcounts = { .peer = peer };
   unsigned int i;
   
-  if (!bgp->rib[afi][safi])
+  if (!peer || !peer->bgp || !peer->afc[afi][safi]
+      || !peer->bgp->rib[afi][safi])
     {
-      vty_out (vty, "%% No RIB exists for the AFI/SAFI%s", VTY_NEWLINE);
+      vty_out (vty, "%% No such neighbor or address family%s", VTY_NEWLINE);
       return CMD_WARNING;
     }
   
-  memset (&ts, 0, sizeof (ts));
-  ts.table = bgp->rib[afi][safi];
-  thread_execute (bm->master, bgp_table_stats_walker, &ts, 0);
-
-  vty_out (vty, "BGP %s RIB statistics%s%s",
-           afi_safi_print (afi, safi), VTY_NEWLINE, VTY_NEWLINE);
+  memset (&pcounts, 0, sizeof(pcounts));
+  pcounts.peer = peer;
+  pcounts.table = peer->bgp->rib[afi][safi];
   
-  for (i = 0; i < BGP_STATS_MAX; i++)
+  /* in-place call via thread subsystem so as to record execution time
+   * stats for the thread-walk (i.e. ensure this can't be blamed on
+   * on just vty_read()).
+   */
+  thread_execute (bm->master, bgp_peer_count_walker, &pcounts, 0);
+  
+  vty_out (vty, "Prefix counts for %s, %s%s", 
+           peer->host, afi_safi_print (afi, safi), VTY_NEWLINE);
+  vty_out (vty, "PfxCt: %ld%s", peer->pcount[afi][safi], VTY_NEWLINE);
+  vty_out (vty, "%sCounts from RIB table walk:%s%s", 
+           VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE);
+
+  for (i = 0; i < PCOUNT_MAX; i++)
+      vty_out (vty, "%20s: %-10d%s",
+               pcount_strs[i], pcounts.count[i], VTY_NEWLINE);
+
+  if (pcounts.count[PCOUNT_PFCNT] != peer->pcount[afi][safi])
     {
-      if (!table_stats_strs[i])
-        continue;
-      
-      switch (i)
-        {
-#if 0
-          case BGP_STATS_ASPATH_AVGHOPS:
-          case BGP_STATS_ASPATH_AVGSIZE:
-          case BGP_STATS_AVGPLEN:
-            vty_out (vty, "%-30s: ", table_stats_strs[i]);
-            vty_out (vty, "%12.2f",
-                     (float)ts.counts[i] / (float)TALLY_SIGFIG);
-            break;
-#endif
-          case BGP_STATS_ASPATH_TOTHOPS:
-          case BGP_STATS_ASPATH_TOTSIZE:
-            vty_out (vty, "%-30s: ", table_stats_strs[i]);
-            vty_out (vty, "%12.2f",
-                     ts.counts[i] ?
-                     (float)ts.counts[i] / 
-                      (float)ts.counts[BGP_STATS_ASPATH_COUNT]
-                     : 0);
-            break;
-          case BGP_STATS_TOTPLEN:
-            vty_out (vty, "%-30s: ", table_stats_strs[i]);
-            vty_out (vty, "%12.2f",
-                     ts.counts[i] ?
-                     (float)ts.counts[i] / 
-                      (float)ts.counts[BGP_STATS_PREFIXES]
-                     : 0);
-            break;
-          case BGP_STATS_SPACE:
-            vty_out (vty, "%-30s: ", table_stats_strs[i]);
-            vty_out (vty, "%12llu%s", ts.counts[i], VTY_NEWLINE);
-            if (ts.counts[BGP_STATS_MAXBITLEN] < 9)
-              break;
-            vty_out (vty, "%30s: ", "%% announced ");
-            vty_out (vty, "%12.2f%s", 
-                     100 * (float)ts.counts[BGP_STATS_SPACE] / 
-                       (float)((uint64_t)1UL << ts.counts[BGP_STATS_MAXBITLEN]),
-                       VTY_NEWLINE);
-            vty_out (vty, "%30s: ", "/8 equivalent ");
-            vty_out (vty, "%12.2f%s", 
-                     (float)ts.counts[BGP_STATS_SPACE] / 
-                       (float)(1UL << (ts.counts[BGP_STATS_MAXBITLEN] - 8)),
-                     VTY_NEWLINE);
-            if (ts.counts[BGP_STATS_MAXBITLEN] < 25)
-              break;
-            vty_out (vty, "%30s: ", "/24 equivalent ");
-            vty_out (vty, "%12.2f", 
-                     (float)ts.counts[BGP_STATS_SPACE] / 
-                       (float)(1UL << (ts.counts[BGP_STATS_MAXBITLEN] - 24)));
-            break;
-          default:
-            vty_out (vty, "%-30s: ", table_stats_strs[i]);
-            vty_out (vty, "%12llu", ts.counts[i]);
-        }
-        
-      vty_out (vty, "%s", VTY_NEWLINE);
+      vty_out (vty, "%s [pcount] PfxCt drift!%s",
+               peer->host, VTY_NEWLINE);
+      vty_out (vty, "Please report this bug, with the above command output%s",
+              VTY_NEWLINE);
     }
+               
   return CMD_SUCCESS;
 }
 
-static int
-bgp_table_stats_vty (struct vty *vty, const char *name,
-                     const char *afi_str, const char *safi_str)
+DEFUN (show_ip_bgp_neighbor_prefix_counts,
+       show_ip_bgp_neighbor_prefix_counts_cmd,
+       "show ip bgp neighbors (A.B.C.D|X:X::X:X) prefix-counts",
+       SHOW_STR
+       IP_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 detailed prefix count information\n")
 {
-  struct bgp *bgp;
-  afi_t afi;
-  safi_t safi;
+  struct peer *peer;
+
+  peer = peer_lookup_in_view (vty, NULL, argv[0]);  
+  if (! peer) 
+    return CMD_WARNING;
+ 
+  return bgp_peer_counts (vty, peer, AFI_IP, SAFI_UNICAST);
+}
+
+DEFUN (show_bgp_ipv6_neighbor_prefix_counts,
+       show_bgp_ipv6_neighbor_prefix_counts_cmd,
+       "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X) prefix-counts",
+       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 detailed prefix count information\n")
+{
+  struct peer *peer;
+
+  peer = peer_lookup_in_view (vty, NULL, argv[0]);  
+  if (! peer) 
+    return CMD_WARNING;
+ 
+  return bgp_peer_counts (vty, peer, AFI_IP6, SAFI_UNICAST);
+}
+
+DEFUN (show_ip_bgp_ipv4_neighbor_prefix_counts,
+       show_ip_bgp_ipv4_neighbor_prefix_counts_cmd,
+       "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X) \
prefix-counts", +       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Address family\n"
+       "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"
+       "Display detailed prefix count information\n")
+{
+  struct peer *peer;
+
+  peer = peer_lookup_in_view (vty, NULL, argv[1]);
+  if (! peer)
+    return CMD_WARNING;
+
+  if (strncmp (argv[0], "m", 1) == 0)
+    return bgp_peer_counts (vty, peer, AFI_IP, SAFI_MULTICAST);
+
+  return bgp_peer_counts (vty, peer, AFI_IP, SAFI_UNICAST);
+}
+
+DEFUN (show_ip_bgp_vpnv4_neighbor_prefix_counts,
+       show_ip_bgp_vpnv4_neighbor_prefix_counts_cmd,
+       "show ip bgp vpnv4 all neighbors (A.B.C.D|X:X::X:X) prefix-counts",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Address family\n"
+       "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"
+       "Display detailed prefix count information\n")
+{
+  struct peer *peer;
+
+  peer = peer_lookup_in_view (vty, NULL, argv[0]);
+  if (! peer)
+    return CMD_WARNING;
   
- if (name)
-    bgp = bgp_lookup_by_name (name);
-  else
-    bgp = bgp_get_default ();
+  return bgp_peer_counts (vty, peer, AFI_IP, SAFI_MPLS_VPN);
+}
 
-  if (!bgp)
-    {
-      vty_out (vty, "%% No such BGP instance exists%s", VTY_NEWLINE);
-      return CMD_WARNING;
-    }
-  if (strncmp (afi_str, "ipv", 3) == 0)
-    {
-      if (strncmp (afi_str, "ipv4", 4) == 0)
-        afi = AFI_IP;
-      else if (strncmp (afi_str, "ipv6", 4) == 0)
-        afi = AFI_IP6;
-      else
-        {
-          vty_out (vty, "%% Invalid address family %s%s",
-                   afi_str, VTY_NEWLINE);
-          return CMD_WARNING;
-        }
-      switch (safi_str[0]) {
-	case 'm':
-	    safi = SAFI_MULTICAST;
-	    break;
-	case 'u':
-	    safi = SAFI_UNICAST;
-	    break;
-	case 'v':
-	    safi =  SAFI_MPLS_LABELED_VPN;
-	    break;
-	case 'e':
-	    safi = SAFI_ENCAP;
-	    break;
-	default:
-	    vty_out (vty, "%% Invalid subsequent address family %s%s",
-                   safi_str, VTY_NEWLINE);
-            return CMD_WARNING;
-      }
-    }
-  else
-    {
-      vty_out (vty, "%% Invalid address family \"%s\"%s",
-               afi_str, VTY_NEWLINE);
-      return CMD_WARNING;
-    }
+DEFUN (show_bgp_ipv4_safi_neighbor_prefix_counts,
+       show_bgp_ipv4_safi_neighbor_prefix_counts_cmd,
+       "show bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X) \
prefix-counts", +       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "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"
+       "Display detailed prefix count information\n")
+{
+  struct peer *peer;
+  safi_t	safi;
+
+  if (bgp_parse_safi(argv[0], &safi)) {
+    vty_out (vty, "Error: Bad SAFI: %s%s", argv[0], VTY_NEWLINE);
+    return CMD_WARNING;
+  }
 
-  return bgp_table_stats (vty, bgp, afi, safi);
-}
+  peer = peer_lookup_in_view (vty, NULL, argv[1]);
+  if (! peer)
+    return CMD_WARNING;
 
-DEFUN (show_bgp_statistics,
-       show_bgp_statistics_cmd,
-       "show bgp (ipv4|ipv6) (encap|multicast|unicast|vpn) statistics",
+  return bgp_peer_counts (vty, peer, AFI_IP, safi);
+}
+#ifdef HAVE_IPV6
+DEFUN (show_bgp_ipv6_safi_neighbor_prefix_counts,
+       show_bgp_ipv6_safi_neighbor_prefix_counts_cmd,
+       "show bgp ipv6 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X) \
prefix-counts",  SHOW_STR
        BGP_STR
        "Address family\n"
-       "Address family\n"
        "Address Family modifier\n"
        "Address Family modifier\n"
        "Address Family modifier\n"
        "Address Family modifier\n"
-       "BGP RIB advertisement statistics\n")
+       "Detailed information on TCP and BGP neighbor connections\n"
+       "Neighbor to display information about\n"
+       "Neighbor to display information about\n"
+       "Display detailed prefix count information\n")
 {
-  return bgp_table_stats_vty (vty, NULL, argv[0], argv[1]);
+  struct peer *peer;
+  safi_t	safi;
+
+  if (bgp_parse_safi(argv[0], &safi)) {
+    vty_out (vty, "Error: Bad SAFI: %s%s", argv[0], VTY_NEWLINE);
+    return CMD_WARNING;
+  }
+
+  peer = peer_lookup_in_view (vty, NULL, argv[1]);
+  if (! peer)
+    return CMD_WARNING;
+
+  return bgp_peer_counts (vty, peer, AFI_IP6, safi);
 }
+#endif
 
-DEFUN (show_bgp_statistics_view,
-       show_bgp_statistics_view_cmd,
-       "show bgp view WORD (ipv4|ipv6) (encap|multicast|unicast|vpn) statistics",
+DEFUN (show_ip_bgp_encap_neighbor_prefix_counts,
+       show_ip_bgp_encap_neighbor_prefix_counts_cmd,
+       "show ip bgp encap all neighbors (A.B.C.D|X:X::X:X) prefix-counts",
        SHOW_STR
+       IP_STR
        BGP_STR
-       "BGP view\n"
-       "Address family\n"
        "Address family\n"
        "Address Family modifier\n"
        "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "BGP RIB advertisement statistics\n")
+       "Detailed information on TCP and BGP neighbor connections\n"
+       "Neighbor to display information about\n"
+       "Neighbor to display information about\n"
+       "Display detailed prefix count information\n")
 {
-  return bgp_table_stats_vty (vty, NULL, argv[0], argv[1]);
+  struct peer *peer;
+
+  peer = peer_lookup_in_view (vty, NULL, argv[0]);
+  if (! peer)
+    return CMD_WARNING;
+  
+  return bgp_peer_counts (vty, peer, AFI_IP, SAFI_ENCAP);
 }
 
-#if 0 /* added as options to above command */
-ALIAS (show_bgp_statistics_view,
-       show_bgp_statistics_view_encap_cmd,
-       "show bgp view WORD (ipv4) (encap) statistics",
-       SHOW_STR
-       BGP_STR
-       "BGP view\n"
-       "Address family\n"
-       "Address Family modifier\n"
-       "BGP RIB advertisement statistics\n")
-#endif
 
-enum bgp_pcounts
+static void
+show_adj_route (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi,
+		int in)
 {
-  PCOUNT_ADJ_IN = 0,
-  PCOUNT_DAMPED,
-  PCOUNT_REMOVED,
-  PCOUNT_HISTORY,
-  PCOUNT_STALE,
-  PCOUNT_VALID,
-  PCOUNT_ALL,
-  PCOUNT_COUNTED,
-  PCOUNT_PFCNT, /* the figure we display to users */
-  PCOUNT_MAX,
-};
+  struct bgp_table *table;
+  struct bgp_adj_in *ain;
+  struct bgp_adj_out *adj;
+  unsigned long output_count;
+  struct bgp_node *rn;
+  int header1 = 1;
+  struct bgp *bgp;
+  int header2 = 1;
 
-static const char *pcount_strs[] =
-{
-  [PCOUNT_ADJ_IN]  = "Adj-in",
-  [PCOUNT_DAMPED]  = "Damped",
-  [PCOUNT_REMOVED] = "Removed",
-  [PCOUNT_HISTORY] = "History",
-  [PCOUNT_STALE]   = "Stale",
-  [PCOUNT_VALID]   = "Valid",
-  [PCOUNT_ALL]     = "All RIB",
-  [PCOUNT_COUNTED] = "PfxCt counted",
-  [PCOUNT_PFCNT]   = "Useable",
-  [PCOUNT_MAX]     = NULL,
-};
+  bgp = peer->bgp;
 
-struct peer_pcounts
-{
-  unsigned int count[PCOUNT_MAX];
-  const struct peer *peer;
-  const struct bgp_table *table;
-};
+  if (! bgp)
+    return;
 
-static int
-bgp_peer_count_walker (struct thread *t)
-{
-  struct bgp_node *rn;
-  struct peer_pcounts *pc = THREAD_ARG (t);
-  const struct peer *peer = pc->peer;
-  
-  for (rn = bgp_table_top (pc->table); rn; rn = bgp_route_next (rn))
+  table = bgp->rib[afi][safi];
+
+  output_count = 0;
+	
+  if (! in && CHECK_FLAG (peer->af_sflags[afi][safi],
+			  PEER_STATUS_DEFAULT_ORIGINATE))
     {
-      struct bgp_adj_in *ain;
-      struct bgp_info *ri;
-      
-      for (ain = rn->adj_in; ain; ain = ain->next)
-        if (ain->peer == peer)
-          pc->count[PCOUNT_ADJ_IN]++;
+      vty_out (vty, "BGP table version is 0, local router ID is %s%s", inet_ntoa \
(bgp->router_id), VTY_NEWLINE); +      vty_out (vty, BGP_SHOW_SCODE_HEADER, \
VTY_NEWLINE, VTY_NEWLINE); +      vty_out (vty, BGP_SHOW_OCODE_HEADER, VTY_NEWLINE, \
VTY_NEWLINE);  
-      for (ri = rn->info; ri; ri = ri->next)
-        {
-          char buf[SU_ADDRSTRLEN];
-          
-          if (ri->peer != peer)
-            continue;
-          
-          pc->count[PCOUNT_ALL]++;
-          
-          if (CHECK_FLAG (ri->flags, BGP_INFO_DAMPED))
-            pc->count[PCOUNT_DAMPED]++;
-          if (CHECK_FLAG (ri->flags, BGP_INFO_HISTORY))
-            pc->count[PCOUNT_HISTORY]++;
-          if (CHECK_FLAG (ri->flags, BGP_INFO_REMOVED))
-            pc->count[PCOUNT_REMOVED]++;
-          if (CHECK_FLAG (ri->flags, BGP_INFO_STALE))
-            pc->count[PCOUNT_STALE]++;
-          if (CHECK_FLAG (ri->flags, BGP_INFO_VALID))
-            pc->count[PCOUNT_VALID]++;
-          if (!CHECK_FLAG (ri->flags, BGP_INFO_UNUSEABLE))
-            pc->count[PCOUNT_PFCNT]++;
-          
-          if (CHECK_FLAG (ri->flags, BGP_INFO_COUNTED))
-            {
-              pc->count[PCOUNT_COUNTED]++;
-              if (CHECK_FLAG (ri->flags, BGP_INFO_UNUSEABLE))
-                plog_warn (peer->log,
-                           "%s [pcount] %s/%d is counted but flags 0x%x",
-                           peer->host,
-                           inet_ntop(rn->p.family, &rn->p.u.prefix,
-                                     buf, SU_ADDRSTRLEN),
-                           rn->p.prefixlen,
-                           ri->flags);
-            }
-          else
-            {
-              if (!CHECK_FLAG (ri->flags, BGP_INFO_UNUSEABLE))
-                plog_warn (peer->log,
-                           "%s [pcount] %s/%d not counted but flags 0x%x",
-                           peer->host,
-                           inet_ntop(rn->p.family, &rn->p.u.prefix,
-                                     buf, SU_ADDRSTRLEN),
-                           rn->p.prefixlen,
-                           ri->flags);
-            }
-        }
+      vty_out (vty, "Originating default network 0.0.0.0%s%s",
+	       VTY_NEWLINE, VTY_NEWLINE);
+      header1 = 0;
     }
-  return 0;
+
+  for (rn = bgp_table_top (table); rn; rn = bgp_route_next (rn))
+    if (in)
+      {
+	for (ain = rn->adj_in; ain; ain = ain->next)
+	  if (ain->peer == peer)
+	    {
+	      if (header1)
+		{
+		  vty_out (vty, "BGP table version is 0, local router ID is %s%s", inet_ntoa \
(bgp->router_id), VTY_NEWLINE); +		  vty_out (vty, BGP_SHOW_SCODE_HEADER, \
VTY_NEWLINE, VTY_NEWLINE); +		  vty_out (vty, BGP_SHOW_OCODE_HEADER, VTY_NEWLINE, \
VTY_NEWLINE); +		  header1 = 0;
+		}
+	      if (header2)
+		{
+		  vty_out (vty, BGP_SHOW_HEADER, VTY_NEWLINE);
+		  header2 = 0;
+		}
+	      if (ain->attr)
+		{ 
+		  route_vty_out_tmp (vty, &rn->p, ain->attr, safi);
+		  output_count++;
+		}
+	    }
+      }
+    else
+      {
+	for (adj = rn->adj_out; adj; adj = adj->next)
+	  if (adj->peer == peer)
+	    {
+	      if (header1)
+		{
+		  vty_out (vty, "BGP table version is 0, local router ID is %s%s", inet_ntoa \
(bgp->router_id), VTY_NEWLINE); +		  vty_out (vty, BGP_SHOW_SCODE_HEADER, \
VTY_NEWLINE, VTY_NEWLINE); +		  vty_out (vty, BGP_SHOW_OCODE_HEADER, VTY_NEWLINE, \
VTY_NEWLINE); +		  header1 = 0;
+		}
+	      if (header2)
+		{
+		  vty_out (vty, BGP_SHOW_HEADER, VTY_NEWLINE);
+		  header2 = 0;
+		}
+	      if (adj->attr)
+		{	
+		  route_vty_out_tmp (vty, &rn->p, adj->attr, safi);
+		  output_count++;
+		}
+	    }
+      }
+  
+  if (output_count != 0)
+    vty_out (vty, "%sTotal number of prefixes %ld%s",
+	     VTY_NEWLINE, output_count, VTY_NEWLINE);
 }
 
 static int
-bgp_peer_counts (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi)
-{
-  struct peer_pcounts pcounts = { .peer = peer };
-  unsigned int i;
-  
-  if (!peer || !peer->bgp || !peer->afc[afi][safi]
-      || !peer->bgp->rib[afi][safi])
+peer_adj_routes (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, int in)
+{    
+  if (! peer || ! peer->afc[afi][safi])
+    {
+      vty_out (vty, "%% No such neighbor or address family%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  if (in && ! CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_SOFT_RECONFIG))
     {
-      vty_out (vty, "%% No such neighbor or address family%s", VTY_NEWLINE);
+      vty_out (vty, "%% Inbound soft reconfiguration not enabled%s",
+	       VTY_NEWLINE);
       return CMD_WARNING;
     }
-  
-  memset (&pcounts, 0, sizeof(pcounts));
-  pcounts.peer = peer;
-  pcounts.table = peer->bgp->rib[afi][safi];
-  
-  /* in-place call via thread subsystem so as to record execution time
-   * stats for the thread-walk (i.e. ensure this can't be blamed on
-   * on just vty_read()).
-   */
-  thread_execute (bm->master, bgp_peer_count_walker, &pcounts, 0);
-  
-  vty_out (vty, "Prefix counts for %s, %s%s", 
-           peer->host, afi_safi_print (afi, safi), VTY_NEWLINE);
-  vty_out (vty, "PfxCt: %ld%s", peer->pcount[afi][safi], VTY_NEWLINE);
-  vty_out (vty, "%sCounts from RIB table walk:%s%s", 
-           VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE);
 
-  for (i = 0; i < PCOUNT_MAX; i++)
-      vty_out (vty, "%20s: %-10d%s",
-               pcount_strs[i], pcounts.count[i], VTY_NEWLINE);
+  show_adj_route (vty, peer, afi, safi, in);
 
-  if (pcounts.count[PCOUNT_PFCNT] != peer->pcount[afi][safi])
-    {
-      vty_out (vty, "%s [pcount] PfxCt drift!%s",
-               peer->host, VTY_NEWLINE);
-      vty_out (vty, "Please report this bug, with the above command output%s",
-              VTY_NEWLINE);
-    }
-               
   return CMD_SUCCESS;
 }
 
-#ifdef HAVE_IPV6
-DEFUN (show_bgp_ipv6_neighbor_prefix_counts,
-       show_bgp_ipv6_neighbor_prefix_counts_cmd,
-       "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X) prefix-counts",
+DEFUN (show_ip_bgp_view_neighbor_advertised_route,
+       show_ip_bgp_view_neighbor_advertised_route_cmd,
+       "show ip bgp view WORD neighbors (A.B.C.D|X:X::X:X) advertised-routes",
        SHOW_STR
+       IP_STR
        BGP_STR
-       "Address family\n"
+       "BGP view\n"
+       "View name\n"
        "Detailed information on TCP and BGP neighbor connections\n"
        "Neighbor to display information about\n"
        "Neighbor to display information about\n"
-       "Display detailed prefix count information\n")
+       "Display the routes advertised to a BGP neighbor\n")
 {
   struct peer *peer;
 
-  peer = peer_lookup_in_view (vty, NULL, argv[0]);  
+  if (argc == 2)
+    peer = peer_lookup_in_view (vty, argv[0], argv[1]);
+  else
+    peer = peer_lookup_in_view (vty, NULL, argv[0]);
+
   if (! peer) 
     return CMD_WARNING;
  
-  return bgp_peer_counts (vty, peer, AFI_IP6, SAFI_UNICAST);
+  return peer_adj_routes (vty, peer, AFI_IP, SAFI_UNICAST, 0);
 }
-#endif
 
-DEFUN (show_bgp_ipv4_safi_neighbor_prefix_counts,
-       show_bgp_ipv4_safi_neighbor_prefix_counts_cmd,
-       "show bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X) \
prefix-counts", +ALIAS (show_ip_bgp_view_neighbor_advertised_route,
+       show_ip_bgp_neighbor_advertised_route_cmd,
+       "show ip bgp neighbors (A.B.C.D|X:X::X:X) advertised-routes",
+       SHOW_STR
+       IP_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")
+
+DEFUN (show_ip_bgp_ipv4_neighbor_advertised_route,
+       show_ip_bgp_ipv4_neighbor_advertised_route_cmd,
+       "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X) \
advertised-routes",  SHOW_STR
+       IP_STR
        BGP_STR
        "Address family\n"
        "Address Family modifier\n"
        "Address Family modifier\n"
-       "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"
-       "Display detailed prefix count information\n")
+       "Display the routes advertised to a BGP neighbor\n")
 {
   struct peer *peer;
-  safi_t	safi;
 
-  if (bgp_parse_safi(argv[0], &safi)) {
-    vty_out (vty, "Error: Bad SAFI: %s%s", argv[0], VTY_NEWLINE);
+  peer = peer_lookup_in_view (vty, NULL, argv[1]);
+  if (! peer)
     return CMD_WARNING;
-  }
 
-  peer = peer_lookup_in_view (vty, NULL, argv[1]);
+  if (strncmp (argv[0], "m", 1) == 0)
+    return peer_adj_routes (vty, peer, AFI_IP, SAFI_MULTICAST, 0);
+
+  return peer_adj_routes (vty, peer, AFI_IP, SAFI_UNICAST, 0);
+}
+
+#ifdef HAVE_IPV6
+DEFUN (show_bgp_view_neighbor_advertised_route,
+       show_bgp_view_neighbor_advertised_route_cmd,
+       "show bgp view WORD neighbors (A.B.C.D|X:X::X:X) advertised-routes",
+       SHOW_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\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")
+{
+  struct peer *peer;
+
+  if (argc == 2)
+    peer = peer_lookup_in_view (vty, argv[0], argv[1]);
+  else
+    peer = peer_lookup_in_view (vty, NULL, argv[0]);
+
+  if (! peer)
+    return CMD_WARNING;    
+
+  return peer_adj_routes (vty, peer, AFI_IP6, SAFI_UNICAST, 0);
+}
+
+DEFUN (show_bgp_view_neighbor_received_routes,
+       show_bgp_view_neighbor_received_routes_cmd,
+       "show bgp view WORD neighbors (A.B.C.D|X:X::X:X) received-routes",
+       SHOW_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "Detailed information on TCP and BGP neighbor connections\n"
+       "Neighbor to display information about\n"
+       "Neighbor to display information about\n"
+       "Display the received routes from neighbor\n")
+{
+  struct peer *peer;
+
+  if (argc == 2)
+    peer = peer_lookup_in_view (vty, argv[0], argv[1]);
+  else
+    peer = peer_lookup_in_view (vty, NULL, argv[0]);
+
+  if (! peer)
+    return CMD_WARNING;
+
+  return peer_adj_routes (vty, peer, AFI_IP6, SAFI_UNICAST, 1);
+}
+
+ALIAS (show_bgp_view_neighbor_advertised_route,
+       show_bgp_neighbor_advertised_route_cmd,
+       "show bgp neighbors (A.B.C.D|X:X::X:X) advertised-routes",
+       SHOW_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")
+       
+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",
+       SHOW_STR
+       IPV6_STR
+       MBGP_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")
+{
+  struct peer *peer;
+
+  peer = peer_lookup_in_view (vty, NULL, argv[0]);
+  if (! peer)
+    return CMD_WARNING;  
+
+  return peer_adj_routes (vty, peer, AFI_IP6, SAFI_MULTICAST, 0);
+}
+#endif /* HAVE_IPV6 */
+
+DEFUN (show_ip_bgp_view_neighbor_received_routes,
+       show_ip_bgp_view_neighbor_received_routes_cmd,
+       "show ip bgp view WORD neighbors (A.B.C.D|X:X::X:X) received-routes",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "Detailed information on TCP and BGP neighbor connections\n"
+       "Neighbor to display information about\n"
+       "Neighbor to display information about\n"
+       "Display the received routes from neighbor\n")
+{
+  struct peer *peer;
+
+  if (argc == 2)
+    peer = peer_lookup_in_view (vty, argv[0], argv[1]);
+  else
+    peer = peer_lookup_in_view (vty, NULL, argv[0]);
+
+  if (! peer)
+    return CMD_WARNING;
+
+  return peer_adj_routes (vty, peer, AFI_IP, SAFI_UNICAST, 1);
+}
+
+ALIAS (show_ip_bgp_view_neighbor_received_routes,
+       show_ip_bgp_neighbor_received_routes_cmd,
+       "show ip bgp neighbors (A.B.C.D|X:X::X:X) received-routes",
+       SHOW_STR
+       IP_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 received routes from neighbor\n")
+
+ALIAS (show_bgp_view_neighbor_received_routes,
+       show_bgp_ipv6_neighbor_received_routes_cmd,
+       "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X) received-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 received routes from neighbor\n")
+
+DEFUN (show_bgp_neighbor_received_prefix_filter,
+       show_bgp_neighbor_received_prefix_filter_cmd,
+       "show bgp neighbors (A.B.C.D|X:X::X:X) received prefix-filter",
+       SHOW_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 information received from a BGP neighbor\n"
+       "Display the prefixlist filter\n")
+{
+  char name[BUFSIZ];
+  union sockunion su;
+  struct peer *peer;
+  int count, ret;
+
+  ret = str2sockunion (argv[0], &su);
+  if (ret < 0)
+    {
+      vty_out (vty, "Malformed address: %s%s", argv[0], VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  peer = peer_lookup (NULL, &su);
+  if (! peer)
+    return CMD_WARNING;
+
+  sprintf (name, "%s.%d.%d", peer->host, AFI_IP6, SAFI_UNICAST);
+  count =  prefix_bgp_show_prefix_list (NULL, AFI_IP6, name);
+  if (count)
+    {
+      vty_out (vty, "Address family: IPv6 Unicast%s", VTY_NEWLINE);
+      prefix_bgp_show_prefix_list (vty, AFI_IP6, name);
+    }
+
+  return CMD_SUCCESS;
+}
+
+/* old command */
+ALIAS (show_bgp_view_neighbor_received_routes,
+       ipv6_bgp_neighbor_received_routes_cmd,
+       "show ipv6 bgp neighbors (A.B.C.D|X:X::X:X) received-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 received routes from neighbor\n")
+
+/* old command */
+DEFUN (ipv6_mbgp_neighbor_received_routes,
+       ipv6_mbgp_neighbor_received_routes_cmd,
+       "show ipv6 mbgp neighbors (A.B.C.D|X:X::X:X) received-routes",
+       SHOW_STR
+       IPV6_STR
+       MBGP_STR
+       "Detailed information on TCP and BGP neighbor connections\n"
+       "Neighbor to display information about\n"
+       "Neighbor to display information about\n"
+       "Display the received routes from neighbor\n")
+{
+  struct peer *peer;
+
+  peer = peer_lookup_in_view (vty, NULL, argv[0]);
   if (! peer)
     return CMD_WARNING;
 
-  return bgp_peer_counts (vty, peer, AFI_IP, safi);
+  return peer_adj_routes (vty, peer, AFI_IP6, SAFI_MULTICAST, 1);
 }
-#ifdef HAVE_IPV6
-DEFUN (show_bgp_ipv6_safi_neighbor_prefix_counts,
-       show_bgp_ipv6_safi_neighbor_prefix_counts_cmd,
-       "show bgp ipv6 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X) \
prefix-counts", +
+DEFUN (show_bgp_view_neighbor_received_prefix_filter,
+       show_bgp_view_neighbor_received_prefix_filter_cmd,
+       "show bgp view WORD neighbors (A.B.C.D|X:X::X:X) received prefix-filter",
        SHOW_STR
        BGP_STR
-       "Address family\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
+       "BGP view\n"
+       "View name\n"
        "Detailed information on TCP and BGP neighbor connections\n"
        "Neighbor to display information about\n"
        "Neighbor to display information about\n"
-       "Display detailed prefix count information\n")
+       "Display information received from a BGP neighbor\n"
+       "Display the prefixlist filter\n")
 {
+  char name[BUFSIZ];
+  union sockunion su;
   struct peer *peer;
-  safi_t	safi;
+  struct bgp *bgp;
+  int count, ret;
 
-  if (bgp_parse_safi(argv[0], &safi)) {
-    vty_out (vty, "Error: Bad SAFI: %s%s", argv[0], VTY_NEWLINE);
-    return CMD_WARNING;
-  }
+  /* BGP structure lookup. */
+  bgp = bgp_lookup_by_name (argv[0]);
+  if (bgp == NULL)
+  {  
+	  vty_out (vty, "Can't find BGP view %s%s", argv[0], VTY_NEWLINE);
+	  return CMD_WARNING;
+	}
+  
+  ret = str2sockunion (argv[1], &su);
+  if (ret < 0)
+    {
+      vty_out (vty, "Malformed address: %s%s", argv[1], VTY_NEWLINE);
+      return CMD_WARNING;
+    }
 
-  peer = peer_lookup_in_view (vty, NULL, argv[1]);
+  peer = peer_lookup (bgp, &su);
   if (! peer)
     return CMD_WARNING;
 
-  return bgp_peer_counts (vty, peer, AFI_IP6, safi);
+  sprintf (name, "%s.%d.%d", peer->host, AFI_IP6, SAFI_UNICAST);
+  count =  prefix_bgp_show_prefix_list (NULL, AFI_IP6, name);
+  if (count)
+    {
+      vty_out (vty, "Address family: IPv6 Unicast%s", VTY_NEWLINE);
+      prefix_bgp_show_prefix_list (vty, AFI_IP6, name);
+    }
+
+  return CMD_SUCCESS;
 }
-#endif
 
-DEFUN (show_ip_bgp_encap_neighbor_prefix_counts,
-       show_ip_bgp_encap_neighbor_prefix_counts_cmd,
-       "show ip bgp encap all neighbors (A.B.C.D|X:X::X:X) prefix-counts",
+
+DEFUN (show_ip_bgp_ipv4_neighbor_received_routes,
+       show_ip_bgp_ipv4_neighbor_received_routes_cmd,
+       "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X) \
received-routes",  SHOW_STR
        IP_STR
        BGP_STR
@@ -10207,126 +12881,18 @@ DEFUN (show_ip_bgp_encap_neighbor_prefix_counts,
        "Detailed information on TCP and BGP neighbor connections\n"
        "Neighbor to display information about\n"
        "Neighbor to display information about\n"
-       "Display detailed prefix count information\n")
+       "Display the received routes from neighbor\n")
 {
   struct peer *peer;
 
-  peer = peer_lookup_in_view (vty, NULL, argv[0]);
+  peer = peer_lookup_in_view (vty, NULL, argv[1]);
   if (! peer)
     return CMD_WARNING;
   
-  return bgp_peer_counts (vty, peer, AFI_IP, SAFI_ENCAP);
-}
-
-
-static void
-show_adj_route (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi,
-		int in)
-{
-  struct bgp_table *table;
-  struct bgp_adj_in *ain;
-  struct bgp_adj_out *adj;
-  unsigned long output_count;
-  struct bgp_node *rn;
-  int header1 = 1;
-  struct bgp *bgp;
-  int header2 = 1;
-
-  bgp = peer->bgp;
-
-  if (! bgp)
-    return;
-
-  table = bgp->rib[afi][safi];
-
-  output_count = 0;
-	
-  if (! in && CHECK_FLAG (peer->af_sflags[afi][safi],
-			  PEER_STATUS_DEFAULT_ORIGINATE))
-    {
-      vty_out (vty, "BGP table version is 0, local router ID is %s%s", inet_ntoa \
                (bgp->router_id), VTY_NEWLINE);
-      vty_out (vty, BGP_SHOW_SCODE_HEADER, VTY_NEWLINE, VTY_NEWLINE);
-      vty_out (vty, BGP_SHOW_OCODE_HEADER, VTY_NEWLINE, VTY_NEWLINE);
-
-      vty_out (vty, "Originating default network 0.0.0.0%s%s",
-	       VTY_NEWLINE, VTY_NEWLINE);
-      header1 = 0;
-    }
-
-  for (rn = bgp_table_top (table); rn; rn = bgp_route_next (rn))
-    if (in)
-      {
-	for (ain = rn->adj_in; ain; ain = ain->next)
-	  if (ain->peer == peer)
-	    {
-	      if (header1)
-		{
-		  vty_out (vty, "BGP table version is 0, local router ID is %s%s", inet_ntoa \
                (bgp->router_id), VTY_NEWLINE);
-		  vty_out (vty, BGP_SHOW_SCODE_HEADER, VTY_NEWLINE, VTY_NEWLINE);
-		  vty_out (vty, BGP_SHOW_OCODE_HEADER, VTY_NEWLINE, VTY_NEWLINE);
-		  header1 = 0;
-		}
-	      if (header2)
-		{
-		  vty_out (vty, BGP_SHOW_HEADER, VTY_NEWLINE);
-		  header2 = 0;
-		}
-	      if (ain->attr)
-		{ 
-		  route_vty_out_tmp (vty, &rn->p, ain->attr, safi);
-		  output_count++;
-		}
-	    }
-      }
-    else
-      {
-	for (adj = rn->adj_out; adj; adj = adj->next)
-	  if (adj->peer == peer)
-	    {
-	      if (header1)
-		{
-		  vty_out (vty, "BGP table version is 0, local router ID is %s%s", inet_ntoa \
                (bgp->router_id), VTY_NEWLINE);
-		  vty_out (vty, BGP_SHOW_SCODE_HEADER, VTY_NEWLINE, VTY_NEWLINE);
-		  vty_out (vty, BGP_SHOW_OCODE_HEADER, VTY_NEWLINE, VTY_NEWLINE);
-		  header1 = 0;
-		}
-	      if (header2)
-		{
-		  vty_out (vty, BGP_SHOW_HEADER, VTY_NEWLINE);
-		  header2 = 0;
-		}
-	      if (adj->attr)
-		{	
-		  route_vty_out_tmp (vty, &rn->p, adj->attr, safi);
-		  output_count++;
-		}
-	    }
-      }
-  
-  if (output_count != 0)
-    vty_out (vty, "%sTotal number of prefixes %ld%s",
-	     VTY_NEWLINE, output_count, VTY_NEWLINE);
-}
-
-static int
-peer_adj_routes (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, int in)
-{    
-  if (! peer || ! peer->afc[afi][safi])
-    {
-      vty_out (vty, "%% No such neighbor or address family%s", VTY_NEWLINE);
-      return CMD_WARNING;
-    }
-
-  if (in && ! CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_SOFT_RECONFIG))
-    {
-      vty_out (vty, "%% Inbound soft reconfiguration not enabled%s",
-	       VTY_NEWLINE);
-      return CMD_WARNING;
-    }
-
-  show_adj_route (vty, peer, afi, safi, in);
+  if (strncmp (argv[0], "m", 1) == 0)
+    return peer_adj_routes (vty, peer, AFI_IP, SAFI_MULTICAST, 1);
 
-  return CMD_SUCCESS;
+  return peer_adj_routes (vty, peer, AFI_IP, SAFI_UNICAST, 1);
 }
 
 DEFUN (show_bgp_ipv4_safi_neighbor_advertised_route,
@@ -10384,7 +12950,7 @@ DEFUN (show_bgp_ipv6_safi_neighbor_advertised_route,
   return peer_adj_routes (vty, peer, AFI_IP6, safi, 0);
 }
 
-DEFUN (show_bgp_view_neighbor_advertised_route,
+DEFUN (show_bgp_view_ipv6_neighbor_advertised_route,
        show_bgp_view_ipv6_neighbor_advertised_route_cmd,
        "show bgp view WORD ipv6 neighbors (A.B.C.D|X:X::X:X) advertised-routes",
        SHOW_STR
@@ -10410,7 +12976,7 @@ DEFUN (show_bgp_view_neighbor_advertised_route,
   return peer_adj_routes (vty, peer, AFI_IP6, SAFI_UNICAST, 0);
 }
 
-DEFUN (show_bgp_view_neighbor_received_routes,
+DEFUN (show_bgp_view_ipv6_neighbor_received_routes,
        show_bgp_view_ipv6_neighbor_received_routes_cmd,
        "show bgp view WORD ipv6 neighbors (A.B.C.D|X:X::X:X) received-routes",
        SHOW_STR
@@ -10435,18 +13001,6 @@ DEFUN (show_bgp_view_neighbor_received_routes,
 
   return peer_adj_routes (vty, peer, AFI_IP6, SAFI_UNICAST, 1);
 }
-
-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")
-
 #endif /* HAVE_IPV6 */
 
 
@@ -10528,23 +13082,127 @@ DEFUN (show_bgp_view_afi_safi_neighbor_adv_recd_routes,
        "Display the advertised routes to neighbor\n"
        "Display the received routes from neighbor\n")
 {
-  int afi;
-  int safi;
-  int in;
+  int afi;
+  int safi;
+  int in;
+  struct peer *peer;
+
+  peer = peer_lookup_in_view (vty, argv[0], argv[3]);
+
+  if (! peer)
+    return CMD_WARNING;
+
+  afi = (strncmp (argv[1], "ipv6", 4) == 0) ? AFI_IP6 : AFI_IP;
+  safi = (strncmp (argv[2], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
+  in = (strncmp (argv[4], "r", 1) == 0) ? 1 : 0;
+
+  return peer_adj_routes (vty, peer, afi, safi, in);
+}
+
+DEFUN (show_ip_bgp_neighbor_received_prefix_filter,
+       show_ip_bgp_neighbor_received_prefix_filter_cmd,
+       "show ip bgp neighbors (A.B.C.D|X:X::X:X) received prefix-filter",
+       SHOW_STR
+       IP_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 information received from a BGP neighbor\n"
+       "Display the prefixlist filter\n")
+{
+  char name[BUFSIZ];
+  union sockunion su;
+  struct peer *peer;
+  int count, ret;
+
+  ret = str2sockunion (argv[0], &su);
+  if (ret < 0)
+    {
+      vty_out (vty, "Malformed address: %s%s", argv[0], VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  peer = peer_lookup (NULL, &su);
+  if (! peer)
+    return CMD_WARNING;
+
+  sprintf (name, "%s.%d.%d", peer->host, AFI_IP, SAFI_UNICAST);
+  count =  prefix_bgp_show_prefix_list (NULL, AFI_IP, name);
+  if (count)
+    {
+      vty_out (vty, "Address family: IPv4 Unicast%s", VTY_NEWLINE);
+      prefix_bgp_show_prefix_list (vty, AFI_IP, name);
+    }
+
+  return CMD_SUCCESS;
+}
+
+DEFUN (show_ip_bgp_ipv4_neighbor_received_prefix_filter,
+       show_ip_bgp_ipv4_neighbor_received_prefix_filter_cmd,
+       "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X) received \
prefix-filter", +       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Address family\n"
+       "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"
+       "Display information received from a BGP neighbor\n"
+       "Display the prefixlist filter\n")
+{
+  char name[BUFSIZ];
+  union sockunion su;
   struct peer *peer;
+  int count, ret;
 
-  peer = peer_lookup_in_view (vty, argv[0], argv[3]);
+  ret = str2sockunion (argv[1], &su);
+  if (ret < 0)
+    {
+      vty_out (vty, "Malformed address: %s%s", argv[1], VTY_NEWLINE);
+      return CMD_WARNING;
+    }
 
+  peer = peer_lookup (NULL, &su);
   if (! peer)
     return CMD_WARNING;
 
-  afi = (strncmp (argv[1], "ipv6", 4) == 0) ? AFI_IP6 : AFI_IP;
-  safi = (strncmp (argv[2], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
-  in = (strncmp (argv[4], "r", 1) == 0) ? 1 : 0;
+  if (strncmp (argv[0], "m", 1) == 0)
+    {
+      sprintf (name, "%s.%d.%d", peer->host, AFI_IP, SAFI_MULTICAST);
+      count =  prefix_bgp_show_prefix_list (NULL, AFI_IP, name);
+      if (count)
+	{
+	  vty_out (vty, "Address family: IPv4 Multicast%s", VTY_NEWLINE);
+	  prefix_bgp_show_prefix_list (vty, AFI_IP, name);
+	}
+    }
+  else 
+    {
+      sprintf (name, "%s.%d.%d", peer->host, AFI_IP, SAFI_UNICAST);
+      count =  prefix_bgp_show_prefix_list (NULL, AFI_IP, name);
+      if (count)
+	{
+	  vty_out (vty, "Address family: IPv4 Unicast%s", VTY_NEWLINE);
+	  prefix_bgp_show_prefix_list (vty, AFI_IP, name);
+	}
+    }
 
-  return peer_adj_routes (vty, peer, afi, safi, in);
+  return CMD_SUCCESS;
 }
 
+ALIAS (show_bgp_view_neighbor_received_routes,
+       show_bgp_neighbor_received_routes_cmd,
+       "show bgp neighbors (A.B.C.D|X:X::X:X) received-routes",
+       SHOW_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 received routes from neighbor\n")
+
 DEFUN (show_bgp_ipv4_safi_neighbor_received_prefix_filter,
        show_bgp_ipv4_safi_neighbor_received_prefix_filter_cmd,
        "show bgp ipv4 (encap|multicast|unicast|vpn) neighbors (A.B.C.D|X:X::X:X) \
received prefix-filter", @@ -10627,134 +13285,396 @@ DEFUN \
(show_bgp_ipv6_safi_neighbor_received_prefix_filter,  return CMD_WARNING;
     }
 
-  peer = peer_lookup (NULL, &su);
-  if (! peer)
-    return CMD_WARNING;
-
-  sprintf (name, "%s.%d.%d", peer->host, AFI_IP6, safi);
-  count =  prefix_bgp_show_prefix_list (NULL, AFI_IP6, name);
-  if (count) {
-      vty_out (vty, "Address family: IPv6 %s%s", safi2str(safi), VTY_NEWLINE);
-      prefix_bgp_show_prefix_list (vty, AFI_IP6, name);
-  }
+  peer = peer_lookup (NULL, &su);
+  if (! peer)
+    return CMD_WARNING;
+
+  sprintf (name, "%s.%d.%d", peer->host, AFI_IP6, safi);
+  count =  prefix_bgp_show_prefix_list (NULL, AFI_IP6, name);
+  if (count) {
+      vty_out (vty, "Address family: IPv6 %s%s", safi2str(safi), VTY_NEWLINE);
+      prefix_bgp_show_prefix_list (vty, AFI_IP6, name);
+  }
+
+  return CMD_SUCCESS;
+}
+
+DEFUN (show_bgp_ipv6_neighbor_received_prefix_filter,
+       show_bgp_ipv6_neighbor_received_prefix_filter_cmd,
+       "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X) received prefix-filter",
+       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 information received from a BGP neighbor\n"
+       "Display the prefixlist filter\n")
+{
+  char name[BUFSIZ];
+  union sockunion su;
+  struct peer *peer;
+  int count, ret;
+
+  ret = str2sockunion (argv[0], &su);
+  if (ret < 0)
+    {
+      vty_out (vty, "Malformed address: %s%s", argv[0], VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  peer = peer_lookup (NULL, &su);
+  if (! peer)
+    return CMD_WARNING;
+
+  sprintf (name, "%s.%d.%d", peer->host, AFI_IP6, SAFI_UNICAST);
+  count =  prefix_bgp_show_prefix_list (NULL, AFI_IP6, name);
+  if (count)
+    {
+      vty_out (vty, "Address family: IPv6 Unicast%s", VTY_NEWLINE);
+      prefix_bgp_show_prefix_list (vty, AFI_IP6, name);
+    }
+
+  return CMD_SUCCESS;
+}
+
+DEFUN (show_bgp_view_ipv6_neighbor_received_prefix_filter,
+       show_bgp_view_ipv6_neighbor_received_prefix_filter_cmd,
+       "show bgp view WORD ipv6 neighbors (A.B.C.D|X:X::X:X) received \
prefix-filter", +       SHOW_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "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 information received from a BGP neighbor\n"
+       "Display the prefixlist filter\n")
+{
+  char name[BUFSIZ];
+  union sockunion su;
+  struct peer *peer;
+  struct bgp *bgp;
+  int count, ret;
+
+  /* BGP structure lookup. */
+  bgp = bgp_lookup_by_name (argv[0]);
+  if (bgp == NULL)
+  {  
+	  vty_out (vty, "Can't find BGP view %s%s", argv[0], VTY_NEWLINE);
+	  return CMD_WARNING;
+	}
+  
+  ret = str2sockunion (argv[1], &su);
+  if (ret < 0)
+    {
+      vty_out (vty, "Malformed address: %s%s", argv[1], VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  peer = peer_lookup (bgp, &su);
+  if (! peer)
+    return CMD_WARNING;
+
+  sprintf (name, "%s.%d.%d", peer->host, AFI_IP6, SAFI_UNICAST);
+  count =  prefix_bgp_show_prefix_list (NULL, AFI_IP6, name);
+  if (count)
+    {
+      vty_out (vty, "Address family: IPv6 Unicast%s", VTY_NEWLINE);
+      prefix_bgp_show_prefix_list (vty, AFI_IP6, name);
+    }
+
+  return CMD_SUCCESS;
+}
+#endif /* HAVE_IPV6 */
+
+static int
+bgp_show_neighbor_route (struct vty *vty, struct peer *peer, afi_t afi,
+			 safi_t safi, enum bgp_show_type type)
+{
+  if (! peer || ! peer->afc[afi][safi])
+    {
+      vty_out (vty, "%% No such neighbor or address family%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+ 
+  return bgp_show (vty, peer->bgp, afi, safi, type, &peer->su);
+}
+DEFUN (show_ip_bgp_neighbor_routes,
+       show_ip_bgp_neighbor_routes_cmd,
+       "show ip bgp neighbors (A.B.C.D|X:X::X:X) routes",
+       SHOW_STR
+       IP_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 routes learned from neighbor\n")
+{
+  struct peer *peer;
+
+  peer = peer_lookup_in_view (vty, NULL, argv[0]);
+  if (! peer)
+    return CMD_WARNING;
+    
+  return bgp_show_neighbor_route (vty, peer, AFI_IP, SAFI_UNICAST,
+				  bgp_show_type_neighbor);
+}
+
+DEFUN (show_ip_bgp_neighbor_flap,
+       show_ip_bgp_neighbor_flap_cmd,
+       "show ip bgp neighbors (A.B.C.D|X:X::X:X) flap-statistics",
+       SHOW_STR
+       IP_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 flap statistics of the routes learned from neighbor\n")
+{
+  struct peer *peer;
+
+  peer = peer_lookup_in_view (vty, NULL, argv[0]);
+  if (! peer)
+    return CMD_WARNING;
+    
+  return bgp_show_neighbor_route (vty, peer, AFI_IP, SAFI_UNICAST,
+				  bgp_show_type_flap_neighbor);
+}
+
+DEFUN (show_ip_bgp_neighbor_damp,
+       show_ip_bgp_neighbor_damp_cmd,
+       "show ip bgp neighbors (A.B.C.D|X:X::X:X) dampened-routes",
+       SHOW_STR
+       IP_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 dampened routes received from neighbor\n")
+{
+  struct peer *peer;
+
+  peer = peer_lookup_in_view (vty, NULL, argv[0]);
+  if (! peer)
+    return CMD_WARNING;
+    
+  return bgp_show_neighbor_route (vty, peer, AFI_IP, SAFI_UNICAST,
+				  bgp_show_type_damp_neighbor);
+}
+
+DEFUN (show_ip_bgp_ipv4_neighbor_routes,
+       show_ip_bgp_ipv4_neighbor_routes_cmd,
+       "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X) routes",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Address family\n"
+       "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"
+       "Display routes learned from neighbor\n")
+{
+  struct peer *peer;
+
+  peer = peer_lookup_in_view (vty, NULL, argv[1]);
+  if (! peer)
+    return CMD_WARNING;
+ 
+  if (strncmp (argv[0], "m", 1) == 0)
+    return bgp_show_neighbor_route (vty, peer, AFI_IP, SAFI_MULTICAST,
+				    bgp_show_type_neighbor);
+
+  return bgp_show_neighbor_route (vty, peer, AFI_IP, SAFI_UNICAST,
+				  bgp_show_type_neighbor);
+}
+
+DEFUN (show_ip_bgp_view_rsclient,
+       show_ip_bgp_view_rsclient_cmd,
+       "show ip bgp view WORD rsclient (A.B.C.D|X:X::X:X)",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "Information about Route Server Client\n"
+       NEIGHBOR_ADDR_STR)
+{
+  struct bgp_table *table;
+  struct peer *peer;
+
+  if (argc == 2)
+    peer = peer_lookup_in_view (vty, argv[0], argv[1]);
+  else
+    peer = peer_lookup_in_view (vty, NULL, argv[0]);
+
+  if (! peer)
+    return CMD_WARNING;
+
+  if (! peer->afc[AFI_IP][SAFI_UNICAST])
+    {
+      vty_out (vty, "%% Activate the neighbor for the address family first%s",
+            VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  if ( ! CHECK_FLAG (peer->af_flags[AFI_IP][SAFI_UNICAST],
+              PEER_FLAG_RSERVER_CLIENT))
+    {
+      vty_out (vty, "%% Neighbor is not a Route-Server client%s",
+            VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  table = peer->rib[AFI_IP][SAFI_UNICAST];
 
-  return CMD_SUCCESS;
+  return bgp_show_table (vty, table, &peer->remote_id, bgp_show_type_normal, NULL);
 }
 
-ALIAS (show_bgp_view_neighbor_received_routes,
-       show_bgp_ipv6_neighbor_received_routes_cmd,
-       "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X) received-routes",
+ALIAS (show_ip_bgp_view_rsclient,
+       show_ip_bgp_rsclient_cmd,
+       "show ip bgp rsclient (A.B.C.D|X:X::X:X)",
        SHOW_STR
+       IP_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 received routes from neighbor\n")
+       "Information about Route Server Client\n"
+       NEIGHBOR_ADDR_STR)
 
-DEFUN (show_bgp_neighbor_received_prefix_filter,
-       show_bgp_ipv6_neighbor_received_prefix_filter_cmd,
-       "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X) received prefix-filter",
+DEFUN (show_bgp_view_ipv4_safi_rsclient,
+       show_bgp_view_ipv4_safi_rsclient_cmd,
+       "show bgp view WORD ipv4 (unicast|multicast) rsclient (A.B.C.D|X:X::X:X)",
        SHOW_STR
        BGP_STR
+       "BGP view\n"
+       "View name\n"
        "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 information received from a BGP neighbor\n"
-       "Display the prefixlist filter\n")
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Information about Route Server Client\n"
+       NEIGHBOR_ADDR_STR)
 {
-  char name[BUFSIZ];
-  union sockunion su;
+  struct bgp_table *table;
   struct peer *peer;
-  int count, ret;
+  safi_t safi;
 
-  ret = str2sockunion (argv[0], &su);
-  if (ret < 0)
-    {
-      vty_out (vty, "Malformed address: %s%s", argv[0], VTY_NEWLINE);
-      return CMD_WARNING;
-    }
+  if (argc == 3) {
+    peer = peer_lookup_in_view (vty, argv[0], argv[2]);
+    safi = (strncmp (argv[1], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
+  } else {
+    peer = peer_lookup_in_view (vty, NULL, argv[1]);
+    safi = (strncmp (argv[0], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
+  }
 
-  peer = peer_lookup (NULL, &su);
   if (! peer)
     return CMD_WARNING;
 
-  sprintf (name, "%s.%d.%d", peer->host, AFI_IP6, SAFI_UNICAST);
-  count =  prefix_bgp_show_prefix_list (NULL, AFI_IP6, name);
-  if (count)
+  if (! peer->afc[AFI_IP][safi])
     {
-      vty_out (vty, "Address family: IPv6 Unicast%s", VTY_NEWLINE);
-      prefix_bgp_show_prefix_list (vty, AFI_IP6, name);
+      vty_out (vty, "%% Activate the neighbor for the address family first%s",
+            VTY_NEWLINE);
+      return CMD_WARNING;
     }
 
-  return CMD_SUCCESS;
+  if ( ! CHECK_FLAG (peer->af_flags[AFI_IP][safi],
+              PEER_FLAG_RSERVER_CLIENT))
+    {
+      vty_out (vty, "%% Neighbor is not a Route-Server client%s",
+            VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  table = peer->rib[AFI_IP][safi];
+
+  return bgp_show_table (vty, table, &peer->remote_id, bgp_show_type_normal, NULL);
 }
 
-DEFUN (show_bgp_view_neighbor_received_prefix_filter,
-       show_bgp_view_ipv6_neighbor_received_prefix_filter_cmd,
-       "show bgp view WORD ipv6 neighbors (A.B.C.D|X:X::X:X) received \
prefix-filter", +ALIAS (show_bgp_view_ipv4_safi_rsclient,
+       show_bgp_ipv4_safi_rsclient_cmd,
+       "show bgp ipv4 (unicast|multicast) rsclient (A.B.C.D|X:X::X:X)",
+       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Information about Route Server Client\n"
+       NEIGHBOR_ADDR_STR)
+
+DEFUN (show_ip_bgp_view_rsclient_route,
+       show_ip_bgp_view_rsclient_route_cmd,
+       "show ip bgp view WORD rsclient (A.B.C.D|X:X::X:X) A.B.C.D",
        SHOW_STR
+       IP_STR
        BGP_STR
        "BGP view\n"
        "View name\n"
-       "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 information received from a BGP neighbor\n"
-       "Display the prefixlist filter\n")
+       "Information about Route Server Client\n"
+       NEIGHBOR_ADDR_STR
+       "Network in the BGP routing table to display\n")
 {
-  char name[BUFSIZ];
-  union sockunion su;
-  struct peer *peer;
   struct bgp *bgp;
-  int count, ret;
+  struct peer *peer;
 
   /* BGP structure lookup. */
-  bgp = bgp_lookup_by_name (argv[0]);
-  if (bgp == NULL)
-  {  
+  if (argc == 3)
+    {
+      bgp = bgp_lookup_by_name (argv[0]);
+      if (bgp == NULL)
+	{
 	  vty_out (vty, "Can't find BGP view %s%s", argv[0], VTY_NEWLINE);
 	  return CMD_WARNING;
 	}
-  
-  ret = str2sockunion (argv[1], &su);
-  if (ret < 0)
+    }
+  else
     {
-      vty_out (vty, "Malformed address: %s%s", argv[1], VTY_NEWLINE);
-      return CMD_WARNING;
+      bgp = bgp_get_default ();
+      if (bgp == NULL)
+	{
+	  vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
+	  return CMD_WARNING;
+	}
     }
 
-  peer = peer_lookup (bgp, &su);
+  if (argc == 3)
+    peer = peer_lookup_in_view (vty, argv[0], argv[1]);
+  else
+    peer = peer_lookup_in_view (vty, NULL, argv[0]);
+
   if (! peer)
     return CMD_WARNING;
 
-  sprintf (name, "%s.%d.%d", peer->host, AFI_IP6, SAFI_UNICAST);
-  count =  prefix_bgp_show_prefix_list (NULL, AFI_IP6, name);
-  if (count)
+  if (! peer->afc[AFI_IP][SAFI_UNICAST])
     {
-      vty_out (vty, "Address family: IPv6 Unicast%s", VTY_NEWLINE);
-      prefix_bgp_show_prefix_list (vty, AFI_IP6, name);
-    }
-
-  return CMD_SUCCESS;
+      vty_out (vty, "%% Activate the neighbor for the address family first%s",
+            VTY_NEWLINE);
+      return CMD_WARNING;
 }
-#endif /* HAVE_IPV6 */
 
-static int
-bgp_show_neighbor_route (struct vty *vty, struct peer *peer, afi_t afi,
-			 safi_t safi, enum bgp_show_type type)
-{
-  if (! peer || ! peer->afc[afi][safi])
+  if ( ! CHECK_FLAG (peer->af_flags[AFI_IP][SAFI_UNICAST],
+              PEER_FLAG_RSERVER_CLIENT))
     {
-      vty_out (vty, "%% No such neighbor or address family%s", VTY_NEWLINE);
+      vty_out (vty, "%% Neighbor is not a Route-Server client%s",
+            VTY_NEWLINE);
       return CMD_WARNING;
     }
  
-  return bgp_show (vty, peer->bgp, afi, safi, type, &peer->su);
+  return bgp_show_route_in_table (vty, bgp, peer->rib[AFI_IP][SAFI_UNICAST], 
+                                  (argc == 3) ? argv[2] : argv[1],
+                                  AFI_IP, SAFI_UNICAST, NULL, 0);
 }
 
+ALIAS (show_ip_bgp_view_rsclient_route,
+       show_ip_bgp_rsclient_route_cmd,
+       "show ip bgp rsclient (A.B.C.D|X:X::X:X) A.B.C.D",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Information about Route Server Client\n"
+       NEIGHBOR_ADDR_STR
+       "Network in the BGP routing table to display\n")
+
 DEFUN (show_bgp_ipv4_safi_neighbor_flap,
        show_bgp_ipv4_safi_neighbor_flap_cmd,
        "show bgp ipv4 (encap|multicast|unicast|vpn) neighbors (A.B.C.D|X:X::X:X) \
flap-statistics", @@ -10927,90 +13847,14 @@ DEFUN \
(show_bgp_ipv6_safi_neighbor_routes,  return CMD_WARNING;
   }
 
-  peer = peer_lookup_in_view (vty, NULL, argv[1]);
-  if (! peer)
-    return CMD_WARNING;
- 
-  return bgp_show_neighbor_route (vty, peer, AFI_IP6, safi,
-				  bgp_show_type_neighbor);
-}
-#endif
-
-DEFUN (show_bgp_view_ipv4_safi_rsclient,
-       show_bgp_view_ipv4_safi_rsclient_cmd,
-       "show bgp view WORD ipv4 (unicast|multicast) rsclient (A.B.C.D|X:X::X:X)",
-       SHOW_STR
-       BGP_STR
-       "BGP view\n"
-       "View name\n"
-       "Address family\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Information about Route Server Client\n"
-       NEIGHBOR_ADDR_STR)
-{
-  struct bgp_table *table;
-  struct peer *peer;
-  safi_t safi;
-
-  if (argc == 3) {
-    peer = peer_lookup_in_view (vty, argv[0], argv[2]);
-    safi = (strncmp (argv[1], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
-  } else {
-    peer = peer_lookup_in_view (vty, NULL, argv[1]);
-    safi = (strncmp (argv[0], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
-  }
-
-  if (! peer)
-    return CMD_WARNING;
-
-  if (! peer->afc[AFI_IP][safi])
-    {
-      vty_out (vty, "%% Activate the neighbor for the address family first%s",
-            VTY_NEWLINE);
-      return CMD_WARNING;
-    }
-
-  if ( ! CHECK_FLAG (peer->af_flags[AFI_IP][safi],
-              PEER_FLAG_RSERVER_CLIENT))
-    {
-      vty_out (vty, "%% Neighbor is not a Route-Server client%s",
-            VTY_NEWLINE);
-      return CMD_WARNING;
-    }
-
-  table = peer->rib[AFI_IP][safi];
-
-  return bgp_show_table (vty, table, &peer->remote_id, bgp_show_type_normal, NULL);
-}
-
-ALIAS (show_bgp_view_ipv4_safi_rsclient,
-       show_bgp_ipv4_safi_rsclient_cmd,
-       "show bgp ipv4 (unicast|multicast) rsclient (A.B.C.D|X:X::X:X)",
-       SHOW_STR
-       BGP_STR
-       "Address family\n"
-       "Address Family modifier\n"
-       "Address Family modifier\n"
-       "Information about Route Server Client\n"
-       NEIGHBOR_ADDR_STR)
-
-#if 0                           /* from 0.99.24.1 merge */
-DEFUN (show_ip_bgp_view_rsclient_route,
-       show_ip_bgp_view_rsclient_route_cmd,
-       "show ip bgp view WORD rsclient (A.B.C.D|X:X::X:X) A.B.C.D",
-       SHOW_STR
-       IP_STR
-       BGP_STR
-       "BGP view\n"
-       "View name\n"
-       "Information about Route Server Client\n"
-       NEIGHBOR_ADDR_STR
-       "Network in the BGP routing table to display\n")
-{
-  struct bgp *bgp;
-  struct peer *peer;
-#endif 
+  peer = peer_lookup_in_view (vty, NULL, argv[1]);
+  if (! peer)
+    return CMD_WARNING;
+ 
+  return bgp_show_neighbor_route (vty, peer, AFI_IP6, safi,
+				  bgp_show_type_neighbor);
+}
+#endif
 
 DEFUN (show_bgp_view_ipv4_safi_rsclient_route,
        show_bgp_view_ipv4_safi_rsclient_route_cmd,
@@ -11093,22 +13937,6 @@ ALIAS (show_bgp_view_ipv4_safi_rsclient_route,
        NEIGHBOR_ADDR_STR
        "Network in the BGP routing table to display\n")
 
-#if 0                           /* from 0.99.24.1 merge */
-DEFUN (show_ip_bgp_view_rsclient_prefix,
-       show_ip_bgp_view_rsclient_prefix_cmd,
-       "show ip bgp view WORD rsclient (A.B.C.D|X:X::X:X) A.B.C.D/M",
-       SHOW_STR
-       IP_STR
-       BGP_STR
-       "BGP view\n"
-       "View name\n"
-       "Information about Route Server Client\n"
-       NEIGHBOR_ADDR_STR
-       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
-{
-  struct bgp *bgp;
-  struct peer *peer;
-#endif
 
 DEFUN (show_bgp_view_ipv4_safi_rsclient_prefix,
        show_bgp_view_ipv4_safi_rsclient_prefix_cmd,
@@ -11179,6 +14007,79 @@ DEFUN (show_bgp_view_ipv4_safi_rsclient_prefix,
                                   AFI_IP, safi, NULL, 1);
 }
 
+DEFUN (show_ip_bgp_view_rsclient_prefix,
+       show_ip_bgp_view_rsclient_prefix_cmd,
+       "show ip bgp view WORD rsclient (A.B.C.D|X:X::X:X) A.B.C.D/M",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "Information about Route Server Client\n"
+       NEIGHBOR_ADDR_STR
+       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
+{
+  struct bgp *bgp;
+  struct peer *peer;
+
+  /* BGP structure lookup. */
+  if (argc == 3)
+    {
+      bgp = bgp_lookup_by_name (argv[0]);
+      if (bgp == NULL)
+	{
+	  vty_out (vty, "Can't find BGP view %s%s", argv[0], VTY_NEWLINE);
+	  return CMD_WARNING;
+	}
+    }
+  else
+    {
+      bgp = bgp_get_default ();
+      if (bgp == NULL)
+	{
+	  vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
+	  return CMD_WARNING;
+	}
+    }
+
+  if (argc == 3)
+    peer = peer_lookup_in_view (vty, argv[0], argv[1]);
+  else
+  peer = peer_lookup_in_view (vty, NULL, argv[0]);
+
+  if (! peer)
+    return CMD_WARNING;
+    
+  if (! peer->afc[AFI_IP][SAFI_UNICAST])
+    {
+      vty_out (vty, "%% Activate the neighbor for the address family first%s",
+            VTY_NEWLINE);
+      return CMD_WARNING;
+}
+
+  if ( ! CHECK_FLAG (peer->af_flags[AFI_IP][SAFI_UNICAST],
+              PEER_FLAG_RSERVER_CLIENT))
+{
+      vty_out (vty, "%% Neighbor is not a Route-Server client%s",
+            VTY_NEWLINE);
+    return CMD_WARNING;
+    }
+    
+  return bgp_show_route_in_table (vty, bgp, peer->rib[AFI_IP][SAFI_UNICAST], 
+                                  (argc == 3) ? argv[2] : argv[1],
+                                  AFI_IP, SAFI_UNICAST, NULL, 1);
+}
+
+ALIAS (show_ip_bgp_view_rsclient_prefix,
+       show_ip_bgp_rsclient_prefix_cmd,
+       "show ip bgp rsclient (A.B.C.D|X:X::X:X) A.B.C.D/M",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Information about Route Server Client\n"
+       NEIGHBOR_ADDR_STR
+       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
+
 ALIAS (show_bgp_view_ipv4_safi_rsclient_prefix,
        show_bgp_ipv4_safi_rsclient_prefix_cmd,
        "show bgp ipv4 (unicast|multicast) rsclient (A.B.C.D|X:X::X:X) A.B.C.D/M",
@@ -11192,7 +14093,7 @@ ALIAS (show_bgp_view_ipv4_safi_rsclient_prefix,
        "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
 
 #ifdef HAVE_IPV6
-DEFUN (show_bgp_view_neighbor_routes,
+DEFUN (show_bgp_view_ipv6_neighbor_routes,
        show_bgp_view_ipv6_neighbor_routes_cmd,
        "show bgp view WORD ipv6 neighbors (A.B.C.D|X:X::X:X) routes",
        SHOW_STR
@@ -11220,6 +14121,32 @@ DEFUN (show_bgp_view_neighbor_routes,
 }
 
 DEFUN (show_bgp_view_neighbor_damp,
+       show_bgp_view_neighbor_damp_cmd,
+       "show bgp view WORD neighbors (A.B.C.D|X:X::X:X) dampened-routes",
+       SHOW_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "Detailed information on TCP and BGP neighbor connections\n"
+       "Neighbor to display information about\n"
+       "Neighbor to display information about\n"
+       "Display the dampened routes received from neighbor\n")
+{
+  struct peer *peer;
+
+  if (argc == 2)
+    peer = peer_lookup_in_view (vty, argv[0], argv[1]);
+  else
+    peer = peer_lookup_in_view (vty, NULL, argv[0]);
+
+  if (! peer)
+    return CMD_WARNING;
+
+  return bgp_show_neighbor_route (vty, peer, AFI_IP6, SAFI_UNICAST,
+				  bgp_show_type_damp_neighbor);
+}
+
+DEFUN (show_bgp_view_ipv6_neighbor_damp,
        show_bgp_view_ipv6_neighbor_damp_cmd,
        "show bgp view WORD ipv6 neighbors (A.B.C.D|X:X::X:X) dampened-routes",
        SHOW_STR
@@ -11246,7 +14173,7 @@ DEFUN (show_bgp_view_neighbor_damp,
 				  bgp_show_type_damp_neighbor);
 }
 
-DEFUN (show_bgp_view_neighbor_flap,
+DEFUN (show_bgp_view_ipv6_neighbor_flap,
        show_bgp_view_ipv6_neighbor_flap_cmd,
        "show bgp view WORD ipv6 neighbors (A.B.C.D|X:X::X:X) flap-statistics",
        SHOW_STR
@@ -11273,6 +14200,88 @@ DEFUN (show_bgp_view_neighbor_flap,
 				  bgp_show_type_flap_neighbor);
 }
 
+DEFUN (show_bgp_view_neighbor_flap,
+       show_bgp_view_neighbor_flap_cmd,
+       "show bgp view WORD neighbors (A.B.C.D|X:X::X:X) flap-statistics",
+       SHOW_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "Detailed information on TCP and BGP neighbor connections\n"
+       "Neighbor to display information about\n"
+       "Neighbor to display information about\n"
+       "Display flap statistics of the routes learned from neighbor\n")
+{
+  struct peer *peer;
+
+  if (argc == 2)
+    peer = peer_lookup_in_view (vty, argv[0], argv[1]);
+  else
+    peer = peer_lookup_in_view (vty, NULL, argv[0]);
+
+  if (! peer)
+    return CMD_WARNING;
+
+  return bgp_show_neighbor_route (vty, peer, AFI_IP6, SAFI_UNICAST,
+				  bgp_show_type_flap_neighbor);
+}
+
+ALIAS (show_bgp_view_neighbor_flap,
+       show_bgp_neighbor_flap_cmd,
+       "show bgp neighbors (A.B.C.D|X:X::X:X) flap-statistics",
+       SHOW_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 flap statistics of the routes learned from neighbor\n")
+
+ALIAS (show_bgp_view_neighbor_damp,
+       show_bgp_neighbor_damp_cmd,
+       "show bgp neighbors (A.B.C.D|X:X::X:X) dampened-routes",
+       SHOW_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 dampened routes received from neighbor\n")
+
+DEFUN (show_bgp_view_neighbor_routes,
+       show_bgp_view_neighbor_routes_cmd,
+       "show bgp view WORD neighbors (A.B.C.D|X:X::X:X) routes",
+       SHOW_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "Detailed information on TCP and BGP neighbor connections\n"
+       "Neighbor to display information about\n"
+       "Neighbor to display information about\n"
+       "Display routes learned from neighbor\n")
+{
+  struct peer *peer;
+
+  if (argc == 2)
+    peer = peer_lookup_in_view (vty, argv[0], argv[1]);
+  else
+    peer = peer_lookup_in_view (vty, NULL, argv[0]);
+   
+  if (! peer)
+    return CMD_WARNING;
+
+  return bgp_show_neighbor_route (vty, peer, AFI_IP6, SAFI_UNICAST,
+				  bgp_show_type_neighbor);
+}
+
+ALIAS (show_bgp_view_neighbor_routes,
+       show_bgp_neighbor_routes_cmd,
+       "show bgp neighbors (A.B.C.D|X:X::X:X) routes",
+       SHOW_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 routes learned from neighbor\n")
+
 ALIAS (show_bgp_view_neighbor_routes,
        show_bgp_ipv6_neighbor_routes_cmd,
        "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X) routes",
@@ -11284,6 +14293,40 @@ ALIAS (show_bgp_view_neighbor_routes,
        "Neighbor to display information about\n"
        "Display routes learned from neighbor\n")
 
+/* old command */
+ALIAS (show_bgp_view_neighbor_routes,
+       ipv6_bgp_neighbor_routes_cmd,
+       "show ipv6 bgp neighbors (A.B.C.D|X:X::X:X) 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 routes learned from neighbor\n")
+
+/* old command */
+DEFUN (ipv6_mbgp_neighbor_routes,
+       ipv6_mbgp_neighbor_routes_cmd,
+       "show ipv6 mbgp neighbors (A.B.C.D|X:X::X:X) routes",
+       SHOW_STR
+       IPV6_STR
+       MBGP_STR
+       "Detailed information on TCP and BGP neighbor connections\n"
+       "Neighbor to display information about\n"
+       "Neighbor to display information about\n"
+       "Display routes learned from neighbor\n")
+{
+  struct peer *peer;
+
+  peer = peer_lookup_in_view (vty, NULL, argv[0]);
+  if (! peer)
+    return CMD_WARNING;
+ 
+  return bgp_show_neighbor_route (vty, peer, AFI_IP6, SAFI_MULTICAST,
+				  bgp_show_type_neighbor);
+}
+
 ALIAS (show_bgp_view_neighbor_flap,
        show_bgp_ipv6_neighbor_flap_cmd,
        "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X) flap-statistics",
@@ -11295,18 +14338,67 @@ ALIAS (show_bgp_view_neighbor_flap,
        "Neighbor to display information about\n"
        "Display flap statistics of the routes learned from neighbor\n")
 
-ALIAS (show_bgp_view_neighbor_damp,
-       show_bgp_ipv6_neighbor_damp_cmd,
-       "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X) dampened-routes",
+ALIAS (show_bgp_view_neighbor_damp,
+       show_bgp_ipv6_neighbor_damp_cmd,
+       "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X) dampened-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 dampened routes received from neighbor\n")
+
+#endif /* HAVE_IPV6 */
+
+DEFUN (show_bgp_view_rsclient,
+       show_bgp_view_rsclient_cmd,
+       "show bgp view WORD rsclient (A.B.C.D|X:X::X:X)",
+       SHOW_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "Information about Route Server Client\n"
+       NEIGHBOR_ADDR_STR)
+{
+  struct bgp_table *table;
+  struct peer *peer;
+
+  if (argc == 2)
+    peer = peer_lookup_in_view (vty, argv[0], argv[1]);
+  else
+    peer = peer_lookup_in_view (vty, NULL, argv[0]);
+
+  if (! peer)
+    return CMD_WARNING;
+
+  if (! peer->afc[AFI_IP6][SAFI_UNICAST])
+    {
+      vty_out (vty, "%% Activate the neighbor for the address family first%s",
+            VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  if ( ! CHECK_FLAG (peer->af_flags[AFI_IP6][SAFI_UNICAST],
+              PEER_FLAG_RSERVER_CLIENT))
+    {
+      vty_out (vty, "%% Neighbor is not a Route-Server client%s",
+            VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  table = peer->rib[AFI_IP6][SAFI_UNICAST];
+
+  return bgp_show_table (vty, table, &peer->remote_id, bgp_show_type_normal, NULL);
+}
+
+ALIAS (show_bgp_view_rsclient,
+       show_bgp_rsclient_cmd,
+       "show bgp rsclient (A.B.C.D|X:X::X:X)",
        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 dampened routes received from neighbor\n")
-
-#endif /* HAVE_IPV6 */
+       "Information about Route Server Client\n"
+       NEIGHBOR_ADDR_STR)
 
 DEFUN (show_bgp_view_ipv4_rsclient,
        show_bgp_view_ipv4_rsclient_cmd,
@@ -11469,9 +14561,70 @@ ALIAS (show_bgp_view_ipv6_safi_rsclient,
        "Information about Route Server Client\n"
        NEIGHBOR_ADDR_STR)
 
-
 DEFUN (show_bgp_view_rsclient_route,
        show_bgp_view_rsclient_route_cmd,
+       "show bgp view WORD rsclient (A.B.C.D|X:X::X:X) X:X::X:X",
+       SHOW_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "Information about Route Server Client\n"
+       NEIGHBOR_ADDR_STR
+       "Network in the BGP routing table to display\n")
+{
+  struct bgp *bgp;
+  struct peer *peer;
+
+  /* BGP structure lookup. */
+  if (argc == 3)
+    {
+      bgp = bgp_lookup_by_name (argv[0]);
+      if (bgp == NULL)
+        {
+          vty_out (vty, "Can't find BGP view %s%s", argv[0], VTY_NEWLINE);
+          return CMD_WARNING;
+        }
+    }
+  else
+    {
+      bgp = bgp_get_default ();
+      if (bgp == NULL)
+        {
+          vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
+          return CMD_WARNING;
+        }
+    }
+
+  if (argc == 3)
+    peer = peer_lookup_in_view (vty, argv[0], argv[1]);
+  else
+    peer = peer_lookup_in_view (vty, NULL, argv[0]);
+
+  if (! peer)
+    return CMD_WARNING;
+
+  if (! peer->afc[AFI_IP6][SAFI_UNICAST])
+    {
+      vty_out (vty, "%% Activate the neighbor for the address family first%s",
+            VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  if ( ! CHECK_FLAG (peer->af_flags[AFI_IP6][SAFI_UNICAST],
+              PEER_FLAG_RSERVER_CLIENT))
+    {
+      vty_out (vty, "%% Neighbor is not a Route-Server client%s",
+            VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  return bgp_show_route_in_table (vty, bgp, peer->rib[AFI_IP6][SAFI_UNICAST],
+                                  (argc == 3) ? argv[2] : argv[1],
+                                  AFI_IP6, SAFI_UNICAST, NULL, 0);
+}
+
+DEFUN (show_bgp_view_ipv6_rsclient_route,
+       show_bgp_view_ipv6_rsclient_route_cmd,
        "show bgp view WORD ipv6 rsclient (A.B.C.D|X:X::X:X) X:X::X:X",
        SHOW_STR
        BGP_STR
@@ -11533,8 +14686,17 @@ DEFUN (show_bgp_view_rsclient_route,
                                   AFI_IP6, SAFI_UNICAST, NULL, 0);
 }
 
-ALIAS (show_bgp_view_rsclient_route,
+ALIAS (show_bgp_view_ipv6_rsclient_route,
        show_bgp_rsclient_route_cmd,
+       "show bgp rsclient (A.B.C.D|X:X::X:X) X:X::X:X",
+       SHOW_STR
+       BGP_STR
+       "Information about Route Server Client\n"
+       NEIGHBOR_ADDR_STR
+       "Network in the BGP routing table to display\n")
+
+ALIAS (show_bgp_view_ipv6_rsclient_route,
+       show_bgp_ipv6_rsclient_route_cmd,
        "show bgp ipv6 rsclient (A.B.C.D|X:X::X:X) X:X::X:X",
        SHOW_STR
        BGP_STR
@@ -11627,6 +14789,68 @@ ALIAS (show_bgp_view_ipv6_safi_rsclient_route,
 
 DEFUN (show_bgp_view_rsclient_prefix,
        show_bgp_view_rsclient_prefix_cmd,
+       "show bgp view WORD rsclient (A.B.C.D|X:X::X:X) X:X::X:X/M",
+       SHOW_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "Information about Route Server Client\n"
+       NEIGHBOR_ADDR_STR
+       "IPv6 prefix <network>/<length>, e.g., 3ffe::/16\n")
+{
+  struct bgp *bgp;
+  struct peer *peer;
+
+  /* BGP structure lookup. */
+  if (argc == 3)
+    {
+      bgp = bgp_lookup_by_name (argv[0]);
+      if (bgp == NULL)
+        {
+          vty_out (vty, "Can't find BGP view %s%s", argv[0], VTY_NEWLINE);
+          return CMD_WARNING;
+        }
+    }
+  else
+    {
+      bgp = bgp_get_default ();
+      if (bgp == NULL)
+        {
+          vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
+          return CMD_WARNING;
+        }
+    }
+
+  if (argc == 3)
+    peer = peer_lookup_in_view (vty, argv[0], argv[1]);
+  else
+    peer = peer_lookup_in_view (vty, NULL, argv[0]);
+
+  if (! peer)
+    return CMD_WARNING;
+
+  if (! peer->afc[AFI_IP6][SAFI_UNICAST])
+    {
+      vty_out (vty, "%% Activate the neighbor for the address family first%s",
+            VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  if ( ! CHECK_FLAG (peer->af_flags[AFI_IP6][SAFI_UNICAST],
+              PEER_FLAG_RSERVER_CLIENT))
+    {
+      vty_out (vty, "%% Neighbor is not a Route-Server client%s",
+            VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  return bgp_show_route_in_table (vty, bgp, peer->rib[AFI_IP6][SAFI_UNICAST],
+                                  (argc == 3) ? argv[2] : argv[1],
+                                  AFI_IP6, SAFI_UNICAST, NULL, 1);
+}
+
+DEFUN (show_bgp_view_ipv6_rsclient_prefix,
+       show_bgp_view_ipv6_rsclient_prefix_cmd,
        "show bgp view WORD ipv6 rsclient (A.B.C.D|X:X::X:X) X:X::X:X/M",
        SHOW_STR
        BGP_STR
@@ -11688,8 +14912,17 @@ DEFUN (show_bgp_view_rsclient_prefix,
                                   AFI_IP6, SAFI_UNICAST, NULL, 1);
 }
 
-ALIAS (show_bgp_view_rsclient_prefix,
+ALIAS (show_bgp_view_ipv6_rsclient_prefix,
        show_bgp_rsclient_prefix_cmd,
+       "show bgp rsclient (A.B.C.D|X:X::X:X) X:X::X:X/M",
+       SHOW_STR
+       BGP_STR
+       "Information about Route Server Client\n"
+       NEIGHBOR_ADDR_STR
+       "IPv6 prefix <network>/<length>, e.g., 3ffe::/16\n")
+
+ALIAS (show_bgp_view_ipv6_rsclient_prefix,
+       show_bgp_ipv6_rsclient_prefix_cmd,
        "show bgp ipv6 rsclient (A.B.C.D|X:X::X:X) X:X::X:X/M",
        SHOW_STR
        BGP_STR
@@ -12142,6 +15375,48 @@ ALIAS (bgp_damp_unset,
        "Value to start suppressing a route\n"
        "Maximum duration to suppress a stable route\n")
 
+DEFUN (show_ip_bgp_dampened_paths,
+       show_ip_bgp_dampened_paths_cmd,
+       "show ip bgp dampened-paths",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display paths suppressed due to dampening\n")
+{
+  return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST, bgp_show_type_dampend_paths,
+                   NULL);
+}
+
+ALIAS (show_ip_bgp_dampened_paths,
+       show_ip_bgp_damp_dampened_paths_cmd,
+       "show ip bgp dampening dampened-paths",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display detailed information about dampening\n"
+       "Display paths suppressed due to dampening\n")
+
+DEFUN (show_ip_bgp_flap_statistics,
+       show_ip_bgp_flap_statistics_cmd,
+       "show ip bgp flap-statistics",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display flap statistics of routes\n")
+{
+  return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST,
+                   bgp_show_type_flap_statistics, NULL);
+}
+
+ALIAS (show_ip_bgp_flap_statistics,
+       show_ip_bgp_damp_flap_statistics_cmd,
+       "show ip bgp dampening flap-statistics",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display detailed information about dampening\n"
+       "Display flap statistics of routes\n")
+
 DEFUN (show_bgp_ipv4_safi_dampened_paths,
        show_bgp_ipv4_safi_dampened_paths_cmd,
        "show bgp ipv4 (encap|multicast|unicast|vpn) dampened-paths",
@@ -13050,14 +16325,14 @@ bgp_route_init (void)
   install_element (VIEW_NODE, &show_bgp_ipv6_prefix_list_cmd);
   install_element (VIEW_NODE, &show_bgp_ipv6_filter_list_cmd);
   install_element (VIEW_NODE, &show_bgp_ipv6_route_map_cmd);
-  install_element (VIEW_NODE, &show_bgp_ipv6_community_cmd);
-  install_element (VIEW_NODE, &show_bgp_ipv6_community2_cmd);
-  install_element (VIEW_NODE, &show_bgp_ipv6_community3_cmd);
-  install_element (VIEW_NODE, &show_bgp_ipv6_community4_cmd);
-  install_element (VIEW_NODE, &show_bgp_ipv6_community_exact_cmd);
-  install_element (VIEW_NODE, &show_bgp_ipv6_community2_exact_cmd);
-  install_element (VIEW_NODE, &show_bgp_ipv6_community3_exact_cmd);
-  install_element (VIEW_NODE, &show_bgp_ipv6_community4_exact_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_safi_community_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_safi_community2_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_safi_community3_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_safi_community4_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_safi_community_exact_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_safi_community2_exact_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_safi_community3_exact_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_safi_community4_exact_cmd);
   install_element (VIEW_NODE, &show_bgp_community_list_cmd);
   install_element (VIEW_NODE, &show_bgp_ipv6_prefix_longer_cmd);
   install_element (VIEW_NODE, &show_bgp_ipv6_neighbor_advertised_route_cmd);
@@ -13069,9 +16344,9 @@ bgp_route_init (void)
   install_element (VIEW_NODE, &show_bgp_ipv4_rsclient_cmd);
   install_element (VIEW_NODE, &show_bgp_ipv6_rsclient_cmd);
   install_element (VIEW_NODE, &show_bgp_ipv6_safi_rsclient_cmd);
-  install_element (VIEW_NODE, &show_bgp_rsclient_route_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_rsclient_route_cmd);
   install_element (VIEW_NODE, &show_bgp_ipv6_safi_rsclient_route_cmd);
-  install_element (VIEW_NODE, &show_bgp_rsclient_prefix_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_rsclient_prefix_cmd);
   install_element (VIEW_NODE, &show_bgp_ipv6_safi_rsclient_prefix_cmd);
   install_element (VIEW_NODE, &show_bgp_view_ipv6_cmd);
   install_element (VIEW_NODE, &show_bgp_view_ipv6_route_cmd);
@@ -13085,9 +16360,9 @@ bgp_route_init (void)
   install_element (VIEW_NODE, &show_bgp_view_ipv4_rsclient_cmd);
   install_element (VIEW_NODE, &show_bgp_view_ipv6_rsclient_cmd);
   install_element (VIEW_NODE, &show_bgp_view_ipv6_safi_rsclient_cmd);
-  install_element (VIEW_NODE, &show_bgp_view_rsclient_route_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_ipv6_rsclient_route_cmd);
   install_element (VIEW_NODE, &show_bgp_view_ipv6_safi_rsclient_route_cmd);
-  install_element (VIEW_NODE, &show_bgp_view_rsclient_prefix_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_ipv6_rsclient_prefix_cmd);
   install_element (VIEW_NODE, &show_bgp_view_ipv6_safi_rsclient_prefix_cmd);
   
   /* Restricted:
@@ -13097,24 +16372,24 @@ bgp_route_init (void)
   install_element (RESTRICTED_NODE, &show_bgp_ipv6_safi_route_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_ipv6_prefix_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_ipv6_safi_prefix_cmd);
-  install_element (RESTRICTED_NODE, &show_bgp_ipv6_community_cmd);
-  install_element (RESTRICTED_NODE, &show_bgp_ipv6_community2_cmd);
-  install_element (RESTRICTED_NODE, &show_bgp_ipv6_community3_cmd);
-  install_element (RESTRICTED_NODE, &show_bgp_ipv6_community4_cmd);
-  install_element (RESTRICTED_NODE, &show_bgp_ipv6_community_exact_cmd);
-  install_element (RESTRICTED_NODE, &show_bgp_ipv6_community2_exact_cmd);
-  install_element (RESTRICTED_NODE, &show_bgp_ipv6_community3_exact_cmd);
-  install_element (RESTRICTED_NODE, &show_bgp_ipv6_community4_exact_cmd);
-  install_element (RESTRICTED_NODE, &show_bgp_rsclient_route_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_ipv6_safi_community_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_ipv6_safi_community2_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_ipv6_safi_community3_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_ipv6_safi_community4_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_ipv6_safi_community_exact_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_ipv6_safi_community2_exact_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_ipv6_safi_community3_exact_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_ipv6_safi_community4_exact_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_ipv6_rsclient_route_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_ipv6_safi_rsclient_route_cmd);
-  install_element (RESTRICTED_NODE, &show_bgp_rsclient_prefix_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_ipv6_rsclient_prefix_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_ipv6_safi_rsclient_prefix_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_view_ipv6_route_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_view_ipv6_prefix_cmd);
   install_element (RESTRICTED_NODE, \
                &show_bgp_view_ipv6_neighbor_received_prefix_filter_cmd);
-  install_element (RESTRICTED_NODE, &show_bgp_view_rsclient_route_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_view_ipv6_rsclient_route_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_view_ipv6_safi_rsclient_route_cmd);
-  install_element (RESTRICTED_NODE, &show_bgp_view_rsclient_prefix_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_view_ipv6_rsclient_prefix_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_view_ipv6_safi_rsclient_prefix_cmd);
 
   install_element (ENABLE_NODE, &show_bgp_ipv6_safi_cmd);
@@ -13126,16 +16401,16 @@ bgp_route_init (void)
   install_element (ENABLE_NODE, &show_bgp_ipv6_prefix_list_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv6_filter_list_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv6_route_map_cmd);
-  install_element (ENABLE_NODE, &show_bgp_ipv6_community_cmd);
-  install_element (ENABLE_NODE, &show_bgp_ipv6_community2_cmd);
-  install_element (ENABLE_NODE, &show_bgp_ipv6_community3_cmd);
-  install_element (ENABLE_NODE, &show_bgp_ipv6_community4_cmd);
-  install_element (ENABLE_NODE, &show_bgp_ipv6_community_exact_cmd);
-  install_element (ENABLE_NODE, &show_bgp_ipv6_community2_exact_cmd);
-  install_element (ENABLE_NODE, &show_bgp_ipv6_community3_exact_cmd);
-  install_element (ENABLE_NODE, &show_bgp_ipv6_community4_exact_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_safi_community_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_safi_community2_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_safi_community3_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_safi_community4_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_safi_community_exact_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_safi_community2_exact_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_safi_community3_exact_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_safi_community4_exact_cmd);
   install_element (ENABLE_NODE, &show_bgp_community_list_cmd);
-  install_element (ENABLE_NODE, &show_bgp_ipv6_community_list_exact_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_safi_community_list_exact_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv6_prefix_longer_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv6_neighbor_advertised_route_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv6_neighbor_received_routes_cmd);
@@ -13146,9 +16421,9 @@ bgp_route_init (void)
   install_element (ENABLE_NODE, &show_bgp_ipv4_rsclient_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv6_rsclient_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv6_safi_rsclient_cmd);
-  install_element (ENABLE_NODE, &show_bgp_rsclient_route_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_rsclient_route_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv6_safi_rsclient_route_cmd);
-  install_element (ENABLE_NODE, &show_bgp_rsclient_prefix_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_rsclient_prefix_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv6_safi_rsclient_prefix_cmd);
   install_element (ENABLE_NODE, &show_bgp_view_ipv6_cmd);
   install_element (ENABLE_NODE, &show_bgp_view_ipv6_route_cmd);
@@ -13162,9 +16437,9 @@ bgp_route_init (void)
   install_element (ENABLE_NODE, &show_bgp_view_ipv4_rsclient_cmd);
   install_element (ENABLE_NODE, &show_bgp_view_ipv6_rsclient_cmd);
   install_element (ENABLE_NODE, &show_bgp_view_ipv6_safi_rsclient_cmd);
-  install_element (ENABLE_NODE, &show_bgp_view_rsclient_route_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_ipv6_rsclient_route_cmd);
   install_element (ENABLE_NODE, &show_bgp_view_ipv6_safi_rsclient_route_cmd);
-  install_element (ENABLE_NODE, &show_bgp_view_rsclient_prefix_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_ipv6_rsclient_prefix_cmd);
   install_element (ENABLE_NODE, &show_bgp_view_ipv6_safi_rsclient_prefix_cmd);
   
   /* Statistics */
@@ -13238,6 +16513,428 @@ bgp_route_init (void)
   install_element (BGP_IPV6_NODE, &ipv6_bgp_network_ttl_cmd);
   install_element (BGP_IPV6_NODE, &no_ipv6_bgp_network_ttl_cmd);
 #endif
+
+  /* old style commands */
+  install_element (VIEW_NODE, &show_ip_bgp_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_ipv4_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_route_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_ipv4_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_ipv4_prefix_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_view_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_view_route_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_view_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_ipv4_prefix_list_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_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_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);
+  install_element (VIEW_NODE, &show_ip_bgp_community_all_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_ipv4_community_all_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_community_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_community2_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_community3_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_community4_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_ipv4_community_cmd);
+  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_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);
+  install_element (VIEW_NODE, &show_ip_bgp_community4_exact_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_ipv4_community_exact_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_ipv4_community2_exact_cmd);
+  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_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_ipv4_prefix_longer_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_neighbor_advertised_route_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbor_advertised_route_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_neighbor_received_routes_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbor_received_routes_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_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); +  install_element \
(VIEW_NODE, &show_ip_bgp_dampening_params_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_dampened_paths_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_damp_dampened_paths_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_flap_statistics_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_damp_flap_statistics_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_flap_address_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_damp_flap_address_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_flap_prefix_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_flap_cidr_only_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_damp_flap_cidr_only_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_flap_regexp_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_flap_filter_list_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_damp_flap_filter_list_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_flap_prefix_list_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_damp_flap_prefix_list_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_flap_prefix_longer_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_damp_flap_prefix_longer_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_flap_route_map_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_damp_flap_route_map_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_neighbor_flap_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_neighbor_damp_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_rsclient_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_rsclient_route_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_rsclient_prefix_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_view_neighbor_advertised_route_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_view_neighbor_received_routes_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_view_rsclient_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_view_rsclient_route_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_view_rsclient_prefix_cmd); +  install_element (RESTRICTED_NODE, \
&show_ip_bgp_route_cmd); +  install_element (RESTRICTED_NODE, \
&show_ip_bgp_ipv4_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_ipv4_prefix_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_community_cmd); +  install_element (RESTRICTED_NODE, \
&show_ip_bgp_community2_cmd); +  install_element (RESTRICTED_NODE, \
&show_ip_bgp_community3_cmd); +  install_element (RESTRICTED_NODE, \
&show_ip_bgp_community4_cmd); +  install_element (RESTRICTED_NODE, \
&show_ip_bgp_ipv4_community_cmd); +  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_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); +  install_element (RESTRICTED_NODE, \
&show_ip_bgp_community4_exact_cmd); +  install_element (RESTRICTED_NODE, \
&show_ip_bgp_ipv4_community_exact_cmd); +  install_element (RESTRICTED_NODE, \
&show_ip_bgp_ipv4_community2_exact_cmd); +  install_element (RESTRICTED_NODE, \
&show_ip_bgp_ipv4_community3_exact_cmd); +  install_element (RESTRICTED_NODE, \
&show_ip_bgp_ipv4_community4_exact_cmd); +  install_element (RESTRICTED_NODE, \
&show_ip_bgp_rsclient_route_cmd); +  install_element (RESTRICTED_NODE, \
&show_ip_bgp_rsclient_prefix_cmd); +  install_element (RESTRICTED_NODE, \
&show_ip_bgp_view_rsclient_route_cmd); +  install_element (RESTRICTED_NODE, \
&show_ip_bgp_view_rsclient_prefix_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_cmd); +  install_element (ENABLE_NODE, &show_ip_bgp_ipv4_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_route_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_ipv4_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_ipv4_prefix_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_view_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_view_route_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_view_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_ipv4_prefix_list_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_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_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);
+  install_element (ENABLE_NODE, &show_ip_bgp_community_all_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_ipv4_community_all_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_community_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_community2_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_community3_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_community4_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_ipv4_community_cmd);
+  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_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);
+  install_element (ENABLE_NODE, &show_ip_bgp_community4_exact_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_ipv4_community_exact_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_ipv4_community2_exact_cmd);
+  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_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_ipv4_prefix_longer_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_neighbor_advertised_route_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbor_advertised_route_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_neighbor_received_routes_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbor_received_routes_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_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); +  install_element \
(ENABLE_NODE, &show_ip_bgp_dampening_params_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_dampened_paths_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_damp_dampened_paths_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_flap_statistics_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_damp_flap_statistics_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_flap_address_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_damp_flap_address_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_flap_prefix_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_flap_cidr_only_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_damp_flap_cidr_only_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_flap_regexp_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_damp_flap_regexp_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_flap_filter_list_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_damp_flap_filter_list_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_flap_prefix_list_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_damp_flap_prefix_list_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_flap_prefix_longer_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_damp_flap_prefix_longer_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_flap_route_map_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_damp_flap_route_map_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_neighbor_flap_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_neighbor_damp_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_rsclient_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_rsclient_route_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_rsclient_prefix_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_view_neighbor_advertised_route_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_view_neighbor_received_routes_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_view_rsclient_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_view_rsclient_route_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_view_rsclient_prefix_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_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); +  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_prefix_cmd);
+  install_element (VIEW_NODE, &show_bgp_regexp_cmd);
+  install_element (VIEW_NODE, &show_bgp_prefix_list_cmd);
+  install_element (VIEW_NODE, &show_bgp_filter_list_cmd);
+  install_element (VIEW_NODE, &show_bgp_route_map_cmd);
+  install_element (VIEW_NODE, &show_bgp_community_all_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_community_all_cmd);
+  install_element (VIEW_NODE, &show_bgp_community_cmd);
+  install_element (VIEW_NODE, &show_bgp_community2_cmd);
+  install_element (VIEW_NODE, &show_bgp_community3_cmd);
+  install_element (VIEW_NODE, &show_bgp_community4_cmd);
+  install_element (VIEW_NODE, &show_bgp_community_exact_cmd);
+  install_element (VIEW_NODE, &show_bgp_community2_exact_cmd);
+  install_element (VIEW_NODE, &show_bgp_community3_exact_cmd);
+  install_element (VIEW_NODE, &show_bgp_community4_exact_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_safi_community_list_cmd);
+  install_element (VIEW_NODE, &show_bgp_community_list_exact_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_safi_community_list_exact_cmd);
+  install_element (VIEW_NODE, &show_bgp_prefix_longer_cmd);
+  install_element (VIEW_NODE, &show_bgp_neighbor_advertised_route_cmd);
+  install_element (VIEW_NODE, &show_bgp_neighbor_received_routes_cmd);
+  install_element (VIEW_NODE, &show_bgp_neighbor_routes_cmd);
+  install_element (VIEW_NODE, &show_bgp_neighbor_received_prefix_filter_cmd);
+  install_element (VIEW_NODE, &show_bgp_neighbor_flap_cmd);
+  install_element (VIEW_NODE, &show_bgp_neighbor_damp_cmd);
+  install_element (VIEW_NODE, &show_bgp_rsclient_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_route_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_prefix_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_neighbor_advertised_route_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_neighbor_received_routes_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_neighbor_routes_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_neighbor_received_prefix_filter_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_neighbor_flap_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_neighbor_damp_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_rsclient_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_route_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_prefix_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_community_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_community2_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_community3_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_community4_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_community_exact_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_community2_exact_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_community3_exact_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_community4_exact_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_view_route_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_view_prefix_cmd);
+  install_element (RESTRICTED_NODE, \
&show_bgp_view_neighbor_received_prefix_filter_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_prefix_cmd);
+  install_element (ENABLE_NODE, &show_bgp_regexp_cmd);
+  install_element (ENABLE_NODE, &show_bgp_prefix_list_cmd);
+  install_element (ENABLE_NODE, &show_bgp_filter_list_cmd);
+  install_element (ENABLE_NODE, &show_bgp_route_map_cmd);
+  install_element (ENABLE_NODE, &show_bgp_community_all_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_community_all_cmd);
+  install_element (ENABLE_NODE, &show_bgp_community_cmd);
+  install_element (ENABLE_NODE, &show_bgp_community2_cmd);
+  install_element (ENABLE_NODE, &show_bgp_community3_cmd);
+  install_element (ENABLE_NODE, &show_bgp_community4_cmd);
+  install_element (ENABLE_NODE, &show_bgp_community_exact_cmd);
+  install_element (ENABLE_NODE, &show_bgp_community2_exact_cmd);
+  install_element (ENABLE_NODE, &show_bgp_community3_exact_cmd);
+  install_element (ENABLE_NODE, &show_bgp_community4_exact_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_safi_community_list_cmd);
+  install_element (ENABLE_NODE, &show_bgp_community_list_exact_cmd);
+  install_element (ENABLE_NODE, &show_bgp_prefix_longer_cmd);
+  install_element (ENABLE_NODE, &show_bgp_neighbor_advertised_route_cmd);
+  install_element (ENABLE_NODE, &show_bgp_neighbor_received_routes_cmd);
+  install_element (ENABLE_NODE, &show_bgp_neighbor_routes_cmd);
+  install_element (ENABLE_NODE, &show_bgp_neighbor_received_prefix_filter_cmd);
+  install_element (ENABLE_NODE, &show_bgp_neighbor_flap_cmd);
+  install_element (ENABLE_NODE, &show_bgp_neighbor_damp_cmd);
+  install_element (ENABLE_NODE, &show_bgp_rsclient_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_route_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_prefix_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_neighbor_advertised_route_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_neighbor_received_routes_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_neighbor_routes_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_neighbor_received_prefix_filter_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_neighbor_flap_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_neighbor_damp_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_rsclient_cmd);
+  install_element (ENABLE_NODE, &show_bgp_statistics_vpnv4_cmd);
+  install_element (ENABLE_NODE, &show_bgp_statistics_view_vpnv4_cmd);
+  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);
+  install_element (VIEW_NODE, &show_ipv6_bgp_prefix_list_cmd);
+  install_element (VIEW_NODE, &show_ipv6_bgp_filter_list_cmd);
+  install_element (VIEW_NODE, &show_ipv6_bgp_community_all_cmd);
+  install_element (VIEW_NODE, &show_ipv6_bgp_community_cmd);
+  install_element (VIEW_NODE, &show_ipv6_bgp_community2_cmd);
+  install_element (VIEW_NODE, &show_ipv6_bgp_community3_cmd);
+  install_element (VIEW_NODE, &show_ipv6_bgp_community4_cmd);
+  install_element (VIEW_NODE, &show_ipv6_bgp_community_exact_cmd);
+  install_element (VIEW_NODE, &show_ipv6_bgp_community2_exact_cmd);
+  install_element (VIEW_NODE, &show_ipv6_bgp_community3_exact_cmd);
+  install_element (VIEW_NODE, &show_ipv6_bgp_community4_exact_cmd);
+  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_ipv6_mbgp_regexp_cmd);
+  install_element (VIEW_NODE, &show_ipv6_mbgp_prefix_list_cmd);
+  install_element (VIEW_NODE, &show_ipv6_mbgp_filter_list_cmd);
+  install_element (VIEW_NODE, &show_ipv6_mbgp_community_all_cmd);
+  install_element (VIEW_NODE, &show_ipv6_mbgp_community_cmd);
+  install_element (VIEW_NODE, &show_ipv6_mbgp_community2_cmd);
+  install_element (VIEW_NODE, &show_ipv6_mbgp_community3_cmd);
+  install_element (VIEW_NODE, &show_ipv6_mbgp_community4_cmd);
+  install_element (VIEW_NODE, &show_ipv6_mbgp_community_exact_cmd);
+  install_element (VIEW_NODE, &show_ipv6_mbgp_community2_exact_cmd);
+  install_element (VIEW_NODE, &show_ipv6_mbgp_community3_exact_cmd);
+  install_element (VIEW_NODE, &show_ipv6_mbgp_community4_exact_cmd);
+  install_element (VIEW_NODE, &show_ipv6_mbgp_community_list_cmd);
+  install_element (VIEW_NODE, &show_ipv6_mbgp_community_list_exact_cmd);
+  install_element (VIEW_NODE, &show_ipv6_mbgp_prefix_longer_cmd);
+  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);
+  install_element (ENABLE_NODE, &show_ipv6_bgp_prefix_list_cmd);
+  install_element (ENABLE_NODE, &show_ipv6_bgp_filter_list_cmd);
+  install_element (ENABLE_NODE, &show_ipv6_bgp_community_all_cmd);
+  install_element (ENABLE_NODE, &show_ipv6_bgp_community_cmd);
+  install_element (ENABLE_NODE, &show_ipv6_bgp_community2_cmd);
+  install_element (ENABLE_NODE, &show_ipv6_bgp_community3_cmd);
+  install_element (ENABLE_NODE, &show_ipv6_bgp_community4_cmd);
+  install_element (ENABLE_NODE, &show_ipv6_bgp_community_exact_cmd);
+  install_element (ENABLE_NODE, &show_ipv6_bgp_community2_exact_cmd);
+  install_element (ENABLE_NODE, &show_ipv6_bgp_community3_exact_cmd);
+  install_element (ENABLE_NODE, &show_ipv6_bgp_community4_exact_cmd);
+  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_ipv6_mbgp_regexp_cmd);
+  install_element (ENABLE_NODE, &show_ipv6_mbgp_prefix_list_cmd);
+  install_element (ENABLE_NODE, &show_ipv6_mbgp_filter_list_cmd);
+  install_element (ENABLE_NODE, &show_ipv6_mbgp_community_all_cmd);
+  install_element (ENABLE_NODE, &show_ipv6_mbgp_community_cmd);
+  install_element (ENABLE_NODE, &show_ipv6_mbgp_community2_cmd);
+  install_element (ENABLE_NODE, &show_ipv6_mbgp_community3_cmd);
+  install_element (ENABLE_NODE, &show_ipv6_mbgp_community4_cmd);
+  install_element (ENABLE_NODE, &show_ipv6_mbgp_community_exact_cmd);
+  install_element (ENABLE_NODE, &show_ipv6_mbgp_community2_exact_cmd);
+  install_element (ENABLE_NODE, &show_ipv6_mbgp_community3_exact_cmd);
+  install_element (ENABLE_NODE, &show_ipv6_mbgp_community4_exact_cmd);
+  install_element (ENABLE_NODE, &show_ipv6_mbgp_community_list_cmd);
+  install_element (ENABLE_NODE, &show_ipv6_mbgp_community_list_exact_cmd);
+  install_element (ENABLE_NODE, &show_ipv6_mbgp_prefix_longer_cmd);
+  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);
+  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);
+  install_element (ENABLE_NODE, &ipv6_mbgp_neighbor_received_routes_cmd);
+  install_element (VIEW_NODE, &ipv6_bgp_neighbor_routes_cmd);
+  install_element (ENABLE_NODE, &ipv6_bgp_neighbor_routes_cmd);
+  install_element (VIEW_NODE, &ipv6_mbgp_neighbor_routes_cmd);
+  install_element (ENABLE_NODE, &ipv6_mbgp_neighbor_routes_cmd);
+  /* old with name safi collision */
+  install_element (VIEW_NODE, &show_bgp_ipv6_community_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_community2_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_community3_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_community4_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_community_exact_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_community2_exact_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_community3_exact_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_community4_exact_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_ipv6_community_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_ipv6_community2_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_ipv6_community3_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_ipv6_community4_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_ipv6_community_exact_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_ipv6_community2_exact_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_ipv6_community3_exact_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_ipv6_community4_exact_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_community_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_community2_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_community3_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_community4_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_community_exact_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_community2_exact_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_community3_exact_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_community4_exact_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_community_list_exact_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_community_list_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_community_list_exact_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_community_list_cmd);
+
+  install_element (VIEW_NODE, &show_bgp_rsclient_route_cmd);
+  install_element (VIEW_NODE, &show_bgp_rsclient_prefix_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_rsclient_route_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_rsclient_prefix_cmd);
+  install_element (ENABLE_NODE, &show_bgp_rsclient_route_cmd);
+  install_element (ENABLE_NODE, &show_bgp_rsclient_prefix_cmd);
+
+  install_element (VIEW_NODE, &show_bgp_view_rsclient_route_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_rsclient_prefix_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_view_rsclient_route_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_view_rsclient_prefix_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_rsclient_route_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_rsclient_prefix_cmd);
 }
 
 void
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 4b22865..47a2337 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -7381,6 +7381,103 @@ bgp_show_summary_vty (struct vty *vty, const char *name,
 }
 
 /* `show ip bgp summary' commands. */
+DEFUN (show_ip_bgp_summary, 
+       show_ip_bgp_summary_cmd,
+       "show ip bgp summary",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Summary of BGP neighbor status\n")
+{
+  return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST);
+}
+
+DEFUN (show_ip_bgp_instance_summary,
+       show_ip_bgp_instance_summary_cmd,
+       "show ip bgp view WORD summary",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "Summary of BGP neighbor status\n")
+{
+  return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST);  
+}
+
+DEFUN (show_ip_bgp_ipv4_summary, 
+       show_ip_bgp_ipv4_summary_cmd,
+       "show ip bgp ipv4 (unicast|multicast) summary",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Summary of BGP neighbor status\n")
+{
+  if (strncmp (argv[0], "m", 1) == 0)
+    return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST);
+
+  return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST);
+}
+
+DEFUN (show_ip_bgp_instance_ipv4_summary,
+       show_ip_bgp_instance_ipv4_summary_cmd,
+       "show ip bgp view WORD ipv4 (unicast|multicast) summary",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Summary of BGP neighbor status\n")
+{
+  if (strncmp (argv[1], "m", 1) == 0)
+    return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST);
+  else
+    return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST);
+}
+
+DEFUN (show_ip_bgp_vpnv4_all_summary,
+       show_ip_bgp_vpnv4_all_summary_cmd,
+       "show ip bgp vpnv4 all summary",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display VPNv4 NLRI specific information\n"
+       "Display information about all VPNv4 NLRIs\n"
+       "Summary of BGP neighbor status\n")
+{
+  return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN);
+}
+
+DEFUN (show_ip_bgp_vpnv4_rd_summary,
+       show_ip_bgp_vpnv4_rd_summary_cmd,
+       "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn summary",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display VPNv4 NLRI specific information\n"
+       "Display information for a route distinguisher\n"
+       "VPN Route Distinguisher\n"
+       "Summary of BGP neighbor status\n")
+{
+  int ret;
+  struct prefix_rd prd;
+
+  ret = str2prefix_rd (argv[0], &prd);
+  if (! ret)
+    {
+      vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN);
+}
+
 DEFUN (show_bgp_ipv4_safi_summary,
        show_bgp_ipv4_safi_summary_cmd,
        "show bgp ipv4 (unicast|multicast) summary",
@@ -7604,6 +7701,29 @@ DEFUN (show_bgp_instance_ipv6_safi_summary,
   return bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST);
 }
 
+/* old command */
+DEFUN (show_ipv6_bgp_summary, 
+       show_ipv6_bgp_summary_cmd,
+       "show ipv6 bgp summary",
+       SHOW_STR
+       IPV6_STR
+       BGP_STR
+       "Summary of BGP neighbor status\n")
+{
+  return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST);
+}
+
+/* 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);
+}
 #endif /* HAVE_IPV6 */
 
 /* variations of show bgp [...] summary */
@@ -7646,6 +7766,14 @@ DEFUN (show_bgp_summary,
     return CMD_SUCCESS;
 }
 
+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")
+
 DEFUN (show_bgp_summary_1w,
        show_bgp_summary_1w_cmd,
 #ifdef HAVE_IPV6
@@ -8482,7 +8610,186 @@ bgp_show_neighbor_vty (struct vty *vty, const char *name,
   return CMD_SUCCESS;
 }
 
-/* "show ip bgp neighbors" commands.  */
+/* "show ip bgp neighbors" commands.  */DEFUN (show_ip_bgp_neighbors,
+       show_ip_bgp_neighbors_cmd,
+       "show ip bgp neighbors",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Detailed information on TCP and BGP neighbor connections\n")
+{
+  return bgp_show_neighbor_vty (vty, NULL, show_all, NULL);
+}
+
+ALIAS (show_ip_bgp_neighbors,
+       show_ip_bgp_ipv4_neighbors_cmd,
+       "show ip bgp ipv4 (unicast|multicast) neighbors",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Detailed information on TCP and BGP neighbor connections\n")
+
+ALIAS (show_ip_bgp_neighbors,
+       show_ip_bgp_vpnv4_all_neighbors_cmd,
+       "show ip bgp vpnv4 all neighbors",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display VPNv4 NLRI specific information\n"
+       "Display information about all VPNv4 NLRIs\n"
+       "Detailed information on TCP and BGP neighbor connections\n")
+
+ALIAS (show_ip_bgp_neighbors,
+       show_ip_bgp_vpnv4_rd_neighbors_cmd,
+       "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display VPNv4 NLRI specific information\n"
+       "Display information for a route distinguisher\n"
+       "VPN Route Distinguisher\n"
+       "Detailed information on TCP and BGP neighbor connections\n")
+
+ALIAS (show_ip_bgp_neighbors,
+       show_bgp_ipv6_neighbors_cmd,
+       "show bgp ipv6 neighbors",
+       SHOW_STR
+       BGP_STR
+       "Address family\n"
+       "Detailed information on TCP and BGP neighbor connections\n")
+
+DEFUN (show_ip_bgp_neighbors_peer,
+       show_ip_bgp_neighbors_peer_cmd,
+       "show ip bgp neighbors (A.B.C.D|X:X::X:X)",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Detailed information on TCP and BGP neighbor connections\n"
+       "Neighbor to display information about\n"
+       "Neighbor to display information about\n")
+{
+  return bgp_show_neighbor_vty (vty, NULL, show_peer, argv[argc - 1]);
+}
+
+ALIAS (show_ip_bgp_neighbors_peer,
+       show_ip_bgp_ipv4_neighbors_peer_cmd,
+       "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X)",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Address family\n"
+       "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")
+
+ALIAS (show_ip_bgp_neighbors_peer,
+       show_ip_bgp_vpnv4_all_neighbors_peer_cmd,
+       "show ip bgp vpnv4 all neighbors A.B.C.D",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display VPNv4 NLRI specific information\n"
+       "Display information about all VPNv4 NLRIs\n"
+       "Detailed information on TCP and BGP neighbor connections\n"
+       "Neighbor to display information about\n")
+
+ALIAS (show_ip_bgp_neighbors_peer,
+       show_ip_bgp_vpnv4_rd_neighbors_peer_cmd,
+       "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors A.B.C.D",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Display VPNv4 NLRI specific information\n"
+       "Display information about all VPNv4 NLRIs\n"
+       "Detailed information on TCP and BGP neighbor connections\n"
+       "Neighbor to display information about\n")
+
+ALIAS (show_ip_bgp_neighbors_peer,
+       show_bgp_ipv6_neighbors_peer_cmd,
+       "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X)",
+       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")
+
+DEFUN (show_ip_bgp_instance_neighbors,
+       show_ip_bgp_instance_neighbors_cmd,
+       "show ip bgp view WORD neighbors",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "Detailed information on TCP and BGP neighbor connections\n")
+{
+  return bgp_show_neighbor_vty (vty, argv[0], show_all, NULL);
+}
+
+ALIAS (show_ip_bgp_instance_neighbors,
+       show_bgp_instance_ipv6_neighbors_cmd,
+       "show bgp view WORD ipv6 neighbors",
+       SHOW_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "Address family\n"
+       "Detailed information on TCP and BGP neighbor connections\n")
+
+DEFUN (show_ip_bgp_instance_neighbors_peer,
+       show_ip_bgp_instance_neighbors_peer_cmd,
+       "show ip bgp view WORD neighbors (A.B.C.D|X:X::X:X)",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "Detailed information on TCP and BGP neighbor connections\n"
+       "Neighbor to display information about\n"
+       "Neighbor to display information about\n")
+{
+  return bgp_show_neighbor_vty (vty, argv[0], show_peer, argv[1]);
+}
+
+/* Show BGP's AS paths internal data.  There are both `show ip bgp
+   paths' and `show ip mbgp paths'.  Those functions results are the
+   same.*/
+DEFUN (show_ip_bgp_paths, 
+       show_ip_bgp_paths_cmd,
+       "show ip bgp paths",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Path information\n")
+{
+  vty_out (vty, "Address Refcnt Path%s", VTY_NEWLINE);
+  aspath_print_all_vty (vty);
+  return CMD_SUCCESS;
+}
+
+DEFUN (show_ip_bgp_ipv4_paths, 
+       show_ip_bgp_ipv4_paths_cmd,
+       "show ip bgp ipv4 (unicast|multicast) paths",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Path information\n")
+{
+  vty_out (vty, "Address Refcnt Path\r\n");
+  aspath_print_all_vty (vty);
+
+  return CMD_SUCCESS;
+}
+
 DEFUN (show_bgp_neighbors,
        show_bgp_neighbors_cmd,
        "show bgp neighbors",
@@ -8521,16 +8828,6 @@ DEFUN (show_bgp_instance_neighbors,
   return bgp_show_neighbor_vty (vty, argv[0], show_all, NULL);
 }
 
-ALIAS (show_bgp_instance_neighbors,
-       show_bgp_instance_ipv6_neighbors_cmd,
-       "show bgp view WORD ipv6 neighbors",
-       SHOW_STR
-       BGP_STR
-       "BGP view\n"
-       "View name\n"
-       "Address family\n"
-       "Detailed information on TCP and BGP neighbor connections\n")
-
 DEFUN (show_bgp_instance_neighbors_peer,
        show_bgp_instance_neighbors_peer_cmd,
 #ifdef HAVE_IPV6
@@ -8759,6 +9056,69 @@ bgp_show_rsclient_summary_vty (struct vty *vty, const char \
*name,  }
 
 /* 'show bgp rsclient' commands. */
+DEFUN (show_ip_bgp_rsclient_summary,
+       show_ip_bgp_rsclient_summary_cmd,
+       "show ip bgp rsclient summary",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Information about Route Server Clients\n"
+       "Summary of all Route Server Clients\n")
+{
+  return bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST);
+}
+
+DEFUN (show_ip_bgp_instance_rsclient_summary,
+       show_ip_bgp_instance_rsclient_summary_cmd,
+       "show ip bgp view WORD rsclient summary",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "Information about Route Server Clients\n"
+       "Summary of all Route Server Clients\n")
+{
+  return bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST);
+}
+
+DEFUN (show_ip_bgp_ipv4_rsclient_summary,
+      show_ip_bgp_ipv4_rsclient_summary_cmd,
+      "show ip bgp ipv4 (unicast|multicast) rsclient summary",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Information about Route Server Clients\n"
+       "Summary of all Route Server Clients\n")
+{
+  if (strncmp (argv[0], "m", 1) == 0)
+    return bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST);
+
+  return bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST);
+}
+
+DEFUN (show_ip_bgp_instance_ipv4_rsclient_summary,
+      show_ip_bgp_instance_ipv4_rsclient_summary_cmd,
+      "show ip bgp view WORD ipv4 (unicast|multicast) rsclient summary",
+       SHOW_STR
+       IP_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n"
+       "Information about Route Server Clients\n"
+       "Summary of all Route Server Clients\n")
+{
+  if (strncmp (argv[1], "m", 1) == 0)
+    return bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST);
+
+  return bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST);
+}
 
 DEFUN (show_bgp_instance_ipv4_safi_rsclient_summary,
        show_bgp_instance_ipv4_safi_rsclient_summary_cmd,
@@ -10699,7 +11059,6 @@ bgp_vty_init (void)
 #ifdef HAVE_IPV6
   install_element (RESTRICTED_NODE, &show_bgp_ipv6_vpn_summary_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_ipv6_encap_summary_cmd);
-  install_element (RESTRICTED_NODE, &show_bgp_ipv6_encap_summary_cmd);
 #endif
 
   install_element (RESTRICTED_NODE, &show_bgp_instance_summary_cmd);
@@ -10766,12 +11125,10 @@ bgp_vty_init (void)
   install_element (VIEW_NODE, &show_bgp_instance_ipv6_rsclient_summary_cmd);
   install_element (VIEW_NODE, &show_bgp_instance_ipv6_safi_rsclient_summary_cmd);
   install_element (VIEW_NODE, &show_bgp_ipv6_safi_rsclient_summary_cmd);
-  install_element (RESTRICTED_NODE, &show_bgp_rsclient_summary_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_ipv6_rsclient_summary_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_rsclient_summary_cmd);
   install_element (RESTRICTED_NODE, \
&show_bgp_instance_ipv6_safi_rsclient_summary_cmd);  install_element \
                (RESTRICTED_NODE, &show_bgp_ipv6_safi_rsclient_summary_cmd);
-  install_element (ENABLE_NODE, &show_bgp_rsclient_summary_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv6_rsclient_summary_cmd);
   install_element (ENABLE_NODE, &show_bgp_instance_ipv6_rsclient_summary_cmd);
   install_element (ENABLE_NODE, &show_bgp_instance_ipv6_safi_rsclient_summary_cmd);
@@ -10827,7 +11184,79 @@ bgp_vty_init (void)
   install_element (VIEW_NODE, &show_bgp_views_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_views_cmd);
   install_element (ENABLE_NODE, &show_bgp_views_cmd);
-  
+
+  /* non afi/safi forms of commands */
+  install_element (VIEW_NODE, &show_ip_bgp_summary_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_instance_summary_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_ipv4_summary_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_instance_ipv4_summary_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_summary_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_summary_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_summary_cmd);
+  install_element (RESTRICTED_NODE, &show_ip_bgp_summary_cmd);
+  install_element (RESTRICTED_NODE, &show_ip_bgp_instance_summary_cmd);
+  install_element (RESTRICTED_NODE, &show_ip_bgp_ipv4_summary_cmd);
+  install_element (RESTRICTED_NODE, &show_ip_bgp_instance_ipv4_summary_cmd);
+  install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_all_summary_cmd);
+  install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_rd_summary_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_ipv6_summary_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_summary_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_instance_summary_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_ipv4_summary_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_instance_ipv4_summary_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_all_summary_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_rd_summary_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_summary_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_neighbors_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbors_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_neighbors_peer_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbors_peer_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_neighbors_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_neighbors_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_instance_neighbors_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_instance_neighbors_peer_cmd);
+  install_element (RESTRICTED_NODE, &show_ip_bgp_neighbors_peer_cmd);
+  install_element (RESTRICTED_NODE, &show_ip_bgp_ipv4_neighbors_peer_cmd);
+  install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd);
+  install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd);
+  install_element (RESTRICTED_NODE, &show_ip_bgp_instance_neighbors_peer_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_neighbors_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbors_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_neighbors_peer_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbors_peer_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_all_neighbors_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_rd_neighbors_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_instance_neighbors_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_instance_neighbors_peer_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_neighbors_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_neighbors_peer_cmd);
+  install_element (RESTRICTED_NODE, &show_bgp_ipv6_neighbors_peer_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_neighbors_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_neighbors_peer_cmd);
+  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_ip_bgp_rsclient_summary_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_instance_rsclient_summary_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_ipv4_rsclient_summary_cmd);
+  install_element (VIEW_NODE, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd);
+  install_element (RESTRICTED_NODE, &show_ip_bgp_rsclient_summary_cmd);
+  install_element (RESTRICTED_NODE, &show_ip_bgp_instance_rsclient_summary_cmd);
+  install_element (RESTRICTED_NODE, &show_ip_bgp_ipv4_rsclient_summary_cmd);
+  install_element (RESTRICTED_NODE, \
&show_ip_bgp_instance_ipv4_rsclient_summary_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_rsclient_summary_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_instance_rsclient_summary_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_ipv4_rsclient_summary_cmd); +  install_element (ENABLE_NODE, \
&show_ip_bgp_instance_ipv4_rsclient_summary_cmd); +  install_element (VIEW_NODE, \
&show_ip_bgp_paths_cmd); +  install_element (VIEW_NODE, &show_ip_bgp_ipv4_paths_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_paths_cmd);
+  install_element (ENABLE_NODE, &show_ip_bgp_ipv4_paths_cmd);
   /* Community-list. */
   community_list_vty ();
 }
-- 
2.1.3


_______________________________________________
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic