#ifndef _NET_IF_H
#define _NET_IF_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define IF_NAMESIZE 16
struct if_nameindex
-#ifdef _GNU_SOURCE
+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#include <sys/socket.h>
#endif
-
+#ifdef __cplusplus
+}
+#endif
#endif