summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/getaddrinfo.c32
-rw-r--r--Modules/getnameinfo.c12
-rw-r--r--Modules/socketmodule.c22
3 files changed, 33 insertions, 33 deletions
diff --git a/Modules/getaddrinfo.c b/Modules/getaddrinfo.c
index 5d92608..6731c6c 100644
--- a/Modules/getaddrinfo.c
+++ b/Modules/getaddrinfo.c
@@ -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
diff --git a/Modules/getnameinfo.c b/Modules/getnameinfo.c
index 4827bc6..d3c0ac5 100644
--- a/Modules/getnameinfo.c
+++ b/Modules/getnameinfo.c
@@ -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 {
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index db91d8b..bbca138 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -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;