
    h              #       f   % S r SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	r	SSK
r
SSKrSSKJrJrJrJrJrJr  SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK rSSK!r SSK"r"S r&S r'\RP                  RS                  S5      r*\*(       aU  SSK+r,SSK-r-\,R\                  r/\,R`                  Rb                  Rd                  r3 " S S\/5      r4 " S	 S
\-Rj                  5      r6O
 " S S
5      r6\*r7S\Rp                  \9-  S\Rt                  S\9S\R                  4S jr;\;r<\\Rp                  \9-  \Rt                  \9/\R                  4   \=S'    " S S\R|                  R~                  5      r@ " S S\R|                  R                  5      rB " S S\R|                  R~                  5      rC " S S\R|                  R~                  5      rD\R                  R                  rFS rGS rHS rIS rJS rKS rL S{S! jrM S|S\Rp                  \9-  S"\Rt                  S#\S-  S\R                  4S$ jjrN  S}S\Rp                  \9-  S"\Rt                  S%\"R                  S&\R                  R                  \R-  S-  S#\S-  S\"R                  4S' jjrTS( rUS)\S*   SS*4S+ jrV " S, S-\R                  5      rXSS.SSS/S/SS0S SS S\R                  \XR                  4S1\R                  R                  S2\RS3\]S-  S4\9S#\RS-  S5\9S6\^S7\^S8\S-  S9\RS:\^S;\RS-  S<\^\R-  \"R                  -  S)\S*   S=\9S>\XS\R                  R                  4"S? jjr_S@\R                  R                  SA\bS\b4SB jrcS@\R                  R                  SC\RSD\bSS4SE jrd         S~S1\R                  R                  S2\RSF\RS3\]S-  S4\9S#\RS-  S5\9S6\^S7\^S<\^\R-  \"R                  -  S:\^SG\R                  R                  S-  S\R                  R                  4SH jjrfSI rgSJ rh S|SK\SL\R                  R                  \b-  SM\SN\]S-  S\\9\]4   4
SO jjri          SSK\SM\S-  SN\]S-  SP\^S6\^SQ\\R                  R                  \R                  R                  4   S-  SR\bS-  S7\^SS\^ST\^SU\R                  R                  S-  S\4SV jjrl          SS1\R                  R                  S2\RS3\]S-  S4\9S#\RS-  S5\9SP\^S6\^S7\^SS\^SK\S-  ST\^S\R                  R                  4SX jjrm          SS1\R                  R                  S2\RS3\]S-  S4\9S#\RS-  S5\9SP\^S6\^S7\^SY\S-  SZ\S-  ST\^S\\R                  R                  \^4   4S[ jjrnS\ roS] rp S|SK\SL\R                  R                  \b-  SN\]S-  S\\9\]4   4S^ jjrq     SSK\SN\]S-  S6\^SQ\\R                  R                  \R                  R                  4   S-  SR\bS-  S7\^S\\R                  R                  \]4   4S_ jjrrS` rs       SS1\R                  R                  S2\RS3\]S-  S4\9S#\RS-  S5\9S6\^S7\^SK\S-  S\R                  R                  4Sa jjrtSb ru   SS<\^\R-  Sc\^Sd\v\R   S-  S\"R                  4Se jjrwS&\RS-  S<\^\R-  S\"R                  4Sf jrx          SS1\R                  R                  S2\RS3\]S-  S4\9S#\RS-  S5\9S6\^S7\^SK\"R                  S-  S%\"R                  S-  S&\RS-  S<\^\R-  S\R                  R                  4Sg jjry          SS1\R                  R                  S2\RS3\]S-  S4\9S#\RS-  S5\9S6\^S7\^SG\R                  R                  S-  S<\^\R-  Sh\RS-  S&\RS-  S\R                  R                  4Si jjr` " Sj Sk\R                  5      rzSl\R                  R                  Sm\R                  \"R                  -  SU\R                  R                  Sn\9S-  S3\]S-  SN\]S-  S\4So jr}\R                  R                  \GR                   GR                  SSWSSS SSSSS/\R                  GR                  4S2\RSp\R                  R                  \R-  Sq\R                  GR                  \R-  Sr\GR                   GR                  \R-  S3\]S-  S4\9SQ\\R                  R                  \R                  R                  4   S-  Ss\R                  R                  \R-  S-  St\^Su\]S-  S#\RS-  S5\9Sn\9Sv\^Sw\R                  R                  \R-  S\4 Sx jjrESSWSSSS\zGR
                  4S2\RSl\R                  R                  SU\R                  R                  S-  S4\9S3\]S-  Su\]S-  S#\RS-  S5\9Sy\zSS4Sz jjrg! \# a
    SSK$J%r"   G	N6f = f)zTalk to a DNS server.    N)AnyCallableDictOptionalTuplecastc                 ~    U c  g U [         R                   " 5       -
  nUS::  a  [        R                  R                  eU$ )N        )timedns	exceptionTimeout)
expirationtimeouts     ^C:\Users\ROHAN GUPTA\OneDrive\Desktop\mathbuddy-assessment\venv\Lib\site-packages\dns/query.py
_remainingr   5   s7    499;&G#~mm###N    c                 N    Uc  g [        [        R                  " 5       U -   U5      $ N)minr   )r   r   s     r   _expiration_for_this_attemptr   >   s#    tyy{W$j11r   dohc                   @   ^  \ rS rSrU 4S jr SS jr SS jrSrU =r$ )_NetworkBackendL   c                 R   > [         TU ]  5         X l        Xl        X0l        X@l        g r   )super__init___local_port	_resolver_bootstrap_address_family)selfresolver
local_portbootstrap_addressfamily	__class__s        r   r   _NetworkBackend.__init__M   s$    G)%N&7#!Lr   c                    / n[        U5      u  px[        R                  R                  U5      (       a  UR	                  U5        OU R
                  b  UR	                  U R
                  5        Og[        U5      nU R                  n	U(       a  [        R                  R                  U5      n	U R                  R                  XUS9n
U
R                  5       nU H  n[        R                  R                  U5      nUc  U R                  S:w  a1  Uc  Sn[        R                  R                  X@R                  4U5      nOS n [        U[        R                   U5      n[#        SU5      n[%        U[        R                  R                  X4U5      U5        ['        U5      s  $    [*        R,                  e! [(         a     M  f = f)N)r'   lifetimer   z0.0.0.0g       @)_compute_timesr   inet
is_addressappendr!   r   r"   af_for_addressr    resolve_name	addressesr   low_level_address_tuplemake_socketsocketSOCK_STREAMr   _connect_CoreSyncStream	ExceptionhttpcoreConnectError)r#   hostportr   local_addresssocket_optionsr2   _r   r'   answersaddressafsourcesockattempt_expirations                   r   connect_tcp_NetworkBackend.connect_tcpT   s    I*73MAxx""4((  &((4  !8!89$Z0  XX44]CF..55' 6  $--/	$XX,,W5 ,0@0@A0E$,(1 XX==&(8(892F "F
&r6+=+=vFD)Ec:)V&88'"M*
 +400% %* ''' ! s   AF33
G Gc                     [         er   NotImplementedError)r#   pathr   r?   s       r   connect_unix_socket#_NetworkBackend.connect_unix_socket}   s
     &%r   )r!   r"   r   r    )NNNNN)	__name__
__module____qualname____firstlineno__r   rG   rM   __static_attributes____classcell__r(   s   @r   r   r   L   s$    	" PT'	(T 6:	& 	&r   r   c                   J   ^  \ rS rSrSSS\R
                  S.U 4S jjrSrU =r$ )_HTTPTransport   r   Nr%   r&   r$   r'   c                   > Uc!  Uc  SS K nUR                  R                  5       n[        TU ]  " U0 UD6  [        X1X$5      U R                  l        g Nr   )dns.resolverr$   Resolverr   r   r   _pool_network_backend)	r#   r%   r&   r$   r'   argskwargsr   r(   s	           r   r   _HTTPTransport.__init__   sO     $5$=#<<002Gd-f-*9&7+DJJ'r    )	rP   rQ   rR   rS   r5   	AF_UNSPECr   rT   rU   rV   s   @r   rX   rX      s!     "##	 	r   rX   c                   B    \ rS rSrSSS\R
                  S.S jrS rSrg)rX      r   NrZ   c                    g r   rd   )r#   r%   r&   r$   r'   ra   rb   s          r   r   rc      s     r   c                     [         er   rJ   )r#   r<   r=   r   r>   s        r   rG   _HTTPTransport.connect_tcp       %%r   rd   )	rP   rQ   rR   rS   r5   re   r   rG   rT   rd   r   r   rX   rX      s      "##			&r   rC   kindprotoreturnc                 0    [         R                   " XU5      $ r   )r5   )rC   rl   rm   s      r   default_socket_factoryrp      s    
 ==5))r   socket_factoryc                       \ rS rSrSrSrg)UnexpectedSource   z=A DNS query response came from an unexpected address or port.rd   NrP   rQ   rR   rS   __doc__rT   rd   r   r   rs   rs      s    Gr   rs   c                       \ rS rSrSrSrg)BadResponse   z<A DNS query response does not respond to the question asked.rd   Nru   rd   r   r   rx   rx      s    Fr   rx   c                       \ rS rSrSrSrg)NoDOH   zIDNS over HTTPS (DOH) was requested but the httpx module is not
available.rd   Nru   rd   r   r   r{   r{          r   r{   c                       \ rS rSrSrSrg)NoDOQ   zJDNS over QUIC (DOQ) was requested but the aioquic module is not
available.rd   Nru   rd   r   r   r   r      r}   r   r   c                 F    [         R                   " 5       nU c  US 4$ XU -   4$ r   )r   )r   nows     r   r,   r,      s)    
))+CT{7]##r   c                 R   U(       a4  [        U [        R                  5      (       a  U R                  5       S:  a  g[        R
                  " 5        nSnU(       a  U[        R                  -  nU(       a  U[        R                  -  nU(       a  UR                  X5        Uc  S nO8U[        R                  " 5       -
  nUS::  a  [        R                  R                  eUR                  U5      (       d  [        R                  R                  e S S S 5        g ! , (       d  f       g = f)Nr   Tr
   )
isinstancessl	SSLSocketpending	selectorsDefaultSelector
EVENT_READEVENT_WRITEregisterr   r   r   r   select)fdreadablewritabler@   r   seleventsr   s           r   	_wait_forr      s     Jr3==11bjjlQ6F		"	"	$i***Fi+++FLL$G 499;.G#~mm+++zz'""--''' # 
%	$	$s   B=D
D&c                 "    [        U SSSU5        g )NTFr   sr   s     r   _wait_for_readabler      s    audJ/r   c                 "    [        U SSSU5        g )NFTr   r   s     r   _wait_for_writabler      s    adJ/r   c                      [         R                  R                  XS   5      n[         R                  R                  XS   5      nX4:H  =(       a    USS  USS  :H  $ ! [         R                  R                   a     gf = f)Nr   F   )r   r-   	inet_ptonr   SyntaxError)rC   a1a2n1n2s        r   _addresses_equalr      su    XXqE*XXqE* 8(12"QR&(( ==$$ s   AA A=<A=c                     U(       d  g[        XU5      (       d3  [        R                  R                  US   5      (       a  USS  USS  :X  a  gU(       a  g[	        SU SU 35      e)NTr   r   Fzgot a response from z instead of )r   r   r-   is_multicastrs   )rC   from_addressdestinationignore_unexpecteds       r   _matches_destinationr     sl     +66k!n--,qr2BkRSRTo2U	

|nL[MJ r   Tc                 4   S nS n [         R                  R                  U 5      nU nU(       a9  [         R                  R                  U5      nU(       a  Xu:w  a  [	        S5      eOUnU(       a'  U(       d    [         R                  R                  U5      nU(       a!  [         R                  R                  Xa4U5      nU(       a!  [         R                  R                  X#4U5      nXVU4$ ! [         a    U(       a  e  Nf = f! [         a    [	        S5      ef = f)Nz5different address families for source and destinationz3source_port specified but address family is unknown)r   r-   r0   r9   
ValueError
any_for_afr3   )wherer=   rD   source_portwhere_must_be_addressrC   r   safs           r   _destination_and_sourcer     s   
 
BKXX$$U+
 hh%%f-y K   B6	TXX((,F hh667JBO1162GLV$$?    !,  	TRSS	Ts   !C) 6D )C>=C>DtyperD   c                     [        XS5      n UR                  S5        Ub  UR                  U5        U$ ! [         a    UR	                  5         e f = f)a!  Make a socket.

This function uses the module's ``socket_factory`` to make a socket of the
specified address family and type.

*af*, a ``socket.AddressFamily`` or ``int`` is the address family, either
``socket.AF_INET`` or ``socket.AF_INET6``.

*type*, a ``socket.SocketKind`` is the type of socket, e.g. ``socket.SOCK_DGRAM``,
a datagram socket, or ``socket.SOCK_STREAM``, a stream socket.  Note that the
``proto`` attribute of a socket is always zero with this API, so a datagram socket
will always be a UDP socket, and a stream socket will always be a TCP socket.

*source* is the source address and port to bind to, if any.  The default is
``None`` which will bind to the wildcard address and a randomly chosen port.
If not ``None``, it should be a (low-level) address tuple appropriate for *af*.
r   F)rq   setblockingbindr9   close)rC   r   rD   r   s       r   r4   r4   D  sR    , 	r#A	eFF6N 		s	   &5 Assl_contextserver_hostnamec                     [        XU5      n[        U[        R                  R                  5      (       a  UR                  5       nUR                  USUS9$ )aV  Make a socket.

This function uses the module's ``socket_factory`` to make a socket of the
specified address family and type.

*af*, a ``socket.AddressFamily`` or ``int`` is the address family, either
``socket.AF_INET`` or ``socket.AF_INET6``.

*type*, a ``socket.SocketKind`` is the type of socket, e.g. ``socket.SOCK_DGRAM``,
a datagram socket, or ``socket.SOCK_STREAM``, a stream socket.  Note that the
``proto`` attribute of a socket is always zero with this API, so a datagram socket
will always be a UDP socket, and a stream socket will always be a TCP socket.

If *ssl_context* is not ``None``, then it specifies the SSL context to use,
typically created with ``make_ssl_context()``.

If *server_hostname* is not ``None``, then it is the hostname to use for server
certificate validation.  A valid hostname must be supplied if *ssl_context*
requires hostname checking.

*source* is the source address and port to bind to, if any.  The default is
``None`` which will bind to the wildcard address and a randomly chosen port.
If not ``None``, it should be a (low-level) address tuple appropriate for *af*.
F)do_handshake_on_connectr   )r4   r   r   nameNameto_textwrap_socket)rC   r   r   r   rD   rE   s         r   make_ssl_socketr   e  sT    > r(D/388==11)113"" %' #  r   c                 :    Ub  [        XX4U5      $ [        XU5      $ r   )r   r4   )rC   r   rD   r   r   s        r   _make_socketr     s&     rvNN2V,,r   r$   zdns.resolver.Resolverc                 H    U c  SS K nUR                  R                  5       n U $ r\   )r]   r$   r^   )r$   r   s     r   _maybe_get_resolverr     s$     <<((*Or   c                   4    \ rS rSrSrSrSrSrSrSr	Sr
SrSrg)	HTTPVersioni  zzWhich version of HTTP should be used?

DEFAULT will select the first version from the list [2, 1.1, 3] that
is available.
r   r         rd   N)rP   rQ   rR   rS   rv   DEFAULTHTTP_1H1HTTP_2H2HTTP_3H3rT   rd   r   r   r   r     s,     GF	
BF	
BF	
Br   r     Fz
/dns-queryqr   r   r=   r   one_rr_per_rrsetignore_trailingsessionrL   postr&   verifyr'   http_versionc                    [        XXES5      u  nnnUnUba  [        R                  R                  U5      (       a=  U[        R
                  :X  a  SU SU U	 3nOU[        R                  :X  a
  SU SU U	 3n0 nUc  [        R                  R                  U5      nUR                  c  [        S5      e[        R                  R                  UR                  5      (       a  UR                  nUR                  US'   UR                  b  UR                  nU[        R                  :X  d  U[        R                  :X  a  [         (       d  Ucc  [#        U5      nWR                  c   eUR%                  UR                  U5      n[&        R(                  " [+        UR-                  5       5      5      nU(       a4  [/        U[        R0                  R2                  5      (       d  [        S	5      e[5        U UUUUUUUUUU
US
9$ [         (       d  [6        eU(       a*  [/        U[8        R:                  5      (       d  [        S5      eU R=                  5       nSS0nU[        R>                  [        R                  4;   nU[        R@                  [        R                  4;   nUc  SnSnO
US   nUS   nU(       a  [B        RD                  " U5      nO'[G        UUUUUUUUS9n[8        R:                  " UUUUS9nU nUc   eU
(       a:  URI                  S[K        [M        U5      5      S.5        URO                  UUUUUS9nOJ[P        RR                  " U5      RU                  S5      nURW                  5       n URY                  UUUSU 0US9nSSS5        WRZ                  S:  d  URZ                  S:  a'  [        U SURZ                   SUR\                   35      e[        R^                  Ra                  UR\                  U Rb                  U Rd                  UUS9n!URf                  Ri                  5       U!l5        U Rm                  U!5      (       d  [n        eU!$ ! , (       d  f       N= f)a  Return the response obtained after sending a query via DNS-over-HTTPS.

*q*, a ``dns.message.Message``, the query to send.

*where*, a ``str``, the nameserver IP address or the full URL. If an IP address is
given, the URL will be constructed using the following schema:
https://<IP-address>:<port>/<path>.

*timeout*, a ``float`` or ``None``, the number of seconds to wait before the query
times out. If ``None``, the default, wait forever.

*port*, a ``int``, the port to send the query to. The default is 443.

*source*, a ``str`` containing an IPv4 or IPv6 address, specifying the source
address.  The default is the wildcard address.

*source_port*, an ``int``, the port from which to send the message. The default is
0.

*one_rr_per_rrset*, a ``bool``. If ``True``, put each RR into its own RRset.

*ignore_trailing*, a ``bool``. If ``True``, ignore trailing junk at end of the
received message.

*session*, an ``httpx.Client``.  If provided, the client session to use to send the
queries.

*path*, a ``str``. If *where* is an IP address, then *path* will be used to
construct the URL to send the DNS query to.

*post*, a ``bool``. If ``True``, the default, POST method will be used.

*bootstrap_address*, a ``str``, the IP address to use to bypass resolution.

*verify*, a ``bool`` or ``str``.  If a ``True``, then TLS certificate verification
of the server is done using the default CA bundle; if ``False``, then no
verification is done; if a `str` then it specifies the path to a certificate file or
directory which will be used for verification.

*resolver*, a ``dns.resolver.Resolver`` or ``None``, the resolver to use for
resolution of hostnames in URLs.  If not specified, a new resolver with a default
configuration will be used; note this is *not* the default resolver as that resolver
might have been configured to use DoH causing a chicken-and-egg problem.  This
parameter only has an effect if the HTTP library is httpx.

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

*http_version*, a ``dns.query.HTTPVersion``, indicating which HTTP version to use.

Returns a ``dns.message.Message``.
FNzhttps://:z	https://[z]:zno hostname in URLsni_hostnamez8session parameter must be a dns.quic.SyncQuicConnection.)r   r   
connectionz)session parameter must be an httpx.Clientacceptzapplication/dns-messager   r   )r>   http1http2r   r%   r&   r$   r'   )r   r   r   	transport)zcontent-typezcontent-length)headerscontentr   
extensions   =r   )r   r   paramsr      +   responded with status code z
Response body: keyringrequest_macr   r   )8r   r   r-   r.   r5   AF_INETAF_INET6urllibparseurlparsehostnamer   r=   r   r   r   have_dohr   r1   randomchoicelistr2   r   quicSyncQuicConnection_http3r{   httpxClientto_wirer   r   
contextlibnullcontextrX   updatestrlenr   base64urlsafe_b64encoderstripdecodegetstatus_coder   message	from_wirer   r   elapsedtotal_secondsr   is_responserx   )"r   r   r   r=   rD   r   r   r   r   rL   r   r&   r   r$   r'   r   rC   r@   
the_sourceurlr   parsedrA   wirer   h1h2r>   r%   cmr   responsetwirers"                                     r   httpsr    s   N 2V%RJ C	~#((--e44UG1TF4&1C6??"eWBtfTF3CJ &&s+??"12288v// &)/J~&;;";;D{~~%+++HH$*84H??...++FOOVDG &d73D3D3F.G H:SXX00
 
 WXX
 	
 8z'5<<88DEE99;D23G	+..+*=*=>	>B	+..+*=*=>	>B 
"1]
0:0F0Fw0O"'!/	
	 \\Bv
 
w """NN$=&)#d)n ||% $ H ++D188>DKKME{{u~% # H+ 
> c!X%9%9C%?g1(2F2F1G 0 013
 	
 			MM)' 	 	A ++-AF==H] 
s   3BQ
Qr   r   c                 H    U c  [         eU  H  u  p#X!:X  d  M  Us  $    [         er   )KeyError)r   r   headervalues       r   _find_headerr    s)     >L ! Nr   peerr  c                    [        U S5      nUc  [        S5      e[        U5      nUS:  a  [        S5      eUS:  d  US:  a7  Sn[        U5      S:  a   SUR	                  5       -   n[        U S	U U 35      eg ! [
         a     Nf = f)
Ns   :statuszno :status header in responser   zstatus is negativer   r    z: r   )r  r   intr   r  r9   r   )r   r  r  r  statuserrors         r   _check_statusr     s    *-E}9::ZFz.//|v|t9q=t{{}, D6!=fXeWMNN $
  s   A; ;
BBr  r   c                    [         R                  R                  (       d  [        S5      e[        R
                  R                  U5      nUR                  nUc   eUR                  b  UR                  nSU l	        U R                  5       nU(       a  [        R                  " S 5      nO [         R                  R                  XSS9nUnU   U(       a  UnOWR                  XXV5      n[        U5      u  nnUR!                  U5       nUR#                  X.U
5        UR%                  ['        U5      5      n[)        UR+                  5       X5        S S S 5        [,        R,                  " 5       nS S S 5        [         R.                  R1                  UU R2                  U R4                  UUS9n[7        WW-
  S5      Ul        U R9                  U5      (       d  [:        eU$ ! , (       d  f       N= f! , (       d  f       N= f)Nz DNS-over-HTTP3 is not available.r   T)verify_modeserver_nameh3r   r
   )r   r   	have_quicr{   r   r   r   r   r=   idr   r   r   SyncQuicManagerconnectr,   make_streamsend_h3receiver   r   r   r   r  r  r   r   maxr	  rx   )r   r   r  r   r=   rD   r   r   r   r   r   r   	url_partsr   r  managerthe_managerthe_connectionstartr   streamfinishr  s                          r   r   r     s    88677%%c*I!!H~~!~~AD99;D 5?5K5KD5Q((** + 
 	'N(00VN -W5
''0FNN3d+>>*Z"89D&..*E8 1  
 			MM)' 	 	A %%AF==H 10 
s%   <G+AGG+
G(	$G++
G9c                 b      U R                  U5      $ ! [         a    [        X5         Of = fM/  )zReads a datagram from the socket.
A Timeout exception will be raised if the operation is not completed
by the expiration time.
)recvfromBlockingIOErrorr   )rE   max_sizer   s      r   	_udp_recvr8    s7    
 	1==** 	1t0	1 s    ,,c                       U(       a  U R                  X5      $ U R                  U5      $ ! [         a    [        X5         Of = fMG  )zSends the specified datagram to destination over the socket.
A Timeout exception will be raised if the operation is not completed
by the expiration time.
)sendtosendr6  r   )rE   datar   r   s       r   	_udp_sendr=    sH    
 	1{{455yy& 	1t0	1 s   , , AArE   whatr   r   c                     [        U[        R                  R                  5      (       a  UR	                  5       n[
        R
                  " 5       n[        XX#5      nXT4$ )a  Send a DNS message to the specified UDP socket.

*sock*, a ``socket``.

*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.

Returns an ``(int, float)`` tuple of bytes sent and the sent time.
)r   r   r  Messager   r   r=  )rE   r>  r   r   	sent_timens         r   send_udprC    sE    , $++,,||~		I$k6A>r   r   r   r   raise_on_truncationignore_errorsqueryc           	         Sn [        U SU5      u  p[        U R                  XU5      (       d  M.  [        R                  " 5       n [        R
                  R                  UUUUUUS9nU	(       a  U
b  U
R                  U5      (       d  M  U(       a  X4$ XU4$ ! [        R
                  R                   a:  nU	(       a-  U
b*  U
R                  UR                  5       5      (       d   SnAM  e SnAf[         a    U	(       a   GM  e f = f)a  Read a DNS message from a UDP socket.

*sock*, a ``socket``.

*destination*, a destination tuple appropriate for the address family
of the socket, specifying where the message is expected to arrive from.
When receiving a response, this would be where the associated query was
sent.

*expiration*, a ``float`` or ``None``, the absolute time at which
a timeout exception should be raised.  If ``None``, no timeout will
occur.

*ignore_unexpected*, a ``bool``.  If ``True``, ignore responses from
unexpected sources.

*one_rr_per_rrset*, a ``bool``.  If ``True``, put each RR into its own
RRset.

*keyring*, a ``dict``, the keyring to use for TSIG.

*request_mac*, a ``bytes`` or ``None``, the MAC of the request (for TSIG).

*ignore_trailing*, a ``bool``.  If ``True``, ignore trailing
junk at end of the received message.

*raise_on_truncation*, a ``bool``.  If ``True``, raise an exception if
the TC bit is set.

Raises if the message is malformed, if network errors occur, of if
there is a timeout.

If *destination* is not ``None``, returns a ``(dns.message.Message, float)``
tuple of the received message and the received time.

If *destination* is ``None``, returns a
``(dns.message.Message, float, tuple)``
tuple of the received message, the received time, and the address where
the message arrived from.

*ignore_errors*, a ``bool``.  If various format errors or response
mismatches occur, ignore them and keep listening for a valid response.
The default is ``False``.

*query*, a ``dns.message.Message`` or ``None``.  If not ``None`` and
*ignore_errors* is ``True``, check that the received message is a response
to this query, and if not keep listening for a valid response.
r     )r   r   r   r   rD  N)
r8  r   r'   r   r   r  r  	Truncatedr	  r9   )rE   r   r   r   r   r   r   r   rD  rE  rF  r  r   received_timer  es                   r   receive_udprL    s    | D
(ujA#KK4E
 
 			%%'!1 /$7 & A6 U.u7H7H7K7K%%l331 {{$$ 	 %))!))+66 			s$   "B D7.C,+C,,DD5   c                    U R                  5       n[        XXES5      u  pn[        U5      u  nnU
(       a  [        R                  " U
5      nO Uc   e[        U[        R                  U5      nU n[        UXU5        [        UUUUUU R                  U R                  UU	UU 5      u  nnUU-
  Ul        U(       d  U R                  U5      (       d  [        eUsSSS5        $ ! , (       d  f       O= f  e)a  Return the response obtained after sending a query via UDP.

*q*, a ``dns.message.Message``, the query to send

*where*, a ``str`` containing an IPv4 or IPv6 address,  where
to send the message.

*timeout*, a ``float`` or ``None``, the number of seconds to wait before the
query times out.  If ``None``, the default, wait forever.

*port*, an ``int``, the port send the message to.  The default is 53.

*source*, a ``str`` containing an IPv4 or IPv6 address, specifying
the source address.  The default is the wildcard address.

*source_port*, an ``int``, the port from which to send the message.
The default is 0.

*ignore_unexpected*, a ``bool``.  If ``True``, ignore responses from
unexpected sources.

*one_rr_per_rrset*, a ``bool``.  If ``True``, put each RR into its own
RRset.

*ignore_trailing*, a ``bool``.  If ``True``, ignore trailing
junk at end of the received message.

*raise_on_truncation*, a ``bool``.  If ``True``, raise an exception if
the TC bit is set.

*sock*, a ``socket.socket``, or ``None``, the socket to use for the
query.  If ``None``, the default, a socket is created.  Note that
if a socket is provided, it must be a nonblocking datagram socket,
and the *source* and *source_port* are ignored.

*ignore_errors*, a ``bool``.  If various format errors or response
mismatches occur, ignore them and keep listening for a valid response.
The default is ``False``.

Returns a ``dns.message.Message``.
TN)r   r   r,   r   r   r4   r5   
SOCK_DGRAMrC  rL  r   macr   r	  rx   )r   r   r   r=   rD   r   r   r   r   rD  rE   rE  r  rC   r   
begin_timer   r  r   r  rJ  s                        r   udprR    s    p 99;D 7V$!Rf  .g6Z0:0F0Ft0L~~V..7	qDz2(IIEE
M + q!1!1) 
, 	s   /A(C!!
C/udp_socktcp_sockc                      [        U UUUUUUUUSU	U5      nUS4$ ! [        R                  R                   a    [	        U UUUUUUUU
5	      nUS4s $ f = f)a  Return the response to the query, trying UDP first and falling back
to TCP if UDP results in a truncated response.

*q*, a ``dns.message.Message``, the query to send

*where*, a ``str`` containing an IPv4 or IPv6 address,  where to send the message.

*timeout*, a ``float`` or ``None``, the number of seconds to wait before the query
times out.  If ``None``, the default, wait forever.

*port*, an ``int``, the port send the message to.  The default is 53.

*source*, a ``str`` containing an IPv4 or IPv6 address, specifying the source
address.  The default is the wildcard address.

*source_port*, an ``int``, the port from which to send the message. The default is
0.

*ignore_unexpected*, a ``bool``.  If ``True``, ignore responses from unexpected
sources.

*one_rr_per_rrset*, a ``bool``.  If ``True``, put each RR into its own RRset.

*ignore_trailing*, a ``bool``.  If ``True``, ignore trailing junk at end of the
received message.

*udp_sock*, a ``socket.socket``, or ``None``, the socket to use for the UDP query.
If ``None``, the default, a socket is created.  Note that if a socket is provided,
it must be a nonblocking datagram socket, and the *source* and *source_port* are
ignored for the UDP query.

*tcp_sock*, a ``socket.socket``, or ``None``, the connected socket to use for the
TCP query.  If ``None``, the default, a socket is created.  Note that if a socket is
provided, it must be a nonblocking connected stream socket, and *where*, *source*
and *source_port* are ignored for the TCP query.

*ignore_errors*, a ``bool``.  If various format errors or response mismatches occur
while listening for UDP, ignore them and keep listening for a valid response. The
default is ``False``.

Returns a (``dns.message.Message``, tcp) tuple where tcp is ``True`` if and only if
TCP was used.
TF)rR  r   r  rI  tcp)r   r   r   r=   rD   r   r   r   r   rS  rT  rE  r  s                r   udp_with_fallbackrW    s    r 
 %  ;;    

 $ s    5AAc                 &   SnUS:  a=   U R                  U5      nUS:X  a  [        S5      eU[        U5      -  nX4-  nUS:  a  M=  U$ ! [        [        R
                  4 a    [        X5         N1[        R                   a    [        X5         NQf = f)zRead the specified number of bytes from sock.  Keep trying until we
either get the desired amount, or we hit EOF.
A Timeout exception will be raised if the operation is not completed
by the expiration time.
r   r   EOF)	recvEOFErrorr   r6  r   SSLWantReadErrorr   SSLWantWriteErrorr   )rE   countr   r   rB  s        r   	_net_readr_  7  s     	A
!)		1		% ACxuo%SVOEFA !) H	  !5!56 	1t0$$ 	1t0	1s   4A %B/BBc                     Sn[        U5      nX4:  a   X0R                  XS 5      -  nX4:  a  M  gg! [        [        R                  4 a    [        X5         N0[        R                   a    [        X5         NPf = f)zWrite the specified data to the socket.
A Timeout exception will be raised if the operation is not completed
by the expiration time.
r   N)r   r;  r6  r   r]  r   r\  r   )rE   r<  r   currentls        r   
_net_writerc  L  sr    
 GD	A
+	1yyh00G +  !6!67 	1t0## 	1t0	1s   2 %A:A:9A:c                    [        U[        R                  R                  5      (       a  UR	                  SS9nO[        U5      R                  SS5      U-   n[        R                  " 5       n[        XU5        [        U5      U4$ )a_  Send a DNS message to the specified TCP socket.

*sock*, a ``socket``.

*what*, a ``bytes`` or ``dns.message.Message``, the message to send.

*expiration*, a ``float`` or ``None``, the absolute time at which
a timeout exception should be raised.  If ``None``, no timeout will
occur.

Returns an ``(int, float)`` tuple of bytes sent and the sent time.
T)prepend_lengthr   big)	r   r   r  r@  r   r   to_bytesr   rc  )rE   r>  r   tcpmsgrA  s        r   send_tcpri  \  sl    $ $++,,T2
 T##Au-4		ItZ(K##r   c                     [        U SU5      n[        R                  " SU5      u  n[        XU5      n[        R                  " 5       n	[        R
                  R                  UUUUUS9n
X4$ )a  Read a DNS message from a TCP socket.

*sock*, a ``socket``.

*expiration*, a ``float`` or ``None``, the absolute time at which
a timeout exception should be raised.  If ``None``, no timeout will
occur.

*one_rr_per_rrset*, a ``bool``.  If ``True``, put each RR into its own
RRset.

*keyring*, a ``dict``, the keyring to use for TSIG.

*request_mac*, a ``bytes`` or ``None``, the MAC of the request (for TSIG).

*ignore_trailing*, a ``bool``.  If ``True``, ignore trailing
junk at end of the received message.

Raises if the message is malformed, if network errors occur, of if
there is a timeout.

Returns a ``(dns.message.Message, float)`` tuple of the received message
and the received time.
r   !Hr   )r_  structunpackr   r   r  r  )rE   r   r   r   r   r   ldatarb  r  rJ  r  s              r   receive_tcpro  z  so    B dAz*E==u%DQTj)DIIKM)' 	 	A r   c                 X   U R                  U5      nUS:X  a  g U[        R                  [        R                  [        R                  4;   a9  [        X5        U R                  [        R                  [        R                  5      nUS:w  a   [        U[        R                  " U5      5      eg r\   )
connect_exerrnoEINPROGRESSEWOULDBLOCKEALREADYr   
getsockoptr5   
SOL_SOCKETSO_ERROROSErrorosstrerror)r   rB   r   errs       r   r7   r7     s}    
,,w
C
ax
u  %"3"3U^^DD1)ll6,,foo>
axc2;;s+,, r   c	           	         U R                  5       n	[        U5      u  pU(       a  [        R                  " U5      nO0[	        XXES5      u  pnUc   e[        U[        R                  U5      nU nU(       d  [        UWU5        [        XU5        [        XX`R                  U R                  U5      u  nnUU
-
  Ul        U R                  U5      (       d  [        eUsSSS5        $ ! , (       d  f       O= f  e)aU  Return the response obtained after sending a query via TCP.

*q*, a ``dns.message.Message``, the query to send

*where*, a ``str`` containing an IPv4 or IPv6 address, where
to send the message.

*timeout*, a ``float`` or ``None``, the number of seconds to wait before the
query times out.  If ``None``, the default, wait forever.

*port*, an ``int``, the port send the message to.  The default is 53.

*source*, a ``str`` containing an IPv4 or IPv6 address, specifying
the source address.  The default is the wildcard address.

*source_port*, an ``int``, the port from which to send the message.
The default is 0.

*one_rr_per_rrset*, a ``bool``.  If ``True``, put each RR into its own
RRset.

*ignore_trailing*, a ``bool``.  If ``True``, ignore trailing
junk at end of the received message.

*sock*, a ``socket.socket``, or ``None``, the connected socket to use for the
query.  If ``None``, the default, a socket is created.  Note that
if a socket is provided, it must be a nonblocking connected stream
socket, and *where*, *port*, *source* and *source_port* are ignored.

Returns a ``dns.message.Message``.
TN)r   r,   r   r   r   r4   r5   r6   r7   ri  ro  r   rP  r   r	  rx   )r   r   r   r=   rD   r   r   r   rE   r  rQ  r   r  rC   r   r   r  rJ  s                     r   rV  rV    s    V 99;D-g6Z0:0F0Ft0L$;d%
!& ~~V//8	qQZ0*%(+YY
M +}}Q 
 	s   .A-C%%
C3c                       U R                  5         g ! [        R                   a    [        X5         O$[        R                   a    [        X5         Of = fMY  r   )do_handshaker   r\  r   r]  r   r   s     r   _tls_handshaker    sO    
	.NN## 	.q-$$ 	.q-	. s    AAAcheck_hostnamealpnsc                    [         R                  R                  U 5      u  p4[        R                  " X4S9n[        R
                  R                  Ul        Xl        U SL a  [        R                  Ul
        Ub  UR                  U5        U$ )a%  Make an SSL context

If *verify* is ``True``, the default, then certificate verification will occur using
the standard CA roots.  If *verify* is ``False``, then certificate verification will
be disabled.  If *verify* is a string which is a valid pathname, then if the
pathname is a regular file, the CA roots will be taken from the file, otherwise if
the pathname is a directory roots will be taken from the directory.

If *check_hostname* is ``True``, the default, then the hostname of the server must
be specified when connecting and the server's certificate must authorize the
hostname.  If ``False``, then hostname checking is disabled.

*aplns* is ``None`` or a list of TLS ALPN (Application Layer Protocol Negotiation)
strings to use in negotiation.  For DNS-over-TLS, the right value is `["dot"]`.
)cafilecapathF)r   	_tls_util#convert_verify_to_cafile_and_capathr   create_default_context
TLSVersionTLSv1_2minimum_versionr  	CERT_NONEr"  set_alpn_protocols)r   r  r  r  r  r   s         r   make_ssl_contextr    sq    ( ]]FFvNNF,,FJK #&.."8"8K!/"%--&&u-r   c                      [        XS LS/5      $ )Ndot)r  )r   r   s     r   _make_dot_ssl_contextr  '  s     F4$?%IIr   c                    U(       a  [        U UUUUUUUU5	      $ U R                  5       n[        U5      u  p[        XXES5      u  nnnUc   eU	c  [	        XSLS/5      n	[        U[        R                  U	U
US9 n[        UUU5        [        UU5        [        UX5        [        UXU R                  U R                  U5      u  nnUU-
  Ul        U R                  U5      (       d  [         eUsSSS5        $ ! , (       d  f       O= f  e)a  Return the response obtained after sending a query via TLS.

*q*, a ``dns.message.Message``, the query to send

*where*, a ``str`` containing an IPv4 or IPv6 address,  where
to send the message.

*timeout*, a ``float`` or ``None``, the number of seconds to wait before the
query times out.  If ``None``, the default, wait forever.

*port*, an ``int``, the port send the message to.  The default is 853.

*source*, a ``str`` containing an IPv4 or IPv6 address, specifying
the source address.  The default is the wildcard address.

*source_port*, an ``int``, the port from which to send the message.
The default is 0.

*one_rr_per_rrset*, a ``bool``.  If ``True``, put each RR into its own
RRset.

*ignore_trailing*, a ``bool``.  If ``True``, ignore trailing
junk at end of the received message.

*sock*, an ``ssl.SSLSocket``, or ``None``, the socket to use for
the query.  If ``None``, the default, a socket is created.  Note
that if a socket is provided, it must be a nonblocking connected
SSL stream socket, and *where*, *port*, *source*, *source_port*,
and *ssl_context* are ignored.

*ssl_context*, an ``ssl.SSLContext``, the context to use when establishing
a TLS connection. If ``None``, the default, creates one with the default
configuration.

*server_hostname*, a ``str`` containing the server's hostname.  The
default is ``None``, which means that no hostname is known, and if an
SSL context is created, hostname checking will be disabled.

*verify*, a ``bool`` or ``str``.  If a ``True``, then TLS certificate verification
of the server is done using the default CA bundle; if ``False``, then no
verification is done; if a `str` then it specifies the path to a certificate file or
directory which will be used for verification.

Returns a ``dns.message.Message``.

TNr  )r   r   rD   )rV  r   r,   r   r  r   r5   r6   r7   r  ri  ro  r   rP  r   r	  rx   )r   r   r   r=   rD   r   r   r   rE   r   r   r   r  rQ  r   rC   r   r   r  rJ  s                       r   tlsr  -  s0   z  

 
	
 99;D-g6Z 7V$!Rf >>&vd/JUGT	
'
 
K,q*%D%(zQYY
M +}}Q!
 
 
$ 	s   ;A3C88
Dr   c                 >   [         R                  R                  (       d  [        S5      eUb  U
c  Un
SU l        U R                  5       nU(       a  [        R                  " S5      nUnO[         R                  R                  XS9nUnU   U(       d  WR                  XXE5      n[        U5      u  nnWR                  U5       nUR                  US5        UR                  [        U5      5      nSSS5        [        R                  " 5       nSSS5        [         R                   R#                  UU R$                  U R&                  UUS9n[)        WW-
  S5      Ul        U R+                  U5      (       d  [,        eU$ ! , (       d  f       N= f! , (       d  f       N= f)a+  Return the response obtained after sending a query via DNS-over-QUIC.

*q*, a ``dns.message.Message``, the query to send.

*where*, a ``str``, the nameserver IP address.

*timeout*, a ``float`` or ``None``, the number of seconds to wait before the query
times out. If ``None``, the default, wait forever.

*port*, a ``int``, the port to send the query to. The default is 853.

*source*, a ``str`` containing an IPv4 or IPv6 address, specifying the source
address.  The default is the wildcard address.

*source_port*, an ``int``, the port from which to send the message. The default is
0.

*one_rr_per_rrset*, a ``bool``. If ``True``, put each RR into its own RRset.

*ignore_trailing*, a ``bool``. If ``True``, ignore trailing junk at end of the
received message.

*connection*, a ``dns.quic.SyncQuicConnection``.  If provided, the connection to use
to send the query.

*verify*, a ``bool`` or ``str``.  If a ``True``, then TLS certificate verification
of the server is done using the default CA bundle; if ``False``, then no
verification is done; if a `str` then it specifies the path to a certificate file or
directory which will be used for verification.

*hostname*, a ``str`` containing the server's hostname or ``None``.  The default is
``None``, which means that no hostname is known, and if an SSL context is created,
hostname checking will be disabled.  This value is ignored if *url* is not
``None``.

*server_hostname*, a ``str`` or ``None``.  This item is for backwards compatibility
only, and has the same meaning as *hostname*.

Returns a ``dns.message.Message``.
zDNS-over-QUIC is not available.Nr   )r"  r#  Tr   r
   )r   r   r%  r   r&  r   r   r   r'  r(  r,   r)  r;  r+  r   r   r  r  r   r   r,  r	  rx   )r   r   r   r=   rD   r   r   r   r   r   r   r   r  r.  r0  r/  r1  r   r2  r3  r  s                        r   r   r     sb   n 88566"x'7"AD99;D 5?5K5KD5Q#((** + 
 	(00VN -W5
''0FKKd#>>*Z"89D 1  
 			MM)' 	 	A %%AF==H 10 
s$   9F-E=1F=
F	F
Fc                   $    \ rS rSrSrSrSrSrSrg)UDPModei  zHow should UDP be used in an IXFR from :py:func:`inbound_xfr()`?

NEVER means "never use UDP; always use TCP"
TRY_FIRST means "try to use UDP but fall back to TCP if needed"
ONLY means "raise ``dns.xfr.UseTCP`` if trying UDP does not succeed"
r   r   r   rd   N)	rP   rQ   rR   rS   rv   NEVER	TRY_FIRSTONLYrT   rd   r   r   r  r    s     EIDr   r  txn_managerr   serialc              #   n  #    UR                   S   R                  nU[        R                  R                  :H  nU R                  5       nUR                  5       n	[        U[        R                  5      =(       a    UR                  [        R                  :H  n
U
(       a  [        XSU5        O/[        R                  " S[        U	5      5      U	-   n[        XU5        [        R                   R#                  XX:5       nSnSnSnU(       d  [%        U5      u  nnUb	  Ub  UU:  a  UnU
(       a  ['        USU5      u  nnO3[)        USU5      n[        R*                  " SU5      u  n[)        UUU5      n[        R,                  R/                  UUR0                  UR2                  SUUU
(       + US9nUR5                  U5      nUv   UR6                  nU(       d  M  UR0                  (       a3  Ub0  UR8                  (       d  [        R:                  R=                  S	5      eSSS5        g! , (       d  f       g= f7f)
z'Given a socket, does the zone transfer.r   Nrk  FrH  r   T)r   r   xfrorigintsig_ctxmultir   zmissing TSIG)questionrdtyper   	rdatatypeIXFRfrom_wire_originr   r   r5   r   rO  r=  rl  packr   rc  r  Inboundr,   r8  r_  rm  r  r  r   rP  process_messager  had_tsigr   	FormError)r  r   rF  r  r   r   r  is_ixfrr  r  is_udprh  inbounddoner  r  r@   mexpirationrwirern  rb  s                        r   _inbound_xfrr    s     ^^A%%F***G))+F==?D6==)Iaff8I8I.IF!4,T3t9-41j)	f	=(,-g6Q"&;+C(&q%=
!!Q4}}T51!!Q4%%!II!!z!( & 	A **1-DGzzH1 $2 ==Q]1::--)).99= 
>	=	=s&   C9H5;CH$AH$	H5$
H2.H5zoner  rdclasskeyname
relativizer+   use_udpkeyalgorithmc           	   #   V  #     " S S[         R                  R                  5      n[        U[        5      (       a  [         R
                  R                  U5      n[         R                  R                  R                  U5      n[         R                  R                  XU5      nU[         R                  R                  :X  a  UR                  UR                  U[         R                  R                   [         R                  R"                  SS9n[         R$                  R                  SSSU S35      nUR'                  US	5        Ub  UR)                  XgUS9  [+        XXS5      u  nnn
Uc   e[-        U	5      u  nnU" X5      nU(       a)  U[         R                  R                  :w  a  [/        S5      eU(       a  [0        R2                  O[0        R4                  n[7        UUU
5       n[9        UUU5        [;        UUUXU5       S
h  vN   S
S
S
5        g
 N! , (       d  f       g
= f7f)a/  Return a generator for the responses to a zone transfer.

*where*, a ``str`` containing an IPv4 or IPv6 address,  where
to send the message.

*zone*, a ``dns.name.Name`` or ``str``, the name of the zone to transfer.

*rdtype*, an ``int`` or ``str``, the type of zone transfer.  The
default is ``dns.rdatatype.AXFR``.  ``dns.rdatatype.IXFR`` can be
used to do an incremental transfer instead.

*rdclass*, an ``int`` or ``str``, the class of the zone transfer.
The default is ``dns.rdataclass.IN``.

*timeout*, a ``float``, the number of seconds to wait for each
response message.  If None, the default, wait forever.

*port*, an ``int``, the port send the message to.  The default is 53.

*keyring*, a ``dict``, the keyring to use for TSIG.

*keyname*, a ``dns.name.Name`` or ``str``, the name of the TSIG
key to use.

*relativize*, a ``bool``.  If ``True``, all names in the zone will be
relativized to the zone origin.  It is essential that the
relativize setting matches the one specified to
``dns.zone.from_xfr()`` if using this generator to make a zone.

*lifetime*, a ``float``, the total number of seconds to spend
doing the transfer.  If ``None``, the default, then there is no
limit on the time the transfer may take.

*source*, a ``str`` containing an IPv4 or IPv6 address, specifying
the source address.  The default is the wildcard address.

*source_port*, an ``int``, the port from which to send the message.
The default is 0.

*serial*, an ``int``, the SOA serial number to use as the base for
an IXFR diff sequence (only meaningful if *rdtype* is
``dns.rdatatype.IXFR``).

*use_udp*, a ``bool``.  If ``True``, use UDP (only meaningful for IXFR).

*keyalgorithm*, a ``dns.name.Name`` or ``str``, the TSIG algorithm to use.

Raises on errors, and so does the generator.

Returns a generator of ``dns.message.Message`` objects.
c                       \ rS rSrS rS rS\R                  R                  4S jr	S r
SS\S\R                  R                  4S jjrS	rg
)$xfr.<locals>.DummyTransactionManageri  c                 X    XU(       a  [         R                  R                  OU4U l        g r   )r   r   emptyinfo)r#   r  r  s      r   r   -xfr.<locals>.DummyTransactionManager.__init__  s    zSXX^^vVDIr   c                     U R                   $ r   r  r#   s    r   origin_information7xfr.<locals>.DummyTransactionManager.origin_information  s    99r   rn   c                     [         er   rJ   r  s    r   	get_class.xfr.<locals>.DummyTransactionManager.get_class  rk   r   c                     [         er   rJ   r  s    r   reader+xfr.<locals>.DummyTransactionManager.reader  rk   r   replacementc                 h     " S S5      n[        [        R                  R                  U" 5       5      $ )Nc                        \ rS rSrS rS rSrg)Exfr.<locals>.DummyTransactionManager.writer.<locals>.DummyTransactioni  c                     g r   rd   )r#   ra   kws      r   nopIxfr.<locals>.DummyTransactionManager.writer.<locals>.DummyTransaction.nop  s    r   c                     U R                   $ r   )r  )r#   r@   s     r   __getattr__Qxfr.<locals>.DummyTransactionManager.writer.<locals>.DummyTransaction.__getattr__  s    88Or   rd   N)rP   rQ   rR   rS   r  r  rT   rd   r   r   DummyTransactionr    s    $r   r  )r   r   transactionTransaction)r#   r  r  s      r   writer+xfr.<locals>.DummyTransactionManager.writer  s)    $ $ 335E5GHHr   r  N)F)rP   rQ   rR   rS   r   r  r   
rdataclass
RdataClassr  r  boolr  r  r  rT   rd   r   r   DummyTransactionManagerr    sN    	W		&s~~88 	&	&	Id 	Is7R7R 	I 	Ir   r  T)createINSOAz. . z 0 0 0 0r   N)	algorithmzcannot do a UDP AXFR)r   r  TransactionManagerr   r   r   	from_textr  	RdataTypemaker  
make_queryr  
find_rrset	authorityr  r  r  rdataadduse_tsigr   r,   r   r5   rO  r6   r4   r7   r  )r   r  r  r  r   r=   r   r  r  r+   rD   r   r  r  r  r  r   rrsetsoarC   r   r@   r   tm	sock_typer   s                             r   r  r  ;  s    JI#//"D"D I. $xx!!$']]$$))&1FtW5A###KKs~~00#--2C2CD  
 ii!!$fXX/FG		#q	

7|
< 7V$!Rf >>$X.OQ
	 	2B6S]]////00%,!!&2D2DI	RF	+qK,Aq&:FFF 
,	+F 
,	+s0   G&H)( HH	H	H)H
H&"H)udp_modec	           	      D   Uc"  [         R                  R                  U5      u  p)O[         R                  R                  U5      n	[	        XXgS5      u  pnU
c   e[        U5      u  pUR                  S   R                  [         R                  R                  :X  a[  U[        R                  :w  aG  [        U
[        R                  U5       n[        XU5         [!        XX)XM5       H  nM      SSS5        g[        U
[        R&                  U5       n[        XU5        [!        XX)XM5       H  nM     SSS5        g! [         R                  R"                   a    U[        R$                  :X  a  e  Of = f SSS5        M  ! , (       d  f       N= f! , (       d  f       g= f)aM  Conduct an inbound transfer and apply it via a transaction from the
txn_manager.

*where*, a ``str`` containing an IPv4 or IPv6 address,  where
to send the message.

*txn_manager*, a ``dns.transaction.TransactionManager``, the txn_manager
for this transfer (typically a ``dns.zone.Zone``).

*query*, the query to send.  If not supplied, a default query is
constructed using information from the *txn_manager*.

*port*, an ``int``, the port send the message to.  The default is 53.

*timeout*, a ``float``, the number of seconds to wait for each
response message.  If None, the default, wait forever.

*lifetime*, a ``float``, the total number of seconds to spend
doing the transfer.  If ``None``, the default, then there is no
limit on the time the transfer may take.

*source*, a ``str`` containing an IPv4 or IPv6 address, specifying
the source address.  The default is the wildcard address.

*source_port*, an ``int``, the port from which to send the message.
The default is 0.

*udp_mode*, a ``dns.query.UDPMode``, determines how UDP is used
for IXFRs.  The default is ``dns.query.UDPMode.NEVER``, i.e. only use
TCP.  Other possibilities are ``dns.query.UDPMode.TRY_FIRST``, which
means "try UDP but fallback to TCP if needed", and
``dns.query.UDPMode.ONLY``, which means "try UDP and raise
``dns.xfr.UseTCP`` if it does not succeed.

Raises on errors.
NTr   )r   r  r  extract_serial_from_queryr   r,   r  r  r  r  r  r  r4   r5   rO  r7   r  UseTCPr  r6   )r   r  rF  r=   r   r+   rD   r   r  r  rC   r   r@   r   r   s                  r   inbound_xfrr    s_   ^ }'',,[92259 7V$!Rf >>$X.OQ~~a3==#5#55(gmm:SV..71QZ0%E7A   87 
R++V	4,keWQA R 
5	4	 77>> w||+ ,+ 877 
5	4s6   F D<!F<3E2/F 1E22F  
F
F)Tr   rO   )	Nr   Nr   FFTTN)
NNFFNr   FFFN)
NrM  Nr   FFFFNF)
NrM  Nr   FFFNNF)NFNr   F)NrM  Nr   FFN)TTN)
NU  Nr   FFNNNT)
Nr  Nr   FFNTNN)rv   r   r   enumrr  rz  r   r   r5   rl  r   urllib.parser   typingr   r   r   r   r   r   dns._featuresr   dns._tls_utildns.exceptiondns.inetdns.messagedns.namedns.quic	dns.rdatadns.rdataclassdns.rdatatypedns.transactiondns.tsigdns.xfrr   ImportErrordns._no_ssl_no_sslr   r   	_featureshave_have_httpxhttpcore._backends.syncr:   r   NetworkBackend_CoreNetworkBackend	_backendssync
SyncStreamr8   r   HTTPTransportrX   r   AddressFamilyr  
SocketKindrp   rq   __annotations__r   DNSExceptionrs   r  rx   r{   r   r  TransferErrorr,   r   r   r   r   r   r   r4   
SSLContextr   r   r   r   r   r   r   IntEnumr   re   r   r  r@  floatr  r  r   Headersbytesr  r   r   r   r8  r=  rC  tsigKeyrL  rR  rW  r_  rc  ri  ro  r7   rV  r  r   r  r  r  r  r  r  r  r  AXFRr  r  default_algorithmr  r  r  r  rd   r   r   <module>r!     s  $      	       = =             
2 mm  '""11((--88O4&- 4&l,, ,& &  *s"*


* * ]]	*  C!2!2C8&--G 
Hs}}11 HG#--)) GCMM&& 
CMM&&  %%$(800	)" =A)%^ s"


 $J ]]	J 37's"'


' ' XX]]S(4/	'
 $J' 	]]'V
-./$,, & !"!$(*.26"" + 3 3!L
{{LL T\L 	L
 $JL L L L 4ZL L L TzL 3J'L ./L L  !L" 	[[#L^#((** % E O388++ O3 Oe O O* !"!*.59:
{{:: 
: T\	:
 : $J: : : : 3J': : ++d2: 	[[:z	11&  $	

++


%  	
 3:> ###"8< #! %(,g4
g4tg4 g4 	g4
 g4 #((---.5g4 g4 g4 g4 g4 ;;%g4 	g4Z !#"! %Y
{{YY T\Y 	Y
 $JY Y Y Y Y Y *Y Y 	[[Y~ !#"!U 
{{U U  T\U  	U 
 $JU  U  U  U  U  DjU  DjU  U  3;;$%U p*1&  $$
$
++


%$ $ 3:	$@  $"8< #!,
,, , #((---.5	,
 , , 3;;%&,^- !"!C
{{CC T\C 	C
 $JC C C C *C 	[[CL. "3J 9t 	^^	DJ4ZJ)-J^^J !"!!%)-"&i
{{ii T\i 	i
 $Ji i i i --$
i $&i 4Zi 3Ji 	[[i^ !"!59"&^
{{^^ T\^ 	^
 $J^ ^ ^ ^ ++d2^ 3J^ Dj^ 4Z^ 	[[^B
dll 
1:331:}}s}}$1: ;;1: $J	1:
 T\1: 1: 	1:n -0MM,>,>/2~~/@/@ 8<*.!(+(B(BsGsG
((--#
sG MM##c)sG ^^&&,	sG
 T\sG sG #((---.5sG XX]]S 4'sG sG dlsG $JsG sG sG sG ((--#%sG  	!sGr )- !II33I ;;%I 	I
 T\I dlI $JI I I 
IA4  s   5f   f0/f0