Home | History | Annotate | Download | only in Lib

Lines Matching defs:ip

28     """Take an IP string/int and return an object of the correct type.
31 address: A string or integer, the IP address. Either IPv4 or
58 """Take an IP string/int and return an object of the correct type.
61 address: A string or integer, the IP network. Either IPv4 or
88 """Take an IP string/int and return an object of the correct type.
91 address: A string or integer, the IP address. Either IPv4 or
126 address: An integer representation of an IPv4 IP address.
133 IPv4 IP address.
146 address: An integer representation of an IPv6 IP address.
173 A tuple containing the first and last IP addresses in the sequence.
178 for ip in it:
179 if ip._ip != last._ip + 1:
181 first = ip
182 last = ip
203 """Summarize a network range given the first and last IP addresses.
221 If the first and last objects are not IP addresses.
230 raise TypeError('first and last must be IP addresses, not networks')
235 raise ValueError('last IP address must be greater than first')
238 ip = IPv4Network
240 ip = IPv6Network
242 raise ValueError('unknown IP version')
250 net = ip((first_int, ip_bits - nbits))
253 if first_int - 1 == ip._ALL_ONES:
307 """Collapse a list of IP objects.
328 # split IP addresses and networks
329 for ip in addresses:
330 if isinstance(ip, _BaseAddress):
331 if ips and ips[-1]._version != ip._version:
333 ip, ips[-1]))
334 ips.append(ip)
335 elif ip._prefixlen == ip._max_prefixlen:
336 if ips and ips[-1]._version != ip._version:
338 ip, ips[-1]))
340 ips.append(ip.ip)
342 ips.append(ip.network_address)
344 if nets and nets[-1]._version != ip._version:
346 ip, nets[-1]))
347 nets.append(ip)
393 """Return the longhand version of the IP address as a string."""
398 """Return the shorthand version of the IP address as a string."""
403 """The name of the reverse DNS pointer for the IP address, e.g.:
514 # Parse the netmask/hostmask like an IP address.
542 """A generic IP object.
544 This IP class contains the version independent methods which are
545 used by single IP addresses.
601 """A generic IP network object.
603 This IP class contains the version independent methods which are
815 """Compare two IP objects.
824 other: An IP object.
827 If the IP versions of self and other are the same, returns:
843 TypeError if the IP versions are different.
875 In the case that self contains only one IP
1053 The following methods are used by IPv4 objects in both single IP
1101 """Turn the given IP string into an integer for comparison.
1104 ip_str: A string, the IP ip_str.
1107 The IP ip_str as an integer.
1167 ip_int: An integer, the IP address.
1170 The IP address as a string in dotted decimal notation.
1207 """Test if the IP string is a hostmask (rather than a netmask).
1213 A boolean, True if the IP string is a hostmask.
1255 address: A string or integer representing the IP
1280 # which converts into a formatted IP string.
1425 def ip(self):
1464 address: A string or integer representing the IP [& network].
1523 # which converts into a formatted IP prefix string.
1596 The following methods are used by IPv6 objects in both single IP
1813 ip_int: An integer, the IP address.
1847 ip_str = str(self.ip)
1886 address: A string or integer representing the IP
1912 # which converts into a formatted IP string.
2115 def ip(self):
2163 IP and prefix/netmask.
2180 IP address on a network, eg, 2001:db8::1/124.
2215 # which converts into a formatted IP prefix string.