summaryrefslogtreecommitdiff
path: root/source4/lib/replace/system
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-16 02:39:01 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:50:31 +0100
commitbe4decb2b73e3431155663c2dae3a8452ecde28a (patch)
tree41cff60fa2fb327fdb6e42b60b9d4ee246542fb3 /source4/lib/replace/system
parent1786af425bfcd156c8880a72e947197c0218841e (diff)
downloadsamba-be4decb2b73e3431155663c2dae3a8452ecde28a.tar.gz
samba-be4decb2b73e3431155663c2dae3a8452ecde28a.tar.bz2
samba-be4decb2b73e3431155663c2dae3a8452ecde28a.zip
r26467: Use getifaddrs() for interface enumeration and provide replacements for platforms that don't have it in lib/replace.
(This used to be commit 9b4924fbd8619033c55b4c6e2589da247332e7db)
Diffstat (limited to 'source4/lib/replace/system')
-rw-r--r--source4/lib/replace/system/network.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h
index d3ae2bf398..45d84e0386 100644
--- a/source4/lib/replace/system/network.h
+++ b/source4/lib/replace/system/network.h
@@ -6,6 +6,7 @@
networking system include wrappers
Copyright (C) Andrew Tridgell 2004
+ Copyright (C) Jelmer Vernooij 2007
** NOTE! The following LGPL license applies to the replace
** library. This does NOT imply that all of Samba is released
@@ -93,6 +94,30 @@ int rep_inet_pton(int af, const char *src, void *dst);
const char *rep_inet_ntop(int af, const void *src, char *dst, socklen_t size);
#endif
+#ifdef HAVE_IFADDRS_H
+#include <ifaddrs.h>
+#endif
+
+#ifndef HAVE_STRUCT_IFADDRS
+struct ifaddrs {
+ struct ifaddrs *ifa_next; /* Pointer to next struct */
+ char *ifa_name; /* Interface name */
+ u_int ifa_flags; /* Interface flags */
+ struct sockaddr *ifa_addr; /* Interface address */
+ struct sockaddr *ifa_netmask; /* Interface netmask */
+ struct sockaddr *ifa_dstaddr; /* P2P interface destination */
+ void *ifa_data; /* Address specific data */
+};
+#endif
+
+#ifndef HAVE_GETIFADDRS
+int rep_getifaddrs(struct ifaddrs **);
+#endif
+
+#ifndef HAVE_FREEIFADDRS
+int rep_freeifaddrs(struct ifaddrs **);
+#endif
+
/*
* Some systems have getaddrinfo but not the
* defines needed to use it.