timmerk / ipaddr-py

Automatically exported from code.google.com/p/ipaddr-py
0 stars 0 forks source link

Feature Request: support hex() for pxelinux style ips #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It'd be nice to easily get the hex for ipv4 addresses for use with
applications that use that such as pxelinux.

http://codereview.appspot.com/7255/show

Original issue reported on code.google.com by pnas...@gmail.com on 6 Oct 2008 at 6:02

GoogleCodeExporter commented 9 years ago

Original comment by ha...@google.com on 7 Oct 2008 at 1:23

GoogleCodeExporter commented 9 years ago
I think there are too many variations on this, and it only works for IPv4 /32s 
and
IPv6 /128s.

For example, 1.2.3.4/32 would become which of the following?

  0x01020304  # hex(ip.int)
  0x04030201  # NBO
  01020304    # '%08x' % ip.int (IPv6 would be '%032x' % ip.int)

1.2.3.0/24 in hex doesn't make sense, unless we do '0x01020304/0x18' ?

Not implementing this means the user is free to do whatever variation they need.

Original comment by sm...@google.com on 18 Dec 2008 at 8:05

GoogleCodeExporter commented 9 years ago
I'm happy for this issue to be closed and letting the api user do what they need
having thought about it more

Original comment by pnas...@gmail.com on 18 Dec 2008 at 9:04

GoogleCodeExporter commented 9 years ago
Thanks pnasrat.  It was a good suggestion, though.  Keep them coming!

Original comment by sm...@google.com on 18 Dec 2008 at 4:31