Peter Moody
unread,Sep 20, 2013, 5:11:51 PM9/20/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pma...@google.com, vkli...@google.com, ipaddr...@googlegroups.com, re...@codereview-hr.appspotmail.com
Sorry for the delay, looking at this now.
note that ipaddr is effectively deprecated in favor of ipaddress which is in the stdlib of python 3.2 (not that making this patch against ipaddr as opposed to ipaddress delayed its review).
On Tue, Sep 17 2013 at 11:46,
pma...@google.com wrote:
> Reviewers: Peter Moody,
>
> Description:
> This operates at the bit level, instead of making strange assumptions at
> the octet level, and thus fixes an assortment of bugs.
>
> Note that this could be trivially extended to support IPv6 netmasks and
> hostmasks, but that's probably not useful because everyone uses CIDR
> notation.
>
> Added:
> - _prefix_from_prefix_string: Parse a number, with bounds checking.
> - _prefix_from_ip_string: Parse IPv4 netmask/hostmask string.
>
> Improved:
> - _prefix_from_ip_int: Only accept inputs with the bit sequence 1*0*.
>
> Removed:
> - _ip_string_from_prefix
> - _is_hostmask
> - _is_valid_netmask
>
>
> Please review this at
https://codereview.appspot.com/13745043/
>
> Affected files (+141, -124 lines):
> M trunk/ipaddr.py
> M trunk/ipaddr_test.py