+
    ni                     X  a  RU tr0 t R t^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RIt^ RIt^ RIHtHtHtHtHtHt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI t^ RI!t^ RI"t ^ RI#t#R t'R t(]PR                  PU                  R4      t+]+'       dV   ^ RI,t-^ RI.t.]-P^                  t0]-Pb                  Pd                  Pf                  t4 ! R R]04      t5 ! R R	].Pl                  4      t7M
 ! R
 R	4      t7]+t8R R lt9]9t:] ^ k  ! R R]Pv                  Px                  4      t= ! R R]Pv                  P|                  4      t? ! R R]Pv                  Px                  4      t@ ! R R]Pv                  Px                  4      tA]P                  P                  tCR tDR tER tFR tGR tHR tIRVR ltJRWR R lltKRXR R  lltLR! tMR" R# ltN ! R$ R%]P                  4      tPRR&R^ R'R'RR(RRRR]	P                  ]PP                  3R) R* lltSR+ R, ltTR- R. ltURYR/ R0 lltVR1 tWR2 tXRWR3 R4 lltYRZR5 R6 lltZR[R7 R8 llt[R\R9 R: llt\R; t]R< t^RWR= R> llt_R]R? R@ llt`RA taR^RB RC lltbRD tcR_RE RF lltdRG RH lteR`RI RJ lltfRaRK RL lltg ! RM RN]P                  4      thRO RP lti]P                  P                  ]P                  P                  R^5RRRRR^ ^ R']P                  P                  3RQ RR lltBR^5RRR^ ]hP                  3RS RT lltqR#   ]$ d    ^ RI%H&t#  ELi ; i)bzTalk to a DNS server.N)AnyCallableDictOptionalTuplecastc                     V f   R # V \         P                   ! 4       ,
          pVR8:  d   \        P                  P                  hV# )N        )timedns	exceptionTimeout)
expirationtimeouts   & cC:\Users\petid\OneDrive\Desktop\Maestro\MAESTRO\maestro-backend\venv\Lib\site-packages\dns/query.py
_remainingr   5   s7    499;&G#~mm###N    c                 Z    Vf   R # \        \        P                  ! 4       V ,           V4      # N)minr
   )r   r   s   &&r   _expiration_for_this_attemptr   >   s#    tyy{W$j11r   dohc                   F   a a ] tR t^Lt oV 3R ltRR ltRR ltRtVtV ;t	# )_NetworkBackendc                T   < \         SV `  4        W n        Wn        W0n        W@n        R # 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                   . p\        V4      w  rx\        P                  P                  V4      '       d   VP	                  V4       MV P
                  e   VP	                  V P
                  4       Mk\        V4      pV P                  p	V'       d    \        P                  P                  V4      p	V P                  P                  WVR7      p
V
P                  4       pV F  p\        P                  P                  V4      pVf   V P                  ^ 8w  d3   Vf   Rp\        P                  P                  W@P                  3V4      pMR p \        V\        P                   V4      p\#        RV4      p\%        V\        P                  P                  W3V4      V4       \'        V4      u # 	  \*        P,                  h  \(         d     K  i ; i)N)r%   lifetimez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_optionsr0   _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F<<G
Gc                    \         h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   rE   rK   __static_attributes____classdictcell____classcell__r&   __classdict__s   @@r   r   r   L   s     	"'	(R	& 	&r   r   c                   Z   a a ] tR t^t oR^ RRRRR]P
                  /V 3R lltRtVtV ;t	# )_HTTPTransportr#   r$   Nr"   r%   c                  < Vf#   Vf   ^ R I pVP                  P                  4       p\        SV `  ! V/ VB  \        W1W$4      V P                  n        R # r   )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    )
rN   rO   rP   rQ   r3   	AF_UNSPECr   rR   rS   rT   rU   s   @@r   rX   rX      s=     	 	 #		
 	 ##	 	r   rX   c                   T   a  ] tR t^t o R^ RRRRR]P
                  /R ltR tRtV t	R# )	rX   r#   r$   Nr"   r%   c                   R # r   ra   )r!   r#   r$   r"   r%   r^   r_   s   &$$$$*,r   r   r`      s     r   c                    \         hr   rH   )r!   r:   r;   r   r<   s   &&&&&r   rE   _HTTPTransport.connect_tcp       %%r   ra   )
rN   rO   rP   rQ   r3   rb   r   rE   rR   rS   rV   s   @r   rX   rX      sB     		 		 #			
 		 ##			& 	&r   c                    V ^8  d   QhR\         P                  \        ,          R\         P                  R\        R\         P                   /# )   rA   kindprotoreturn)r3   AddressFamilyint
SocketKind)formats   "r   __annotate__rr      sE     * *s"*


* * ]]	*r   c                 0    \         P                   ! WV4      # r   )r3   )rA   rk   rl   s   &&&r   default_socket_factoryrt      s    
 ==5))r   c                       ] tR t^tRtRtR# )UnexpectedSourcez=A DNS query response came from an unexpected address or port.ra   NrN   rO   rP   rQ   __doc__rR   ra   r   r   rv   rv      s    Gr   rv   c                       ] tR t^tRtRtR# )BadResponsez<A DNS query response does not respond to the question asked.ra   Nrw   ra   r   r   rz   rz      s    Fr   rz   c                       ] tR t^tRtRtR# )NoDOHzIDNS over HTTPS (DOH) was requested but the httpx module is not
available.ra   Nrw   ra   r   r   r|   r|          r   r|   c                       ] tR t^tRtRtR# )NoDOQzJDNS over QUIC (DOQ) was requested but the aioquic module is not
available.ra   Nrw   ra   r   r   r   r      r}   r   r   c                 P    \         P                   ! 4       pV f   VR 3# WV ,           3# r   )r
   )r   nows   & r   r*   r*      s)    
))+CT{7]##r   c                    V'       d8   \        V \        P                  4      '       d   V P                  4       ^ 8  d   R# \        P
                  ! 4       ;_uu_ 4       p^ pV'       d   V\        P                  ,          pV'       d   V\        P                  ,          pV'       d   VP                  W4       Vf   RpM=V\        P                  ! 4       ,
          pVR8:  d   \        P                  P                  hVP                  V4      '       g   \        P                  P                  h RRR4       R#   + '       g   i     R# ; i)    TNr	   )
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   )D7D7&A+D7D77E	c                 $    \        V R RR V4       R# )TFNr   sr   s   &&r   _wait_for_readabler      s    audJ/r   c                 $    \        V R RRV4       R# )FTNr   r   s   &&r   _wait_for_writabler      s    adJ/r   c                 &    \         P                  P                  W^ ,          4      p\         P                  P                  W^ ,          4      pY48H  ;'       d    TR,          TR,          8H  #   \         P                  P                   d     R# i ; i)r   F   NN)r   r+   	inet_ptonr   SyntaxError)rA   a1a2n1n2s   &&&  r   _addresses_equalr      st    XXqE*XXqE* 8((2"R&(( ==$$ s   AA- -BBc                     V'       g   R # \        WV4      '       gB   \        P                  P                  V^ ,          4      '       d   VR,          VR,          8X  d   R # V'       d   R# \	        RV RV 24      h)Tr   Fzgot a response from z instead of )r   r   r+   is_multicastrv   )rA   from_addressdestinationignore_unexpecteds   &&&&r   _matches_destinationr     sg     +66k!n--,r2BkRTo2U	

|nL[MJ r   Tc                 H   R pR p \         P                  P                  V 4      pT pV'       d<   \         P                  P                  V4      pV'       d   Wu8w  d   \	        R4      hMTpV'       d)   V'       g!    \         P                  P                  V4      pV'       d"   \         P                  P                  Wa3V4      pV'       d"   \         P                  P                  W#3V4      pWVV3#   \         d    T'       d   h  Li ; i  \         d    \	        R4      hi ; i)Nz5different address families for source and destinationz3source_port specified but address family is unknown)r   r+   r.   r7   
ValueError
any_for_afr1   )wherer;   rB   source_portwhere_must_be_addressrA   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#   !C0 ;D
 0DDD
D!c                    V ^8  d   QhR\         P                  \        ,          R\         P                  R\        R,          R\         P                   /# )rj   rA   typerB   Nrm   )r3   rn   ro   rp   r   )rq   s   "r   rr   rr   D  sI      s"


 $J ]]	r   c                    \        W^ 4      p VP                  R4       Ve   VP                  V4       V#   \         d    TP	                  4        h i ; i)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*.
F)socket_factorysetblockingbindr7   close)rA   r   rB   r   s   &&& r   r2   r2   D  sR    , 	r#A	eFF6N 		s	   '6 Ac                    V ^8  d   QhR\         P                  \        ,          R\         P                  R\        P
                  R\        P                  P                  \        ,          R,          R\        R,          R\        P                  /# )rj   rA   r   ssl_contextserver_hostnameNrB   rm   )r3   rn   ro   rp   r   
SSLContextr   nameNamestrr   r   )rq   s   "r   rr   rr   e  ss     ' 's"'


' ' XX]]S(4/	'
 $J' 	]]'r   c                    \        WV4      p\        V\        P                  P                  4      '       d   VP                  4       pVP                  VRVR7      # )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   )r2   r   r   r   r   to_textwrap_socket)rA   r   r   r   rB   rC   s   &&&&& r   make_ssl_socketr   e  sT    > r(D/388==11)113"" %' #  r   c                 <    Ve   \        WW4V4      # \        WV4      # r   )r   r2   )rA   r   rB   r   r   s   &&&&&r   _make_socketr     s&     rvNN2V,,r   c                6    V ^8  d   QhR\         R,          RR/# )rj   r"   dns.resolver.Resolverrm   )r   )rq   s   "r   rr   rr     s"      ./r   c                 J    V f   ^ R I pVP                  P                  4       p V # r   )rZ   r"   r[   )r"   r   s   & r   _maybe_get_resolverr     s$     <<((*Or   c                   6    ] tR tRtRt^ t^t^t^t^t	^t
^tRtR# )HTTPVersioni  zzWhich version of HTTP should be used?

DEFAULT will select the first version from the list [2, 1.1, 3] that
is available.
ra   N)rN   rO   rP   rQ   rx   DEFAULTHTTP_1H1HTTP_2H2HTTP_3H3rR   ra   r   r   r   r     s,     GF	
BF	
BF	
Br   r     Fz
/dns-queryc          "         V ^8  d   QhR\         P                  P                  R\        R\        R,          R\
        R\        R,          R\
        R\        R	\        R
\        R,          R\        R\        R\        R,          R\        \        ,          \        P                  ,          R\        R,          R\
        R\        R\         P                  P                  /# )rj   qr   r   Nr;   rB   r   one_rr_per_rrsetignore_trailingsessionrJ   postr$   verifyr"   r   r%   http_versionrm   )r   messageMessager   floatro   boolr   r   r   r   r   )rq   s   "r   rr   rr     s     L L
{{LL T\L 	L
 $JL L L L 4ZL L L TzL 3J'L ./L L  !L" 	[[#Lr   c                <	   \        WWER4      w  pppTpVee   \        P                  P                  V4      '       d@   V\        P
                  8X  d   RV RV V	 2pMV\        P                  8X  d   RV RV V	 2p/ pVf   \        P                  P                  V4      pVP                  f   \        R4      h\        P                  P                  VP                  4      '       d   VP                  pVP                  VR&   VP                  e   VP                  pV\        P                  8X  g"   V\        P                  8X  d   \         '       g   Vfe   \#        V4      pXP                  f   Q hVP%                  VP                  V4      p\&        P(                  ! \+        VP-                  4       4      4      pV'       d6   \/        V\        P0                  P2                  4      '       g   \        R	4      h\5        V VVVVVVVVVV
VR
7      # \         '       g   \6        hV'       d,   \/        V\8        P:                  4      '       g   \        R4      hV P=                  4       pRR/pV\        P>                  \        P                  39   pV\        P@                  \        P                  39   pVf   Rp^ pMV^ ,          pV^,          pV'       d   \B        PD                  ! V4      pM-\G        VVVVVVVVR7      p\8        P:                  ! VVVVR7      pT;_uu_ 4       pVf   Q hV
'       d?   VPI                  RRR\K        \M        V4      4      /4       VPO                  VVVVVR7      pMM\P        PR                  ! V4      PU                  R4      pVPW                  4       p VPY                  VVVRV /VR7      pRRR4       XPZ                  ^8  g   VPZ                  R8  d(   \        V RVPZ                   RVP\                   24      h\        P^                  Pa                  VP\                  V Pb                  V Pd                  VVR7      p!VPf                  Pi                  4       V!n5        V Pm                  V!4      '       g   \n        hV!#   + '       g   i     L; i)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-message)r<   http1http2r   r#   r$   r"   r%   )r   r   r   	transportz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,   r3   AF_INETAF_INET6urllibparseurlparsehostnamer   r;   r   r   r   have_dohr   r/   randomchoicelistr0   r   quicSyncQuicConnection_http3r|   httpxClientto_wirer   r   
contextlibnullcontextrX   updater   lenr   base64urlsafe_b64encoderstripdecodegetstatus_coder   r   	from_wirer   r   elapsedtotal_secondsr
   is_responserz   )"r   r   r   r;   rB   r   r   r   r   rJ   r   r$   r   r"   r%   r   rA   r>   
the_sourceurlr   parsedr?   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"$=$c#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    R/BRR	c                d    V ^8  d   QhR\         P                  P                  R\        R\        /# )rj   r   r   rm   )r   r   Headersbytes)rq   s   "r   rr   rr     s+      #((** % E r   c                 L    V f   \         hV  F  w  r#W!8X  g   K  Vu # 	  \         hr   )KeyError)r   r   headervalues   &&  r   _find_headerr$    s)     >L ! Nr   c                h    V ^8  d   QhR\         P                  P                  R\        R\        RR/# )rj   r   peerr  rm   N)r   r   r  r   r  )rq   s   "r   rr   rr     s8     O O388++ O3 Oe O Or   c                 ,   \        V R 4      pVf   \        R4      h\        V4      pV^ 8  d   \        R4      hV^8  g   VR8  d=   Rp\        V4      ^ 8  d    RVP	                  4       ,           p\        V RV V 24      hR#   \
         d     L!i ; i)s   :statusNzno :status header in responsezstatus is negativer    z: r   )r$  r   ro   r  r  r7   r   )r   r&  r  r#  statuserrors   &&&   r   _check_statusr+    s    *-E}9::ZFz.//|v|t9q=t{{}, D6!=fXeWMNN $
  s   B BBc                   V ^8  d   QhR\         P                  P                  R\        R\        R\        R,          R\
        R\        R,          R\
        R	\        R
\        R\        \        ,          \        P                  ,          R\        R\         P                  P                  R,          R\         P                  P                  /# )rj   r   r   r  r   Nr;   rB   r   r   r   r   r   r   rm   )r   r   r   r   r   ro   r   r   r   r   r   )rq   s   "r   rr   rr     s     : :
{{:: 
: T\	:
 : $J: : : : 3J': : ++d2: 	[[:r   c           	      @   \         P                  P                  '       g   \        R 4      h\        P
                  P                  V4      pVP                  pVf   Q hVP                  e   VP                  p^ V n	        V P                  4       pV'       d   \        P                  ! R4      pM#\         P                  P                  WRR7      pTpT;_uu_ 4        V'       d   TpMXP                  WWV4      p\        V4      w  ppVP!                  V4      ;_uu_ 4       pVP#                  W.V
4       VP%                  \'        V4      4      p\)        VP+                  4       W4       RRR4       \,        P,                  ! 4       pRRR4       \         P.                  P1                  VV P2                  V P4                  VVR7      p\7        XX,
          R4      Vn        V P9                  V4      '       g   \:        hV#   + '       g   i     L; i  + '       g   i     L; i)z DNS-over-HTTP3 is not available.NT)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  rz   )r   r   r  r   r;   rB   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
''00FNN3d+>>*Z"89D&..*E8 1  
 			MM)' 	 	A %%AF==H 10 
s&   AHAG:	&H:H
HH	c                b      V P                  V4      #   \         d    \        Y4        K,  i ; i)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   )rC   max_sizer   s   &&&r   	_udp_recvrD    s2    
 	1==** 	1t0	1s    ..c                      V'       d   V P                  W4      # V P                  V4      #   \         d    \        Y4        KE  i ; i)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sendrB  r   )rC   datar   r   s   &&&&r   	_udp_sendrI    sC    
 	1{{455yy& 	1t0	1s   - - - AAc                    V ^8  d   QhR\         R\        P                  P                  \        ,          R\         R\
        R,          R\        \        \
        3,          /# )rj   rC   whatr   r   Nrm   r   r   r   r   r  r   r   ro   )rq   s   "r   rr   rr     sV      

++


%  	
 3:r   c                    \        V\        P                  P                  4      '       d   VP	                  4       p\
        P
                  ! 4       p\        WW#4      pWT3# )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   r   r  r
   rI  )rC   rK  r   r   	sent_timens   &&&&  r   send_udprP    sE    , $++,,||~		I$k6A>r   c                   V ^8  d   QhR\         R\         R,          R\        R,          R\        R\        R\        \        P
                  P                  \        P                  P                  3,          R,          R\        R,          R	\        R
\        R\        R\        P                  P                  R,          R\         /# )rj   rC   r   Nr   r   r   r   r   r   raise_on_truncationignore_errorsqueryrm   )r   r   r   r   r   r   r   tsigKeyr  r   r   )rq   s   "r   rr   rr     s     g4 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4r   c           	     .   Rp \        V RV4      w  r\        V P                  WV4      '       g   K/  \        P                  ! 4       p \        P
                  P                  VVVVVVR7      pT	'       d   T
e   T
P                  T4      '       g   K  T'       d   Y3# YT3#   \        P
                  P                   d>   pT	'       d0   T
e,   T
P                  TP                  4       4      '       g    Rp?K  h Rp?i\         d    T	'       d    EK  h i ; i)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   rR  N)
rD  r   r%   r
   r   r   r  	Truncatedr  r7   )rC   r   r   r   r   r   r   r   rR  rS  rT  r  r   received_timer  es   &&&&&&&&&&&     r   receive_udpr\    s    | D
(ujA#KK4E
 
 			%%'!1 /$7 & A6 U.u7H7H7K7K%%l331 {{$$ 	 %))!))+66 			s*   %B! !D 0C87C88DDDc                .   V ^8  d   QhR\         P                  P                  R\        R\        R,          R\
        R\        R,          R\
        R\        R	\        R
\        R\        R\        R,          R\        R\         P                  P                  /# )rj   r   r   r   Nr;   rB   r   r   r   r   rR  rC   rS  rm   r   r   r   r   r   ro   r   r   )rq   s   "r   rr   rr     s     Y Y
{{YY T\Y 	Y
 $JY Y Y Y Y Y *Y Y 	[[Yr   c                   V P                  4       p\        WWER4      w  rp\        V4      w  ppV
'       d   \        P                  ! V
4      pM!Vf   Q h\        V\        P                  V4      pT;_uu_ 4       p\        VWV4       \        VVVVVV P                  V P                  VV	VV 4      w  ppVV,
          Vn        V'       g   V P                  V4      '       g   \        hVuuRRR4       #   + '       g   i     M; i Q h)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  r2   r3   
SOCK_DGRAMrP  r\  r   macr
   r  rz   )r   r   r   r;   rB   r   r   r   r   rR  rC   rS  r  rA   r   
begin_timer   r  r   r  rZ  s   &&&&&&&&&&&&         r   udprc    s    p 99;D 7V$!Rf  .g6Z0:0F0Ft0L~~V..7	qDz2(IIEE
M + q!1!1) 
, 	s   9A&C2 C22D	c                ^   V ^8  d   QhR\         P                  P                  R\        R\        R,          R\
        R\        R,          R\
        R\        R	\        R
\        R\        R,          R\        R,          R\        R\        \         P                  P                  \        3,          /# )rj   r   r   r   Nr;   rB   r   r   r   r   udp_socktcp_sockrS  rm   )	r   r   r   r   r   ro   r   r   r   )rq   s   "r   rr   rr     s     U  U 
{{U U  T\U  	U 
 $JU  U  U  U  U  DjU  DjU  U  3;;$%U r   c                     \        V VVVVVVVVRV	V4      pVR3#   \        P                  P                   d    \	        T TTTTTTTT
4	      pTR3u # i ; i)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)rc  r   r   rY  tcp)r   r   r   r;   rB   r   r   r   r   re  rf  rS  r  s   &&&&&&&&&&&& r   udp_with_fallbackri    s    r 
 %  ;;    

 $ s    6AAc                6   RpV^ 8  dA    V P                  V4      pVR8X  d   \        R4      hV\        V4      ,          pW4,          pKG  V#   \        \        P
                  3 d    \        Y4        Kr  \        P                   d    \        Y4        K  i ; i)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   EOF)	recvEOFErrorr  rB  r   SSLWantReadErrorr   SSLWantWriteErrorr   )rC   countr   r   rO  s   &&&  r   	_net_readrq  7  s     	A
!)		1		% ACxuo%SVOEFA
 H	  !5!56 	1t0$$ 	1t0	1s   =A &B5BBBc                   ^ p\        V4      pW48  d    W0P                  WR 4      ,          pK"  R#   \        \        P                  3 d    \        Y4        KM  \        P                   d    \        Y4        Ko  i ; i)zWrite the specified data to the socket.
A Timeout exception will be raised if the operation is not completed
by the expiration time.
N)r  rG  rB  r   ro  r   rn  r   )rC   rH  r   currentls   &&&  r   
_net_writeru  L  sp    
 GD	A
+	1yyh00G   !6!67 	1t0## 	1t0	1s   2 &A>A>.A>=A>c          
          V ^8  d   QhR\         R\        P                  P                  \        ,          R\
        R,          R\        \        \
        3,          /# )rj   rC   rK  r   Nrm   rL  )rq   s   "r   rr   rr   \  sL     $ $
$
++


%$ $ 3:	$r   c                   \        V\        P                  P                  4      '       d   VP	                  RR7      pM"\        V4      P                  ^R4      V,           p\        P                  ! 4       p\        WV4       \        V4      V3# )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_lengthbig)	r   r   r   r   r  r  to_bytesr
   ru  )rC   rK  r   tcpmsgrN  s   &&&  r   send_tcpr|  \  sl    $ $++,,T2
 T##Au-4		ItZ(K##r   c                R   V ^8  d   QhR\         R\        R,          R\        R\        \        P
                  P                  \        P                  P                  3,          R,          R\        R,          R\        R\        \        P                  P                  \        3,          /# )	rj   rC   r   Nr   r   r   r   rm   )r   r   r   r   r   r   r   rU  rV  r  r   r   r   )rq   s   "r   rr   rr   z  s     , ,
,, , #((---.5	,
 , , 3;;%&,r   c                    \        V ^V4      p\        P                  ! RV4      w  p\        WV4      p\        P                  ! 4       p	\        P
                  P                  VVVVVR7      p
W3# )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.
!Hr   )rq  structunpackr
   r   r   r  )rC   r   r   r   r   r   ldatart  r  rZ  r  s   &&&&&&     r   receive_tcpr  z  so    B dAz*E==u%DQTj)DIIKM)' 	 	A r   c                 b   V P                  V4      pV^ 8X  d   R# V\        P                  \        P                  \        P                  39   d:   \        W4       V P                  \        P                  \        P                  4      pV^ 8w  d!   \        V\        P                  ! V4      4      hR# )r   N)
connect_exerrnoEINPROGRESSEWOULDBLOCKEALREADYr   
getsockoptr3   
SOL_SOCKETSO_ERROROSErrorosstrerror)r   r@   r   errs   &&& r   r5   r5     s}    
,,w
C
ax
u  %"3"3U^^DD1)ll6,,foo>
axc2;;s+,, r   c                
   V ^8  d   QhR\         P                  P                  R\        R\        R,          R\
        R\        R,          R\
        R\        R	\        R
\        R,          R\         P                  P                  /
# )rj   r   r   r   Nr;   rB   r   r   r   rC   rm   r^  )rq   s   "r   rr   rr     s     C C
{{CC T\C 	C
 $JC C C C *C 	[[Cr   c	           
        V P                  4       p	\        V4      w  rV'       d   \        P                  ! V4      pM1\	        WWER4      w  rpVf   Q h\        V\        P                  V4      pT;_uu_ 4       pV'       g   \        VXV4       \        WV4       \        WW`P                  V P                  V4      w  ppVV
,
          Vn        V P                  V4      '       g   \        hVuuRRR4       #   + '       g   i     M; i Q h)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   r2   r3   r4   r5   r|  r  r   ra  r
   r  rz   )r   r   r   r;   rB   r   r   r   rC   r  rb  r   r  rA   r   r   r  rZ  s   &&&&&&&&&         r   rh  rh    s    V 99;D-g6Z0:0F0Ft0L$;d%
!& ~~V//8	qQZ0*%(+YY
M +}}Q 
 	s   8A3C66D	c                       V P                  4        R#   \        P                   d    \        Y4        K7  \        P                   d    \        Y4        KY  i ; i)TN)do_handshaker   rn  r   ro  r   r   s   &&r   _tls_handshaker    sJ    
	.NN## 	.q-$$ 	.q-	.s     AAAAc                    V ^8  d   QhR\         \        ,          R\         R\        \        ,          R,          R\        P                  /# )rj   r   check_hostnamealpnsNrm   )r   r   r   r   r   )rq   s   "r   rr   rr     sA      3J 9t 	^^	r   c                    \         P                  P                  V 4      w  r4\        P                  ! W4R7      p\        P
                  P                  Vn        Wn        V RJ d   \        P                  Vn
        Ve   VP                  V4       V# )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                t    V ^8  d   QhR\         R,          R\        \         ,          R\        P                  /# )rj   r   Nr   rm   )r   r   r   r   )rq   s   "r   rr   rr   '  s5     J J4ZJ)-J^^Jr   c                      \        WR JR.4      # )Ndot)r  )r   r   s   &&r   _make_dot_ssl_contextr  '  s     F4$?%IIr   c                   V ^8  d   QhR\         P                  P                  R\        R\        R,          R\
        R\        R,          R\
        R\        R	\        R
\        P                  R,          R\        P                  R,          R\        R,          R\        \        ,          R\         P                  P                  /# )rj   r   r   r   Nr;   rB   r   r   r   rC   r   r   r   rm   )
r   r   r   r   r   ro   r   r   r   r   )rq   s   "r   rr   rr   -  s     i i
{{ii T\i 	i
 $Ji i i i --$
i $&i 4Zi 3Ji 	[[ir   c                D   V'       d   \        V VVVVVVVV4	      # V P                  4       p\        V4      w  r\        WWER4      w  pppVf   Q hV	f   \	        WRJR.4      p	\        V\        P                  V	V
VR7      ;_uu_ 4       p\        VVV4       \        VV4       \        VW4       \        VWV P                  V P                  V4      w  ppVV,
          Vn        V P                  V4      '       g   \         hVuuRRR4       #   + '       g   i     M; i Q h)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   rB   )rh  r  r*   r   r  r   r3   r4   r5   r  r|  r  r   ra  r
   r  rz   )r   r   r   r;   rB   r   r   r   rC   r   r   r   r  rb  r   rA   r   r   r  rZ  s   &&&&&&&&&&&&        r   tlsr  -  s:   z  

 
	
 99;D-g6Z 7V$!Rf >>&vd/JUGT	
'
 
 
K,q*%D%(zQYY
M +}}Q!
 
 
 
$ 	s   	A8DD	c                   V ^8  d   QhR\         P                  P                  R\        R\        R,          R\
        R\        R,          R\
        R\        R	\        R
\         P                  P                  R,          R\        \        ,          R\        R,          R\        R,          R\         P                  P                  /# )rj   r   r   r   Nr;   rB   r   r   r   r   r   r   r   rm   )	r   r   r   r   r   ro   r   r   r   )rq   s   "r   rr   rr     s     ^ ^
{{^^ T\^ 	^
 $J^ ^ ^ ^ ++d2^ 3J^ Dj^ 4Z^ 	[[^r   c           	        \         P                  P                  '       g   \        R4      hVe   V
f   Tp
^ V n        V P                  4       pV'       d   \        P                  ! R4      pTpM"\         P                  P                  WR7      pTpT;_uu_ 4        V'       g   XP                  WWE4      p\        V4      w  ppXP                  V4      ;_uu_ 4       pVP                  VR4       VP                  \        V4      4      pRRR4       \        P                  ! 4       pRRR4       \         P                   P#                  VV P$                  V P&                  VVR7      p\)        XX,
          R4      Vn        V P+                  V4      '       g   \,        hV#   + '       g   i     L; i  + '       g   i     L; i)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.N)r.  r/  Tr   r	   )r   r   r1  r   r2  r  r  r  r3  r4  r*   r5  rG  r7  r   r
   r   r  r   r   r8  r  rz   )r   r   r   r;   rB   r   r   r   r   r   r   r   r  r:  r<  r;  r=  r   r>  r?  r  s   &&&&&&&&&&&&         r   r   r     sj   n 88566"x'7"AD99;D 5?5K5KD5Q#((** + 
 	(00VN -W5
''00FKKd#>>*Z"89D 1  
 			MM)' 	 	A %%AF==H 10 
s%   AF0-F		F0F-(F00G 	c                   &    ] tR tRtRt^ t^t^tRtR# )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"
ra   N)	rN   rO   rP   rQ   rx   NEVER	TRY_FIRSTONLYrR   ra   r   r   r  r    s     EIDr   r  c                $   V ^8  d   QhR\         P                  P                  R\        P                  \        P
                  ,          R\         P                  P                  R\        R,          R\        R,          R\        R,          R\        /# )	rj   txn_managerr   rT  serialNr   r   rm   )r   transactionTransactionManagerr3   r   r   r   r   ro   r   r   )rq   s   "r   rr   rr     s{     1: 1:331:}}s}}$1: ;;1: $J	1:
 T\1: 1: 	1:r   c              #    "   VP                   ^ ,          P                  pV\        P                  P                  8H  pV P                  4       pVP                  4       p	\        V\        P                  4      ;'       d    VP                  \        P                  8H  p
V
'       d   \        WRV4       M3\        P                  ! R\        V	4      4      V	,           p\        WV4       \        P                   P#                  WW:4      ;_uu_ 4       pRpRpRpV'       g   \%        V4      w  ppVe   Ve
   VV8  d   TpV
'       d   \'        VRV4      w  ppM3\)        V^V4      p\        P*                  ! RV4      w  p\)        VVV4      p\        P,                  P/                  VVP0                  VP2                  RVVV
'       * VR7      pVP5                  V4      pVx  VP6                  pK  VP0                  '       d6   Ve2   VP8                  '       g    \        P:                  P=                  R4      hRRR4       R#   + '       g   i     R# ; i5i)z'Given a socket, does the zone transfer.Nr  FrX  T)r   r   xfrorigintsig_ctxmultir   zmissing TSIG)questionrdtyper   	rdatatypeIXFRfrom_wire_originr  r   r3   r   r`  rI  r  packr  ru  r  Inboundr*   rD  rq  r  r   r  r   ra  process_messager  had_tsigr   	FormError)r  r   rT  r  r   r   r  is_ixfrr  r  is_udpr{  inbounddoner  r  r>   mexpirationrwirer  rt  s   &&&&&&               r   _inbound_xfrr    s     ^^A%%F***G))+F==?D6==)I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zzH===Q]1:::--)).99= 
>	=	=	=s>   B!I$A)IH;&H;B8H;<H;H;1
I;I		Ic                    V ^8  d   QhR\         R\        P                  P                  \         ,          R\        P                  P
                  \         ,          R\        P                  P                  \         ,          R\        R,          R\        R\        \        P                  P                  \        P                  P                  3,          R,          R	\        P                  P                  \         ,          R,          R
\        R\        R,          R\         R,          R\        R\        R\        R\        P                  P                  \         ,          R\        /# )rj   r   zoner  rdclassr   Nr;   r   keyname
relativizer)   rB   r   r  use_udpkeyalgorithmrm   )r   r   r   r   r  	RdataType
rdataclass
RdataClassr   ro   r   rU  rV  r   r   )rq   s   "r   rr   rr   ;  sA    sG 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   c           
   #    "    ! R R\         P                  P                  4      p\        V\        4      '       d    \         P
                  P                  V4      p\         P                  P                  P                  V4      p\         P                  P                  WV4      pV\         P                  P                  8X  d   VP                  VP                  V\         P                  P                   \         P                  P"                  RR7      p\         P$                  P                  RRRV R24      pVP'                  V^ 4       Ve   VP)                  WgVR
7       \+        WWR4      w  ppp
Vf   Q h\-        V	4      w  ppV! W4      pV'       d+   V\         P                  P                  8w  d   \/        R4      hV'       d   \0        P2                  M\0        P4                  p\7        VVV
4      ;_uu_ 4       p\9        VVV4       \;        VVVWV4       R	j  xL
  R	R	R	4       R	#  L  + '       g   i     R	# ; i5i)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                   Z   a  ] tR tRt o R tR tV 3R lR ltR tRV 3R lR lltR	t	V t
R
# )$xfr.<locals>.DummyTransactionManageri  c                \    YV'       d   \         P                  P                  MT3V n        R # r   )r   r   emptyinfo)r!   r  r  s   &&&r   r   -xfr.<locals>.DummyTransactionManager.__init__  s    zSXX^^vVDIr   c                    V P                   # r   r  r!   s   &r   origin_information7xfr.<locals>.DummyTransactionManager.origin_information  s    99r   c                H   < V ^8  d   QhRS[ P                  P                  /# )rj   rm   )r   r  r  )rq   rV   s   "r   rr   1xfr.<locals>.DummyTransactionManager.__annotate__  s     	& 	&s~~88 	&r   c                    \         hr   rH   r  s   &r   	get_class.xfr.<locals>.DummyTransactionManager.get_class  rg   r   c                    \         hr   rH   r  s   &r   reader+xfr.<locals>.DummyTransactionManager.reader  rg   r   c                N   < V ^8  d   QhRS[ RS[P                  P                  /# )rj   replacementrm   )r   r   r  Transaction)rq   rV   s   "r   rr   r    s)     	I 	Id 	Is7R7R 	Ir   c                h     ! R  R4      p\        \        P                  P                  V! 4       4      # )c                   ,   a  ] tR tRt o R tR tRtV tR# )Exfr.<locals>.DummyTransactionManager.writer.<locals>.DummyTransactioni  c                    R # r   ra   )r!   r^   kws   &*,r   nopIxfr.<locals>.DummyTransactionManager.writer.<locals>.DummyTransaction.nop  s    r   c                    V P                   # r   )r  )r!   r>   s   &&r   __getattr__Qxfr.<locals>.DummyTransactionManager.writer.<locals>.DummyTransaction.__getattr__  s    88Or   ra   N)rN   rO   rP   rQ   r  r  rR   rS   rh   s   @r   DummyTransactionr    s     $ $r   r  )r   r   r  r  )r!   r  r  s   && r   writer+xfr.<locals>.DummyTransactionManager.writer  s)    $ $ 335E5GHHr   r  N)F)rN   rO   rP   rQ   r   r  r  r  r  rR   rS   rh   s   @r   DummyTransactionManagerr    s1     	W		& 	&	&	I 	I 	Ir   r  T)createINSOAz. . z 0 0 0 0N)	algorithmzcannot do a UDP AXFR)r   r  r  r   r   r   	from_textr  r  maker   
make_queryr  
find_rrset	authorityr  r  r  rdataadduse_tsigr   r*   r   r3   r`  r4   r2   r5   r  )r   r  r  r  r   r;   r   r  r  r)   rB   r   r  r  r  r  r   rrsetsoarA   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 
,	+	+s6   GI5I= H.H,H."
I,H..H?	9	Ic                   V ^8  d   QhR\         R\        P                  P                  R\        P                  P
                  R,          R\        R\        R,          R\        R,          R\         R,          R	\        R
\        RR/
# )rj   r   r  rT  Nr;   r   r)   rB   r   udp_moderm   )	r   r   r  r  r   r   ro   r   r  )rq   s   "r   rr   rr     s     I II33I ;;%I 	I
 T\I dlI $JI I I 
Ir   c	           
        Vf#   \         P                  P                  V4      w  r)M\         P                  P                  V4      p	\	        WWgR4      w  rpV
f   Q h\        V4      w  rVP                  ^ ,          P                  \         P                  P                  8X  df   V\        P                  8w  dQ   \        V
\        P                  V4      ;_uu_ 4       p\        WV4        \!        WW)WM4       F  pK  	   RRR4       R# \        V
\        P&                  V4      ;_uu_ 4       p\        WV4       \!        WW)WM4       F  pK  	  RRR4       R#   \         P                  P"                   d    T\        P$                  8X  d   h  Mi ; i RRR4       K    + '       g   i     L; i  + '       g   i     R# ; i)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.
NT)r   r  r  extract_serial_from_queryr   r*   r  r  r  r  r  r  r2   r3   r`  r5   r  UseTCPr  r4   )r   r  rT  r;   r   r)   rB   r   r  r  rA   r   r>   r   r   s   &&&&&&&&&      r   inbound_xfrr    sk   ^ }'',,[92259 7V$!Rf >>$X.OQ~~a3==#5#55(gmm:SV..771QZ0%E7A   87 
R++V	4	4,keWQA R 
5	4	 77>> w||+ ,+ 8777 
5	4	4s6   F)E+!F/5FFFFF,	/G 	c                    V ^8  d   Qh/ ^ \         9   dO   \        \        P                  \        ,          \        P
                  \        .\        P                  3,          ;R&   # )rj   r   )__conditional_annotations__r   r3   rn   ro   rp   )rq   s   "r   rr   rr      sI      F C!2!2C8&--G G r   )Tr   rM   )	Nr   Nr   FFTTN)
NNFFNr   FFFN)
N5   Nr   FFFFNF)
Nr  Nr   FFFNNF)NFNr   F)Nr  Nr   FFN)TTN)
NU  Nr   FFNNNT)
Nr  Nr   FFNTNN)sr  rx   r  r  enumr  r  r   r   r3   r  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.syncr8   r  NetworkBackend_CoreNetworkBackend	_backendssync
SyncStreamr6   r   HTTPTransportrX   r   rt   r   r   DNSExceptionrv   r  rz   r|   r   r  TransferErrorr*   r   r   r   r   r   r   r2   r   r   r   IntEnumr   rb   r   r  r$  r+  r   rD  rI  rP  r\  rc  ri  rq  ru  r|  r  r5   rh  r  r  r  r  r   r  r  r  AXFRr  r  rU  default_algorithmr  r  rr   )r  s   @r   <module>r9     s  $      	       = =             
2 mm  '""11((--88O4&- 4&l,, ,& &  *   
Hs}}11 HG#--)) GCMM&& 
CMM&&  %%$(800	) )%XB'V
-$,, & !"!$(*.26"" + 3 3!L^O":z	11:g4TYxU p*1 $<,^-CL.DJiX^B
dll 
1:n -0MM,>,>/2~~/@/@ 8<*.!(+(B(BsGr )- !I IA4  s   :L L)(L)