Remove INET6 define. Use ENABLE_IPV6 instead.

This commit is contained in:
Martin v. Löwis 2001-12-02 10:15:37 +00:00
parent 080d5b3f0b
commit 44ddbde3ab
5 changed files with 236 additions and 248 deletions

View File

@ -57,7 +57,7 @@
#include "addrinfo.h"
#endif
#if defined(__KAME__) && defined(INET6)
#if defined(__KAME__) && defined(ENABLE_IPV6)
# define FAITH
#endif
@ -94,7 +94,7 @@ static struct gai_afd {
const char *a_addrany;
const char *a_loopback;
} gai_afdl [] = {
#ifdef INET6
#ifdef ENABLE_IPV6
#define N_INET6 0
{PF_INET6, sizeof(struct in6_addr),
sizeof(struct sockaddr_in6),
@ -111,7 +111,7 @@ static struct gai_afd {
{0, 0, 0, 0, NULL, NULL},
};
#ifdef INET6
#ifdef ENABLE_IPV6
#define PTON_MAX 16
#else
#define PTON_MAX 4
@ -288,7 +288,7 @@ getaddrinfo(const char*hostname, const char*servname,
switch (hints->ai_family) {
case PF_UNSPEC:
case PF_INET:
#ifdef INET6
#ifdef ENABLE_IPV6
case PF_INET6:
#endif
break;
@ -417,7 +417,7 @@ getaddrinfo(const char*hostname, const char*servname,
for (i = 0; gai_afdl[i].a_af; i++) {
if (inet_pton(gai_afdl[i].a_af, hostname, pton)) {
u_long v4a;
#ifdef INET6
#ifdef ENABLE_IPV6
u_char pfx;
#endif
@ -430,7 +430,7 @@ getaddrinfo(const char*hostname, const char*servname,
if (v4a == 0 || v4a == IN_LOOPBACKNET)
pai->ai_flags &= ~AI_CANONNAME;
break;
#ifdef INET6
#ifdef ENABLE_IPV6
case AF_INET6:
pfx = ((struct in6_addr *)pton)->s6_addr8[0];
if (pfx == 0 || pfx == 0xfe || pfx == 0xff)
@ -495,11 +495,11 @@ get_name(addr, gai_afd, res, numaddr, pai, port0)
struct hostent *hp;
struct addrinfo *cur;
int error = 0;
#ifdef INET6
#ifdef ENABLE_IPV6
int h_error;
#endif
#ifdef INET6
#ifdef ENABLE_IPV6
hp = getipnodebyaddr(addr, gai_afd->a_addrlen, gai_afd->a_af, &h_error);
#else
hp = gethostbyaddr(addr, gai_afd->a_addrlen, AF_INET);
@ -510,7 +510,7 @@ get_name(addr, gai_afd, res, numaddr, pai, port0)
} else
GET_AI(cur, gai_afd, numaddr, port);
#ifdef INET6
#ifdef ENABLE_IPV6
if (hp)
freehostent(hp);
#endif
@ -519,7 +519,7 @@ get_name(addr, gai_afd, res, numaddr, pai, port0)
free:
if (cur)
freeaddrinfo(cur);
#ifdef INET6
#ifdef ENABLE_IPV6
if (hp)
freehostent(hp);
#endif
@ -547,7 +547,7 @@ get_addr(hostname, af, res, pai, port0)
top = NULL;
sentinel.ai_next = NULL;
cur = &sentinel;
#ifdef INET6
#ifdef ENABLE_IPV6
if (af == AF_UNSPEC) {
hp = getipnodebyname(hostname, AF_INET6,
AI_ADDRCONFIG|AI_ALL|AI_V4MAPPED, &h_error);
@ -582,18 +582,18 @@ get_addr(hostname, af, res, pai, port0)
for (i = 0; (ap = hp->h_addr_list[i]) != NULL; i++) {
switch (af) {
#ifdef INET6
#ifdef ENABLE_IPV6
case AF_INET6:
gai_afd = &gai_afdl[N_INET6];
break;
#endif
#ifndef INET6
#ifndef ENABLE_IPV6
default: /* AF_UNSPEC */
#endif
case AF_INET:
gai_afd = &gai_afdl[N_INET];
break;
#ifdef INET6
#ifdef ENABLE_IPV6
default: /* AF_UNSPEC */
if (IN6_IS_ADDR_V4MAPPED((struct in6_addr *)ap)) {
ap += sizeof(struct in6_addr) -
@ -622,7 +622,7 @@ get_addr(hostname, af, res, pai, port0)
}
cur = cur->ai_next;
}
#ifdef INET6
#ifdef ENABLE_IPV6
freehostent(hp);
#endif
*res = top;
@ -630,7 +630,7 @@ get_addr(hostname, af, res, pai, port0)
free:
if (top)
freeaddrinfo(top);
#ifdef INET6
#ifdef ENABLE_IPV6
if (hp)
freehostent(hp);
#endif

View File

@ -58,7 +58,7 @@ static struct gni_afd {
int a_socklen;
int a_off;
} gni_afdl [] = {
#ifdef INET6
#ifdef ENABLE_IPV6
{PF_INET6, sizeof(struct in6_addr), sizeof(struct sockaddr_in6),
offsetof(struct sockaddr_in6, sin6_addr)},
#endif
@ -102,7 +102,7 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
int family, len, i;
char *addr, *p;
u_long v4a;
#ifdef INET6
#ifdef ENABLE_IPV6
u_char pfx;
#endif
int h_error;
@ -159,7 +159,7 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
if (v4a == 0 || v4a == IN_LOOPBACKNET)
flags |= NI_NUMERICHOST;
break;
#ifdef INET6
#ifdef ENABLE_IPV6
case AF_INET6:
pfx = ((struct sockaddr_in6 *)sa)->sin6_addr.s6_addr8[0];
if (pfx == 0 || pfx == 0xfe || pfx == 0xff)
@ -177,7 +177,7 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
return ENI_MEMORY;
strcpy(host, numaddr);
} else {
#ifdef INET6
#ifdef ENABLE_IPV6
hp = getipnodebyaddr(addr, gni_afd->a_addrlen, gni_afd->a_af, &h_error);
#else
hp = gethostbyaddr(addr, gni_afd->a_addrlen, gni_afd->a_af);
@ -190,13 +190,13 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
if (p) *p = '\0';
}
if (strlen(hp->h_name) > hostlen) {
#ifdef INET6
#ifdef ENABLE_IPV6
freehostent(hp);
#endif
return ENI_MEMORY;
}
strcpy(host, hp->h_name);
#ifdef INET6
#ifdef ENABLE_IPV6
freehostent(hp);
#endif
} else {

View File

@ -479,7 +479,7 @@ typedef struct {
#ifdef AF_UNIX
struct sockaddr_un un;
#endif
#ifdef INET6
#ifdef ENABLE_IPV6
struct sockaddr_in6 in6;
struct sockaddr_storage storage;
#endif
@ -594,7 +594,7 @@ setipaddr(char* name, struct sockaddr * addr_ret, int af)
case AF_INET:
siz = 4;
break;
#ifdef INET6
#ifdef ENABLE_IPV6
case AF_INET6:
siz = 16;
break;
@ -651,7 +651,7 @@ setipaddr(char* name, struct sockaddr * addr_ret, int af)
switch (addr_ret->sa_family) {
case AF_INET:
return 4;
#ifdef INET6
#ifdef ENABLE_IPV6
case AF_INET6:
return 16;
#endif
@ -725,7 +725,7 @@ makesockaddr(int sockfd, struct sockaddr *addr, int addrlen)
}
#endif /* AF_UNIX */
#ifdef INET6
#ifdef ENABLE_IPV6
case AF_INET6:
{
struct sockaddr_in6 *a;
@ -830,7 +830,7 @@ getsockaddrarg(PySocketSockObject *s, PyObject *args,
return 1;
}
#ifdef INET6
#ifdef ENABLE_IPV6
case AF_INET6:
{
struct sockaddr_in6* addr;
@ -919,7 +919,7 @@ getsockaddrlen(PySocketSockObject *s, socklen_t *len_ret)
return 1;
}
#ifdef INET6
#ifdef ENABLE_IPV6
case AF_INET6:
{
*len_ret = sizeof (struct sockaddr_in6);
@ -1993,7 +1993,7 @@ gethost_common(struct hostent *h, struct sockaddr *addr, int alen, int af)
if (alen < sizeof(struct sockaddr_in))
return NULL;
break;
#ifdef INET6
#ifdef ENABLE_IPV6
case AF_INET6:
if (alen < sizeof(struct sockaddr_in6))
return NULL;
@ -2031,7 +2031,7 @@ gethost_common(struct hostent *h, struct sockaddr *addr, int alen, int af)
memcpy((char *) addr, &sin, sizeof(sin));
break;
}
#ifdef INET6
#ifdef ENABLE_IPV6
case AF_INET6:
{
struct sockaddr_in6 sin6;
@ -2138,7 +2138,7 @@ for a host. The host argument is a string giving a host name or IP number.";
static PyObject *
PySocket_gethostbyaddr(PyObject *self, PyObject *args)
{
#ifdef INET6
#ifdef ENABLE_IPV6
struct sockaddr_storage addr;
#else
struct sockaddr_in addr;
@ -2177,7 +2177,7 @@ PySocket_gethostbyaddr(PyObject *self, PyObject *args)
ap = (char *)&((struct sockaddr_in *)sa)->sin_addr;
al = sizeof(((struct sockaddr_in *)sa)->sin_addr);
break;
#ifdef INET6
#ifdef ENABLE_IPV6
case AF_INET6:
ap = (char *)&((struct sockaddr_in6 *)sa)->sin6_addr;
al = sizeof(((struct sockaddr_in6 *)sa)->sin6_addr);
@ -2588,7 +2588,7 @@ PySocket_getnameinfo(PyObject *self, PyObject *args)
}
break;
}
#ifdef INET6
#ifdef ENABLE_IPV6
case AF_INET6:
{
struct sockaddr_in6 *sin6;

400
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1189,8 +1189,7 @@ if test "$ipv6" = "yes"; then
#ifdef IPV6_INRIA_VERSION
yes
#endif],
[ipv6type=$i;
OPT="-DINET6 $OPT"])
[ipv6type=$i])
;;
kame)
dnl http://www.kame.net/
@ -1202,8 +1201,7 @@ yes
[ipv6type=$i;
ipv6lib=inet6
ipv6libdir=/usr/local/v6/lib
ipv6trylibc=yes
OPT="-DINET6 $OPT"])
ipv6trylibc=yes])
;;
linux-glibc)
dnl http://www.v6.linux.or.jp/
@ -1213,8 +1211,7 @@ yes
yes
#endif],
[ipv6type=$i;
ipv6trylibc=yes
OPT="-DINET6 $OPT"])
ipv6trylibc=yes])
;;
linux-inet6)
dnl http://www.v6.linux.or.jp/
@ -1222,7 +1219,7 @@ yes
ipv6type=$i
ipv6lib=inet6
ipv6libdir=/usr/inet6/lib
OPT="-DINET6 -I/usr/inet6/include $OPT"
OPT="-I/usr/inet6/include $OPT"
fi
;;
solaris)
@ -1230,7 +1227,6 @@ yes
if /usr/xpg4/bin/grep -q tcp6 /etc/netconfig; then
ipv6type=$i
ipv6trylibc=yes
OPT="-DINET6 $OPT"
fi
fi
;;
@ -1242,8 +1238,7 @@ yes
#endif],
[ipv6type=$i;
ipv6lib=inet6;
ipv6libdir=/usr/local/v6/lib;
OPT="-DINET6 $OPT"])
ipv6libdir=/usr/local/v6/lib])
;;
v6d)
AC_EGREP_CPP(yes, [
@ -1264,8 +1259,7 @@ yes
#endif],
[ipv6type=$i;
ipv6lib=inet6;
ipv6libdir=/usr/local/v6/lib;
OPT="-DINET6 $OPT"])
ipv6libdir=/usr/local/v6/lib])
;;
esac
if test "$ipv6type" != "unknown"; then