# Path: dyndnsc/detector/iface.py
# LOG = logging.getLogger(__name__)
# def _default_interface():
#     def __init__(self, iface=None, netmask=None, family=None, *args, **kwargs):
#     def can_detect_offline(self):
#     def _detect(self):
#     def detect(self):
# class IPDetector_Iface(IPDetector):


import logging
from .iface import IPDetector_Iface, AF_INET6
# -*- coding: utf-8 -*-

"""Module containing logic for teredo based detectors."""



LOG = logging.getLogger(__name__)


class IPDetector_Teredo(IPDetector_Iface):
    """IPDetector to detect a Teredo ipv6 address of a local interface.

    Bits 0 to 31 of the ipv6 address are set to the Teredo prefix (normally
    2001:0000::/32).
    This detector only checks the first 16 bits!
    See http://en.wikipedia.org/wiki/Teredo_tunneling for more information on
    Teredo.

    Inherits IPDetector_Iface and sets default options only.
    """

    configuration_key = "teredo"

    def __init__(self, iface="tun0", netmask="2001:0000::/32", *args, **kwargs):
        """Initialize."""
        super(IPDetector_Teredo, self).__init__(*args, **kwargs)

        self.opts_iface = iface
        self.opts_netmask = netmask

# Path: dyndnsc/detector/iface.py
# LOG = logging.getLogger(__name__)
# def _default_interface():
#     def __init__(self, iface=None, netmask=None, family=None, *args, **kwargs):
#     def can_detect_offline(self):
#     def _detect(self):
#     def detect(self):
# class IPDetector_Iface(IPDetector):


# Path: dyndnsc/detector/teredo.py
import logging
from .iface import IPDetector_Iface, AF_INET6

# -*- coding: utf-8 -*-

"""Module containing logic for teredo based detectors."""



LOG = logging.getLogger(__name__)


class IPDetector_Teredo(IPDetector_Iface):
    """IPDetector to detect a Teredo ipv6 address of a local interface.

    Bits 0 to 31 of the ipv6 address are set to the Teredo prefix (normally
    2001:0000::/32).
    This detector only checks the first 16 bits!
    See http://en.wikipedia.org/wiki/Teredo_tunneling for more information on
    Teredo.

    Inherits IPDetector_Iface and sets default options only.
    """

    configuration_key = "teredo"

    def __init__(self, iface="tun0", netmask="2001:0000::/32", *args, **kwargs):
        """Initialize."""
        super(IPDetector_Teredo, self).__init__(*args, **kwargs)

        self.opts_iface = iface
        self.opts_netmask = netmask

        self.opts_family = AF_INET6