summaryrefslogtreecommitdiff
path: root/lib/mlibc/options/linux/include/ifaddrs.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mlibc/options/linux/include/ifaddrs.h')
-rw-r--r--lib/mlibc/options/linux/include/ifaddrs.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/mlibc/options/linux/include/ifaddrs.h b/lib/mlibc/options/linux/include/ifaddrs.h
new file mode 100644
index 0000000..2604e3e
--- /dev/null
+++ b/lib/mlibc/options/linux/include/ifaddrs.h
@@ -0,0 +1,35 @@
+
+#ifndef _IFADDRS_H
+#define _IFADDRS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <netinet/in.h>
+#include <sys/socket.h>
+
+// Struct definitions taken from musl
+struct ifaddrs {
+ struct ifaddrs *ifa_next;
+ char *ifa_name;
+ unsigned ifa_flags;
+ struct sockaddr *ifa_addr;
+ struct sockaddr *ifa_netmask;
+ struct sockaddr *ifa_broadaddr;
+ struct sockaddr *ifa_dstaddr;
+ void *ifa_data;
+};
+
+#ifndef __MLIBC_ABI_ONLY
+
+int getifaddrs(struct ifaddrs **);
+void freeifaddrs(struct ifaddrs *);
+
+#endif /* !__MLIBC_ABI_ONLY */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _IFADDRS_H