aboutsummaryrefslogtreecommitdiff
path: root/socket_getifidx.c
diff options
context:
space:
mode:
Diffstat (limited to 'socket_getifidx.c')
-rw-r--r--socket_getifidx.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/socket_getifidx.c b/socket_getifidx.c
new file mode 100644
index 0000000..c71fc48
--- /dev/null
+++ b/socket_getifidx.c
@@ -0,0 +1,13 @@
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include "socket.h"
+#include "haven2i.h"
+
+uint32 socket_getifidx(const char* ifname) {
+#ifdef HAVE_N2I
+ return if_nametoindex(ifname);
+#else
+ return 0;
+#endif
+}