add vty command : show ipv6 bgp vrf [route]
This command permits to dump IPv6 entries in VRF RIB filled by export RT 
facility.
Type 1 route distinguishers are now supported by command show ip bgp vrf
<A.B.C.D:nn>

Signed-off-by: Philippe Guibert <philippe.guib...@6wind.com>
---
 bgpd/bgp_route.c | 41 ++++++++++++++++++++++++++++++++++++-----
 1 file changed, 36 insertions(+), 5 deletions(-)

diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 9a8619dda841..c6c5ddf26e19 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -8069,7 +8069,7 @@ bgp_show_vrf (struct vty *vty, const char *vrf_name, 
afi_t afi,
       vty_out (vty, "%% No default BGP instance%s", VTY_NEWLINE);
       return CMD_WARNING;
     }
-  if (! str2prefix_rd (vrf_name, &prd))
+  if (! prefix_str2rd (vrf_name, &prd))
     {
       vty_out (vty, "%% Invalid RD '%s'%s", vrf_name, VTY_NEWLINE);
       return CMD_WARNING;
@@ -8363,11 +8363,25 @@ DEFUN (show_ip_bgp_vrf,
        "show ip bgp vrf WORD",
        SHOW_STR
        IP_STR
-       BGP_STR)
+       BGP_STR
+       "VRF\n"
+       "Route Distinguisher\n")
 {
   return bgp_show_vrf (vty, argv[0], AFI_IP, bgp_show_type_normal, NULL);
 }
 
+DEFUN (show_ipv6_bgp_vrf,
+       show_ipv6_bgp_vrf_cmd,
+       "show ipv6 bgp vrf WORD",
+       SHOW_STR
+       IPV6_STR
+       BGP_STR
+       "VRF\n"
+       "Route Distinguisher\n")
+{
+  return bgp_show_vrf (vty, argv[0], AFI_IP6, bgp_show_type_normal, NULL);
+}
+
 DEFUN (show_ip_bgp_ipv4,
        show_ip_bgp_ipv4_cmd,
        "show ip bgp ipv4 (unicast|multicast)",
@@ -8438,14 +8452,28 @@ DEFUN (show_bgp_ipv4_safi_route_pathtype,
 
 DEFUN (show_ip_bgp_vrf_route,
        show_ip_bgp_vrf_route_cmd,
-       "show ip bgp vrf WORD (ipv4|ipv6) (A.B.C.D|X:X::X:X)",
+       "show ip bgp vrf WORD (A.B.C.D)",
        SHOW_STR
        IP_STR
        BGP_STR
        "VRF\n"
-       "Route Distinguisher\n")
+       "Route Distinguisher\n"
+       "IPv4 Address")
+{
+  return bgp_show_vrf_route (vty, argv[0], argv[2], AFI_IP, 0);
+}
+
+DEFUN (show_ipv6_bgp_vrf_route,
+       show_ipv6_bgp_vrf_route_cmd,
+       "show ipv6 bgp vrf WORD X:X::X:X",
+       SHOW_STR
+       IPV6_STR
+       BGP_STR
+       "VRF\n"
+       "Route Distinguisher\n"
+       "IPv6 Address")
 {
-  afi_t afi = (strncmp (argv[1], "ipv6", 4) == 0) ? AFI_IP6 : AFI_IP;
+  afi_t afi = AFI_IP6;
   return bgp_show_vrf_route (vty, argv[0], argv[2], afi, 0);
 }
 
@@ -18238,11 +18266,13 @@ bgp_route_init (void)
   /* old style commands */
   install_element (VIEW_NODE, &show_ip_bgp_cmd);
   install_element (VIEW_NODE, &show_ip_bgp_vrf_cmd);
+  install_element (VIEW_NODE, &show_ipv6_bgp_vrf_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_route_pathtype_cmd);
   install_element (VIEW_NODE, &show_bgp_ipv4_safi_route_pathtype_cmd);
   install_element (VIEW_NODE, &show_ip_bgp_vrf_route_cmd);
+  install_element (VIEW_NODE, &show_ipv6_bgp_vrf_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_bgp_l2vpn_evpn_all_route_cmd);
@@ -18337,6 +18367,7 @@ bgp_route_init (void)
   install_element (RESTRICTED_NODE, &show_ip_bgp_route_pathtype_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_ipv4_safi_route_pathtype_cmd);
   install_element (RESTRICTED_NODE, &show_ip_bgp_vrf_route_cmd);
+  install_element (RESTRICTED_NODE, &show_ipv6_bgp_vrf_route_cmd);
   install_element (RESTRICTED_NODE, &show_ip_bgp_ipv4_route_cmd);
   install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_all_route_cmd);
   install_element (RESTRICTED_NODE, &show_bgp_l2vpn_evpn_all_route_cmd);
-- 
2.1.4


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

Reply via email to