diff options
Diffstat (limited to 'utils')
-rw-r--r-- | utils/iftest.c | 7 |
1 files changed, 6 insertions, 1 deletions
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 <stdio.h> #include <stdlib.h> #include <errno.h> +#include <net/if.h> #include <libnfnetlink/libnfnetlink.h> @@ -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); |