From a983b06d37c3b87a02444d9a9862777b88629344 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 6 Sep 2006 04:44:32 +0000 Subject: r18129: moved the system includes into libreplace - this gives much more isolation of our portability environment from the main code, and also simplifies the includes system (no separate #ifdef _SAMBA_BUILD for tdb. ldb etc now) (This used to be commit 77d1a468e06290aba789e2f3affc769fc5159a21) --- source4/lib/replace/system/network.h | 103 +++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 source4/lib/replace/system/network.h (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h new file mode 100644 index 0000000000..9b73466924 --- /dev/null +++ b/source4/lib/replace/system/network.h @@ -0,0 +1,103 @@ +#ifndef _system_network_h +#define _system_network_h +/* + Unix SMB/CIFS implementation. + + networking system include wrappers + + Copyright (C) Andrew Tridgell 2004 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + +#ifdef HAVE_UNIXSOCKET +#include +#endif + +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_ARPA_INET_H +#include +#endif + +#ifdef HAVE_NETDB_H +#include +#endif + +#ifdef HAVE_NETINET_TCP_H +#include +#endif + +/* + * The next three defines are needed to access the IPTOS_* options + * on some systems. + */ + +#ifdef HAVE_NETINET_IN_SYSTM_H +#include +#endif + +#ifdef HAVE_NETINET_IN_IP_H +#include +#endif + +#ifdef HAVE_NETINET_IP_H +#include +#endif + +#ifdef HAVE_NET_IF_H +#include +#endif + +#ifdef SOCKET_WRAPPER +#define SOCKET_WRAPPER_REPLACE +#include "lib/socket_wrapper/socket_wrapper.h" +#endif + +#ifdef REPLACE_INET_NTOA +char *rep_inet_ntoa(struct in_addr ip); +#define inet_ntoa rep_inet_ntoa +#endif + +/* + * glibc on linux doesn't seem to have MSG_WAITALL + * defined. I think the kernel has it though.. + */ +#ifndef MSG_WAITALL +#define MSG_WAITALL 0 +#endif + +/* + * Some older systems seem not to have MAXHOSTNAMELEN + * defined. + */ +#ifndef MAXHOSTNAMELEN +#define MAXHOSTNAMELEN 254 +#endif + +#ifndef INADDR_LOOPBACK +#define INADDR_LOOPBACK 0x7f000001 +#endif + +#ifndef INADDR_NONE +#define INADDR_NONE 0xffffffff +#endif + +#endif -- cgit From 4a854fe809ba617336db3e1d277e00c7ef95c55f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 17 Sep 2006 05:11:57 +0000 Subject: r18593: try to get the same socket_wrapper file building in samba3 and samba4 this is preparation of adding libreplace to samba3 later. metze (This used to be commit 26228e4b2e8debd84caebe84bb34bfbbf2ad405c) --- source4/lib/replace/system/network.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index 9b73466924..615fcab5c8 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -67,7 +67,9 @@ #endif #ifdef SOCKET_WRAPPER +#ifndef SOCKET_WRAPPER_NOT_REPLACE #define SOCKET_WRAPPER_REPLACE +#endif #include "lib/socket_wrapper/socket_wrapper.h" #endif -- cgit From 174742a74ce448d1944ada9dd602aadf20bce6f8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 27 Sep 2006 10:13:45 +0000 Subject: r18947: overload listen() and ioctl() in socket_wrapper metze (This used to be commit dfaccdca1b6954cd61828749d7b000f804f3b066) --- source4/lib/replace/system/network.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index 615fcab5c8..a21f8e2eaf 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -66,6 +66,10 @@ #include #endif +#ifdef HAVE_SYS_IOCTL_H +#include +#endif + #ifdef SOCKET_WRAPPER #ifndef SOCKET_WRAPPER_NOT_REPLACE #define SOCKET_WRAPPER_REPLACE -- cgit From c0c135c774fccc9a1ac6b6a40817ff4207df9478 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 27 Sep 2006 14:16:32 +0000 Subject: r18957: we need to include unistd.h in system/network.h because it contains the ioctl() prototype on some systems and we need to make sure it gets included before socket_wrapper defines ioctl swrap_ioctl metze (This used to be commit f37b13cbe65404f27d31b8020afb2f542313f4d3) --- source4/lib/replace/system/network.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index a21f8e2eaf..5e648dcd15 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -66,6 +66,10 @@ #include #endif +#ifdef HAVE_UNISTD_H +#include +#endif + #ifdef HAVE_SYS_IOCTL_H #include #endif -- cgit From c3b00b471aaa4a0da7f2743ae2170a36bb11a16f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 13 May 2007 15:53:59 +0000 Subject: r22827: Change license to LGPL (discussed with tridge). (This used to be commit 1193c759622edd9e6843d9b7f53d9532748ce8a0) --- source4/lib/replace/system/network.h | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index 5e648dcd15..64c7cd3399 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -7,19 +7,24 @@ Copyright (C) Andrew Tridgell 2004 - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + ** NOTE! The following LGPL license applies to the replace + ** library. This does NOT imply that all of Samba is released + ** under the LGPL - This program is distributed in the hope that it will be useful, + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #ifdef HAVE_SYS_SOCKET_H -- cgit From b8d69a7ea2505b706ff7c74d7c97bc89d82dfa07 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:46:15 +0000 Subject: r23795: more v2->v3 conversion (This used to be commit 84b468b2f8f2dffda89593f816e8bc6a8b6d42ac) --- source4/lib/replace/system/network.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index 64c7cd3399..4594f2237d 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -14,7 +14,7 @@ This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. + version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -- cgit From 6c973f4e8ccbcb6c9275f8a54e26abb19df7e15a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 03:42:26 +0000 Subject: r23798: updated old Temple Place FSF addresses to new URL (This used to be commit 40c0919aaa9c1b14bbaebb95ecce53eb0380fdbb) --- source4/lib/replace/system/network.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index 4594f2237d..13d95a8ba7 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -22,8 +22,7 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + License along with this library; if not, see . */ -- cgit From d0f3d4a2f1c674f6b07b6ec4640a2c8d033bad2a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 8 Sep 2007 01:39:31 +0000 Subject: r25017: Move MAXHOSTNAMELEN definition to replace.h as it is usually part of sys/param.h. (This used to be commit 7016d500287ae587d044744f2a318c402148ebea) --- source4/lib/replace/system/network.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index 13d95a8ba7..7469040b28 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -98,14 +98,6 @@ char *rep_inet_ntoa(struct in_addr ip); #define MSG_WAITALL 0 #endif -/* - * Some older systems seem not to have MAXHOSTNAMELEN - * defined. - */ -#ifndef MAXHOSTNAMELEN -#define MAXHOSTNAMELEN 254 -#endif - #ifndef INADDR_LOOPBACK #define INADDR_LOOPBACK 0x7f000001 #endif -- cgit From e511090a4339221dfd1fa597964af7455f96ec28 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 5 Oct 2007 23:54:12 +0000 Subject: r25543: Merge libreplace support for inet_pton, inet_ntop, getaddrinfo, getnameinfo (and friends) from SAMBA_3_2, with some minor tweaks: - avoid including network headers in replace.h unless absolutely required - autoconf tests for getaddrinfo() in lib/replace The heimdal-specific code also no longer looks for these functions anymore. (This used to be commit b6d3fd84a5d7d814035e60d6fa22f19bed9f77da) --- source4/lib/replace/system/network.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index 7469040b28..877f5f25e6 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -49,6 +49,10 @@ #include #endif +#if !defined(HAVE_GETADDRINFO) +#include "getaddrinfo.h" +#endif + /* * The next three defines are needed to access the IPTOS_* options * on some systems. -- cgit From 39f5745c16e294d95591edb44645ca9751fcee9c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 10 Oct 2007 07:18:24 +0000 Subject: r25597: HPUX doesn't have INET_ADDRSTRLEN defined metze (This used to be commit f9696109cc8f4646599f73b78e1eacd94d1a6c2c) --- source4/lib/replace/system/network.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index 877f5f25e6..02942f9a44 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -110,4 +110,8 @@ char *rep_inet_ntoa(struct in_addr ip); #define INADDR_NONE 0xffffffff #endif +#ifndef INET_ADDRSTRLEN +#define INET_ADDRSTRLEN 16 +#endif + #endif -- cgit From a3e5710eda2e9fc7ee9dce1e9082dbf03f96faeb Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 10 Oct 2007 12:09:06 +0200 Subject: r25602: don't imply "system/network.h" within replace.h, as this brings in the socket_wrapper.h in unexpected code and we endup with a missing 'swrap_close' while linking metze (This used to be commit 507d5ca7d994f0771dbb66e61d2d22e391508658) --- source4/lib/replace/system/network.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index 02942f9a44..8b911cf7d3 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -90,8 +90,18 @@ #endif #ifdef REPLACE_INET_NTOA +/* define is in "replace.h" */ char *rep_inet_ntoa(struct in_addr ip); -#define inet_ntoa rep_inet_ntoa +#endif + +#ifndef HAVE_INET_PTON +/* define is in "replace.h" */ +int rep_inet_pton(int af, const char *src, void *dst); +#endif + +#ifndef HAVE_INET_NTOP +/* define is in "replace.h" */ +const char *rep_inet_ntop(int af, const void *src, char *dst, socklen_t size); #endif /* -- cgit From ce7a3abcd8174c9693db853734f3d17bde9a4194 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 17 Oct 2007 13:58:19 +0200 Subject: r25677: add missing stuff from samba3 metze (This used to be commit d286c0533dd2726ebc547dcaf99f45169d4a9d2f) --- source4/lib/replace/system/network.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index 8b911cf7d3..0b0dbcb88d 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -120,8 +120,38 @@ const char *rep_inet_ntop(int af, const void *src, char *dst, socklen_t size); #define INADDR_NONE 0xffffffff #endif +#ifndef EAFNOSUPPORT +#define EAFNOSUPPORT EINVAL +#endif + #ifndef INET_ADDRSTRLEN #define INET_ADDRSTRLEN 16 #endif +#ifndef INET6_ADDRSTRLEN +#define INET6_ADDRSTRLEN 46 +#endif + +#ifndef HAVE_SOCKLEN_T +typedef int socklen_t; +#endif + +#ifndef HAVE_SA_FAMILY_T +typedef unsigned short int sa_family_t; +#endif + +#ifndef HAVE_STRUCT_SOCKADDR_STORAGE +#ifdef HAVE_STRUCT_SOCKADDR_IN6 +#define sockaddr_storage sockaddr_in6 +#define ss_family sin6_family +#else +#define sockaddr_storage sockaddr_in +#define ss_family sin_family +#endif +#endif + +#ifndef HOST_NAME_MAX +#define HOST_NAME_MAX 256 +#endif + #endif -- cgit From 9f53479997da6768113c347e4e31374328f72835 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 17 Oct 2007 14:02:33 +0200 Subject: r25687: Move #defined for getaddrinfo into network.h (as other defines). Allows RHEL4 compile to work. Jeremy. (cherry picked from commit 0ffdf4fdeea88c21880c8bf69d8db56fb49effa7) (This used to be commit facb811bb3c77a0b98089c283fe0707c5f486c88) --- source4/lib/replace/system/network.h | 95 ++++++++++++++++++++++++++++++++++-- 1 file changed, 91 insertions(+), 4 deletions(-) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index 0b0dbcb88d..61de2b728d 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -49,10 +49,6 @@ #include #endif -#if !defined(HAVE_GETADDRINFO) -#include "getaddrinfo.h" -#endif - /* * The next three defines are needed to access the IPTOS_* options * on some systems. @@ -104,6 +100,97 @@ 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 +#if !defined(HAVE_GETADDRINFO) +#include "getaddrinfo.h" +#endif + +/* + * Some systems have getaddrinfo but not the + * defines needed to use it. + */ + +/* Various macros that ought to be in , but might not be */ + +#ifndef EAI_FAIL +#define EAI_BADFLAGS (-1) +#define EAI_NONAME (-2) +#define EAI_AGAIN (-3) +#define EAI_FAIL (-4) +#define EAI_FAMILY (-6) +#define EAI_SOCKTYPE (-7) +#define EAI_SERVICE (-8) +#define EAI_MEMORY (-10) +#define EAI_SYSTEM (-11) +#endif /* !EAI_FAIL */ + +#ifndef AI_PASSIVE +#define AI_PASSIVE 0x0001 +#endif + +#ifndef AI_CANONNAME +#define AI_CANONNAME 0x0002 +#endif + +#ifndef AI_NUMERICHOST +/* + * some platforms don't support AI_NUMERICHOST; define as zero if using + * the system version of getaddrinfo... + */ +#if defined(HAVE_STRUCT_ADDRINFO) && defined(HAVE_GETADDRINFO) +#define AI_NUMERICHOST 0 +#else +#define AI_NUMERICHOST 0x0004 +#endif +#endif + +#ifndef AI_ADDRCONFIG +#define AI_ADDRCONFIG 0x0020 +#endif + +#ifndef NI_NUMERICHOST +#define NI_NUMERICHOST 1 +#endif + +#ifndef NI_NUMERICSERV +#define NI_NUMERICSERV 2 +#endif + +#ifndef NI_NOFQDN +#define NI_NOFQDN 4 +#endif + +#ifndef NI_NAMEREQD +#define NI_NAMEREQD 8 +#endif + +#ifndef NI_DGRAM +#define NI_DGRAM 16 +#endif + + +#ifndef NI_MAXHOST +#define NI_MAXHOST 1025 +#endif + +#ifndef NI_MAXSERV +#define NI_MAXSERV 32 +#endif + +#ifndef HAVE_STRUCT_ADDRINFO + +struct addrinfo +{ + int ai_flags; + int ai_family; + int ai_socktype; + int ai_protocol; + size_t ai_addrlen; + struct sockaddr *ai_addr; + char *ai_canonname; + struct addrinfo *ai_next; +}; +#endif /* HAVE_STRUCT_ADDRINFO */ + /* * glibc on linux doesn't seem to have MSG_WAITALL * defined. I think the kernel has it though.. -- cgit From 1cfd89c6aa50334b21fb8db16ab79a42679dd54b Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 24 Oct 2007 12:53:34 +0200 Subject: r25713: [libreplace] include socket_wrapper.h after we have typedef'ed socklen_t metze (This used to be commit a3657a4e7175e35707e7a00330f6924833774253) --- source4/lib/replace/system/network.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index 61de2b728d..79fe21405f 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -78,13 +78,6 @@ #include #endif -#ifdef SOCKET_WRAPPER -#ifndef SOCKET_WRAPPER_NOT_REPLACE -#define SOCKET_WRAPPER_REPLACE -#endif -#include "lib/socket_wrapper/socket_wrapper.h" -#endif - #ifdef REPLACE_INET_NTOA /* define is in "replace.h" */ char *rep_inet_ntoa(struct in_addr ip); @@ -241,4 +234,11 @@ typedef unsigned short int sa_family_t; #define HOST_NAME_MAX 256 #endif +#ifdef SOCKET_WRAPPER +#ifndef SOCKET_WRAPPER_NOT_REPLACE +#define SOCKET_WRAPPER_REPLACE +#endif +#include "lib/socket_wrapper/socket_wrapper.h" +#endif + #endif -- cgit From c01f61340bb1792d08e649708124f07ec19cc23d Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 24 Oct 2007 12:55:40 +0200 Subject: r25714: [libreplace] move define of a constant to near to the others metze (This used to be commit 8bd2cf71bee1a08c3d420a330730434edbac5e28) --- source4/lib/replace/system/network.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index 79fe21405f..1ac881e496 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -212,6 +212,10 @@ struct addrinfo #define INET6_ADDRSTRLEN 46 #endif +#ifndef HOST_NAME_MAX +#define HOST_NAME_MAX 256 +#endif + #ifndef HAVE_SOCKLEN_T typedef int socklen_t; #endif @@ -230,10 +234,6 @@ typedef unsigned short int sa_family_t; #endif #endif -#ifndef HOST_NAME_MAX -#define HOST_NAME_MAX 256 -#endif - #ifdef SOCKET_WRAPPER #ifndef SOCKET_WRAPPER_NOT_REPLACE #define SOCKET_WRAPPER_REPLACE -- cgit From 582496f5d0e13e514e9c7cb02b138e730b8377d0 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 24 Oct 2007 12:57:57 +0200 Subject: r25715: [libreplace] move definition of struct addrinfo so that it can use socklen_t metze (This used to be commit 12cec014c465a55974aedf44e0e782f5fb841088) --- source4/lib/replace/system/network.h | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index 1ac881e496..774776dca3 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -169,21 +169,6 @@ const char *rep_inet_ntop(int af, const void *src, char *dst, socklen_t size); #define NI_MAXSERV 32 #endif -#ifndef HAVE_STRUCT_ADDRINFO - -struct addrinfo -{ - int ai_flags; - int ai_family; - int ai_socktype; - int ai_protocol; - size_t ai_addrlen; - struct sockaddr *ai_addr; - char *ai_canonname; - struct addrinfo *ai_next; -}; -#endif /* HAVE_STRUCT_ADDRINFO */ - /* * glibc on linux doesn't seem to have MSG_WAITALL * defined. I think the kernel has it though.. @@ -234,6 +219,19 @@ typedef unsigned short int sa_family_t; #endif #endif +#ifndef HAVE_STRUCT_ADDRINFO +struct addrinfo { + int ai_flags; + int ai_family; + int ai_socktype; + int ai_protocol; + socklen_t ai_addrlen; + struct sockaddr *ai_addr; + char *ai_canonname; + struct addrinfo *ai_next; +}; +#endif /* HAVE_STRUCT_ADDRINFO */ + #ifdef SOCKET_WRAPPER #ifndef SOCKET_WRAPPER_NOT_REPLACE #define SOCKET_WRAPPER_REPLACE -- cgit From 31569f1c881a735ef3db173ef57881540b0c5537 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 24 Oct 2007 13:01:03 +0200 Subject: r25718: [libreplace] if we replace types define the HAVE_ macro this is needed as heimdal's roken.h also tries to replace the types metze (This used to be commit 8b92b811015d0855efe3cf4c58cd08e3654f8e88) --- source4/lib/replace/system/network.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index 774776dca3..44a1dcc8e1 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -202,10 +202,12 @@ const char *rep_inet_ntop(int af, const void *src, char *dst, socklen_t size); #endif #ifndef HAVE_SOCKLEN_T +#define HAVE_SOCKLEN_T typedef int socklen_t; #endif #ifndef HAVE_SA_FAMILY_T +#define HAVE_SA_FAMILY_T typedef unsigned short int sa_family_t; #endif @@ -220,6 +222,7 @@ typedef unsigned short int sa_family_t; #endif #ifndef HAVE_STRUCT_ADDRINFO +#define HAVE_STRUCT_ADDRINFO struct addrinfo { int ai_flags; int ai_family; -- cgit From 88f6c5a1d2c337ffe7505e20b96a6b47dab1c063 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 25 Oct 2007 06:53:38 +0200 Subject: r25724: - include getaddrinfo.h after we have defined struct addrinfo - use rep_ instead of pg_ as prefix in getaddrinfo.[ch] - define HAVE_ macros when we replace functions metze (This used to be commit 57d5cf4b5fe8885b1375059aa143c9c71d2503b4) --- source4/lib/replace/system/network.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index 44a1dcc8e1..5de363f134 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -93,10 +93,6 @@ 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 -#if !defined(HAVE_GETADDRINFO) -#include "getaddrinfo.h" -#endif - /* * Some systems have getaddrinfo but not the * defines needed to use it. @@ -212,6 +208,7 @@ typedef unsigned short int sa_family_t; #endif #ifndef HAVE_STRUCT_SOCKADDR_STORAGE +#define HAVE_STRUCT_SOCKADDR_STORAGE #ifdef HAVE_STRUCT_SOCKADDR_IN6 #define sockaddr_storage sockaddr_in6 #define ss_family sin6_family @@ -235,6 +232,10 @@ struct addrinfo { }; #endif /* HAVE_STRUCT_ADDRINFO */ +#if !defined(HAVE_GETADDRINFO) +#include "getaddrinfo.h" +#endif + #ifdef SOCKET_WRAPPER #ifndef SOCKET_WRAPPER_NOT_REPLACE #define SOCKET_WRAPPER_REPLACE -- cgit From 74a2b05793851de3bcc12980221e238da5310d8b Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 25 Oct 2007 09:16:11 +0200 Subject: r25728: [libreplace] define AI_NUMERICSERV as it's used in getaddrinfo.c metze (This used to be commit 5648c8a0de7482a28a5b95410c083ac87577d482) --- source4/lib/replace/system/network.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index 5de363f134..c7b499a932 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -136,6 +136,17 @@ const char *rep_inet_ntop(int af, const void *src, char *dst, socklen_t size); #define AI_ADDRCONFIG 0x0020 #endif +#ifndef AI_NUMERICSERV +/* + * logic copied from AI_NUMERICHOST + */ +#if defined(HAVE_STRUCT_ADDRINFO) && defined(HAVE_GETADDRINFO) +#define AI_NUMERICSERV 0 +#else +#define AI_NUMERICSERV 0x0400 +#endif +#endif + #ifndef NI_NUMERICHOST #define NI_NUMERICHOST 1 #endif -- cgit From 319ecac5b12dd183b657cb6f5bee2dbbdd013e35 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 9 Nov 2007 08:24:36 +0100 Subject: r25910: Try and fix the Solaris build by adding a missing define (from Jerry). Jeremy merge from v3-2-test commit a68bbea0d42cc64b9fa731ab2a1da82ef30937c6 (This used to be commit b833dce5e6d6475a04538d9754b9b0bfeb5915e4) --- source4/lib/replace/system/network.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index c7b499a932..d3ae2bf398 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -247,6 +247,11 @@ struct addrinfo { #include "getaddrinfo.h" #endif +/* Needed for some systems that don't define it (Solaris). */ +#ifndef ifr_netmask +#define ifr_netmask ifr_addrs +#endif + #ifdef SOCKET_WRAPPER #ifndef SOCKET_WRAPPER_NOT_REPLACE #define SOCKET_WRAPPER_REPLACE -- cgit From be4decb2b73e3431155663c2dae3a8452ecde28a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 16 Dec 2007 02:39:01 +0100 Subject: 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) --- source4/lib/replace/system/network.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'source4/lib/replace/system/network.h') 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 +#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. -- cgit From 958864ccdf6062808433fc032577e7b175f027e0 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 16 Dec 2007 03:22:13 +0100 Subject: r26469: Fix paths, only include IPv4 addresses for now. (This used to be commit fa9e3b6fa871b7541878f836ea54e882e614a3cf) --- source4/lib/replace/system/network.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index 45d84e0386..b8228687e3 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -102,7 +102,7 @@ const char *rep_inet_ntop(int af, const void *src, char *dst, socklen_t size); struct ifaddrs { struct ifaddrs *ifa_next; /* Pointer to next struct */ char *ifa_name; /* Interface name */ - u_int ifa_flags; /* Interface flags */ + unsigned int ifa_flags; /* Interface flags */ struct sockaddr *ifa_addr; /* Interface address */ struct sockaddr *ifa_netmask; /* Interface netmask */ struct sockaddr *ifa_dstaddr; /* P2P interface destination */ -- cgit From af3c0b932402b5eb07121d1ea30570fe5b9d171c Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 17 Dec 2007 06:57:30 +0100 Subject: r26492: Some hosts have a define called ifa_dstaddr. (This used to be commit c4cd935ee783b2f4939e2c481bbdb1bbdb9190cd) --- source4/lib/replace/system/network.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index b8228687e3..c340cca657 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -105,6 +105,7 @@ struct ifaddrs { unsigned int ifa_flags; /* Interface flags */ struct sockaddr *ifa_addr; /* Interface address */ struct sockaddr *ifa_netmask; /* Interface netmask */ +#undef ifa_dstaddr struct sockaddr *ifa_dstaddr; /* P2P interface destination */ void *ifa_data; /* Address specific data */ }; -- cgit From 83655ec0dd58c21cdb99d5e7c8008b4b3087449b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 17 Dec 2007 08:20:29 +0100 Subject: r26497: Fix return type for freeifaddrs(). (This used to be commit 8c65053f51330bb55a81572264eefbcc56029dc1) --- source4/lib/replace/system/network.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index c340cca657..853c2a38bb 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -116,7 +116,7 @@ int rep_getifaddrs(struct ifaddrs **); #endif #ifndef HAVE_FREEIFADDRS -int rep_freeifaddrs(struct ifaddrs **); +void rep_freeifaddrs(struct ifaddrs **); #endif /* -- cgit From 89f34bb2133a125b1ddffbda30703bf7c551fb55 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 17 Dec 2007 12:27:59 +0100 Subject: r26507: Fix function signature for freeifaddrs. (This used to be commit cc873bdd2e86e5b380c3056810ccc5ad98372f7c) --- source4/lib/replace/system/network.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index 853c2a38bb..f72b233712 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -116,7 +116,7 @@ int rep_getifaddrs(struct ifaddrs **); #endif #ifndef HAVE_FREEIFADDRS -void rep_freeifaddrs(struct ifaddrs **); +void rep_freeifaddrs(struct ifaddrs *); #endif /* -- cgit From 6afef7d624fbf734d93ebfe95689a282b202aa3c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 20 Dec 2007 15:59:39 +0100 Subject: r26550: libreplace: fallback to __ss_family of struct sockaddr_storage metze (This used to be commit 11bdc9bed80b9842ac1ab8f22509a5d191cddc91) --- source4/lib/replace/system/network.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index f72b233712..e2fad5f686 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -249,9 +249,18 @@ typedef unsigned short int sa_family_t; #ifdef HAVE_STRUCT_SOCKADDR_IN6 #define sockaddr_storage sockaddr_in6 #define ss_family sin6_family +#define HAVE_SS_FAMILY 1 #else #define sockaddr_storage sockaddr_in #define ss_family sin_family +#define HAVE_SS_FAMILY 1 +#endif +#endif + +#ifndef HAVE_SS_FAMILY +#ifdef HAVE___SS_FAMILY +#define ss_family __ss_family +#define HAVE_SS_FAMILY 1 #endif #endif -- cgit From b1fcae724156c2b25f41264943cf4cec8fe68821 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 17 Dec 2007 10:44:09 -0800 Subject: Fix bug #5121 (unix passwd sync not working on a streams based system). Jeremy. (lib/replace part of 545cd2139cfc9484b733693814d4724d37125942 metze) (This used to be commit 9cff25cce1d39460dbcab006a309bb2984969eed) --- source4/lib/replace/system/network.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index e2fad5f686..53bef66d48 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -79,6 +79,10 @@ #include #endif +#ifdef HAVE_STROPTS_H +#include +#endif + #ifdef REPLACE_INET_NTOA /* define is in "replace.h" */ char *rep_inet_ntoa(struct in_addr ip); -- cgit From db2447a7a2b1d39a6849b53f7864e9283daacb6a Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 1 Feb 2008 14:23:56 +0100 Subject: NetBSD does not support AI_ADDRCONFIG (cherry picked from commit fb3f7f4046fa195baf5116598772d9016238637f) (This used to be commit e8f3653414c12fb752c096d848dc962008d90439) --- source4/lib/replace/system/network.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index 53bef66d48..d09e3f71f8 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -163,8 +163,15 @@ void rep_freeifaddrs(struct ifaddrs *); #endif #ifndef AI_ADDRCONFIG +/* + * logic copied from AI_NUMERICHOST + */ +#if defined(HAVE_STRUCT_ADDRINFO) && defined(HAVE_GETADDRINFO) +#define AI_ADDRCONFIG 0 +#else #define AI_ADDRCONFIG 0x0020 #endif +#endif #ifndef AI_NUMERICSERV /* -- cgit From 901addd4a18a9a166fc3518a7bce70969f884e6f Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 26 Feb 2008 11:18:51 +0100 Subject: Fix build on VOS: socklen_t is needed for rep_inet_ntop: move it up. Michael (This used to be commit 8a26a6e8f11aca5119b15e304213548ad608dc5b) --- source4/lib/replace/system/network.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index d09e3f71f8..a84b22e5d0 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -83,6 +83,11 @@ #include #endif +#ifndef HAVE_SOCKLEN_T +#define HAVE_SOCKLEN_T +typedef int socklen_t; +#endif + #ifdef REPLACE_INET_NTOA /* define is in "replace.h" */ char *rep_inet_ntoa(struct in_addr ip); @@ -245,11 +250,6 @@ void rep_freeifaddrs(struct ifaddrs *); #define HOST_NAME_MAX 256 #endif -#ifndef HAVE_SOCKLEN_T -#define HAVE_SOCKLEN_T -typedef int socklen_t; -#endif - #ifndef HAVE_SA_FAMILY_T #define HAVE_SA_FAMILY_T typedef unsigned short int sa_family_t; -- cgit From 28464179174d2c3d1c1bc124ba9c2519e08a5fc9 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 26 Feb 2008 13:24:54 +0100 Subject: libreplace: Add tests for connect and gethostbyname. Provide dummy replacements when a function isnt found. The functions are also searched for in certain libraries, and variables SOCKET_LIBS and NSL_LIBS are set accordingly. One purpose of this is to fix the getifaddrs tests on systems where e.g. the socket calls require special libs for linking. Michael (This used to be commit 900d17acb95f1becfc46656a12c107336c027ef7) --- source4/lib/replace/system/network.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index a84b22e5d0..410c6d7cca 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -103,6 +103,16 @@ 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 +#ifndef HAVE_CONNECT +/* define is in "replace.h" */ +int rep_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen); +#endif + +#ifndef HAVE_GETHOSTBYNAME +/* define is in "replace.h" */ +struct hostent *rep_gethostbyname(const char *name); +#endif + #ifdef HAVE_IFADDRS_H #include #endif -- cgit From fe096dd31336639a478a9f05cb3d790c2c31af47 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 14 Mar 2008 08:49:34 +0100 Subject: libreplace: add an inet_aton() function that calls inet_pton(). inet_aton() is even needed inside libreplace, in the implementation of rep_getaddrinfo(). Michael (This used to be commit bcb2f3a880f8da8f9bedb7a8e61d7d7b533f1919) --- source4/lib/replace/system/network.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index 410c6d7cca..8c606c8f2d 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -103,6 +103,11 @@ 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 +#ifndef HAVE_INET_ATON +/* define is in "replace.h" */ +int rep_inet_aton(const char *src, struct in_addr *dst); +#endif + #ifndef HAVE_CONNECT /* define is in "replace.h" */ int rep_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen); -- cgit From 87b48a812683794935db950446e9fb1db8e3da48 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 18 Mar 2008 12:16:47 +0100 Subject: libreplace: replace inet_ntoa() when it is missing ...not only replace it when it is broken. This moves the defintion of rep_inet_ntoa from replace.c to inet_ntoa.c and adds configure checks for existence of inet_ntoa(). Checks are moved to an include file of its own. NOTE: The original rep_inet_ntoa in replace.c was wrapped into a "#ifndef WITH_PTHREADS" but the prototype in replace.h and the define in system/network.h were not. I removed that ifndef since the inet_ntoa() function is usually not thread safe anyways, since it returns a pointer to a static buffer. So whoever calls inet_ntoa() should be aware that it is not thread safe anyways. Michael (This used to be commit 974c0c45ad42644348e0b55454715b12158f1028) --- source4/lib/replace/system/network.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index 8c606c8f2d..7c2377301b 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -88,7 +88,7 @@ typedef int socklen_t; #endif -#ifdef REPLACE_INET_NTOA +#if !defined (HAVE_INET_NTOA) || defined(REPLACE_INET_NTOA) /* define is in "replace.h" */ char *rep_inet_ntoa(struct in_addr ip); #endif -- cgit From 1268be9f88a1716c9b01b10fef0de5428ef65b3c Mon Sep 17 00:00:00 2001 From: "Gerald W. Carter" Date: Thu, 28 Feb 2008 11:58:05 -0600 Subject: Fix macro name (no 's' in ifr_addr). Interface detection on Solaris still failing due to items pointed out here: http://lists.samba.org/archive/samba-technical/2007-November/056701.html (cherry picked from commit 37c87acc9d48c1fb5d4806374ca8e992300db1ff) (This used to be commit 5757d8dfe9e6cf7b662acdf5c3d825f0021822c0) --- source4/lib/replace/system/network.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index 7c2377301b..f943a7fd87 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -310,7 +310,7 @@ struct addrinfo { /* Needed for some systems that don't define it (Solaris). */ #ifndef ifr_netmask -#define ifr_netmask ifr_addrs +#define ifr_netmask ifr_addr #endif #ifdef SOCKET_WRAPPER -- cgit From 124f82efe13a453a3f5857c1e25584536147c3dc Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 18 Mar 2008 17:20:47 +0100 Subject: libreplace: move rep_socketpair() to its own module. Prototype is now in system/network.h, implementation in socketpair.c, and check in socketpair.m4. Now the last networking function has vanished from replace.c. Michael (This used to be commit 94ac8a25be15b55f66eff96fdddc2fdc71a43b1e) --- source4/lib/replace/system/network.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index f943a7fd87..a5fb813aa1 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -143,6 +143,11 @@ int rep_getifaddrs(struct ifaddrs **); void rep_freeifaddrs(struct ifaddrs *); #endif +#ifndef HAVE_SOCKETPAIR +/* define is in "replace.h" */ +int rep_socketpair(int d, int type, int protocol, int sv[2]); +#endif + /* * Some systems have getaddrinfo but not the * defines needed to use it. -- cgit From dd01174d092eec9bb3bb6b680786f8b9f3b4668f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 8 May 2008 10:39:41 +0200 Subject: libreplace: make sure system/network.h is only used when AC_LIBREPLACE_NETWORK_CHECKS was used metze (This used to be commit 3fddd36e119f73a5021370450f9687ef9d252bab) --- source4/lib/replace/system/network.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/lib/replace/system/network.h') diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index a5fb813aa1..077892a54e 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -27,6 +27,10 @@ */ +#ifndef LIBREPLACE_NETWORK_CHECKS +#error "AC_LIBREPLACE_NETWORK_CHECKS missing in configure" +#endif + #ifdef HAVE_SYS_SOCKET_H #include #endif -- cgit