Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
44ddbde3
Commit
44ddbde3
authored
Dec 02, 2001
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove INET6 define. Use ENABLE_IPV6 instead.
parent
080d5b3f
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
236 additions
and
248 deletions
+236
-248
Modules/getaddrinfo.c
Modules/getaddrinfo.c
+16
-16
Modules/getnameinfo.c
Modules/getnameinfo.c
+6
-6
Modules/socketmodule.c
Modules/socketmodule.c
+11
-11
configure
configure
+197
-203
configure.in
configure.in
+6
-12
No files found.
Modules/getaddrinfo.c
View file @
44ddbde3
...
...
@@ -57,7 +57,7 @@
#include "addrinfo.h"
#endif
#if defined(__KAME__) && defined(
INET
6)
#if defined(__KAME__) && defined(
ENABLE_IPV
6)
# define FAITH
#endif
...
...
@@ -94,7 +94,7 @@ static struct gai_afd {
const
char
*
a_addrany
;
const
char
*
a_loopback
;
}
gai_afdl
[]
=
{
#ifdef
INET
6
#ifdef
ENABLE_IPV
6
#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
INET
6
#ifdef
ENABLE_IPV
6
#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
INET
6
#ifdef
ENABLE_IPV
6
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
INET
6
#ifdef
ENABLE_IPV
6
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
INET
6
#ifdef
ENABLE_IPV
6
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
INET
6
#ifdef
ENABLE_IPV
6
int
h_error
;
#endif
#ifdef
INET
6
#ifdef
ENABLE_IPV
6
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
INET
6
#ifdef
ENABLE_IPV
6
if
(
hp
)
freehostent
(
hp
);
#endif
...
...
@@ -519,7 +519,7 @@ get_name(addr, gai_afd, res, numaddr, pai, port0)
free:
if
(
cur
)
freeaddrinfo
(
cur
);
#ifdef
INET
6
#ifdef
ENABLE_IPV
6
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
INET
6
#ifdef
ENABLE_IPV
6
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
INET
6
#ifdef
ENABLE_IPV
6
case
AF_INET6
:
gai_afd
=
&
gai_afdl
[
N_INET6
];
break
;
#endif
#ifndef
INET
6
#ifndef
ENABLE_IPV
6
default:
/* AF_UNSPEC */
#endif
case
AF_INET
:
gai_afd
=
&
gai_afdl
[
N_INET
];
break
;
#ifdef
INET
6
#ifdef
ENABLE_IPV
6
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
INET
6
#ifdef
ENABLE_IPV
6
freehostent
(
hp
);
#endif
*
res
=
top
;
...
...
@@ -630,7 +630,7 @@ get_addr(hostname, af, res, pai, port0)
free:
if
(
top
)
freeaddrinfo
(
top
);
#ifdef
INET
6
#ifdef
ENABLE_IPV
6
if
(
hp
)
freehostent
(
hp
);
#endif
...
...
Modules/getnameinfo.c
View file @
44ddbde3
...
...
@@ -58,7 +58,7 @@ static struct gni_afd {
int
a_socklen
;
int
a_off
;
}
gni_afdl
[]
=
{
#ifdef
INET
6
#ifdef
ENABLE_IPV
6
{
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
INET
6
#ifdef
ENABLE_IPV
6
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
INET
6
#ifdef
ENABLE_IPV
6
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
INET
6
#ifdef
ENABLE_IPV
6
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
INET
6
#ifdef
ENABLE_IPV
6
freehostent
(
hp
);
#endif
return
ENI_MEMORY
;
}
strcpy
(
host
,
hp
->
h_name
);
#ifdef
INET
6
#ifdef
ENABLE_IPV
6
freehostent
(
hp
);
#endif
}
else
{
...
...
Modules/socketmodule.c
View file @
44ddbde3
...
...
@@ -479,7 +479,7 @@ typedef struct {
#ifdef AF_UNIX
struct
sockaddr_un
un
;
#endif
#ifdef
INET
6
#ifdef
ENABLE_IPV
6
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
INET
6
#ifdef
ENABLE_IPV
6
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
INET
6
#ifdef
ENABLE_IPV
6
case
AF_INET6
:
return
16
;
#endif
...
...
@@ -725,7 +725,7 @@ makesockaddr(int sockfd, struct sockaddr *addr, int addrlen)
}
#endif
/* AF_UNIX */
#ifdef
INET
6
#ifdef
ENABLE_IPV
6
case
AF_INET6
:
{
struct
sockaddr_in6
*
a
;
...
...
@@ -830,7 +830,7 @@ getsockaddrarg(PySocketSockObject *s, PyObject *args,
return
1
;
}
#ifdef
INET
6
#ifdef
ENABLE_IPV
6
case
AF_INET6
:
{
struct
sockaddr_in6
*
addr
;
...
...
@@ -919,7 +919,7 @@ getsockaddrlen(PySocketSockObject *s, socklen_t *len_ret)
return
1
;
}
#ifdef
INET
6
#ifdef
ENABLE_IPV
6
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
INET
6
#ifdef
ENABLE_IPV
6
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
INET
6
#ifdef
ENABLE_IPV
6
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
INET
6
#ifdef
ENABLE_IPV
6
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
INET
6
#ifdef
ENABLE_IPV
6
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
INET
6
#ifdef
ENABLE_IPV
6
case
AF_INET6
:
{
struct
sockaddr_in6
*
sin6
;
...
...
configure
View file @
44ddbde3
This diff is collapsed.
Click to expand it.
configure.in
View file @
44ddbde3
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment