# Path: dyndnsc/detector/base.py
# LOG = logging.getLogger(__name__)
# class IPDetector(Subject, DynamicCliMixin):
#     def __init__(self, *args, **kwargs):
#     def can_detect_offline(self):
#     def af(self):
#     def get_old_value(self):
#     def set_old_value(self, value):
#     def get_current_value(self, default=None):
#     def set_current_value(self, value):
#     def has_changed(self):
#     def configuration_key_prefix():
# 
# Path: dyndnsc/common/six.py
# def ipaddress(addr):
#     """Return an ipaddress.ip_address object from the given string IP."""
#     return _ipaddress.ip_address(addr)
# 
# def ipnetwork(addr):
#     """Return an ipaddress.ip_network object from the given string IP."""
#     return _ipaddress.ip_network(addr)


import logging
from random import randint
from .base import IPDetector, AF_INET
from ..common.six import ipaddress, ipnetwork

    def __init__(self, num=None):
        """Initialize."""
        self._max = num

        # Reserved list from http://www.iana.org/assignments/ipv4-address-space
        # (dated  2010-02-22)
        self._reserved_netmasks = frozenset([
            "0.0.0.0/8",
            "5.0.0.0/8",
            "10.0.0.0/8",
            "23.0.0.0/8",
            "31.0.0.0/8",
            "36.0.0.0/8",
            "39.0.0.0/8",
            "42.0.0.0/8",
            "127.0.0.0/8",
            "169.254.0.0/16",
            "172.16.0.0/12",
            "192.168.0.0/16",
            "224.0.0.0/3",
            "240.0.0.0/8"
        ])

    def is_reserved_ip(self, ip):
        """Check if the given ip address is in a reserved ipv4 address space.

        :param ip: ip address
        :return: boolean
        """

# Path: dyndnsc/detector/base.py
# LOG = logging.getLogger(__name__)
# class IPDetector(Subject, DynamicCliMixin):
#     def __init__(self, *args, **kwargs):
#     def can_detect_offline(self):
#     def af(self):
#     def get_old_value(self):
#     def set_old_value(self, value):
#     def get_current_value(self, default=None):
#     def set_current_value(self, value):
#     def has_changed(self):
#     def configuration_key_prefix():
# 
# Path: dyndnsc/common/six.py
# def ipaddress(addr):
#     """Return an ipaddress.ip_address object from the given string IP."""
#     return _ipaddress.ip_address(addr)
# 
# def ipnetwork(addr):
#     """Return an ipaddress.ip_network object from the given string IP."""
#     return _ipaddress.ip_network(addr)


# Path: dyndnsc/detector/rand.py
import logging
from random import randint
from .base import IPDetector, AF_INET
from ..common.six import ipaddress, ipnetwork


    def __init__(self, num=None):
        """Initialize."""
        self._max = num

        # Reserved list from http://www.iana.org/assignments/ipv4-address-space
        # (dated  2010-02-22)
        self._reserved_netmasks = frozenset([
            "0.0.0.0/8",
            "5.0.0.0/8",
            "10.0.0.0/8",
            "23.0.0.0/8",
            "31.0.0.0/8",
            "36.0.0.0/8",
            "39.0.0.0/8",
            "42.0.0.0/8",
            "127.0.0.0/8",
            "169.254.0.0/16",
            "172.16.0.0/12",
            "192.168.0.0/16",
            "224.0.0.0/3",
            "240.0.0.0/8"
        ])

    def is_reserved_ip(self, ip):
        """Check if the given ip address is in a reserved ipv4 address space.

        :param ip: ip address
        :return: boolean
        """

        theip = ipaddress(ip)