All higher level subnet and network operations can be found in objects
of classes CIDR, IPRange and Wildcard.
There are handy helper methods here, (.cidr(),
.iprange() and .wildcard()) that return
pre-initialised objects of those classes without you having to call them
explicitly.
See those classes for details on the functionality they provide.
|
|
|
|
|
is_netmask(self)
Returns:
True if this addr is a mask that would return a host id,
False otherwise. |
source code
|
|
|
|
netmask_bits(self)
Returns:
If this address is a valid netmask, the number of non-zero bits are
returned, otherwise it returns the width in bits for based on the
version, 32 for IPv4 and 128 for IPv6. |
source code
|
|
|
|
|
|
|
is_hostmask(self)
Returns:
True if this address is a mask that would return a host
id, False otherwise. |
source code
|
|
|
|
hostname(self)
Returns:
Returns the FQDN for this IP address via a DNS query using
gethostbyaddr() Python's socket module. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
ipv4(self)
Returns:
A new version 4 IP object numerically equivalent this address. |
source code
|
|
|
|
ipv6(self,
ipv4_compatible=False)
Please Note: the IPv4-Mapped IPv6 address format is now
considered deprecated. |
source code
|
|
|
|
|
|
|
is_loopback(self)
Returns:
True if this IP is loopback address (not for network
transmission), False otherwise. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
info(self)
Returns:
A record dict containing IANA registration details for this IP
address if available, None otherwise. |
source code
|
|
|
|
|
|
|
|
|
Inherited from Addr:
__add__,
__and__,
__eq__,
__ge__,
__getitem__,
__gt__,
__hash__,
__hex__,
__iadd__,
__int__,
__invert__,
__isub__,
__iter__,
__le__,
__len__,
__long__,
__lshift__,
__lt__,
__ne__,
__or__,
__rshift__,
__setitem__,
__sub__,
__xor__,
bin,
bits,
packed
Inherited from object:
__delattr__,
__getattribute__,
__new__,
__reduce__,
__reduce_ex__,
__setattr__
|