HEX
Server: LiteSpeed
System: Linux srv146.niagahoster.com 4.18.0-553.30.1.lve.el8.x86_64 #1 SMP Tue Dec 3 01:21:19 UTC 2024 x86_64
User: kodi1989 (1633)
PHP: 8.1.34
Disabled: symlink,shell_exec,exec,popen,system,dl,passthru,escapeshellarg,escapeshellcmd,show_source,pcntl_exec
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/dns/__pycache__/asyncresolver.cpython-37.pyc
B

��f�(�
@s�dZddlmZmZmZmZddlZddlZddl	Zddl
ZddlZddlZddl
ZddlZddlZddlmZmZmZmZejjZejjZGdd�dejj�Zdaed�dd	�Zdd�d
d�Zejj ej!j"ddd
ddddf	eej#j$e%feejj&e%feej!j'e%fe(ee%e(e)ee*ee(eej+j,ejj-d�dd�Z.e%eeejj-d�dd�Z/eej#j$e%fej#j$d�dd�Z0ej!j"dddfeej#j$e%fej!j'e(eeeej+j,ej#j$d�dd�Z1dS)zAsynchronous DNS stub resolver.�)�Any�Dict�Optional�UnionN)�NXDOMAIN�NoAnswer�NotAbsolute�	NoRootSOAc
@s�eZdZdZejjejjdddddddf	e	ej
jefe	ejj
efe	ejjefeeeeeeeeeeejjejjd�dd�Zeeeejjd	�d
d�Ze	ej
jefej
jd�d
d�ZdS)�ResolverzAsynchronous DNS stub resolver.FNTr)�qname�rdtype�rdclass�tcp�source�raise_on_no_answer�source_port�lifetime�search�backend�returnc
�s`tj�|||||||	�}|
s&tj��}
t��}�x*|��\}
}|dk	rJ|S|
dk	sVt�d}x�|�sV|��\}}}}|r�|
�	|�IdH|�
|||j�}yjtj�
|�r�|r�t|
||||||
d�IdH}q�t|
|||||d|
d�IdH}ntjj|
||d�IdH}Wn6tk
�r6}z|�d|�\}}w\Wdd}~XYnX|�|d�\}}|dk	r\|Sq\Wq2WdS)a�Query nameservers asynchronously to find the answer to the question.

        *backend*, a ``dns.asyncbackend.Backend``, or ``None``.  If ``None``,
        the default, then dnspython will use the default backend.

        See :py:func:`dns.resolver.Resolver.resolve()` for the
        documentation of the other parameters, exceptions, and return
        type of this method.
        NF)rT)Zraise_on_truncationr)�timeout)�dns�resolverZ_Resolution�asyncbackendZget_default_backend�timeZnext_request�AssertionErrorZnext_nameserver�sleepZ_compute_timeout�errorsZinetZ
is_address�_tcp�_udp�
asyncquery�https�	ExceptionZquery_result)�selfrrr
rrrrrrr�
resolution�start�request�answer�doneZ
nameserver�port�backoffr�response�ex�_�r.�B/opt/alt/python37/lib/python3.7/site-packages/dns/asyncresolver.py�resolve-sX
zResolver.resolve)�ipaddr�args�kwargsrc�sFi}|�|�tjj|d<tjj|d<|jtj�|�f|�|�IdHS)a�Use an asynchronous resolver to run a reverse query for PTR
        records.

        This utilizes the resolve() method to perform a PTR lookup on the
        specified IP address.

        *ipaddr*, a ``str``, the IPv4 or IPv6 address you want to get
        the PTR record for.

        All other arguments that can be passed to the resolve() function
        except for rdtype and rdclass are also supported by this
        function.

        rr
N)	�updater�	rdatatypeZPTR�
rdataclass�INr0Zreversename�from_address)r#r1r2r3Zmodified_kwargsr.r.r/�resolve_address�s
zResolver.resolve_address)�namerc
�sPy|j|dd�IdH}|j}Wn,tjjk
rJ}z
|j}Wdd}~XYnX|S)a�Determine the canonical name of *name*.

        The canonical name is the name the resolver uses for queries
        after all CNAME and DNAME renamings have been applied.

        *name*, a ``dns.name.Name`` or ``str``, the query name.

        This method can raise any exception that ``resolve()`` can
        raise, other than ``dns.resolver.NoAnswer`` and
        ``dns.resolver.NXDOMAIN``.

        Returns a ``dns.name.Name``.
        F)rN)r0�canonical_namerrr)r#r:r'r;�er.r.r/r;�s
zResolver.canonical_name)�__name__�
__module__�__qualname__�__doc__rr5�Ar6r7rr:�Name�str�	RdataType�
RdataClass�boolr�int�floatr�Backendr�Answerr0rr9r;r.r.r.r/r
*sPHr
)rcCstdkrt�tdk	st�tS)zDGet the default asynchronous resolver, initializing it if necessary.N)�default_resolver�reset_default_resolverrr.r.r.r/�get_default_resolver�srMcCs
t�adS)z�Re-initialize default asynchronous resolver.

    Note that the resolver configuration (i.e. /etc/resolv.conf on UNIX
    systems) will be re-read immediately.
    N)r
rKr.r.r.r/rL�srLFT)rrr
rrrrrrrrc

�s$t��||||||||||	�
IdHS)a
Query nameservers asynchronously to find the answer to the question.

    This is a convenience function that uses the default resolver
    object to make the query.

    See :py:func:`dns.asyncresolver.Resolver.resolve` for more
    information on the parameters.
    N)rMr0)
rrr
rrrrrrrr.r.r/r0�sr0)r1r2r3rc�st�j|f|�|�IdHS)z�Use a resolver to run a reverse query for PTR records.

    See :py:func:`dns.asyncresolver.Resolver.resolve_address` for more
    information on the parameters.
    N)rMr9)r1r2r3r.r.r/r9�s	r9)r:rc�st��|�IdHS)z�Determine the canonical name of *name*.

    See :py:func:`dns.resolver.Resolver.canonical_name` for more
    information on the parameters and possible exceptions.
    N)rMr;)r:r.r.r/r;�sr;)r:r
rrrrc	�s�t|t�rtj�|tjj�}|dkr*t�}|��s:t|��x�y@|j	|tj
j|||d�IdH}|jdk	sjt
�|jj|krz|SWnttfk
r�YnXy|��}Wq<tjjk
r�t�Yq<Xq<WdS)z�Find the name of the zone which contains the specified name.

    See :py:func:`dns.resolver.Resolver.zone_for_name` for more
    information on the parameters and possible exceptions.
    N)r)�
isinstancerCrr:Z	from_text�rootrM�is_absoluterr0r5ZSOAZrrsetrrr�parentZNoParentr	)r:r
rrrr'r.r.r/�
zone_for_names&
rR)2r@�typingrrrrrZdns.asyncbackendrZdns.asyncqueryZ
dns.exceptionZdns.nameZ	dns.queryZdns.rdataclassZ
dns.rdatatypeZdns.resolverrrrr	r Zudprrrr�BaseResolverr
rKrMrLr5rAr6r7r:rBrCrDrErFrGrHrrIrJr0r9r;rRr.r.r.r/�<module>sH
P
 *