From: Stefan Metzmacher Date: Thu, 17 Aug 2006 13:37:04 +0000 (+0000) Subject: r17586: merge lib/netif into lib/socket and use -lnsl -lsocket on the X-Git-Tag: samba-4.0.0alpha6~801^3~5457 X-Git-Url: http://git.samba.org/samba.git/?p=sfrench%2Fsamba-autobuild%2F.git;a=commitdiff_plain;h=a2eca9174c7803732658a1e6f7e8ed873c4fb6fd r17586: merge lib/netif into lib/socket and use -lnsl -lsocket on the configure check for the interfaces. should fix the build on some old sun boxes metze (This used to be commit f20e251bfd9f1eb7ce5c00739631b1625a2aa467) --- diff --git a/source4/cldap_server/cldap_server.c b/source4/cldap_server/cldap_server.c index 3687eb52188..4c1c7b86c53 100644 --- a/source4/cldap_server/cldap_server.c +++ b/source4/cldap_server/cldap_server.c @@ -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 diff --git a/source4/cldap_server/netlogon.c b/source4/cldap_server/netlogon.c index 903764abf1c..4e7274f4834 100644 --- a/source4/cldap_server/netlogon.c +++ b/source4/cldap_server/netlogon.c @@ -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 diff --git a/source4/heimdal_build/glue.c b/source4/heimdal_build/glue.c index bf64360c433..333b768fef6 100644 --- a/source4/heimdal_build/glue.c +++ b/source4/heimdal_build/glue.c @@ -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 diff --git a/source4/kdc/kdc.c b/source4/kdc/kdc.c index 10e0764e233..c9df63a2113 100644 --- a/source4/kdc/kdc.c +++ b/source4/kdc/kdc.c @@ -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 { diff --git a/source4/ldap_server/ldap_server.c b/source4/ldap_server/ldap_server.c index 718e3e07739..9b4055f8cf6 100644 --- a/source4/ldap_server/ldap_server.c +++ b/source4/ldap_server/ldap_server.c @@ -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 diff --git a/source4/lib/basic.mk b/source4/lib/basic.mk index bce5b85b328..145adfa3f09 100644 --- a/source4/lib/basic.mk +++ b/source4/lib/basic.mk @@ -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/source4/lib/netif/config.m4 b/source4/lib/netif/config.m4 deleted file mode 100644 index 9880440f216..00000000000 --- a/source4/lib/netif/config.m4 +++ /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 diff --git a/source4/lib/socket/config.m4 b/source4/lib/socket/config.m4 index 7ea7e2b8094..0965cd12453 100644 --- a/source4/lib/socket/config.m4 +++ b/source4/lib/socket/config.m4 @@ -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 diff --git a/source4/lib/socket/config.mk b/source4/lib/socket/config.mk index 1e22edb1d78..a823efb23e5 100644 --- a/source4/lib/socket/config.mk +++ b/source4/lib/socket/config.mk @@ -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 diff --git a/source4/lib/netif/interface.c b/source4/lib/socket/interface.c similarity index 99% rename from source4/lib/netif/interface.c rename to source4/lib/socket/interface.c index 019b05cfbbe..5b2b4fd1ab5 100644 --- a/source4/lib/netif/interface.c +++ b/source4/lib/socket/interface.c @@ -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 */ diff --git a/source4/lib/netif/netif.c b/source4/lib/socket/netif.c similarity index 100% rename from source4/lib/netif/netif.c rename to source4/lib/socket/netif.c diff --git a/source4/lib/netif/netif.h b/source4/lib/socket/netif.h similarity index 96% rename from source4/lib/netif/netif.h rename to source4/lib/socket/netif.h index 558fda47922..ad7c31eb9e5 100644 --- a/source4/lib/netif/netif.h +++ b/source4/lib/socket/netif.h @@ -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 diff --git a/source4/libcli/resolve/bcast.c b/source4/libcli/resolve/bcast.c index 1b58918ea79..8824ad395ea 100644 --- a/source4/libcli/resolve/bcast.c +++ b/source4/libcli/resolve/bcast.c @@ -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 diff --git a/source4/libcli/resolve/nbtlist.c b/source4/libcli/resolve/nbtlist.c index a8ca2ced8b8..9d7035c26d3 100644 --- a/source4/libcli/resolve/nbtlist.c +++ b/source4/libcli/resolve/nbtlist.c @@ -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" diff --git a/source4/libcli/wrepl/winsrepl.c b/source4/libcli/wrepl/winsrepl.c index a1735c547cf..bf0be9fb9ba 100644 --- a/source4/libcli/wrepl/winsrepl.c +++ b/source4/libcli/wrepl/winsrepl.c @@ -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); diff --git a/source4/nbt_server/interfaces.c b/source4/nbt_server/interfaces.c index 1cfe79bb9f7..2ce9688e4db 100644 --- a/source4/nbt_server/interfaces.c +++ b/source4/nbt_server/interfaces.c @@ -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" /* diff --git a/source4/nbt_server/nbt_server.c b/source4/nbt_server/nbt_server.c index 43772eee07b..d8f6a83e945 100644 --- a/source4/nbt_server/nbt_server.c +++ b/source4/nbt_server/nbt_server.c @@ -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 diff --git a/source4/nbt_server/wins/wins_ldb.c b/source4/nbt_server/wins/wins_ldb.c index 5bd1783c690..f5f9e0e327c 100644 --- a/source4/nbt_server/wins/wins_ldb.c +++ b/source4/nbt_server/wins/wins_ldb.c @@ -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) { diff --git a/source4/nbt_server/wins/winsdb.c b/source4/nbt_server/wins/winsdb.c index fc415363773..e51b589f320 100644 --- a/source4/nbt_server/wins/winsdb.c +++ b/source4/nbt_server/wins/winsdb.c @@ -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) { diff --git a/source4/rpc_server/dcerpc_sock.c b/source4/rpc_server/dcerpc_sock.c index 946052e61d2..3808cc01304 100644 --- a/source4/rpc_server/dcerpc_sock.c +++ b/source4/rpc_server/dcerpc_sock.c @@ -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 { diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index 2827920bd0e..5da0dd14f01 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -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 diff --git a/source4/scripting/ejs/smbcalls_sys.c b/source4/scripting/ejs/smbcalls_sys.c index 860002e1d78..d8aaf3898a7 100644 --- a/source4/scripting/ejs/smbcalls_sys.c +++ b/source4/scripting/ejs/smbcalls_sys.c @@ -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 diff --git a/source4/smb_server/smb_server.c b/source4/smb_server/smb_server.c index 56ca686baf4..4fbc428a42c 100644 --- a/source4/smb_server/smb_server.c +++ b/source4/smb_server/smb_server.c @@ -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) diff --git a/source4/torture/local/socket.c b/source4/torture/local/socket.c index 70baae712d7..a49e0dd93ea 100644 --- a/source4/torture/local/socket.c +++ b/source4/torture/local/socket.c @@ -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" /* diff --git a/source4/torture/nbt/dgram.c b/source4/torture/nbt/dgram.c index d847595e3d8..def8adaa48b 100644 --- a/source4/torture/nbt/dgram.c +++ b/source4/torture/nbt/dgram.c @@ -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" diff --git a/source4/torture/nbt/register.c b/source4/torture/nbt/register.c index 1663adcdf22..b72b80ab264 100644 --- a/source4/torture/nbt/register.c +++ b/source4/torture/nbt/register.c @@ -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 { \ diff --git a/source4/torture/nbt/wins.c b/source4/torture/nbt/wins.c index 3062fb1a301..44ac61fe460 100644 --- a/source4/torture/nbt/wins.c +++ b/source4/torture/nbt/wins.c @@ -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" diff --git a/source4/torture/nbt/winsbench.c b/source4/torture/nbt/winsbench.c index f0e90ec9321..6541de8e16e 100644 --- a/source4/torture/nbt/winsbench.c +++ b/source4/torture/nbt/winsbench.c @@ -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 { diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index e66d840e4d0..fe0d0784e12 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -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" diff --git a/source4/utils/nmblookup.c b/source4/utils/nmblookup.c index b9057d49346..3192b0924c3 100644 --- a/source4/utils/nmblookup.c +++ b/source4/utils/nmblookup.c @@ -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" diff --git a/source4/web_server/web_server.c b/source4/web_server/web_server.c index 5329880d8d0..6264b67e0c6 100644 --- a/source4/web_server/web_server.c +++ b/source4/web_server/web_server.c @@ -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 */ diff --git a/source4/wrepl_server/wrepl_in_connection.c b/source4/wrepl_server/wrepl_in_connection.c index fc44b8912c5..a7522a0165f 100644 --- a/source4/wrepl_server/wrepl_in_connection.c +++ b/source4/wrepl_server/wrepl_in_connection.c @@ -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) {