]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: fix up compilation without rtadv/IPv6
authorJoachim Nilsson <troglobit@gmail.com>
Wed, 9 May 2012 11:38:36 +0000 (13:38 +0200)
committerDavid Lamparter <equinox@diac24.net>
Wed, 9 May 2012 11:51:54 +0000 (13:51 +0200)
let's ground the rtadv.h file if route advertisements are disabled. And
fix up the CLI for it, as well as move the "show ip mroute" to its
proper place.

  * zebra/rtadv.h: #ifdef RTADV
  * zebra/main.c: #ifdef RTADV
  * zebra/zebra_vty.c: move "show ip mroute" out of #ifdef IPV6

From: Joachim Nilsson <troglobit@gmail.com>
[moved #ifdef RTADV to rtadv.h]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
zebra/main.c
zebra/rtadv.h
zebra/zebra_vty.c

index 5f26ce243cd3d5c20f6976f88a7145fc9df3c07e..5b5265f27fd45b8afd459ffca25f6253aca02fcf 100644 (file)
@@ -327,7 +327,9 @@ main (int argc, char **argv)
   zebra_vty_init ();
   access_list_init ();
   prefix_list_init ();
+#ifdef RTADV
   rtadv_init ();
+#endif
 #ifdef HAVE_IRDP
   irdp_init();
 #endif
index 564a4c66de56b744ebc334786bb0e71a293f94da..8cb933e0be9730cc7ed288175994afb20a090751 100644 (file)
@@ -26,6 +26,9 @@
 #include "vty.h"
 #include "zebra/interface.h"
 
+/* NB: RTADV is defined in zebra/interface.h above */
+#ifdef RTADV
+
 /* Router advertisement prefix. */
 struct rtadv_prefix
 {
@@ -96,4 +99,6 @@ struct nd_opt_homeagent_info {  /* Home Agent info */
 
 extern const char *rtadv_pref_strs[];
 
+#endif /* RTADV */
+
 #endif /* _ZEBRA_RTADV_H */
index 8a57be91672a9c53664aca005f9f9faca13c3460..743c13fe7471364e2ffb834104cdb376be362a8e 100644 (file)
@@ -1197,6 +1197,40 @@ DEFUN (show_ip_protocol,
     return CMD_SUCCESS;
 }
 
+/*
+ * Show IP mroute command to dump the BGP Multicast
+ * routing table
+ */
+DEFUN (show_ip_mroute,
+       show_ip_mroute_cmd,
+       "show ip mroute",
+       SHOW_STR
+       IP_STR
+       "IP Multicast routing table\n")
+{
+  struct route_table *table;
+  struct route_node *rn;
+  struct rib *rib;
+  int first = 1;
+
+  table = vrf_table (AFI_IP, SAFI_MULTICAST, 0);
+  if (! table)
+    return CMD_SUCCESS;
+
+  /* Show all IPv4 routes. */
+  for (rn = route_top (table); rn; rn = route_next (rn))
+    for (rib = rn->info; rib; rib = rib->next)
+      {
+       if (first)
+         {
+          vty_out (vty, SHOW_ROUTE_V4_HEADER);
+           first = 0;
+         }
+       vty_show_ip_route (vty, rn, rib);
+      }
+  return CMD_SUCCESS;
+}
+
 \f
 #ifdef HAVE_IPV6
 /* General fucntion for IPv6 static route. */
@@ -1951,40 +1985,6 @@ DEFUN (show_ipv6_route_summary,
   return CMD_SUCCESS;
 }
 
-/*
- * Show IP mroute command to dump the BGP Multicast 
- * routing table
- */
-DEFUN (show_ip_mroute,
-       show_ip_mroute_cmd,
-       "show ip mroute",
-       SHOW_STR
-       IP_STR
-       "IP Multicast routing table\n")
-{
-  struct route_table *table;
-  struct route_node *rn;
-  struct rib *rib;
-  int first = 1;
-
-  table = vrf_table (AFI_IP, SAFI_MULTICAST, 0);
-  if (! table)
-    return CMD_SUCCESS;
-
-  /* Show all IPv4 routes. */
-  for (rn = route_top (table); rn; rn = route_next (rn))
-    for (rib = rn->info; rib; rib = rib->next)
-      {
-       if (first)
-         {
-          vty_out (vty, SHOW_ROUTE_V4_HEADER);
-           first = 0;
-         }
-       vty_show_ip_route (vty, rn, rib);
-      }
-  return CMD_SUCCESS;
-}
-
 /*
  * Show IPv6 mroute command.Used to dump
  * the Multicast routing table.
@@ -2020,11 +2020,6 @@ DEFUN (show_ipv6_mroute,
   return CMD_SUCCESS;
 }
 
-
-
-
-
-
 /* Write IPv6 static route configuration. */
 static int
 static_config_ipv6 (struct vty *vty)