[BulletProof] Pruebas con python con IPv6 con vistas al BP

ZOLTAN ZOLTAN at teleline.es
Fri Oct 4 10:13:03 CEST 2002


Mirando en el RFC 2133
>>>>
3.7.  Compatibility with IPv4 Nodes

   The API also provides a different type of compatibility: the ability
   for IPv6 applications to interoperate with IPv4 applications.  This
   feature uses the IPv4-mapped IPv6 address format defined in the IPv6
   addressing architecture specification [2].  This address format
   allows the IPv4 address of an IPv4 node to be represented as an IPv6
   address.  The IPv4 address is encoded into the low-order 32 bits of
   the IPv6 address, and the high-order 96 bits hold the fixed prefix
   0:0:0:0:0:FFFF.  IPv4-mapped addresses are written as follows:

       ::FFFF:<IPv4-address>

   These addresses are often generated automatically by the
   gethostbyname() function when the specified host has only IPv4
   addresses (as described in Section 6.1).


Usando ::FFFF:a.b.c.d

>>> import socket
>>> a=socket.socket(socket.AF_INET6,socket.SOCK_STREAM)
>>> a
<socket object, fd=3, family=10, type=1, protocol=0>
>>> a.connect(("::FFFF:62.37.230.2",6667))
>>> a.send("user e e e e e ee \n")
19
>>> a.send("nick qwqwqwqw\n")
14
>>> a.recv(40)
':gaia.irc-hispano.org NOTICE IP_LOOKUP :'

Esto en un linux con kernel 2.4.18, IPv6 activo y python 2.2.1.


Intente probar en un Windows XP con IPv6 nativo y el python 2.2 usado 
para BulletProof.

Python 2.2 (#28, Dec 21 2001, 12:21:22) [MSC 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import socket
>>> a=socket.socket(socket.AF_INET6,socket.SOCK_STREAM)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
AttributeError: 'module' object has no attribute 'AF_INET6'
>>>

Por lo visto no lo soporta, habra que decir al autor que en windows se 
puede tener IPv6 nativamente (XP y .Net) o por medio de parches (9x, NT 
y 2000).








More information about the BulletProof mailing list