eui64_aton.h \
eui64_aton.c \
fdsetsize.h \
+ getaddrinfo.cc \
getaddrinfo.h \
+ getnameinfo.cc \
getnameinfo.h \
GnuRegex.c \
GnuRegex.h \
+ inet_ntop.cc \
inet_ntop.h \
+ inet_pton.cc \
inet_pton.h \
initgroups.h \
memrchr.cc \
#include "compat/assert.h"
#include "compat/compat_shared.h"
+#include "compat/getaddrinfo.h"
+#include "compat/getnameinfo.h"
+#include "compat/inet_ntop.h"
+#include "compat/inet_pton.h"
#include "compat/stdvarargs.h"
/* cstdio has a bunch of problems with 64-bit definitions */
/* An emulation of the RFC 2553 / Posix getaddrinfo resolver interface.
*/
-#if !HAVE_GETADDRINFO
+#if !HAVE_DECL_GETADDRINFO
/* Need to turn off Posix features in glibc to build this */
#undef _POSIX_C_SOURCE
#undef _XOPEN_SOURCE
-#include "compat/getaddrinfo.h"
-#include "compat/inet_pton.h"
-
#if HAVE_STRING_H
#include <string.h>
#endif
return eai_descr[ecode];
}
-#endif /* HAVE_GETADDRINFO */
+#endif /* HAVE_DECL_GETADDRINFO */
/* Structure and prototypes taken from RFC 2553 */
/* These functions are provided by the OS */
-#if !HAVE_GETADDRINFO
+#if !HAVE_DECL_GETADDRINFO
/* SG 23/09/2007:
On Windows the following definitions are already available, may be that
#define gai_strerror xgai_strerror
#endif
-#endif /* HAVE_GETADDRINFO */
+#endif /* HAVE_DECL_GETADDRINFO */
#endif /* _getaddrinfo_h */
* - gethostbyaddr() is usually not thread safe.
*/
-#if !HAVE_GETNAMEINFO
-
-#include "compat/getaddrinfo.h"
-#include "compat/inet_ntop.h"
+#if !HAVE_DECL_GETNAMEINFO
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
return n;
}
#endif /* INET6 */
-#endif
+#endif /* HAVE_DECL_GETNAMEINFO */
#ifndef _getnameinfo_h
#define _getnameinfo_h
-#if !HAVE_GETNAMEINFO
+#if !HAVE_DECL_GETNAMEINFO
// RFC 2553 / Posix resolver
// Reconstructed from KAME getnameinfo.c
int flags );
#define getnameinfo xgetnameinfo
-#endif /* HAVE_GETNAMEINFO */
+#endif /* HAVE_DECL_GETNAMEINFO */
#endif /* _getnameinfo_h */
#include "squid.h"
-#if !HAVE_INET_NTOP
-#include "inet_ntop.h"
+#if !HAVE_DECL_INET_NTOP
/*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
return (dst);
}
-#endif /* HAVE_INET_NTOP */
+#endif /* HAVE_DECL_INET_NTOP */
#define _INC_INET_NTOP_H
/* Use the system provided version where possible */
-#if !HAVE_INET_NTOP
+#if !HAVE_DECL_INET_NTOP
/* char *
* inet_ntop(af, src, dst, size)
SQUIDCEXTERN const char * xinet_ntop(int af, const void *src, char *dst, size_t size);
#define inet_ntop xinet_ntop
-#endif
+#endif /* HAVE_DECL_INET_NTOP */
#endif /* _INC_INET_NTOP_H */
#include "squid.h"
-#if !HAVE_INET_PTON
+#if !HAVE_DECL_INET_PTON
/*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
return (1);
}
-#endif /* HAVE_INET_PTON */
+#endif /* HAVE_DECL_INET_PTON */
#define _INC_INET_PTON_H
/* Use the system provided version where possible */
-#if !HAVE_INET_PTON
+#if !HAVE_DECL_INET_PTON
/* int
* inet_pton(af, src, dst)
SQUIDCEXTERN int xinet_pton(int af, const char *src, void *dst);
#define inet_pton xinet_pton
-#endif
+#endif /* HAVE_DECL_INET_PTON */
#endif /* _INC_INET_NTOP_H */
}
#define getsockopt(s,l,o,v,n) Squid::getsockopt(s,l,o,v,n)
+inline char *
+inet_ntop(int af, const void *src, char *dst, size_t size)
+{
+ return (char*)InetNtopA(af, const_cast<void*>(src), dst, size);
+}
+#define inet_ntop(a,s,d,l) Squid::inet_ntop(a,s,d,l)
+
/* Simple ioctl() emulation */
inline int
ioctl(int s, int c, void * a)
dnl ... and some we provide local replacements for
AC_REPLACE_FUNCS(\
drand48 \
- inet_ntop \
- inet_pton \
initgroups \
- getaddrinfo \
- getnameinfo \
psignal \
strerror \
strtoll \
tempnam \
)
+AC_CHECK_DECLS([getaddrinfo,getnameinfo,inet_ntop,inet_pton],,,[
+/*
+ * BSD requires sys/types.h, sys/socket.h, netinet/in.h, netdb.h, arpa/inet.h
+ * Linux requires sys/types.h, sys/socket.h, arpa/inet.h
+ * Windows requires sys/socket.h, winsock2.h, ws2tcpip.h
+ */
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#if HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#if HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+])
+
# Magic which checks whether we are forcing a type of comm loop we
# are actually going to (ab)use.
# Mostly ripped from squid-commloops, thanks to adrian and benno
*/
#include "squid.h"
-#include "compat/getaddrinfo.h"
-#include "compat/getnameinfo.h"
#include "rfc1738.h"
#if HAVE_GSSAPI
*/
#include "squid.h"
-#include "compat/getaddrinfo.h"
-#include "compat/getnameinfo.h"
#include "rfc1738.h"
#include "negotiate_kerberos.h"
*/
#include "squid.h"
-#include "compat/inet_pton.h"
#include "util.h"
#if HAVE_UNISTD_H
#include "clientStream.h"
#include "comm/Connection.h"
#include "comm/Write.h"
-#include "compat/inet_pton.h"
#include "err_detail_type.h"
#include "errorpage.h"
#include "fd.h"
/* DEBUG: section 14 IP Storage and Handling */
#include "squid.h"
-#include "compat/getaddrinfo.h"
-#include "compat/inet_ntop.h"
#include "Debug.h"
#include "ip/Address.h"
#include "ip/tools.h"
*/
#include "squid.h"
-#include "compat/getaddrinfo.h"
#if HAVE_UNISTD_H
#include <unistd.h>