%PDF- %PDF-
Direktori : /lib/python3/dist-packages/twisted/names/__pycache__/ |
Current File : //lib/python3/dist-packages/twisted/names/__pycache__/server.cpython-312.pyc |
� Ϫ�f�V � �b � d Z ddlZddlmZ ddlmZmZ ddlmZ G d� dej � Z y)a` Async DNS server Future plans: - Better config file format maybe - Make sure to differentiate between different classes - notice truncation bit Important: No additional processing is done on some of the record types. This violates the most basic RFC and is just plain annoying for resolvers to deal with. Fix it. @author: Jp Calderone � N)�protocol)�dns�resolve)�logc �� � e Zd ZdZej ZdZej Z dd�Z d� Zd� Zd� Z d� Zd� Zej dddfd �Zd � Zd� Zd� Zd � Zd� Zd� Zd� Zdd�Zd� Zy)�DNSServerFactorya Server factory and tracker for L{DNSProtocol} connections. This class also provides records for responses to DNS queries. @ivar cache: A L{Cache<twisted.names.cache.CacheResolver>} instance whose C{cacheResult} method is called when a response is received from one of C{clients}. Defaults to L{None} if no caches are specified. See C{caches} of L{__init__} for more details. @type cache: L{Cache<twisted.names.cache.CacheResolver>} or L{None} @ivar canRecurse: A flag indicating whether this server is capable of performing recursive DNS resolution. @type canRecurse: L{bool} @ivar resolver: A L{resolve.ResolverChain} containing an ordered list of C{authorities}, C{caches} and C{clients} to which queries will be dispatched. @type resolver: L{resolve.ResolverChain} @ivar verbose: See L{__init__} @ivar connections: A list of all the connected L{DNSProtocol} instances using this object as their controller. @type connections: C{list} of L{DNSProtocol} instances @ivar protocol: A callable used for building a DNS stream protocol. Called by L{DNSServerFactory.buildProtocol} and passed the L{DNSServerFactory} instance as the one and only positional argument. Defaults to L{dns.DNSProtocol}. @type protocol: L{IProtocolFactory} constructor @ivar _messageFactory: A response message constructor with an initializer signature matching L{dns.Message.__init__}. @type _messageFactory: C{callable} Nc �� � g }|�|j |� |�|j |� |�|j |� | | _ t j |� | _ || _ |r |d | _ g | _ y)a� @param authorities: Resolvers which provide authoritative answers. @type authorities: L{list} of L{IResolver} providers @param caches: Resolvers which provide cached non-authoritative answers. The first cache instance is assigned to C{DNSServerFactory.cache} and its C{cacheResult} method will be called when a response is received from one of C{clients}. @type caches: L{list} of L{Cache<twisted.names.cache.CacheResolver>} instances @param clients: Resolvers which are capable of performing recursive DNS lookups. @type clients: L{list} of L{IResolver} providers @param verbose: An integer controlling the verbosity of logging of queries and responses. Default is C{0} which means no logging. Set to C{2} to enable logging of full query and response messages. @type verbose: L{int} N���)�extend� canRecurser � ResolverChain�resolver�verbose�cache�connections)�self�authorities�caches�clientsr � resolverss �6/usr/lib/python3/dist-packages/twisted/names/server.py�__init__zDNSServerFactory.__init__E s � �( � ��"����[�)������V�$������W�%�")�k�/����-�-�i�8�� ��������D�J���� c �N � | j dkD rt j |i |�� yy)z� Log a message only if verbose logging is enabled. @param args: Positional arguments which will be passed to C{log.msg} @param kwargs: Keyword arguments which will be passed to C{log.msg} r N)r r �msg)r �args�kwargss r �_verboseLogzDNSServerFactory._verboseLogh s&