[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
IPv6 Netowrk Device Numbering BP
On 01-Nov-2012, Owen DeLong <owen at delong.com> sent:
> The only exceptions to this parsing would be if someone handed
> you a textual representation of an IPv4 mapped address
> (::ffff:192.0.2.50), which essentially represents the partial
> decimal format Masataka is requesting.
I might be missing something here, but isn't that format already
valid for any IPv6 address, not just the special v4-in-v6
>>> import socket
>>> p = '2001:abcd::18.104.22.168'
>>> n = socket.inet_pton(socket.AF_INET6, p)
>>> socket.inet_ntop(socket.AF_INET6, n)
Or is the issue just the ntop part not giving you back the
Chip Marshall <chip at 2bithacker.net>
http://weblog.2bithacker.net/ KB1QYW PGP key ID 43C4819E
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 195 bytes
Desc: not available