[quagga-dev 238] bgpd: Views & IPv6

Jose Luis Rubio Guivernau jrubio at dit.upm.es
Thu Sep 11 11:19:46 BST 2003


Hello! First of all, I'am not sure this is the rigth place to send this, so if 
it's not, please let me know.

I'm working with quagga's bgpd and I need to use different views for IPv6 
peers. Apparently, the current version of quagga (0.96.2) does not include a 
set of "show bgp view ..." commands similar to the existing "show ip bgp 
view..." commands. The only commands currently supported are "show bgp view 
NAME summary" and "show bgp view NAME ipv6 summary".

As those commands are very necessary for my work, I've developed a patch that 
adds the following commands:

	- "show bgp view WORD"
	- "show bgp view WORD X:X::X:X"
	- "show bgp view WORD X:X::X:X/M"
	- "show bgp view WORD neighbors"
	- "show bgp view WORD neighbors (A.B.C.D.|X:X::X:X)"
	- "show bgp view WORD neighbors (A.B.C.D|X:X::X:X) advertised-routes"
	- "show bgp view WORD neighbors (A.B.C.D|X:X::X:X) received-routes"
	- "show bgp view WORD neighbors (A.B.C.D|X:X::X:X) routes"
	- "show bgp view WORD neighbors (A.B.C.D.|X:X::X:X) flap-statistics"
	- "show bgp view WORD neighbors (A.B.C.D.|X:X::X:X) dampened-routes"
	- "show bgp view WORD neighbors (A.B.C.D|X:X::X:X) received prefix-filter"
	- "show bgp neighbors (A.B.C.D.|X:X::X:X) flap-statistics"
	- "show bgp neighbors (A.B.C.D.|X:X::X:X) dampened-routes"

It also adds ALIAS for the corresponding "show bgp view WORD ipv6 ..." 
commands: 

	- "show bgp view WORD ipv6"
	- "show bgp view WORD ipv6 X:X::X:X"
	- "show bgp view WORD ipv6 X:X::X:X/M"
	...
	...
	...

The patch only affects the files: "bgpd/bgp_route.c" and "bgpd/bgp_vty.c"

As I said before, I'am not sure if this is the right place for this, but I'd 
like to post my patch here so anybody that finds it useful can use it.


	Jose Luis

================================================================
--- quagga-0.96.2_original/bgpd/bgp_route.c	2003-08-12 07:32:27.000000000 
+0200
+++ quagga-0.96.2/bgpd/bgp_route.c	2003-09-11 11:48:17.000000000 +0200
@@ -5305,6 +5305,70 @@
   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")
+{
+  return bgp_show (vty, argv[0], AFI_IP6, SAFI_UNICAST, 
bgp_show_type_normal);
+}
+
+ALIAS (show_bgp_view,
+       show_bgp_view_ipv6_cmd,
+       "show bgp view WORD ipv6",
+       SHOW_STR
+       BGP_STR             
+       "BGP view\n"
+       "View name\n"
+       "Address family\n")
+  
+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);
+}
+
+ALIAS (show_bgp_view_route,
+       show_bgp_view_ipv6_route_cmd,
+       "show bgp view WORD ipv6 X:X::X:X",
+       SHOW_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "Address family\n"
+       "Network in the BGP routing table to display\n")
+
+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); 
+}
+
+ALIAS (show_bgp_view_prefix,
+       show_bgp_view_ipv6_prefix_cmd,
+       "show bgp view WORD ipv6 X:X::X:X/M",
+       SHOW_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "Address family\n"
+       "IPv6 prefix <network>/<length>\n")  
+
 /* old command */
 DEFUN (show_ipv6_mbgp,
        show_ipv6_mbgp_cmd,
@@ -7269,9 +7333,21 @@
 				 bgp_show_type_prefix_longer);
 }
 #endif /* HAVE_IPV6 */
-
+
+/* 
+ * This function has been modified for supporting "show bgp view WORD 
neighbors ..." commands. A second argument
+ * "struct bgp *bgp" has been added to indicate the view that the show 
command refers to.
+ *
+ * The changes only affect to the "bgp_get_default()" call. Now this function 
is only called when the second argument
+ * "struct bgp *bgp" is NULL, in any other case the bgp structure received in 
the second argument is used. This allows the use of this
+ * function for displaying route information for peers in any view, and not 
only in the default view.
+ *
+ * The only call to this function is made from "peer_adj_route(...)" and has 
been changed to pass the new argument.
+ *
+ * Also, the local variable "struct bgp *bgp" has been removed, as now the 
argument with the same name is used instead.
+ */
 void
-show_adj_route (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi,
+show_adj_route (struct vty *vty, struct bgp *bgp, struct peer *peer, afi_t 
afi, safi_t safi,
 		int in)
 {
   struct bgp_table *table;
@@ -7280,10 +7356,10 @@
   unsigned long output_count;
   struct bgp_node *rn;
   int header1 = 1;
-  struct bgp *bgp;
   int header2 = 1;
 
-  bgp = bgp_get_default ();
+  if (!bgp)
+    bgp = bgp_get_default ();
 
   if (! bgp)
     return;
@@ -7359,20 +7435,48 @@
 	     VTY_NEWLINE, output_count, VTY_NEWLINE);
 }
 
+/*
+ * This function has been modified for supporting "show bgp view WORD 
neighbors ..." commands. A second argument
+ * "char *view_name" has been added to indicate the name of the view that the 
show command refers to.
+ *
+ * The changes only affect to the "peer_lookup (...)" call. When a view name 
is supplied in the second argument,
+ * the function "bgp_lookup_by_name" is used to get the bgp structure 
corresponding to that view. If the second
+ * argument is NULL, variable bgp is left NULL and the call to 
"peer_lookup(NULL, ...)" is exactly the same as
+ * it was in the previous version of this function.
+ *
+ * The existing calls to this function have been changed using "NULL" as 
their second argument. Because when called in
+ * that way, the function is exactly the same as the previous version.
+ */
 int
-peer_adj_routes (struct vty *vty, char *ip_str, afi_t afi, safi_t safi, int 
in)
+peer_adj_routes (struct vty *vty, char *view_name, char *ip_str, afi_t afi, 
safi_t safi, int in)
 {
   int ret;
   struct peer *peer;
+  struct bgp *bgp;
   union sockunion su;
 
+  /* BGP structure lookup. */
+  if (view_name)
+    {
+      bgp = bgp_lookup_by_name (view_name);
+      if (bgp == NULL)
+	{
+	  vty_out (vty, "Can't find BGP view %s%s", view_name, VTY_NEWLINE);
+	  return CMD_WARNING;
+	}
+    }
+  else
+    {
+      bgp = NULL;
+    }
+    
   ret = str2sockunion (ip_str, &su);
   if (ret < 0)
     {
       vty_out (vty, "Malformed address: %s%s", ip_str, VTY_NEWLINE);
       return CMD_WARNING;
     }
-  peer = peer_lookup (NULL, &su);
+  peer = peer_lookup (bgp, &su);
   if (! peer || ! peer->afc[afi][safi])
     {
       vty_out (vty, "%% No such neighbor or address family%s", VTY_NEWLINE);
@@ -7386,7 +7490,7 @@
       return CMD_WARNING;
     }
 
-  show_adj_route (vty, peer, afi, safi, in);
+  show_adj_route (vty, bgp, peer, afi, safi, in);
 
   return CMD_SUCCESS;
 }
@@ -7402,7 +7506,7 @@
        "Neighbor to display information about\n"
        "Display the routes advertised to a BGP neighbor\n")
 {
-  return peer_adj_routes (vty, argv[0], AFI_IP, SAFI_UNICAST, 0);
+  return peer_adj_routes (vty, NULL, argv[0], AFI_IP, SAFI_UNICAST, 0);
 }
 
 DEFUN (show_ip_bgp_ipv4_neighbor_advertised_route,
@@ -7420,9 +7524,9 @@
        "Display the routes advertised to a BGP neighbor\n")
 {
   if (strncmp (argv[0], "m", 1) == 0)
-    return peer_adj_routes (vty, argv[1], AFI_IP, SAFI_MULTICAST, 0);
+    return peer_adj_routes (vty, NULL, argv[1], AFI_IP, SAFI_MULTICAST, 0);
 
-  return peer_adj_routes (vty, argv[1], AFI_IP, SAFI_UNICAST, 0);
+  return peer_adj_routes (vty, NULL, argv[1], AFI_IP, SAFI_UNICAST, 0);
 }
 
 #ifdef HAVE_IPV6
@@ -7436,7 +7540,7 @@
        "Neighbor to display information about\n"
        "Display the routes advertised to a BGP neighbor\n")
 {
-  return peer_adj_routes (vty, argv[0], AFI_IP6, SAFI_UNICAST, 0);
+  return peer_adj_routes (vty, NULL, argv[0], AFI_IP6, SAFI_UNICAST, 0);
 }
 
 ALIAS (show_bgp_neighbor_advertised_route,
@@ -7462,7 +7566,7 @@
        "Neighbor to display information about\n"
        "Display the routes advertised to a BGP neighbor\n")
 {
-  return peer_adj_routes (vty, argv[0], AFI_IP6, SAFI_UNICAST, 0);
+  return peer_adj_routes (vty, NULL, argv[0], AFI_IP6, SAFI_UNICAST, 0);
 }
 
 /* old command */
@@ -7477,7 +7581,7 @@
        "Neighbor to display information about\n"
        "Display the routes advertised to a BGP neighbor\n")
 {
-  return peer_adj_routes (vty, argv[0], AFI_IP6, SAFI_MULTICAST, 0);
+  return peer_adj_routes (vty, NULL, argv[0], AFI_IP6, SAFI_MULTICAST, 0);
 }
 #endif /* HAVE_IPV6 */
 
@@ -7492,7 +7596,7 @@
        "Neighbor to display information about\n"
        "Display the received routes from neighbor\n")
 {
-  return peer_adj_routes (vty, argv[0], AFI_IP, SAFI_UNICAST, 1);
+  return peer_adj_routes (vty, NULL, argv[0], AFI_IP, SAFI_UNICAST, 1);
 }
 
 DEFUN (show_ip_bgp_ipv4_neighbor_received_routes,
@@ -7510,9 +7614,9 @@
        "Display the received routes from neighbor\n")
 {
   if (strncmp (argv[0], "m", 1) == 0)
-    return peer_adj_routes (vty, argv[1], AFI_IP, SAFI_MULTICAST, 1);
+    return peer_adj_routes (vty, NULL, argv[1], AFI_IP, SAFI_MULTICAST, 1);
 
-  return peer_adj_routes (vty, argv[1], AFI_IP, SAFI_UNICAST, 1);
+  return peer_adj_routes (vty, NULL, argv[1], AFI_IP, SAFI_UNICAST, 1);
 }
 
 DEFUN (show_ip_bgp_neighbor_received_prefix_filter,
@@ -7615,7 +7719,7 @@
        "Neighbor to display information about\n"
        "Display the received routes from neighbor\n")
 {
-  return peer_adj_routes (vty, argv[0], AFI_IP6, SAFI_UNICAST, 1);
+  return peer_adj_routes (vty, NULL, argv[0], AFI_IP6, SAFI_UNICAST, 1);
 }
 
 ALIAS (show_bgp_neighbor_received_routes,
@@ -7688,7 +7792,7 @@
        "Neighbor to display information about\n"
        "Display the received routes from neighbor\n")
 {
-  return peer_adj_routes (vty, argv[0], AFI_IP6, SAFI_UNICAST, 1);
+  return peer_adj_routes (vty, NULL, argv[0], AFI_IP6, SAFI_UNICAST, 1);
 }
 
 /* old command */
@@ -7703,8 +7807,124 @@
        "Neighbor to display information about\n"
        "Display the received routes from neighbor\n")
 {
-  return peer_adj_routes (vty, argv[0], AFI_IP6, SAFI_MULTICAST, 1);
+  return peer_adj_routes (vty, NULL, argv[0], AFI_IP6, SAFI_MULTICAST, 1);
 }
+
+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")
+{
+  return peer_adj_routes (vty, argv[0], argv[1], AFI_IP6, SAFI_UNICAST, 0);
+}
+
+ALIAS (show_bgp_view_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
+       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 the routes advertised to a BGP neighbor\n")
+
+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")
+{
+  return peer_adj_routes (vty, argv[0], argv[1], AFI_IP6, SAFI_UNICAST, 1);
+}
+
+ALIAS (show_bgp_view_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
+       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 the received routes from neighbor\n")
+
+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
+       "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 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;
+
+  /* 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;
+	}
+  
+  su = sockunion_str2su (argv[1]);
+  if (su == NULL)
+    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;
+}
+
+ALIAS (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",
+       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")
 #endif /* HAVE_IPV6 */
 
 void
@@ -7716,13 +7936,41 @@
   XFREE (MTYPE_SOCKUNION, su);
 }
 
+/*
+ * This function has been modified for supporting "show bgp view WORD 
neighbors ..." commands. A second argument
+ * "char *view_name" has been added to indicate the name of the view that the 
show command refers to.
+ *
+ * The changes only affect to the "peer_lookup (...)" call. When a view name 
is supplied in the second argument,
+ * the function "bgp_lookup_by_name" is used to get the bgp structure 
corresponding to that view. If the second
+ * argument is NULL, variable bgp is left NULL and the call to 
"peer_lookup(NULL, ...)" is exactly the same as
+ * it was in the previous version of this function.
+ *
+ * The existing calls to this function have been changed using "NULL" as 
their second argument. Because when called in
+ * that way, the function is exactly the same as the previous version.
+ */
 int
-bgp_show_neighbor_route (struct vty *vty, char *ip_str, afi_t afi,
+bgp_show_neighbor_route (struct vty *vty, char *view_name, char *ip_str, 
afi_t afi,
 			 safi_t safi, enum bgp_show_type type)
 {
   union sockunion *su;
   struct peer *peer;
+  struct bgp *bgp;
 
+  /* BGP structure lookup. */
+  if (view_name)
+    {
+      bgp = bgp_lookup_by_name (view_name);
+      if (bgp == NULL)
+	{
+	  vty_out (vty, "Can't find BGP view %s%s", view_name, VTY_NEWLINE);
+	  return CMD_WARNING;
+	}
+    }
+  else
+    {
+      bgp = NULL;
+    }
+  
   su = sockunion_str2su (ip_str);
   if (su == NULL)
     {
@@ -7730,7 +7978,7 @@
 	       return CMD_WARNING;
     }
 
-  peer = peer_lookup (NULL, su);
+  peer = peer_lookup (bgp, su);
   if (! peer || ! peer->afc[afi][safi])
     {
       vty_out (vty, "%% No such neighbor or address family%s", VTY_NEWLINE);
@@ -7741,7 +7989,7 @@
   vty->output_arg = su;
   vty->output_clean = bgp_show_neighbor_route_clean;
 
-  return bgp_show (vty, NULL, afi, safi, type);
+  return bgp_show (vty, view_name, afi, safi, type);
 }
 
 DEFUN (show_ip_bgp_neighbor_routes,
@@ -7755,7 +8003,7 @@
        "Neighbor to display information about\n"
        "Display routes learned from neighbor\n")
 {
-  return bgp_show_neighbor_route (vty, argv[0], AFI_IP, SAFI_UNICAST,
+  return bgp_show_neighbor_route (vty, NULL, argv[0], AFI_IP, SAFI_UNICAST,
 				  bgp_show_type_neighbor);
 }
 
@@ -7770,7 +8018,7 @@
        "Neighbor to display information about\n"
        "Display flap statistics of the routes learned from neighbor\n")
 {
-  return bgp_show_neighbor_route (vty, argv[0], AFI_IP, SAFI_UNICAST,
+  return bgp_show_neighbor_route (vty, NULL, argv[0], AFI_IP, SAFI_UNICAST,
 				  bgp_show_type_flap_neighbor);
 }
 
@@ -7785,7 +8033,7 @@
        "Neighbor to display information about\n"
        "Display the dampened routes received from neighbor\n")
 {
-  return bgp_show_neighbor_route (vty, argv[0], AFI_IP, SAFI_UNICAST,
+  return bgp_show_neighbor_route (vty, NULL, argv[0], AFI_IP, SAFI_UNICAST,
 				  bgp_show_type_damp_neighbor);
 }
 
@@ -7804,10 +8052,10 @@
        "Display routes learned from neighbor\n")
 {
   if (strncmp (argv[0], "m", 1) == 0)
-    return bgp_show_neighbor_route (vty, argv[1], AFI_IP, SAFI_MULTICAST,
+    return bgp_show_neighbor_route (vty, NULL, argv[1], AFI_IP, 
SAFI_MULTICAST,
 				    bgp_show_type_neighbor);
 
-  return bgp_show_neighbor_route (vty, argv[1], AFI_IP, SAFI_UNICAST,
+  return bgp_show_neighbor_route (vty, NULL, argv[1], AFI_IP, SAFI_UNICAST,
 				  bgp_show_type_neighbor);
 }
 #ifdef HAVE_IPV6
@@ -7821,7 +8069,7 @@
        "Neighbor to display information about\n"
        "Display routes learned from neighbor\n")
 {
-  return bgp_show_neighbor_route (vty, argv[0], AFI_IP6, SAFI_UNICAST,
+  return bgp_show_neighbor_route (vty, NULL, argv[0], AFI_IP6, SAFI_UNICAST,
 				  bgp_show_type_neighbor);
 }
 
@@ -7848,7 +8096,7 @@
        "Neighbor to display information about\n"
        "Display routes learned from neighbor\n")
 {
-  return bgp_show_neighbor_route (vty, argv[0], AFI_IP6, SAFI_UNICAST,
+  return bgp_show_neighbor_route (vty, NULL, argv[0], AFI_IP6, SAFI_UNICAST,
 				  bgp_show_type_neighbor);
 }
 
@@ -7864,9 +8112,146 @@
        "Neighbor to display information about\n"
        "Display routes learned from neighbor\n")
 {
-  return bgp_show_neighbor_route (vty, argv[0], AFI_IP6, SAFI_MULTICAST,
+  return bgp_show_neighbor_route (vty, NULL, argv[0], AFI_IP6, 
SAFI_MULTICAST,
 				  bgp_show_type_neighbor);
 }
+
+DEFUN (show_bgp_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")
+{
+  return bgp_show_neighbor_route (vty, NULL, argv[0], AFI_IP6, SAFI_UNICAST,
+				  bgp_show_type_flap_neighbor);
+}
+
+ALIAS (show_bgp_neighbor_flap,
+       show_bgp_ipv6_neighbor_flap_cmd,
+       "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X) flap-statistics",
+       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 flap statistics of the routes learned from neighbor\n")
+
+DEFUN (show_bgp_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")
+{
+  return bgp_show_neighbor_route (vty, NULL, argv[0], AFI_IP6, SAFI_UNICAST,
+				  bgp_show_type_damp_neighbor);
+}
+
+ALIAS (show_bgp_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")
+
+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"
+       "BGP 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")
+{
+  return bgp_show_neighbor_route (vty, argv[0], argv[1], AFI_IP6, 
SAFI_UNICAST,
+				  bgp_show_type_neighbor);
+}
+
+ALIAS (show_bgp_view_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
+       BGP_STR
+       "BGP view\n"
+       "BGP 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 routes learned from neighbor\n")
+
+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"
+       "BGP 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")
+{
+  return bgp_show_neighbor_route (vty, argv[0], argv[1], AFI_IP6, 
SAFI_UNICAST,
+				  bgp_show_type_damp_neighbor);
+}
+
+ALIAS (show_bgp_view_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
+       BGP_STR
+       "BGP view\n"
+       "BGP 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 the dampened routes received from neighbor\n")
+
+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"
+       "BGP 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")
+{
+  return bgp_show_neighbor_route (vty, argv[0], argv[1], AFI_IP6, 
SAFI_UNICAST,
+				  bgp_show_type_flap_neighbor);
+}
+
+ALIAS (show_bgp_view_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
+       BGP_STR
+       "BGP view\n"
+       "BGP 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 flap statistics of the routes learned from neighbor\n")
 #endif /* HAVE_IPV6 */
 
 struct bgp_table *bgp_distance_table;
@@ -8905,6 +9290,28 @@
   install_element (VIEW_NODE, &show_bgp_ipv6_neighbor_routes_cmd);
   install_element (VIEW_NODE, &show_bgp_neighbor_received_prefix_filter_cmd);
   install_element (VIEW_NODE, 
&show_bgp_ipv6_neighbor_received_prefix_filter_cmd);
+  install_element (VIEW_NODE, &show_bgp_neighbor_flap_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_neighbor_flap_cmd);
+  install_element (VIEW_NODE, &show_bgp_neighbor_damp_cmd);
+  install_element (VIEW_NODE, &show_bgp_ipv6_neighbor_damp_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_ipv6_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_route_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_ipv6_route_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_prefix_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_ipv6_prefix_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_neighbor_advertised_route_cmd);
+  install_element (VIEW_NODE, 
&show_bgp_view_ipv6_neighbor_advertised_route_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_neighbor_received_routes_cmd);
+  install_element (VIEW_NODE, 
&show_bgp_view_ipv6_neighbor_received_routes_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_neighbor_routes_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_ipv6_neighbor_routes_cmd);
+  install_element (VIEW_NODE, 
&show_bgp_view_neighbor_received_prefix_filter_cmd);
+  install_element (VIEW_NODE, 
&show_bgp_view_ipv6_neighbor_received_prefix_filter_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_neighbor_flap_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_ipv6_neighbor_flap_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_neighbor_damp_cmd);
+  install_element (VIEW_NODE, &show_bgp_view_ipv6_neighbor_damp_cmd); 
 
   install_element (ENABLE_NODE, &show_bgp_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv6_cmd);
@@ -8952,6 +9359,28 @@
   install_element (ENABLE_NODE, &show_bgp_ipv6_neighbor_routes_cmd);
   install_element (ENABLE_NODE, 
&show_bgp_neighbor_received_prefix_filter_cmd);
   install_element (ENABLE_NODE, 
&show_bgp_ipv6_neighbor_received_prefix_filter_cmd);
+  install_element (ENABLE_NODE, &show_bgp_neighbor_flap_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_neighbor_flap_cmd);
+  install_element (ENABLE_NODE, &show_bgp_neighbor_damp_cmd);
+  install_element (ENABLE_NODE, &show_bgp_ipv6_neighbor_damp_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_ipv6_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_route_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_ipv6_route_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_prefix_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_ipv6_prefix_cmd);
+  install_element (ENABLE_NODE, 
&show_bgp_view_neighbor_advertised_route_cmd);
+  install_element (ENABLE_NODE, 
&show_bgp_view_ipv6_neighbor_advertised_route_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_neighbor_received_routes_cmd);
+  install_element (ENABLE_NODE, 
&show_bgp_view_ipv6_neighbor_received_routes_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_neighbor_routes_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_ipv6_neighbor_routes_cmd);
+  install_element (ENABLE_NODE, 
&show_bgp_view_neighbor_received_prefix_filter_cmd);
+  install_element (ENABLE_NODE, 
&show_bgp_view_ipv6_neighbor_received_prefix_filter_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_neighbor_flap_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_ipv6_neighbor_flap_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_neighbor_damp_cmd);
+  install_element (ENABLE_NODE, &show_bgp_view_ipv6_neighbor_damp_cmd);
 
   /* old command */
   install_element (VIEW_NODE, &show_ipv6_bgp_cmd);
@@ -8990,7 +9419,7 @@
   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);
-
+  
   /* old command */
   install_element (ENABLE_NODE, &show_ipv6_bgp_cmd);
   install_element (ENABLE_NODE, &show_ipv6_bgp_route_cmd);
--- quagga-0.96.2_original/bgpd/bgp_vty.c	2003-08-13 02:32:50.000000000 +0200
+++ quagga-0.96.2/bgpd/bgp_vty.c	2003-09-11 11:04:01.000000000 +0200
@@ -6973,6 +6973,25 @@
   return bgp_show_neighbor_vty (vty, argv[0], show_all, NULL);
 }
 
+ALIAS (show_ip_bgp_instance_neighbors,
+       show_bgp_instance_neighbors_cmd,
+       "show bgp view WORD neighbors",
+       SHOW_STR
+       BGP_STR
+       "BGP view\n"
+       "View name\n"
+       "Detailed information on TCP and BGP neighbor connections\n")
+
+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)",
@@ -6987,7 +7006,30 @@
 {
   return bgp_show_neighbor_vty (vty, argv[0], show_peer, argv[1]);
 }
-
+
+ALIAS (show_ip_bgp_instance_neighbors_peer,
+       show_bgp_instance_neighbors_peer_cmd,
+       "show bgp view WORD neighbors (A.B.C.D|X:X::X:X)",
+       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")
+
+ALIAS (show_ip_bgp_instance_neighbors_peer,
+       show_bgp_instance_ipv6_neighbors_peer_cmd,
+       "show bgp view WORD ipv6 neighbors (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")
+       
 /* 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.*/
@@ -8502,10 +8544,18 @@
   install_element (VIEW_NODE, &show_bgp_ipv6_neighbors_cmd);
   install_element (VIEW_NODE, &show_bgp_neighbors_peer_cmd);
   install_element (VIEW_NODE, &show_bgp_ipv6_neighbors_peer_cmd);
+  install_element (VIEW_NODE, &show_bgp_instance_neighbors_cmd);
+  install_element (VIEW_NODE, &show_bgp_instance_ipv6_neighbors_cmd);
+  install_element (VIEW_NODE, &show_bgp_instance_neighbors_peer_cmd);
+  install_element (VIEW_NODE, &show_bgp_instance_ipv6_neighbors_peer_cmd);
   install_element (ENABLE_NODE, &show_bgp_neighbors_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv6_neighbors_cmd);
   install_element (ENABLE_NODE, &show_bgp_neighbors_peer_cmd);
   install_element (ENABLE_NODE, &show_bgp_ipv6_neighbors_peer_cmd);
+  install_element (ENABLE_NODE, &show_bgp_instance_neighbors_cmd);
+  install_element (ENABLE_NODE, &show_bgp_instance_ipv6_neighbors_cmd);
+  install_element (ENABLE_NODE, &show_bgp_instance_neighbors_peer_cmd);
+  install_element (ENABLE_NODE, &show_bgp_instance_ipv6_neighbors_peer_cmd);
 
   /* Old commands.  */
   install_element (VIEW_NODE, &show_ipv6_bgp_summary_cmd);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: quagga_0.96.2_bgpd_09082003.patch
Type: text/x-diff
Size: 29866 bytes
Desc: not available
URL: <http://lists.quagga.net/pipermail/quagga-dev/attachments/20030911/ca860b0d/attachment-0001.bin>


More information about the Quagga-dev mailing list