A class whose objects represent Internet Protocol network addresses.
Both IPv4 and IPv6 are fully supported and also permit the inclusion of
bitmask prefix or subnet mask address indicating the size/extent of the
subnet, for example :
|
|
|
|
|
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 the given
address type (IPv4: 32, IPv6: 128). |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__repr__(self)
Returns:
An executable Python statement that can recreate an object with an
equivalent state. |
source code
|
|
|
Inherited from Addr:
__eq__,
__ge__,
__getitem__,
__gt__,
__hash__,
__hex__,
__iadd__,
__int__,
__isub__,
__iter__,
__le__,
__len__,
__long__,
__lt__,
__ne__,
__setitem__,
bits
Inherited from object:
__delattr__,
__getattribute__,
__new__,
__reduce__,
__reduce_ex__,
__setattr__
|