| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| |\
|/ /
| |
| | |
alexf101-patch-1
|
| |
| |
| | |
Calling "ips.index(last)" inside a loop over all ips does O(n) linear searches, leading to quadratic performance. The index call isn't necessary; the position of 'last' in ips can be inferred if _find_address_range returns the position that it found 'last' at.
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
Documentation on the new module is now at:
https://docs.python.org/3/library/ipaddress.html
|
| | |
|
| | |
|
| | |
|
|\ \
| |/ |
|
| |
| |
| |
| | |
patch by pmarks.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The previous code checks each octet separately, and then checks if
the sequence of octets is nonincreasing. This is insufficient, because
it allows nonsensical inputs like "255.128.128.0".
The previous code also only partially handles hostmasks (inverted netmasks).
"0.255.255.255" becomes /8, but 0.15.255.255 is rejected.
The solution is to disregard octets, and interpret the address as a
single sequence of bits.
Note that this could be trivially extended to support IPv6 netmasks and
hostmasks, but those are non-standard.
I've also made the CIDR parser more strict, so it rejects anything that's
not not a decimal digit, like /+24
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
|
| |
| |
| |
| | |
issue97.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@244 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@243 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@242 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@241 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@240 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@239 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@238 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@237 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@236 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@235 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@234 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@233 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| |
| |
| | |
that host bits are not set prior to deleting the ip attribute
git-svn-id: https://ipaddr-py.googlecode.com/svn@232 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| |
| |
| | |
_BaseInterface which return the network to which an interface belongs
git-svn-id: https://ipaddr-py.googlecode.com/svn@231 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| |
| |
| | |
address
git-svn-id: https://ipaddr-py.googlecode.com/svn@230 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@229 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| |
| |
| | |
work. still need to figure out how to handle type-promotion
git-svn-id: https://ipaddr-py.googlecode.com/svn@228 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@227 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@226 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@225 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@224 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@223 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@222 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@221 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@220 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@219 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@218 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@217 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@216 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@215 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@214 09200d28-7f98-11dd-ad27-0f66e57d2035
|
| |
| |
| |
| | |
git-svn-id: https://ipaddr-py.googlecode.com/svn@213 09200d28-7f98-11dd-ad27-0f66e57d2035
|