summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Jakma <paul.jakma@sun.com>2006-06-15 12:48:17 +0000
committerPaul Jakma <paul.jakma@sun.com>2006-06-15 12:48:17 +0000
commit630c97ce0f87a719f678a24bd84945d4f145fdc5 (patch)
tree1b87b2247617af51556f24a45b6735674d7f948d
parentc024fd0c76bc305cd6b6bab0989226bd9ec5e763 (diff)
[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.
-rw-r--r--lib/ChangeLog2
-rw-r--r--lib/if.c3
-rw-r--r--zebra/ChangeLog5
-rw-r--r--zebra/interface.c47
4 files changed, 11 insertions, 46 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog
index a9c3b8bf..d031d8f5 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 df761265..c43d9564 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -405,7 +405,7 @@ if_flag_dump (unsigned long flag)
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 @@ if_flag_dump (unsigned long flag)
strlcat (logbuf, ">", BUFSIZ);
return logbuf;
+#undef IFF_OUT_LOG
}
/* For debugging */
diff --git a/zebra/ChangeLog b/zebra/ChangeLog
index e70efaee..c31e3504 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 3919c3f1..e386047f 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -548,46 +548,6 @@ if_refresh (struct interface *ifp)
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_dump_vty (struct vty *vty, struct interface *ifp)
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;