From 8f153c6128dd15fb132d8ddb1752e793bd6a5985 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 18 Sep 2006 22:49:20 +0000 Subject: r18644: bring in libreplace in lib/replace metze (This used to be commit 596cbe73dd268742acf456fccd8a234376fb0c97) --- source3/lib/replace/system/network.h | 105 +++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 source3/lib/replace/system/network.h (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h new file mode 100644 index 0000000000..615fcab5c8 --- /dev/null +++ b/source3/lib/replace/system/network.h @@ -0,0 +1,105 @@ +#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 +#ifndef SOCKET_WRAPPER_NOT_REPLACE +#define SOCKET_WRAPPER_REPLACE +#endif +#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 cb99b612f874bd1d88e50ff1f2c0331cd56e72ca Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 27 Sep 2006 12:43:51 +0000 Subject: r18953: sync socket_wrapper with samba4 metze (This used to be commit 77b0af43f0f7e52b9040a1d3edfb556a232e64f1) --- source3/lib/replace/system/network.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index 615fcab5c8..a21f8e2eaf 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/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 6aed2cd44e33cb10f52a41acd06c99d8b23df501 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 27 Sep 2006 14:18:08 +0000 Subject: r18958: merge from samba4: 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 d8275347606cd183caea69837fd765b96d4bab71) --- source3/lib/replace/system/network.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index a21f8e2eaf..5e648dcd15 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/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 e893d7f021d149803aa85e347e0a8acefde210ac Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 2 Jun 2007 09:10:08 +0000 Subject: r23309: sync lib/replace with SAMBA_4_0 metze (This used to be commit 20965d800fcac0c55853fb12cdd36b5836fc7e56) --- source3/lib/replace/system/network.h | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index 5e648dcd15..64c7cd3399 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/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 2c09988e46d4e917b1c53c9bda3f81a48bba4952 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 01:44:42 +0000 Subject: r23790: LGPLv3+ conversion for our LGPLv2+ library code (This used to be commit 1b78cace504f60c0f525765fbf59d9cc6506cd4d) --- source3/lib/replace/system/network.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index 64c7cd3399..4594f2237d 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/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 9fa1c63578733077c0aaaeeb2fc97c3b191089cc 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 c676a971142d7176fd5dbf21405fca14515a0a76) --- source3/lib/replace/system/network.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index 4594f2237d..13d95a8ba7 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/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 68edc3a5c5a3cfeed222a95bbe75dadd41dbb5ea Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 19 Sep 2007 14:57:20 +0000 Subject: r25232: sync lib/replace with SAMBA_4_0 metze (This used to be commit 828d2ca0610ab5ee3b96d187b3432b9b4fea72f8) --- source3/lib/replace/system/network.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index 13d95a8ba7..7469040b28 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/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 3fbd1ae54ced2eb889a8fe0a6ea32dfd8175f941 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 2 Oct 2007 19:27:25 +0000 Subject: r25472: Fix the interfaces code to detect IPv6 interfaces, using the new standard getifaddrs() and freeifaddrs() interfaces. Currently we only return IPv4 af_families. Needs fixing for binds to IPv6 but this has to be careful work. Jeremy. (This used to be commit 327875182c9219aeba687e10aaea93546d9a70ea) --- source3/lib/replace/system/network.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index 7469040b28..70c3ec711c 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/lib/replace/system/network.h @@ -106,4 +106,16 @@ char *rep_inet_ntoa(struct in_addr ip); #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 + #endif -- cgit From c7da0dced68ec12a689effcc9c7351b46a815831 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 2 Oct 2007 20:04:14 +0000 Subject: r25474: Try and fix the build on Mac OS X 10.4.9. Shuffle sa_family_t around. Jeremy. (This used to be commit f1b8c5de0ae96e04e340029f5cd544de9ac57b32) --- source3/lib/replace/system/network.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index 70c3ec711c..1b442dd602 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/lib/replace/system/network.h @@ -118,4 +118,8 @@ char *rep_inet_ntoa(struct in_addr ip); #define INET6_ADDRSTRLEN 46 #endif +#ifndef HAVE_SA_FAMILY_T +typedef unsigned short int sa_family_t; +#endif + #endif -- cgit From 334b288831c1730cb88fb431f684b9062e139efd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 3 Oct 2007 19:12:39 +0000 Subject: r25487: Try fix the build - fix socklen_t and sa_family_t. Jeremy. (This used to be commit 2cab82563409eca79ac5f518a3dcb8cdbdcded7e) --- source3/lib/replace/system/network.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index 1b442dd602..fc21a3e99a 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/lib/replace/system/network.h @@ -118,8 +118,16 @@ char *rep_inet_ntoa(struct in_addr ip); #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_SOCKADDR_STORAGE +#define sockaddr_storage sockaddr +#endif + #endif -- cgit From 30e4012396b1f73a4ba03034b546af7daed9c87b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 3 Oct 2007 22:01:25 +0000 Subject: r25495: Fixup definitions for missing sockaddr_storage. Jeremy. (This used to be commit d980ee5040f2ab9e7408218d13962dd64e2b33b1) --- source3/lib/replace/system/network.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index fc21a3e99a..d5d2be068e 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/lib/replace/system/network.h @@ -127,7 +127,8 @@ typedef unsigned short int sa_family_t; #endif #ifndef HAVE_SOCKADDR_STORAGE -#define sockaddr_storage sockaddr +#define sockaddr_storage sockaddr_in +#define ss_family sin_family #endif #endif -- cgit From 941544a9514aaae89268bc9d689705ad0724119e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 4 Oct 2007 17:20:49 +0000 Subject: r25505: Add a replacement (IPv4 only) implementation of getaddrinfo/freeaddrinfo under the 2 clause *BSD license for future use in IPv6 code. Original code was from PostgreSQL and I've maintained their license even though I've rewritten large parts of it (I probably should donate this back to them). Jeremy. (This used to be commit 760d993340a966269d71acfb7a6b5e4d3776ac5d) --- source3/lib/replace/system/network.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index d5d2be068e..a09d3bb01b 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/lib/replace/system/network.h @@ -126,9 +126,13 @@ typedef int socklen_t; typedef unsigned short int sa_family_t; #endif -#ifndef HAVE_SOCKADDR_STORAGE +#ifndef HAVE_STRUCT_SOCKADDR_STORAGE #define sockaddr_storage sockaddr_in #define ss_family sin_family #endif +#ifndef HOST_NAME_MAX +#define HOST_NAME_MAX 256 +#endif + #endif -- cgit From b5725f4fecf9ea3dfc999d8c6542dd1ba171f238 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 4 Oct 2007 17:35:12 +0000 Subject: r25507: Fix definition of struct sockaddr_storage if struct sockaddr_in6 is defined. Jeremy. (This used to be commit 4cf17df5caeb2b0220f6a7dd82d5fed5aca56850) --- source3/lib/replace/system/network.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index a09d3bb01b..c2a5dec5af 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/lib/replace/system/network.h @@ -127,9 +127,14 @@ 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 -- cgit From 804396dce9112361c0e19ad2e15b9bb8dd23c378 Mon Sep 17 00:00:00 2001 From: metze Date: Wed, 10 Oct 2007 12:09:06 +0000 Subject: 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 git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@25602 0c0555d6-39d7-0310-84fc-f1cc0bd64818 (This used to be commit ec8e3f7f92522c65ec472058321db8a7ac30ec4c) --- source3/lib/replace/system/network.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index c2a5dec5af..10e9f66bd9 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/lib/replace/system/network.h @@ -86,8 +86,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 2ecbed36b22e7147462018d9bcbe8e45d85a45c2 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 15 Oct 2007 10:59:50 +0200 Subject: missing stuff from samba4's libreplace metze (This used to be commit 0177158d85797e0d22c81d88175a77d4ad5ed711) --- source3/lib/replace/system/network.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index 10e9f66bd9..0b0dbcb88d 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/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 cadb72dd997a7e3284a3df93a717a4c1920cf24e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 16 Oct 2007 15:15:23 -0700 Subject: Move #defined for getaddrinfo into network.h (as other defines). Allows RHEL4 compile to work. Jeremy. (This used to be commit 0ffdf4fdeea88c21880c8bf69d8db56fb49effa7) --- source3/lib/replace/system/network.h | 95 ++++++++++++++++++++++++++++++++++-- 1 file changed, 91 insertions(+), 4 deletions(-) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index 0b0dbcb88d..61de2b728d 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/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 8cca849769ba44ab9dc5bd875056987e541b92fe Mon Sep 17 00:00:00 2001 From: metze Date: Wed, 24 Oct 2007 12:53:34 +0000 Subject: [libreplace] include socket_wrapper.h after we have typedef'ed socklen_t metze git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@25713 0c0555d6-39d7-0310-84fc-f1cc0bd64818 (This used to be commit f1d434a132e424f2fdce59d51a7c398988c1474d) --- source3/lib/replace/system/network.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index 61de2b728d..79fe21405f 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/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 556513ff72b2ef13654f7a5b3856f7b66a2112b7 Mon Sep 17 00:00:00 2001 From: metze Date: Wed, 24 Oct 2007 12:55:40 +0000 Subject: [libreplace] move define of a constant to near to the others metze git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@25714 0c0555d6-39d7-0310-84fc-f1cc0bd64818 (This used to be commit fa120f7c50d0084e7d887811e5fa59ae3bcfe53e) --- source3/lib/replace/system/network.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index 79fe21405f..1ac881e496 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/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 cd486165e9825864cb73ea8b245195a4d28f1c73 Mon Sep 17 00:00:00 2001 From: metze Date: Wed, 24 Oct 2007 12:57:57 +0000 Subject: [libreplace] move definition of struct addrinfo so that it can use socklen_t metze git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@25715 0c0555d6-39d7-0310-84fc-f1cc0bd64818 (This used to be commit 45150075677451b48ce56ebdce96aca1ed13fa80) --- source3/lib/replace/system/network.h | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index 1ac881e496..774776dca3 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/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 800ca5179261af3137d319ad72507e26dc7c7d7f Mon Sep 17 00:00:00 2001 From: metze Date: Wed, 24 Oct 2007 13:01:03 +0000 Subject: [libreplace] if we replace types define the HAVE_ macro this is needed as heimdal's roken.h also tries to replace the types metze git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@25718 0c0555d6-39d7-0310-84fc-f1cc0bd64818 (This used to be commit b81d8bc43cd7167a5cd4b18c26ba3eecf75043eb) --- source3/lib/replace/system/network.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index 774776dca3..44a1dcc8e1 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/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 899f921c722bb99c04598caa227edb4e4a1093e8 Mon Sep 17 00:00:00 2001 From: metze Date: Thu, 25 Oct 2007 06:53:38 +0000 Subject: - 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 git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@25724 0c0555d6-39d7-0310-84fc-f1cc0bd64818 (This used to be commit e56977ea459b3615d33237d19ed8e7ad8b509853) --- source3/lib/replace/system/network.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index 44a1dcc8e1..5de363f134 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/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 7c6ed7aa1c95f61a4569f266e42938c6b225944e Mon Sep 17 00:00:00 2001 From: metze Date: Thu, 25 Oct 2007 09:16:11 +0000 Subject: [libreplace] define AI_NUMERICSERV as it's used in getaddrinfo.c metze git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@25728 0c0555d6-39d7-0310-84fc-f1cc0bd64818 (This used to be commit 11a977aa0757801fb0fa805b123e7bc75c8be447) --- source3/lib/replace/system/network.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index 5de363f134..c7b499a932 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/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 1870643d20423fcc4df5dc62b1ab75f8a5b2b635 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 25 Oct 2007 15:43:44 -0700 Subject: Try and fix the Solaris build by adding a missing define (from Jerry). Jeremy (This used to be commit a68bbea0d42cc64b9fa731ab2a1da82ef30937c6) --- source3/lib/replace/system/network.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index c7b499a932..d3ae2bf398 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/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 8f28bda7f8c18de597d345126c9ee03e99776e55 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. (This used to be commit 545cd2139cfc9484b733693814d4724d37125942) --- source3/lib/replace/system/network.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index d3ae2bf398..9087c02da1 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/lib/replace/system/network.h @@ -78,6 +78,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 8b88fa53b5f1f344b30b3409acf765ee46005396 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 25 Dec 2007 18:37:42 +0100 Subject: Host SerNet-AIX has __ss_family instead of ss_family in sockaddr_storage (This used to be commit e33286f4a68352e55df081d06307f64f190773b3) --- source3/lib/replace/system/network.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index 9087c02da1..b6ae3c7c6f 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/lib/replace/system/network.h @@ -233,6 +233,10 @@ typedef unsigned short int sa_family_t; #endif #endif +#ifdef HAVE_AIX_SOCKADDR_STORAGE +#define ss_family __ss_family +#endif + #ifndef HAVE_STRUCT_ADDRINFO #define HAVE_STRUCT_ADDRINFO struct addrinfo { -- cgit From 1e5418edbc370e87293c324eae54372a495bb932 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 (cherry picked from commit 11bdc9bed80b9842ac1ab8f22509a5d191cddc91) (This used to be commit c11122afda52ce787dd1d3357bd85b6ce36b8ca4) --- source3/lib/replace/system/network.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index b6ae3c7c6f..2f387de5cf 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/lib/replace/system/network.h @@ -227,9 +227,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 db449a4c5f807b11ec723b11a2db32d09162e163 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 15 Jan 2008 16:34:06 +0100 Subject: Revert "Host SerNet-AIX has __ss_family instead of ss_family in sockaddr_storage" This reverts commit e33286f4a68352e55df081d06307f64f190773b3. 393bab185e0e9f02aac5740becc2aba2762133c8 is the v4-0-test fix for the same problem. metze (This used to be commit b8a57a24c390355c4950ca499c1d96aff80abad7) --- source3/lib/replace/system/network.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index 2f387de5cf..fe6e46817f 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/lib/replace/system/network.h @@ -242,10 +242,6 @@ typedef unsigned short int sa_family_t; #endif #endif -#ifdef HAVE_AIX_SOCKADDR_STORAGE -#define ss_family __ss_family -#endif - #ifndef HAVE_STRUCT_ADDRINFO #define HAVE_STRUCT_ADDRINFO struct addrinfo { -- cgit From 00075c49245d5f96139b7c09f37a2b39aa10559f 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 (This used to be commit fb3f7f4046fa195baf5116598772d9016238637f) --- source3/lib/replace/system/network.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index fe6e46817f..aff8a841da 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/lib/replace/system/network.h @@ -137,8 +137,15 @@ const char *rep_inet_ntop(int af, const void *src, char *dst, socklen_t size); #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 2235ffe2f754da543b796446377b1419bf046204 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. (lib/replace part of 9b4924fbd8619033c55b4c6e2589da247332e7db - Michael) (This used to be commit 789bf2d36bd728cc68b58cfb1e9570b90ca09af7) --- source3/lib/replace/system/network.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index aff8a841da..61be51744c 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/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 @@ -97,6 +98,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 7728a23d43a79eefaf2cc7e1998283e3d1e095f8 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. (cherry picked from commit fa9e3b6fa871b7541878f836ea54e882e614a3cf) (This used to be commit a2d6f6b4ae7fb6711d4228b9e255eebb6bf344bd) --- source3/lib/replace/system/network.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index 61be51744c..0b5fbcddd1 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/lib/replace/system/network.h @@ -106,7 +106,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 ea9ce8f9ac44867403673012cd0979f21cf50a27 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. (cherry picked from commit c4cd935ee783b2f4939e2c481bbdb1bbdb9190cd) (This used to be commit 839d128a42aa624e3cd978700059f947022ee733) --- source3/lib/replace/system/network.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index 0b5fbcddd1..e03c991b3c 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/lib/replace/system/network.h @@ -109,6 +109,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 f822f4150b2b04619d68686ffdb72e82310a7175 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(). (cherry picked from commit 8c65053f51330bb55a81572264eefbcc56029dc1) (This used to be commit 57587e49f5942b81508b40e3c9a67e7536f2271d) --- source3/lib/replace/system/network.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index e03c991b3c..fa5ec9a680 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/lib/replace/system/network.h @@ -120,7 +120,7 @@ int rep_getifaddrs(struct ifaddrs **); #endif #ifndef HAVE_FREEIFADDRS -int rep_freeifaddrs(struct ifaddrs **); +void rep_freeifaddrs(struct ifaddrs **); #endif /* -- cgit From f75d7a69927960ddcc81a31084b1cc11d96838ff 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. (cherry picked from commit cc873bdd2e86e5b380c3056810ccc5ad98372f7c) (This used to be commit ccfb04d18516e0aca88ea0a96afe119175bddba7) --- source3/lib/replace/system/network.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index fa5ec9a680..d09e3f71f8 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/lib/replace/system/network.h @@ -120,7 +120,7 @@ int rep_getifaddrs(struct ifaddrs **); #endif #ifndef HAVE_FREEIFADDRS -void rep_freeifaddrs(struct ifaddrs **); +void rep_freeifaddrs(struct ifaddrs *); #endif /* -- cgit From 9f5c463415b8b7ea495589ce3fa9deb7c01efb2e 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 7b98620ef16c6969fd21dd9c157aedd4adb117a3) --- source3/lib/replace/system/network.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index d09e3f71f8..a84b22e5d0 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/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 7bdd648477c49dc7e23f832b2438bef673398fbf 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 c19f7a0e1004213f95e0bf8db5cd1f6697c7a47b) --- source3/lib/replace/system/network.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index a84b22e5d0..410c6d7cca 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/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 8f58ae97f0c46dc66f680d7b6ed93ee2aa6bc629 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 (This used to be commit 37c87acc9d48c1fb5d4806374ca8e992300db1ff) --- source3/lib/replace/system/network.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index 410c6d7cca..796df2d1da 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/lib/replace/system/network.h @@ -305,7 +305,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 27517ea5bbd0cb7fb0f1a1d88d8282380f14e717 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 (cherry picked from commit bcb2f3a880f8da8f9bedb7a8e61d7d7b533f1919) (This used to be commit 83baff78ce752a9129554a456cc24d043d419cd1) --- source3/lib/replace/system/network.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index 796df2d1da..e9e770205d 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/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 5c73dabd49bfca840c062e8c49d8765dc0e4531e 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 (cherry picked from commit 974c0c45ad42644348e0b55454715b12158f1028) (This used to be commit edcf2712bcdedabbfdd9ee8b9a18f46126930636) --- source3/lib/replace/system/network.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index e9e770205d..f943a7fd87 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/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 b57d67c406311d4c859ee1d409a03669f1a1a8b3 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 (cherry picked from commit 94ac8a25be15b55f66eff96fdddc2fdc71a43b1e) (This used to be commit 6c53753246b8108fe1277b34958e122bd800c4e7) --- source3/lib/replace/system/network.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index f943a7fd87..a5fb813aa1 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/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 107ed5fe0c51abeb4def8f8e2cc041b3f16061ad 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 (cherry picked from commit 3fddd36e119f73a5021370450f9687ef9d252bab) (This used to be commit cd37fdb2401bfd6c23160e34f03238faa1f5cbd3) --- source3/lib/replace/system/network.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/lib/replace/system/network.h') diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h index a5fb813aa1..077892a54e 100644 --- a/source3/lib/replace/system/network.h +++ b/source3/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