zebra link state detection support
diff --git a/lib/if.c b/lib/if.c
index 0934e40..ce3595d 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -270,6 +270,22 @@
   return ifp->flags & IFF_UP;
 }
 
+/* Is interface running? */
+int
+if_is_running (struct interface *ifp)
+{
+  return ifp->flags & IFF_RUNNING;
+}
+
+/* Is the interface operative, eg. either UP & RUNNING
+   or UP & !ZEBRA_INTERFACE_LINK_DETECTION */
+int
+if_is_operative (struct interface *ifp)
+{
+  return ((ifp->flags & IFF_UP) &&
+	  (ifp->flags & IFF_RUNNING || !CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_LINKDETECTION)));
+}
+
 /* Is this loopback interface ? */
 int
 if_is_loopback (struct interface *ifp)