r17586: merge lib/netif into lib/socket and use -lnsl -lsocket on the
authorStefan Metzmacher <metze@samba.org>
Thu, 17 Aug 2006 13:37:04 +0000 (13:37 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:15:39 +0000 (14:15 -0500)
configure check for the interfaces.

should fix the build on some old sun boxes

metze

32 files changed:
source/cldap_server/cldap_server.c
source/cldap_server/netlogon.c
source/heimdal_build/glue.c
source/kdc/kdc.c
source/ldap_server/ldap_server.c
source/lib/basic.mk
source/lib/netif/config.m4 [deleted file]
source/lib/socket/config.m4
source/lib/socket/config.mk
source/lib/socket/interface.c [moved from source/lib/netif/interface.c with 99% similarity]
source/lib/socket/netif.c [moved from source/lib/netif/netif.c with 100% similarity]
source/lib/socket/netif.h [moved from source/lib/netif/netif.h with 96% similarity]
source/libcli/resolve/bcast.c
source/libcli/resolve/nbtlist.c
source/libcli/wrepl/winsrepl.c
source/nbt_server/interfaces.c
source/nbt_server/nbt_server.c
source/nbt_server/wins/wins_ldb.c
source/nbt_server/wins/winsdb.c
source/rpc_server/dcerpc_sock.c
source/scripting/ejs/smbcalls_config.c
source/scripting/ejs/smbcalls_sys.c
source/smb_server/smb_server.c
source/torture/local/socket.c
source/torture/nbt/dgram.c
source/torture/nbt/register.c
source/torture/nbt/wins.c
source/torture/nbt/winsbench.c
source/torture/nbt/winsreplication.c
source/utils/nmblookup.c
source/web_server/web_server.c
source/wrepl_server/wrepl_in_connection.c

index 3687eb52188a0087c7b5ef605c9cba4b781b3e1f..4c1c7b86c5399ac4a8f7596a763114879d849ab8 100644 (file)
@@ -28,7 +28,7 @@
 #include "smbd/service.h"
 #include "cldap_server/cldap_server.h"
 #include "system/network.h"
-#include "netif/netif.h"
+#include "lib/socket/netif.h"
 
 /*
   handle incoming cldap requests
index 903764abf1cff0d06bf334be0fb80518a033e516..4e7274f483443363ec6b0dd685734eecc9bc0d74 100644 (file)
@@ -33,7 +33,7 @@
 #include "auth/auth.h"
 #include "db_wrap.h"
 #include "system/network.h"
-#include "netif/netif.h"
+#include "lib/socket/netif.h"
 
 /*
   fill in the cldap netlogon union for a given version
index bf64360c433627b293bf4b780ed596a44b62d6c8..333b768fef699e033768ab6b7033733f6e2def82 100644 (file)
@@ -23,7 +23,7 @@
 #include "includes.h"
 #include "system/network.h"
 #include "system/kerberos.h"
-#include "netif/netif.h"
+#include "lib/socket/netif.h"
 
 /*
   get the list of IP addresses for configured interfaces
index 10e0764e233381d872c922760a4a008c80e24db6..c9df63a2113368d7f81468e3e1f609f479451f9d 100644 (file)
@@ -35,7 +35,7 @@
 #include "lib/messaging/irpc.h"
 #include "lib/stream/packet.h"
 #include "librpc/gen_ndr/samr.h"
-#include "netif/netif.h"
+#include "lib/socket/netif.h"
 
 /* hold all the info needed to send a reply */
 struct kdc_reply {
index 718e3e07739fc2ff1b77c2e7692e2b347c43eba1..9b4055f8cf674ef04960f47dc2f9a2303ffc5890 100644 (file)
@@ -36,7 +36,7 @@
 #include "lib/ldb/include/ldb.h"
 #include "lib/ldb/include/ldb_errors.h"
 #include "system/network.h"
-#include "netif/netif.h"
+#include "lib/socket/netif.h"
 
 /*
   close the socket and shutdown a server_context
index bce5b85b32823b17cc1ebc948640aba4cd0c03b4..145adfa3f097d98b9b0d08eb1e67c95f7f497b80 100644 (file)
@@ -17,17 +17,6 @@ include stream/config.mk
 include util/config.mk
 include tdr/config.mk
 
-##############################
-# Start SUBSYSTEM LIBNETIF
-[SUBSYSTEM::LIBNETIF]
-PRIVATE_PROTO_HEADER = netif/proto.h
-OBJ_FILES = \
-               netif/interface.o \
-               netif/netif.o
-PRIVATE_DEPENDENCIES = LIBSAMBA-UTIL EXT_NSL
-# End SUBSYSTEM LIBNETIF
-##############################
-
 ##############################
 # Start SUBSYSTEM LIBCRYPTO
 [SUBSYSTEM::LIBCRYPTO]
diff --git a/source/lib/netif/config.m4 b/source/lib/netif/config.m4
deleted file mode 100644 (file)
index 9880440..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-AC_CHECK_HEADERS(arpa/inet.h net/if.h netdb.h netinet/in.h sys/time.h)
-AC_CHECK_HEADERS(netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
-
-##################
-# look for a method of finding the list of network interfaces
-iface=no;
-AC_CACHE_CHECK([for iface AIX],samba_cv_HAVE_IFACE_AIX,[
-AC_TRY_RUN([
-#define HAVE_IFACE_AIX 1
-#define AUTOCONF_TEST 1
-#include "confdefs.h"
-#include "${srcdir-.}/lib/netif/netif.c"],
-           samba_cv_HAVE_IFACE_AIX=yes,samba_cv_HAVE_IFACE_AIX=no,samba_cv_HAVE_IFACE_AIX=cross)])
-if test x"$samba_cv_HAVE_IFACE_AIX" = x"yes"; then
-    iface=yes;AC_DEFINE(HAVE_IFACE_AIX,1,[Whether iface AIX is available])
-fi
-
-if test $iface = no; then
-AC_CACHE_CHECK([for iface ifconf],samba_cv_HAVE_IFACE_IFCONF,[
-AC_TRY_RUN([
-#define HAVE_IFACE_IFCONF 1
-#define AUTOCONF_TEST 1
-#include "confdefs.h"
-#include "${srcdir-.}/lib/netif/netif.c"],
-           samba_cv_HAVE_IFACE_IFCONF=yes,samba_cv_HAVE_IFACE_IFCONF=no,samba_cv_HAVE_IFACE_IFCONF=cross)])
-if test x"$samba_cv_HAVE_IFACE_IFCONF" = x"yes"; then
-    iface=yes;AC_DEFINE(HAVE_IFACE_IFCONF,1,[Whether iface ifconf is available])
-fi
-fi
-
-if test $iface = no; then
-AC_CACHE_CHECK([for iface ifreq],samba_cv_HAVE_IFACE_IFREQ,[
-AC_TRY_RUN([
-#define HAVE_IFACE_IFREQ 1
-#define AUTOCONF_TEST 1
-#include "confdefs.h"
-#include "${srcdir-.}/lib/netif/netif.c"],
-           samba_cv_HAVE_IFACE_IFREQ=yes,samba_cv_HAVE_IFACE_IFREQ=no,samba_cv_HAVE_IFACE_IFREQ=cross)])
-if test x"$samba_cv_HAVE_IFACE_IFREQ" = x"yes"; then
-    iface=yes;AC_DEFINE(HAVE_IFACE_IFREQ,1,[Whether iface ifreq is available])
-fi
-fi
index 7ea7e2b80942a0f64153b98f2bf6812f553c0582..0965cd12453682b529551f45bb0e0407cc3ee57c 100644 (file)
@@ -97,3 +97,54 @@ if $have_ipv6 = true; then
 fi
 dnl don't build ipv6 by default, unless the above test enables it, or
 dnl the configure uses --with-static-modules=socket_ipv6
+
+AC_CHECK_HEADERS(arpa/inet.h net/if.h netdb.h netinet/in.h sys/time.h)
+AC_CHECK_HEADERS(netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
+
+
+##################
+# look for a method of finding the list of network interfaces
+#
+# This tests need LIBS="$NSL_LIBS $SOCKET_LIBS"
+#
+old_LIBS=$LIBS
+LIBS="$NSL_LIBS $SOCKET_LIBS"
+iface=no;
+AC_CACHE_CHECK([for iface AIX],samba_cv_HAVE_IFACE_AIX,[
+AC_TRY_RUN([
+#define HAVE_IFACE_AIX 1
+#define AUTOCONF_TEST 1
+#include "confdefs.h"
+#include "${srcdir-.}/lib/socket/netif.c"],
+           samba_cv_HAVE_IFACE_AIX=yes,samba_cv_HAVE_IFACE_AIX=no,samba_cv_HAVE_IFACE_AIX=cross)])
+if test x"$samba_cv_HAVE_IFACE_AIX" = x"yes"; then
+    iface=yes;AC_DEFINE(HAVE_IFACE_AIX,1,[Whether iface AIX is available])
+fi
+
+if test $iface = no; then
+AC_CACHE_CHECK([for iface ifconf],samba_cv_HAVE_IFACE_IFCONF,[
+AC_TRY_RUN([
+#define HAVE_IFACE_IFCONF 1
+#define AUTOCONF_TEST 1
+#include "confdefs.h"
+#include "${srcdir-.}/lib/socket/netif.c"],
+           samba_cv_HAVE_IFACE_IFCONF=yes,samba_cv_HAVE_IFACE_IFCONF=no,samba_cv_HAVE_IFACE_IFCONF=cross)])
+if test x"$samba_cv_HAVE_IFACE_IFCONF" = x"yes"; then
+    iface=yes;AC_DEFINE(HAVE_IFACE_IFCONF,1,[Whether iface ifconf is available])
+fi
+fi
+
+if test $iface = no; then
+AC_CACHE_CHECK([for iface ifreq],samba_cv_HAVE_IFACE_IFREQ,[
+AC_TRY_RUN([
+#define HAVE_IFACE_IFREQ 1
+#define AUTOCONF_TEST 1
+#include "confdefs.h"
+#include "${srcdir-.}/lib/socket/netif.c"],
+           samba_cv_HAVE_IFACE_IFREQ=yes,samba_cv_HAVE_IFACE_IFREQ=no,samba_cv_HAVE_IFACE_IFREQ=cross)])
+if test x"$samba_cv_HAVE_IFACE_IFREQ" = x"yes"; then
+    iface=yes;AC_DEFINE(HAVE_IFACE_IFREQ,1,[Whether iface ifreq is available])
+fi
+fi
+
+LIBS=$old_LIBS
index 1e22edb1d78257764ec23e873f1d679a38a3934b..a823efb23e5c8dc58ee0d8d50a2aa1c63ba7b65b 100644 (file)
@@ -1,3 +1,13 @@
+##############################
+# Start SUBSYSTEM LIBNETIF
+[SUBSYSTEM::LIBNETIF]
+PRIVATE_PROTO_HEADER = netif_proto.h
+OBJ_FILES = \
+               interface.o \
+               netif.o
+PRIVATE_DEPENDENCIES = LIBSAMBA-UTIL EXT_SOCKET EXT_NSL
+# End SUBSYSTEM LIBNETIF
+##############################
 
 ################################################
 # Start MODULE socket_ipv4
similarity index 99%
rename from source/lib/netif/interface.c
rename to source/lib/socket/interface.c
index 019b05cfbbe12fc79ba52b15bae619b51e790159..5b2b4fd1ab57690b9f11d2924bd3bcaf57986a21 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "includes.h"
 #include "system/network.h"
-#include "lib/netif/netif.h"
+#include "lib/socket/netif.h"
 #include "dlinklist.h"
 
 /** used for network interfaces */
similarity index 96%
rename from source/lib/netif/netif.h
rename to source/lib/socket/netif.h
index 558fda47922db62659fd194510d8775e7eff0ca8..ad7c31eb9e53872cb268c3fbc00c4bf099a76349 100644 (file)
@@ -29,5 +29,5 @@ struct iface_struct {
 #define MAX_INTERFACES 128
 
 #ifndef AUTOCONF_TEST
-#include "lib/netif/proto.h"
+#include "lib/socket/netif_proto.h"
 #endif
index 1b58918ea795d57eef5d7c341cdcf4fc021b4846..8824ad395ead5da1735f6f83569d4748f6f3d3b6 100644 (file)
@@ -23,7 +23,7 @@
 #include "includes.h"
 #include "libcli/resolve/resolve.h"
 #include "system/network.h"
-#include "netif/netif.h"
+#include "lib/socket/netif.h"
 
 /*
   broadcast name resolution method - async send
index a8ca2ced8b81d3aceab7da05a7ea4d9b7e9b2671..9d7035c26d349a7eb10cf2d2dfd872a123cac7eb 100644 (file)
@@ -27,7 +27,7 @@
 #include "includes.h"
 #include "libcli/composite/composite.h"
 #include "system/network.h"
-#include "netif/netif.h"
+#include "lib/socket/netif.h"
 #include "librpc/gen_ndr/ndr_nbt.h"
 #include "libcli/nbt/libnbt.h"
 
index a1735c547cffe5ee70adf4b279808f021232c78e..bf0be9fb9ba0b82c4b6e1f63d6ceb150f8a2e702 100644 (file)
@@ -29,7 +29,7 @@
 #include "lib/stream/packet.h"
 #include "libcli/composite/composite.h"
 #include "system/network.h"
-#include "netif/netif.h"
+#include "lib/socket/netif.h"
 
 static struct wrepl_request *wrepl_request_finished(struct wrepl_request *req, NTSTATUS status);
 
index 1cfe79bb9f7016d59aedad3d634873698a1ea60b..2ce9688e4db834c0698fd79b10eb8c379d1be4b9 100644 (file)
@@ -28,7 +28,7 @@
 #include "nbt_server/wins/winsserver.h"
 #include "nbt_server/dgram/proto.h"
 #include "system/network.h"
-#include "netif/netif.h"
+#include "lib/socket/netif.h"
 
 
 /*
index 43772eee07bbefe5a117da4a5b4ad54274d0df0c..d8f6a83e9457b7b916412d43bf509242ab377ce6 100644 (file)
@@ -26,7 +26,7 @@
 #include "nbt_server/nbt_server.h"
 #include "nbt_server/wins/winsserver.h"
 #include "system/network.h"
-#include "netif/netif.h"
+#include "lib/socket/netif.h"
 
 /*
   startup the nbtd task
index 5bd1783c690a551addc050e0e8cbdd5513f44337..f5f9e0e327cf23569c12facc6a113de1d1ad2c2d 100644 (file)
@@ -35,7 +35,7 @@
 #include "lib/ldb/include/ldb_errors.h"
 #include "lib/ldb/include/ldb_private.h"
 #include "system/network.h"
-#include "netif/netif.h"
+#include "lib/socket/netif.h"
 
 static int wins_ldb_verify(struct ldb_module *module, struct ldb_request *req)
 {
index fc4153637733aba11470c84fa2e7b4423cd652d3..e51b589f32018a6e8ce3139b4607f46c588a21ca 100644 (file)
@@ -30,7 +30,7 @@
 #include "system/time.h"
 #include "db_wrap.h"
 #include "system/network.h"
-#include "netif/netif.h"
+#include "lib/socket/netif.h"
 
 uint64_t winsdb_get_maxVersion(struct winsdb_handle *h)
 {
index 946052e61d29ac469da3dbb80c782cc8e4cf67e3..3808cc01304f3c1610beef3fac1b407d452605da 100644 (file)
@@ -30,7 +30,7 @@
 #include "smbd/service.h"
 #include "lib/messaging/irpc.h"
 #include "system/network.h"
-#include "netif/netif.h"
+#include "lib/socket/netif.h"
 #include "auth/auth.h"
 
 struct dcesrv_socket_context {
index 2827920bd0ea4891806c8d6a35499b96a70d8bb7..5da0dd14f01ce8f4e82fa1710566fe7e749d2276 100644 (file)
@@ -25,7 +25,7 @@
 #include "lib/appweb/ejs/ejs.h"
 #include "param/loadparm.h"
 #include "system/network.h"
-#include "netif/netif.h"
+#include "lib/socket/netif.h"
 
 /*
   return a list of defined services
index 860002e1d785e599d2ef165658c365963d479f28..d8aaf3898a7bd5254d876679621a92fa833e0712 100644 (file)
@@ -26,7 +26,7 @@
 #include "lib/ldb/include/ldb.h"
 #include "system/time.h"
 #include "system/network.h"
-#include "netif/netif.h"
+#include "lib/socket/netif.h"
 
 /*
   return the list of configured network interfaces
index 56ca686baf4a936d34b22aa28f3598f4c337fd2c..4fbc428a42c8b5e44435d1387bf56ff90711ea9e 100644 (file)
@@ -30,7 +30,7 @@
 #include "libcli/smb2/smb2.h"
 #include "smb_server/smb2/smb2_server.h"
 #include "system/network.h"
-#include "netif/netif.h"
+#include "lib/socket/netif.h"
 #include "param/share.h"
 
 static NTSTATUS smbsrv_recv_generic_request(void *private, DATA_BLOB blob)
index 70baae712d7bc7ac0b28a44e801f966232dd3fe6..a49e0dd93ea56b68002ada01cb7d06d3fd4da985 100644 (file)
@@ -24,7 +24,7 @@
 #include "lib/socket/socket.h"
 #include "lib/events/events.h"
 #include "system/network.h"
-#include "netif/netif.h"
+#include "lib/socket/netif.h"
 #include "torture/torture.h"
 
 /*
index d847595e3d89dfe7709d70e667eeaac4b2a7ae9e..def8adaa48b7fad9e03840593ca3bae327728045 100644 (file)
@@ -30,7 +30,7 @@
 #include "torture/rpc/rpc.h"
 #include "libcli/resolve/resolve.h"
 #include "system/network.h"
-#include "netif/netif.h"
+#include "lib/socket/netif.h"
 
 #define TEST_NAME "TORTURE_TEST"
 
index 1663adcdf22ffc3351b35b953a7a8e8854708954..b72b80ab2641d049a9f422c508c75cb3a49af15c 100644 (file)
@@ -24,7 +24,7 @@
 #include "lib/socket/socket.h"
 #include "libcli/resolve/resolve.h"
 #include "system/network.h"
-#include "netif/netif.h"
+#include "lib/socket/netif.h"
 #include "torture/torture.h"
 
 #define CHECK_VALUE(v, correct) do { \
index 3062fb1a3016f7fb251ece9dd32b6f0c335d3eef..44ac61fe460b1e67f6e7f1db645e2de080d4819c 100644 (file)
@@ -24,7 +24,7 @@
 #include "lib/socket/socket.h"
 #include "libcli/resolve/resolve.h"
 #include "system/network.h"
-#include "netif/netif.h"
+#include "lib/socket/netif.h"
 #include "librpc/gen_ndr/ndr_nbt.h"
 #include "torture/torture.h"
 
index f0e90ec9321b8d790272dc3dcfc4eac3e8601565..6541de8e16e54bf9c50df5e1d6e7f73725dbeed8 100644 (file)
@@ -25,7 +25,7 @@
 #include "lib/socket/socket.h"
 #include "libcli/resolve/resolve.h"
 #include "system/network.h"
-#include "netif/netif.h"
+#include "lib/socket/netif.h"
 #include "torture/torture.h"
 
 struct wins_state {
index e66d840e4d01d79abe9844e9277bcd6604e55381..fe0d0784e1263c19f5d3338280ba0704581bb9e9 100644 (file)
@@ -27,7 +27,7 @@
 #include "lib/socket/socket.h"
 #include "libcli/resolve/resolve.h"
 #include "system/network.h"
-#include "netif/netif.h"
+#include "lib/socket/netif.h"
 #include "librpc/gen_ndr/ndr_nbt.h"
 #include "torture/torture.h"
 
index b9057d493463fb13d14f515300ec5169f74fecc9..3192b0924c3d2dc11bf590b3a1c79df21e553949 100644 (file)
@@ -27,7 +27,7 @@
 #include "lib/socket/socket.h"
 #include "system/network.h"
 #include "system/locale.h"
-#include "netif/netif.h"
+#include "lib/socket/netif.h"
 #include "librpc/gen_ndr/nbt.h"
 #include "libcli/nbt/libnbt.h"
 
index 5329880d8d07fbfad3b2e1e912bd55296b863b4f..6264b67e0c6629bd74bc42d1694b347c066e6c9f 100644 (file)
@@ -28,7 +28,7 @@
 #include "lib/events/events.h"
 #include "system/filesys.h"
 #include "system/network.h"
-#include "netif/netif.h"
+#include "lib/socket/netif.h"
 #include "lib/tls/tls.h"
 
 /* don't allow connections to hang around forever */
index fc44b8912c5106c6b70a4435a85bcaf1a381e290..a7522a0165f2888b52e31550327d2b5be68e6e25 100644 (file)
@@ -31,7 +31,7 @@
 #include "wrepl_server/wrepl_server.h"
 #include "smbd/process_model.h"
 #include "system/network.h"
-#include "netif/netif.h"
+#include "lib/socket/netif.h"
 
 void wreplsrv_terminate_in_connection(struct wreplsrv_in_connection *wreplconn, const char *reason)
 {