[zebra] remove internal if_flag_dump, use libzebras version.

2006-06-15 Paul Jakma <paul.jakma@sun.com>

	* lib/if.c: (if_flag_dump) remove the whitespace indentation, callers
	  should provide.
	* zebra/interface.c: (if_flag_dump_vty) redundant code, remove.
	  (if_dump_vty) use libzebra if_flag_dump.
diff --git a/lib/ChangeLog b/lib/ChangeLog
index a9c3b8b..d031d8f 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -5,6 +5,8 @@
 	  pointer.
 	* linklist.c: (list_delete) call list_delete_all_node, don't
 	  duplicate it.
+	* if.c: (if_flag_dump) remove the whitespace indentation, callers
+	  should provide.
 
 2006-05-28 Paul Jakma <paul.jakma@sun.com>
 
diff --git a/lib/if.c b/lib/if.c
index df76126..c43d956 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -405,7 +405,7 @@
       strlcat (logbuf, STR, BUFSIZ); \
     }
 
-  strlcpy (logbuf, "  <", BUFSIZ);
+  strlcpy (logbuf, "<", BUFSIZ);
   IFF_OUT_LOG (IFF_UP, "UP");
   IFF_OUT_LOG (IFF_BROADCAST, "BROADCAST");
   IFF_OUT_LOG (IFF_DEBUG, "DEBUG");
@@ -431,6 +431,7 @@
   strlcat (logbuf, ">", BUFSIZ);
 
   return logbuf;
+#undef IFF_OUT_LOG
 }
 
 /* For debugging */
diff --git a/zebra/ChangeLog b/zebra/ChangeLog
index e70efae..c31e350 100644
--- a/zebra/ChangeLog
+++ b/zebra/ChangeLog
@@ -1,3 +1,8 @@
+2006-06-15 Paul Jakma <paul.jakma@sun.com>
+
+	* interface.c: (if_flag_dump_vty) redundant code, remove.
+	  (if_dump_vty) use libzebra if_flag_dump.
+
 2006-05-21 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
 
 	* connected.c: (connected_withdraw) Do not delete the connected
diff --git a/zebra/interface.c b/zebra/interface.c
index 3919c3f..e386047 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -548,46 +548,6 @@
   if_get_flags (ifp);
 }
 
-/* Printout flag information into vty */
-static void
-if_flag_dump_vty (struct vty *vty, uint64_t flag)
-{
-  int separator = 0;
-
-#define IFF_OUT_VTY(X, Y) \
-  if ((X) && (flag & (X))) \
-    { \
-      if (separator) \
-	vty_out (vty, ","); \
-      else \
-	separator = 1; \
-      vty_out (vty, Y); \
-    }
-
-  vty_out (vty, "<");
-  IFF_OUT_VTY (IFF_UP, "UP");
-  IFF_OUT_VTY (IFF_BROADCAST, "BROADCAST");
-  IFF_OUT_VTY (IFF_DEBUG, "DEBUG");
-  IFF_OUT_VTY (IFF_LOOPBACK, "LOOPBACK");
-  IFF_OUT_VTY (IFF_POINTOPOINT, "POINTOPOINT");
-  IFF_OUT_VTY (IFF_NOTRAILERS, "NOTRAILERS");
-  IFF_OUT_VTY (IFF_RUNNING, "RUNNING");
-  IFF_OUT_VTY (IFF_NOARP, "NOARP");
-  IFF_OUT_VTY (IFF_PROMISC, "PROMISC");
-  IFF_OUT_VTY (IFF_ALLMULTI, "ALLMULTI");
-  IFF_OUT_VTY (IFF_OACTIVE, "OACTIVE");
-  IFF_OUT_VTY (IFF_SIMPLEX, "SIMPLEX");
-  IFF_OUT_VTY (IFF_LINK0, "LINK0");
-  IFF_OUT_VTY (IFF_LINK1, "LINK1");
-  IFF_OUT_VTY (IFF_LINK2, "LINK2");
-  IFF_OUT_VTY (IFF_MULTICAST, "MULTICAST");
-#ifdef SOLARIS_IPV6
-  IFF_OUT_VTY (IFF_VIRTUAL, "IFF_VIRTUAL");
-  IFF_OUT_VTY (IFF_NOXMIT, "IFF_NOXMIT");
-#endif /* SOLARIS_IPV6 */
-  vty_out (vty, ">");
-}
-
 /* Output prefix string to vty. */
 static int
 prefix_vty_out (struct vty *vty, struct prefix *p)
@@ -740,12 +700,9 @@
   if (ifp->mtu6 != ifp->mtu)
     vty_out (vty, "mtu6 %d ", ifp->mtu6);
 #endif 
-  vty_out (vty, "%s  flags: ", VTY_NEWLINE);
+  vty_out (vty, "%s  flags: %s%s", VTY_NEWLINE,
+           if_flag_dump (ifp->flags), VTY_NEWLINE);
   
-  if_flag_dump_vty (vty, ifp->flags);
-
-  vty_out (vty, "%s", VTY_NEWLINE);
-
   /* Hardware address. */
 #ifdef HAVE_SOCKADDR_DL
   sdl = &ifp->sdl;