%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/dns/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/dns/__pycache__/asyncresolver.cpython-312.pyc

�

5��e�E���dZddlZddlZddlmZmZmZmZmZddl	Z
ddlZ
ddlZ
ddl
Z
ddlZ
ddlZ
ddlZ
ddlZ
ddlZ
ddlmZmZmZmZe
j.j0Ze
j.j4ZGd�de
j8j:�Zdadefd�Z d(d	�Z!e
jDjFe
jHjJd
ddddddf	dee
jLjNe(fd
ee
jDjRe(fdee
jHjTe(fde+dee(de+de,dee-dee+dee
j\j^de
j8j`fd�Z1de(dedede
j8j`fd�Z2ejffdee
jLjNe(fde,dede
j8jhfd�Z5dee
jLjNe(fde
jLjNfd�Z6d)de-ddfd �Z7e
jHjJd
ddfdee
jLjNe(fde
jHjTde+d!eedee
j\j^de
jLjNfd"�Z8d#ejfdfd$ee
jLjNe(fd%e,de,d!eedef
d&�Z9e
jDjFe
jHjJd
ddddddd#ejfdfd$ee
jLjNe(fdee
jLjNe(fd
ee
jDjRe(fdee
jHjTe(fde+dee(de+de,dee-dee+dee
j\j^d%e,de,d!eede
j8j`fd'�Z:y)*�Asynchronous DNS stub resolver.�N)�Any�Dict�List�Optional�Union)�NXDOMAIN�NoAnswer�	NoRootSOA�NotAbsolutec���eZdZdZej
jejjdddddddf	de	ejjefde	ej
jefde	ejjefd	ed
eededed
eedeedeej&j(dej*j,fd�Zdedededej*j,fd�Zej6fde	ejjefdededej*j8fd�Zde	ejjefdejjfd�Zdd
eddfd�Zy)�ResolverrFNTr�qname�rdtype�rdclass�tcp�source�raise_on_no_answer�source_port�lifetime�search�backend�returnc	��lK�tjj|||||||	�}|
stjj	�}
tj
�}	|j
�\}
}|�|S|
�J�d}|s�|j�\}}}|r|
j|��d{���|j|||j�}	|j|
|||||
���d{���}|j|d�\}}|�|S|s����7�^7�##t$r}|jd|�\}}Yd}~��d}~wwxYw�w)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)�timeoutrr�max_sizer)�dns�resolver�_Resolution�asyncbackend�get_default_backend�time�next_request�next_nameserver�sleep�_compute_timeout�errors�async_query�	Exception�query_result)�selfrrrrrrrrrr�
resolution�start�request�answer�done�
nameserver�backoffr�response�ex�_s                      �3/usr/lib/python3/dist-packages/dns/asyncresolver.py�resolvezResolver.resolve-s`����.�\�\�-�-��%���#�/A�6�
�
���&�&�:�:�<�G��	�	���� *� 7� 7� 9��W�f�
�!��
��&�&�&��D��-7�-G�-G�-I�*��S�'��!�-�-��0�0�0��/�/��x��AR�AR�S���%/�%;�%;�� '�%�$/�!$� '�
&<�&� �H�",�!8�!8��4�!H����
�%�!�M�/��1�� ��!�� *� 7� 7��b� A�I�Q�����sT�B$D4�&D�'!D4�	D	�#D�$D	�(D4�D4�D	�		D1�D,�'D4�,D1�1D4�ipaddr�args�kwargsc��K�i}|j|�tjj|d<tjj
|d<|jtjj|�g|��i|���d{���S7��w)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.

        rrN)	�updater�	rdatatype�PTR�
rdataclass�INr7�reversename�from_address)r+r8r9r:�modified_kwargss     r6�resolve_addresszResolver.resolve_addressns�����(+-�����v�&�$'�M�M�$5�$5���!�%(�^�^�%6�%6��	�"�!�T�\�\��O�O�(�(��0�
�37�
�;J�
�
�	
�
�s�BB
�B�B
�name�familyc���K�i}|j|�|jdd�tjj|d<|t
jk(r^|j|tjjfi|���d{���}tjjj|��S|t
jk(r^|j|tjjfi|���d{���}tjjj|��S|t
jk7rt!d|����|jdd�}|jd	d�}t#j"�}	|j|tjjfd
|j%|	|�d�|���d{���}|j&}|j|tjjfd
|j%|	|�d�|���d{���}tjjj|||��}
|
st)|j*�
��|
S7���7��l7��7�S�w)aUse an asynchronous resolver to query for address records.

        This utilizes the resolve() method to perform A and/or AAAA lookups on
        the specified name.

        *qname*, a ``dns.name.Name`` or ``str``, the name to resolve.

        *family*, an ``int``, the address family.  If socket.AF_UNSPEC
        (the default), both A and AAAA records will be retrieved.

        All other arguments that can be passed to the resolve() function
        except for rdtype and rdclass are also supported by this
        function.
        rNr)�v4)�v6zunknown address family rTrF)rr)rIrH�	add_empty)r3)r<�poprr?r@�socket�AF_INETr7r=�Ar�HostAnswers�make�AF_INET6�AAAA�	AF_UNSPEC�NotImplementedErrorr"r&rr
r3)r+rErFr:rCrHrIrrr-�answerss           r6�resolve_namezResolver.resolve_name�s%����.+-�����v�&����H�d�+�%(�^�^�%6�%6��	�"��V�^�^�#�#�t�|�|�D�#�-�-�/�/�M�_�M�M�B��<�<�+�+�0�0�B�0�7�7�
�v���
&�#�t�|�|�D�#�-�-�*<�*<�P��P�P�B��<�<�+�+�0�0�B�0�7�7�
�v�'�'�
'�%�(?��x�&H�I�I�,�0�0�1E�t�L��"�&�&�z�4�8���	�	����4�<�<���M�M���
� %��*�*�5�(�;�	
�
�
�
���x�x���4�<�<���M�M�O�O�
� %��*�*�5�(�;�	
�
�
�
���,�,�*�*�/�/��b�(:�$:�0�
����B�K�K�0�0���IN��Q��
��
�sL�BI+�I!�A0I+�8I$�9C	I+�I'�AI+�I)�AI+�$I+�'I+�)I+c���K�	|j|d���d{���}|j}|S7�#tjj$r}|j}Yd}~|Sd}~wwxYw�w)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)r7�canonical_namerrr	)r+rEr/rX�es     r6rXzResolver.canonical_name�sc����	.��<�<���<�G�G�F�#�2�2�N���	H���|�|�$�$�	.��-�-�N����	.�s7�A&�/�-�/�A&�/�A#�A�A&�A#�#A&c��K�	tj�|z}|jtjjd|���d{���}tj
j
|�}tjj||��d{���}t|�dkDr||_	yy7�b7�#t$rYywxYw�w)a�Try to update the resolver's nameservers using Discovery of Designated
        Resolvers (DDR).  If successful, the resolver will subsequently use
        DNS-over-HTTPS or DNS-over-TLS for future queries.

        *lifetime*, a float, is the maximum time to spend attempting DDR.  The default
        is 5 seconds.

        If the SVCB query is successful and results in a non-empty list of nameservers,
        then the resolver's nameservers are set to the returned servers in priority
        order.

        The current implementation does not use any address hints from the SVCB record,
        nor does it resolve addresses for the SCVB target name, rather it assumes that
        the bootstrap nameserver will always be one of the addresses and uses it.
        A future revision to the code may offer fuller support.  The code verifies that
        the bootstrap nameserver is in the Subject Alternative Name field of the
        TLS certficate.
        �svcb)rNr)r"r7r�_ddr�_local_resolver_name�query�
_remaining�_get_nameservers_async�len�nameserversr))r+r�
expirationr/rrbs      r6�try_ddrzResolver.try_ddr�s�����&
	�����x�/�J��<�<����-�-�v��(���F��i�i�*�*�:�6�G� #��� ?� ?��� P�P�K��;��!�#�#.�� �$���Q���	��	�sN�C�AB1�
B-�AB1�B/�B1�+C�-B1�/B1�1	B=�:C�<B=�=C�g@) �__name__�
__module__�__qualname__�__doc__rr=rNr?r@rrE�Name�str�	RdataType�
RdataClass�boolr�int�floatr �Backendr�Answerr7rrDrLrSrOrVrXrd��r6rr*s���)�
7:�m�m�o�o�9<���9J�9J�� $�#'��$(�!%�6:�?"��S�X�X�]�]�C�'�(�?"��c�m�m�-�-�s�2�3�?"��s�~�~�0�0�#�5�6�	?"�
�?"���
�
?"�!�?"��?"��5�/�?"����?"��#�*�*�2�2�3�?"�

���	�	�?"�B
��
�"%�
�14�
�	���	�	�
�>�&�&�A��C�H�H�M�M�3�&�'�A��A��	A�


���	!�	!�A�J��s�x�x�}�}�c�/A�)B��s�x�x�}�}��*�e��d�rtrrc�>�t�
t�t�J�tS)zDGet the default asynchronous resolver, initializing it if necessary.)�default_resolver�reset_default_resolverrsrtr6�get_default_resolverrxs ����� ��'�'�'��rtc��t�ay)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)rrvrsrtr6rwrws�� �z�rtFTrrrrrrrrrrc
��bK�t�j||||||||||	�
�d{���S7��w)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)rxr7)
rrrrrrrrrrs
          r6r7r7sF����*&�'�/�/�
��������������s�&/�-�/r8r9r:c��ZK�t�j|g|��i|���d{���S7��w)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)rxrD)r8r9r:s   r6rDrD=s/����8�%�'�7�7��P��P��P�P�P�P�s�"+�)�+rErFc��VK�t�j||fi|���d{���S7��w)z�Use a resolver to asynchronously query for address records.

    See :py:func:`dns.asyncresolver.Resolver.resolve_name` for more
    information on the parameters.
    N)rxrV)rErFr:s   r6rVrVIs,����5�%�'�4�4�T�6�L�V�L�L�L�L�s� )�'�)c��PK�t�j|��d{���S7��w)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)rxrX)rEs r6rXrXUs"����&�'�6�6�t�<�<�<�<���&�$�&rc��PK�t�j|��d{���S7��w)aTry to update the default resolver's nameservers using Discovery of Designated
    Resolvers (DDR).  If successful, the resolver will subsequently use
    DNS-over-HTTPS or DNS-over-TLS for future queries.

    See :py:func:`dns.resolver.Resolver.try_ddr` for more information.
    N)rxrd)rs r6rdrd_s"����&�'�/�/��8�8�8�8�r~rc��LK�t|t�r8tjj	|tjj
�}|�
t
�}|j�st|��		|j|tjj|||���d{���}|j�J�|jj|k(r|S		|j�}�s7�@#ttf$rY�%wxYw#tjj $rt"�wxYw�w)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)�
isinstancerkrrE�	from_text�rootrx�is_absoluterr7r=�SOA�rrsetr	r
�parent�NoParentr)rErrrrr/s      r6�
zone_for_namer�is�����$����x�x�!�!�$����
�
�6����'�)�������$���
�		�#�+�+��c�m�m�'�'��#�w�,���F��<�<�+�+�+��|�|� � �D�(���)�
	��;�;�=�D�����(�#�	��	���x�x� � �	��O�	�sT�A1D$�41C(�%C&�&,C(�D$�C=�%D$�&C(�(C:�7D$�9C:�:D$�=$D!�!D$�5�where�portc��K�|�
t�}g}t|t�rOtjj|�r0|j
tjj||��n^|j||��d{���}|j�D]1}|j
tjj||���3tjjd��}||_
|S7�q�w)aMake a stub resolver using the specified destination as the full resolver.

    *where*, a ``dns.name.Name`` or ``str`` the domain name or IP address of the
    full resolver.

    *port*, an ``int``, the port to use.  If not specified, the default is 53.

    *family*, an ``int``, the address family to use.  This parameter is used if
    *where* is not an address.  The default is ``socket.AF_UNSPEC`` in which case
    the first address returned by ``resolve_name()`` will be used, otherwise the
    first address of the specified family will be used.

    *resolver*, a ``dns.asyncresolver.Resolver`` or ``None``, the resolver to use for
    resolution of hostnames.  If not specified, the default resolver will be used.

    Returns a ``dns.resolver.Resolver`` or raises an exception.
    NF)�	configure)rxr�rkr�inet�
is_address�appendr1�Do53NameserverrV�	addresses�
asyncresolverrrb)r�r�rFrrbrU�address�ress        r6�make_resolver_atr��s�����.��'�)��?A�K��%���#�(�(�"5�"5�e�"<����3�>�>�8�8���E�F� �-�-�e�V�<�<���(�(�*�	M�G����s�~�~�<�<�W�d�K�L�	M�

�
�
�
$�
$�u�
$�
5�C�!�C�O��J�=�s�BC9�C7�A2C9c��K�t||||
��d{���}|j|||||||||	|
�
�d{���S7�&7��w)a�Query nameservers to find the answer to the question.

    This is a convenience function that calls ``dns.asyncresolver.make_resolver_at()``
    to make a resolver, and then uses it to resolve the query.

    See ``dns.asyncresolver.Resolver.resolve`` for more information on the resolution
    parameters, and ``dns.asyncresolver.make_resolver_at`` for information about the
    resolver parameters *where*, *port*, *family*, and *resolver*.

    If making more than one query, it is more efficient to call
    ``dns.asyncresolver.make_resolver_at()`` and then use that resolver for the queries
    instead of calling ``resolve_at()`` multiple times.
    N)r�r7)r�rrrrrrrrrrr�rFrr�s               r6�
resolve_atr��s[����:!���f�h�?�
?�C����
�������������@���s�?�;�!?�=�?�?)rNre);rirLr"�typingrrrrr�dns._ddrr�dns.asyncbackend�dns.asyncquery�
dns.exception�dns.name�	dns.query�dns.rdataclass�
dns.rdatatype�dns.resolverr	r
rr�
asyncquery�udp�_udpr�_tcpr�BaseResolverrrvrxrwr=rNr?r@rErjrkrlrmrnrorpr rqrrr7rDrSrOrVrXrdr�r�r�rsrtr6�<module>r�s���$&�
��3�3����������D�C��~�~����
�~�~����W�s�|�|�(�(�W�t���h��"�36�-�-�/�/�58�^�^�5F�5F�� �#�� $�!�26� ��������#�$� ��#�-�-�)�)�3�.�/� ��3�>�>�,�,�c�1�
2� �
�	 �

�S�M� ��
 �� ��u�o� �
�T�N� ��c�&�&�.�.�
/� �	�\�\��� �F	Q��	Q��	Q�'*�	Q��\�\���	Q�4:�3C�3C�	M�
����
�
�s�"�
#�	M�-0�	M�OR�	M��\�\���	M�=�u�S�X�X�]�]�C�%7�8�=�S�X�X�]�]�=�9�5�9�4�9�*-���):�):��#'�26�!�
����
�
�s�"�
#�!�
�^�^�
&�
&�!�
�!��x� �	!�
�c�&�&�.�.�
/�!�	�X�X�]�]�
!�L��"�"�#'�	"��������#�$�"�

�"�
�"��x� �	"�
�"�P36�-�-�/�/�58�^�^�5F�5F�� �#�� $�!�26���"�"�#'�)��������#�$�)��������#�$�)�
�#�-�-�)�)�3�.�/�)��3�>�>�,�,�c�1�
2�	)�

�)�
�S�M�
)��)��)��u�o�)�
�T�N�)��c�&�&�.�.�
/�)��)�
�)��x� �)�	�\�\���)rt

Zerion Mini Shell 1.0