summaryrefslogtreecommitdiffstats
path: root/lib/if.c
diff options
context:
space:
mode:
authorpaul <paul>2002-12-13 21:03:13 +0000
committerpaul <paul>2002-12-13 21:03:13 +0000
commit3342537bdb9558c7076f356aa101f1f9035d087a (patch)
tree9c8e95600884bec20f00925b1f802807103d1d81 /lib/if.c
parent3ff790a0f2236be0e77b50ef3d84244efe694160 (diff)
downloadquagga-3342537bdb9558c7076f356aa101f1f9035d087a.tar.bz2
quagga-3342537bdb9558c7076f356aa101f1f9035d087a.tar.xz
zebra link state detection supportpatch.z12269.linkstate
Diffstat (limited to 'lib/if.c')
-rw-r--r--lib/if.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/if.c b/lib/if.c
index 0934e40d..ce3595d3 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -270,6 +270,22 @@ if_is_up (struct interface *ifp)
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)