# Path: twunnel/dns_resolver.py
# def setDefaultConfiguration(configuration, keys):
#     def __init__(self, configuration):
#     def getHostByName(self, name, timeout=None, effort=10):
#     def _cbRecords(self, records, name, timeout, effort):
#     def _extractRecord(self, records, name, timeout, effort):
#     def __init__(self, configuration, ttl = 60 * 60):
#     def lookupAddress(self, name, timeout=None):
#     def lookupIPV6Address(self, name, timeout=None):
#     def _a_aaaaRecords(self, name):
#     def lookupAllRecords(self, name, timeout=None):
#     def __init__(self, controller):
#     def clientConnectionLost(self, connector, reason):
#     def clientConnectionFailed(self, connector, reason):
#     def buildProtocol(self, addr):
#     def __init__(self, configuration):
#     def connectionMade(self, connection):
#     def connectionLost(self, connection):
#     def messageReceived(self, message, protocol, address=None):
#     def _lookup(self, name, cls, type, timeout=None):
#     def _cbMessage(self, message):
#     def __init__(self, configuration):
#     def _lookup(self, name, cls, type, timeout):
# def createResolver(configuration):
# def getDefaultResolver():
# def setDefaultResolver(resolver):
# class ResolverBase(common.ResolverBase):
# class FileResolver(ResolverBase, hosts.Resolver):
# class DNSProtocolClientFactory(protocol.ClientFactory):
# class ServerResolver(ResolverBase):
# class Resolver(ResolverBase, resolve.ResolverChain):
# 
# Path: twunnel/logger.py
# def msgWrapper(*args, **kwargs):
# def setDefaultConfiguration(configuration, keys):
# def configure(configuration):
# def log(messageLevel, message):
# 
# Path: twunnel/proxy_server.py
# def setDefaultConfiguration(configuration, keys):
#     def __init__(self):
#     def connectionMade(self):
#     def connectionLost(self, reason):
#     def dataReceived(self, data):
#     def tunnelOutputProtocol_connectionMade(self, data):
#     def __init__(self, outputProtocolFactory, tunnelOutputProtocolFactory, contextFactory=None):
#     def startedConnecting(self, connector):
#     def clientConnectionFailed(self, connector, reason):
#     def clientConnectionLost(self, connector, reason):
#     def __init__(self, configuration):
#     def connect(self, address, port, outputProtocolFactory, contextFactory=None, timeout=30, bindAddress=None):
#     def getTunnelOutputProtocolFactoryClass(self, type):
# def getDefaultTunnelClass():
# def setDefaultTunnelClass(tunnelClass):
# def createTunnel(configuration):
#     def __init__(self, tunnel):
#     def connectTCP(self, host, port, factory, timeout=30, bindAddress=None):
#     def connectSSL(self, host, port, factory, contextFactory, timeout=30, bindAddress=None):
#     def __getattr__(self, attr):
# def createTunnelReactor(configuration):
# class TunnelProtocol(protocol.Protocol):
# class TunnelProtocolFactory(protocol.ClientFactory):
# class Tunnel(object):
# class TunnelReactor(object):
# 
# Path: examples/example.py
# class Protocol(protocol.Protocol):
# class ProtocolFactory(protocol.ClientFactory):
#     def __init__(self):
#     def connectionMade(self):
#     def connectionLost(self, reason):
#     def dataReceived(self, data):
#     def __init__(self):
#     def startedConnecting(self, connector):
#     def clientConnectionFailed(self, connector, reason):
#     def clientConnectionLost(self, connector, reason):


import sys
import os
from twisted.internet import reactor, ssl
from twisted.python import log
from twunnel import dns_resolver, logger, proxy_server
from examples import example
    "LOGGER":
    {
        "LEVEL": 3
    }
}

logger.configure(configuration)

def install_DNS_RESOLVER():
    configuration = \
    {
        "DNS_RESOLVER":
        {
            "FILE": "files/DNS/H.txt",
            "SERVERS":
            [
                {
                    "ADDRESS": "8.8.8.8",
                    "PORT": 53
                },
                {
                    "ADDRESS": "8.8.4.4",
                    "PORT": 53
                }
            ]
        },
        "PROXY_SERVERS": []
    }
    
    resolver = dns_resolver.createResolver(configuration)

# Path: twunnel/dns_resolver.py
# def setDefaultConfiguration(configuration, keys):
#     def __init__(self, configuration):
#     def getHostByName(self, name, timeout=None, effort=10):
#     def _cbRecords(self, records, name, timeout, effort):
#     def _extractRecord(self, records, name, timeout, effort):
#     def __init__(self, configuration, ttl = 60 * 60):
#     def lookupAddress(self, name, timeout=None):
#     def lookupIPV6Address(self, name, timeout=None):
#     def _a_aaaaRecords(self, name):
#     def lookupAllRecords(self, name, timeout=None):
#     def __init__(self, controller):
#     def clientConnectionLost(self, connector, reason):
#     def clientConnectionFailed(self, connector, reason):
#     def buildProtocol(self, addr):
#     def __init__(self, configuration):
#     def connectionMade(self, connection):
#     def connectionLost(self, connection):
#     def messageReceived(self, message, protocol, address=None):
#     def _lookup(self, name, cls, type, timeout=None):
#     def _cbMessage(self, message):
#     def __init__(self, configuration):
#     def _lookup(self, name, cls, type, timeout):
# def createResolver(configuration):
# def getDefaultResolver():
# def setDefaultResolver(resolver):
# class ResolverBase(common.ResolverBase):
# class FileResolver(ResolverBase, hosts.Resolver):
# class DNSProtocolClientFactory(protocol.ClientFactory):
# class ServerResolver(ResolverBase):
# class Resolver(ResolverBase, resolve.ResolverChain):
# 
# Path: twunnel/logger.py
# def msgWrapper(*args, **kwargs):
# def setDefaultConfiguration(configuration, keys):
# def configure(configuration):
# def log(messageLevel, message):
# 
# Path: twunnel/proxy_server.py
# def setDefaultConfiguration(configuration, keys):
#     def __init__(self):
#     def connectionMade(self):
#     def connectionLost(self, reason):
#     def dataReceived(self, data):
#     def tunnelOutputProtocol_connectionMade(self, data):
#     def __init__(self, outputProtocolFactory, tunnelOutputProtocolFactory, contextFactory=None):
#     def startedConnecting(self, connector):
#     def clientConnectionFailed(self, connector, reason):
#     def clientConnectionLost(self, connector, reason):
#     def __init__(self, configuration):
#     def connect(self, address, port, outputProtocolFactory, contextFactory=None, timeout=30, bindAddress=None):
#     def getTunnelOutputProtocolFactoryClass(self, type):
# def getDefaultTunnelClass():
# def setDefaultTunnelClass(tunnelClass):
# def createTunnel(configuration):
#     def __init__(self, tunnel):
#     def connectTCP(self, host, port, factory, timeout=30, bindAddress=None):
#     def connectSSL(self, host, port, factory, contextFactory, timeout=30, bindAddress=None):
#     def __getattr__(self, attr):
# def createTunnelReactor(configuration):
# class TunnelProtocol(protocol.Protocol):
# class TunnelProtocolFactory(protocol.ClientFactory):
# class Tunnel(object):
# class TunnelReactor(object):
# 
# Path: examples/example.py
# class Protocol(protocol.Protocol):
# class ProtocolFactory(protocol.ClientFactory):
#     def __init__(self):
#     def connectionMade(self):
#     def connectionLost(self, reason):
#     def dataReceived(self, data):
#     def __init__(self):
#     def startedConnecting(self, connector):
#     def clientConnectionFailed(self, connector, reason):
#     def clientConnectionLost(self, connector, reason):


# Path: examples/example5.py
import sys
import os
from twisted.internet import reactor, ssl
from twisted.python import log
from twunnel import dns_resolver, logger, proxy_server
from examples import example

    "LOGGER":
    {
        "LEVEL": 3
    }
}

logger.configure(configuration)

def install_DNS_RESOLVER():
    configuration = \
    {
        "DNS_RESOLVER":
        {
            "FILE": "files/DNS/H.txt",
            "SERVERS":
            [
                {
                    "ADDRESS": "8.8.8.8",
                    "PORT": 53
                },
                {
                    "ADDRESS": "8.8.4.4",
                    "PORT": 53
                }
            ]
        },
        "PROXY_SERVERS": []
    }
    
    resolver = dns_resolver.createResolver(configuration)

    dns_resolver.setDefaultResolver(resolver)