From 6833d97a2314ddce5a7a65402c0afba37e8913c4 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Wed, 7 Jan 2009 01:17:39 +0100 Subject: iftable: add nlif_get_ifflags to get the network interface flags This patch adds the nlif_get_ifflags to get the interface flags. This patch also modifies the example file to display if a network interface is running or not. Signed-off-by: Pablo Neira Ayuso --- utils/iftest.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'utils') diff --git a/utils/iftest.c b/utils/iftest.c index 61d066a..2bbe3a3 100644 --- a/utils/iftest.c +++ b/utils/iftest.c @@ -3,6 +3,7 @@ #include #include #include +#include #include @@ -21,10 +22,14 @@ int main() for (i=0; i<64; i++) { char name[IFNAMSIZ]; + unsigned int flags; if (nlif_index2name(h, i, name) == -1) continue; - printf("index (%d) is %s\n", i, name); + if (nlif_get_ifflags(h, i, &flags) == -1) + continue; + printf("index (%d) is %s (%s)\n", i, name, + flags & IFF_RUNNING ? "RUNNING" : "NOT RUNNING"); } nlif_close(h); -- cgit v1.2.3