You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some protocols and applications (for example DNS or joining multicast
groups via socket.setsockopt) need a binary representation of an IP
address. For IPv4 addresses, socket.inet_aton can be used. On some
platforms supporting IPv6, socket.inet_pton can be used for IPv4 and IPv6
addresses. However, this excludes platforms with (not socket.has_ipv6 or
sys.platform == 'win32').
A property ("packed") should be defined for the IPv4 and IPv6 classes and
return a binary representation (bytes in Python3+, str otherwise).
Additionally, as soon as the code is ported to python3, calling
IP(bytes_instance) should yield an IP i so that i.packed == bytes_instance .
Original issue reported on code.google.com by phihag.de@gmail.com on 6 Mar 2009 at 11:46
The text was updated successfully, but these errors were encountered:
Note that this issue was erroneously created in Rietveld as well as google
code - I did not realise issues in rietveld do not refer to those in google
code
until after I opened the issue at google code. Sorry for that!
[Edit] Corrected some formatting mistakes
Original comment by phihag.de@gmail.com on 8 Mar 2009 at 9:43
When using the dpkt library, the IP's are in the binary form.
src = ipaddr.IP( int( ip.src.encode('hex'), 16 ) ).
I guess this isn't the end of the world, but I haven't profiled to see if there
is a
faster way.
Original comment by noahcamp...@gmail.com on 20 May 2009 at 10:01
Original issue reported on code.google.com by
phihag.de@gmail.com
on 6 Mar 2009 at 11:46The text was updated successfully, but these errors were encountered: