File: //lib/python3.9/site-packages/dns/__pycache__/asyncquery.cpython-39.opt-1.pyc
a
�M�e�h � @ sf d Z ddlZddlZddlZddlZddlZddlmZmZm Z m
Z
mZ ddlZ
ddlZ
ddlZ
ddlZ
ddlZ
ddlZ
ddlZ
ddlZ
ddlZ
ddlZ
ddlmZ ddlmZmZmZmZmZmZm Z m!Z!m"Z"m#Z# e"r�ddl$Z$e
j%j&Z'dd� Z(d6dd �Z)d7e
j*j+ee
j,j-e.f ee e/ e
e0e/f d
�dd�Z1d8e
j*j+e e e e/ e2e2e ee
j3j4e
j5j6f e e. e2e2e2e e
j,j- ed�dd�Z7d9e
j,j-e8e e/ e0e e8 e0e2e2e2e2e e
j*j+ e e
j*j9 e2e
j,j-d�dd�Z:d:e
j,j-e8e e/ e0e e8 e0e2e2e2e e
j*j+ e e
j*j; e e
j*j9 e2e
e
j,j-e2f d�dd�Z<d;e
j*j;ee
j,j-e.f e e/ e
e0e/f d�dd�Z=dd� Z>d<e
j*j;e e/ e2e ee
j3j4e
j5j6f e e. e2e
e
j,j-e/f d�dd �Z?d=e
j,j-e8e e/ e0e e8 e0e2e2e e
j*j; e e
j*j9 e
j,j-d!�d"d#�Z@d>e
j,j-e8e e/ e0e e8 e0e2e2e e
j*j; e e
j*j9 e e#jA e e8 ee2e8f e
j,j-d&�d'd(�ZBdd)ddd
d
dd*d%d%ddejCf
e
j,j-e8e e/ e0e e8 e0e2e2e d+ e8e2ee2e8f e e8 e d, e e0 e
j,j-d-�d.d/�ZDddddddejEdfe8e
jFjGe e
j,j- e0e e/ e e/ e e8 e0ee e
j*j9 dd0�d1d2�ZHd?e
j,j-e8e e/ e0e e8 e0e2e2e e
jIjJ ee2e8f e e
j*j9 e e8 e
j,j-d3�
d4d5�ZIdS )@zTalk to a DNS server.� N)�Any�Dict�Optional�Tuple�Union)�NullContext)
�BadResponse�NoDOH�NoDOQ�UDPMode�_compute_times�_make_dot_ssl_context�_matches_destination�
_remaining�have_doh�sslc C sN |s|rF|d u r>| t jkr d}n| t jkr0d}ntd| � ���||fS d S d S )Nz0.0.0.0z::zunknown address family )�socket�AF_INET�AF_INET6�NotImplementedError)�afZaddress�port� r �2/usr/lib/python3.9/site-packages/dns/asyncquery.py�
_source_tuple: s
r c C s* | d ur"|st � � }t| | d�S d S d S )Nr )�time�max)�
expirationZnowr r r �_timeoutJ s
r )�sock�what�destinationr �returnc � s@ t |tjj�r|�� }t�� }| �||t||��I dH }||fS )a� Send a DNS message to the specified UDP socket.
*sock*, a ``dns.asyncbackend.DatagramSocket``.
*what*, a ``bytes`` or ``dns.message.Message``, the message to send.
*destination*, a destination tuple appropriate for the address family
of the socket, specifying where to send the query.
*expiration*, a ``float`` or ``None``, the absolute time at which
a timeout exception should be raised. If ``None``, no timeout will
occur. The expiration value is meaningless for the asyncio backend, as
asyncio's transport sendto() never blocks.
Returns an ``(int, float)`` tuple of bytes sent and the sent time.
N)�
isinstance�dns�message�Message�to_wirer �sendtor )r r r! r � sent_time�nr r r �send_udpS s
r+ F� )r r! r �ignore_unexpected�one_rr_per_rrset�keyring�request_mac�ignore_trailing�raise_on_truncation�
ignore_errors�queryr"