Package netaddr :: Package ip :: Class BaseIP |
[hide private]
[frames] | no frames]

# Class BaseIP

    object --+
             |
            BaseIP

Known Subclasses:
  - IPAddress
  - , IPRange
  - , IPNetwork

An abstract base class for common operations shared between various IP related subclasses.

Instance Methods | [hide private]
__init__(self) Constructor. |
key(self) Returns: a key tuple that uniquely identifies this IP address. |
sort_key(self) Returns: A key tuple used to compare and sort this IPAddress correctly. |
__hash__(self) Returns: A hash value uniquely indentifying this IP object. |
__eq__(self, other) Returns: `True` if this IPAddress or IPNetwork object is equivalent to `other`, `False` otherwise. |
__ne__(self, other) Returns: `True` if this IPAddress or IPNetwork object is not equivalent to `other`, `False` otherwise. |
__lt__(self, other) Returns: `True` if this IPAddress or IPNetwork object is less than `other`, `False` otherwise. |
__le__(self, other) Returns: `True` if this IPAddress or IPNetwork object is less than or equal to `other`, `False` otherwise. |
__gt__(self, other) Returns: `True` if this IPAddress or IPNetwork object is greater than `other`, `False` otherwise. |
__ge__(self, other) Returns: `True` if this IPAddress or IPNetwork object is greater than or equal to `other`, `False` otherwise. |
is_unicast(self) Returns: `True` if this IP is unicast, `False` otherwise |
is_multicast(self) Returns: `True` if this IP is multicast, `False` otherwise |
is_loopback(self) Returns: `True` if this IP is loopback address (not for network transmission), `False` otherwise. |
is_private(self) Returns: `True` if this IP is for internal/private use only (i.e. |
is_link_local(self) Returns: `True` if this IP is link-local address `False` otherwise. |
is_reserved(self) Returns: `True` if this IP is in IANA reserved range, `False` otherwise. |
is_ipv4_mapped(self) Returns: `True` if this IP is IPv4-compatible IPv6 address, `False` otherwise. |
is_ipv4_compat(self) Returns: `True` if this IP is IPv4-mapped IPv6 address, `False` otherwise. |
Inherited from `object`: `__delattr__`, `__getattribute__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__str__`

Properties | [hide private]
| info A record dict containing IANA registration details for this IP address if available, None otherwise.
| version the IP protocol version represented by this IP object.
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self) (Constructor) |
Constructor. Overrides: object.__init__

### key(self) |
Returns: a key tuple that uniquely identifies this IP address.

### sort_key(self) |
Returns: A key tuple used to compare and sort this IPAddress correctly.

### __hash__(self) (Hashing function) |
hash(x) Returns: A hash value uniquely indentifying this IP object. Overrides: object.__hash__

### __eq__(self, other) (Equality operator) |
Parameters: `other` - an IPAddress or IPNetwork object. Returns: `True` if this IPAddress or IPNetwork object is equivalent to `other`, `False` otherwise.

### __ne__(self, other) |
Parameters: `other` - an IPAddress or IPNetwork object. Returns: `True` if this IPAddress or IPNetwork object is not equivalent to `other`, `False` otherwise.

### __lt__(self, other) (Less-than operator) |
Parameters: `other` - an IPAddress or IPNetwork object. Returns: `True` if this IPAddress or IPNetwork object is less than `other`, `False` otherwise.

### __le__(self, other) (Less-than-or-equals operator) |
Parameters: `other` - an IPAddress or IPNetwork object. Returns: `True` if this IPAddress or IPNetwork object is less than or equal to `other`, `False` otherwise.

### __gt__(self, other) (Greater-than operator) |
Parameters: `other` - an IPAddress or IPNetwork object. Returns: `True` if this IPAddress or IPNetwork object is greater than `other`, `False` otherwise.

### __ge__(self, other) (Greater-than-or-equals operator) |
Parameters: `other` - an IPAddress or IPNetwork object. Returns: `True` if this IPAddress or IPNetwork object is greater than or equal to `other`, `False` otherwise.

### is_unicast(self) |
Returns: `True` if this IP is unicast, `False` otherwise

### is_multicast(self) |
Returns: `True` if this IP is multicast, `False` otherwise

### is_loopback(self) |
Returns: `True` if this IP is loopback address (not for network transmission), `False` otherwise. References: RFC 3330 and 4291.

### is_private(self) |
Returns: `True` if this IP is for internal/private use only (i.e. non-public), `False` otherwise. Reference: RFCs 1918, 3330, 4193, 3879 and 2365.

### is_link_local(self) |
Returns: `True` if this IP is link-local address `False` otherwise. Reference: RFCs 3927 and 4291.

### is_reserved(self) |
Returns: `True` if this IP is in IANA reserved range, `False` otherwise. Reference: RFCs 3330 and 3171.

### is_ipv4_mapped(self) |
Returns: `True` if this IP is IPv4-compatible IPv6 address, `False` otherwise.

### is_ipv4_compat(self) |
Returns: `True` if this IP is IPv4-mapped IPv6 address, `False` otherwise.

Property Details | [hide private]

### info A record dict containing IANA registration details for this IP address if available, None otherwise. Get Method: unreachable.info(self) - A record dict containing IANA registration details for this IP address if available, None otherwise.

### version the IP protocol version represented by this IP object. Get Method: unreachable.version(self) - the IP protocol version represented by this IP object.