f0!dZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl m Z m Z mZmZmZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZdZdZ ejBjEdZ#e#rUddl$Z%ddl&Z&e%jNZ(e%jRjTjVZ,Gdde(Z-Gd d e&j\Z/n Gd d Z/e#Z0 ddl1Z1ejZ3GddejhjjZ6GddejhjnZ8GddejhjjZ9GddejhjjZ:ejvjxZdZ?e@edr ejaBn ejaBdZDdZEdZFdZG dedZHdfd ZIdd!ddd"d"dd#ddddejf d$ejjd%eMd&eeNd'eOd(eeMd)eOd*ePd+ePd,ee d-eMd.ePd/eeMd0eePeMfd1ed2d3eeOd4ejjf d5ZQd6ZRd7ZS dgd8e d9eejjeTfd:e d;eeNd4eeOeNff d<ZU dhd8e d:ee d;eeNd=ePd*ePd>ee ejjejjfd?eeTd+ePd@ePdAePdBeejjd4e fdCZZ did$ejjd%eMd&eeNd'eOd(eeMd)eOd=ePd*ePd+ePd@ePd8ee dAePd4ejjfdEZ[ djd$ejjd%eMd&eeNd'eOd(eeMd)eOd=ePd*ePd+ePdFee dGee dAePd4eejjePffdHZ\dIZ]dJZ^ dgd8e d9eejjeTfd;eeNd4eeOeNffdKZ_ dkd8e d;eeNd*ePd>ee ejjejjfd?eeTd+ePd4eejjeNffdLZ`dMZa dld$ejjd%eMd&eeNd'eOd(eeMd)eOd*ePd+ePd8ee d4ejjfdNZbdOZcdPeeMd0eePeMfd4e1jfdQZe dmd$ejjd%eMd&eeNd'eOd(eeMd)eOd*ePd+ePd8ee1jdRee1jdPeeMd0eePeMfd4ejjfdSZg dnd$ejjd%eMd&eeNd'eOd(eeMd)eOd*ePd+ePdTeejjd0eePeMfdPeeMd4ejjfdUZhejjejjddDdddddddd"ejjf d%eMdVeejjeMfdWeejjeMfdXeejjeMfd&eeNd'eOd>ee ejjejjfdYeeejjeMfdZePd[eeNd(eeMd)eOd\eOd]ePd^eejjeMfd4e f d_Z;Gd`daejZrddDdddderjfd%eMdbejjdBeejjd'eOd&eeNd[eeNd(eeMd)eOdcerd4dfddZvy#e2$rGd d Z1YkwxYw)ozTalk to a DNS server.N)AnyDictOptionalTupleUnioncx|y|tjz }|dkrtjj|S)N)timedns exceptionTimeout) expirationtimeouts R/var/lib/jenkins/workspace/mettalog/venv/lib/python3.12/site-packages/dns/query.py _remainingr/s7499;&G#~mm### NcJ|yttj|z|SN)minr )rrs r_expiration_for_this_attemptr8s# tyy{W$j 11rdohc2eZdZfdZ ddZ ddZxZS)_NetworkBackendcZt|||_||_||_||_yr)super__init__ _local_port _resolver_bootstrap_address_family)selfresolver local_portbootstrap_addressfamily __class__s rrz_NetworkBackend.__init__Gs, G  )D %DN&7D #!DLrclg}t|\}}tjj|r|j |n|j |j |j nft |}|j} |rtjj|} |jj|| |} | j}|D]} tjj| } ||jdk7r-tjj||jf| } nd} t| tj | }t#d|} t%|tjj| |f| |t'|cSt*j,#t($rYwxYw)N)r%lifetimerg@)_compute_timesr inet is_addressappendrrr af_for_addressr resolve_name addressesrlow_level_address_tuple _make_socketsocket SOCK_STREAMr_connect_CoreSyncStream Exceptionhttpcore ConnectError)r!hostportr local_addresssocket_optionsr/_rr%answersaddressafsourcesockattempt_expirations r connect_tcpz_NetworkBackend.connect_tcpNsI*73MAzxx""4(  &((4  !8!89$Z0  XX44]CF..55'6$--/ $XX,,W5 ,0@0@A0E XX==&(8(892F"F#B(:(:FC%A#z%R"88'4"M* +400!%&'' '!s7F'' F32F3ctrNotImplementedError)r!pathrr<s rconnect_unix_socketz#_NetworkBackend.connect_unix_socketus & %rr)__name__ __module__ __qualname__rrDrI __classcell__r&s@rrrFs "FJ% (P15 &rrc>eZdZdddejdfd ZxZS)_HTTPTransportrN)r#r$r"r%c|ddl}|jj}t||i|t |||||j _yNr) dns.resolverr"Resolverrrr_pool_network_backend) r!r#r$r"r%argskwargsr r&s rrz_HTTPTransport.__init__{sM#<<002 G d -f -*9*&7+DJJ 'r)rJrKrLr2 AF_UNSPECrrMrNs@rrPrPzs!"##   rrPceZdZdZy)rPctrrF)r!r9r:rr;s rrDz_HTTPTransport.connect_tcps% %rN)rJrKrLrDrrrPrPs &rcteZdZdZGddeZGddeZGddZGdd Ze d Z y ) sslrc eZdZy)ssl.WantReadExceptionNrJrKrLr\rrWantReadExceptionr` rrbc eZdZy)ssl.WantWriteExceptionNrar\rrWantWriteExceptionrercrrfc eZdZy)ssl.SSLContextNrar\rr SSLContextrhrcrric eZdZy) ssl.SSLSocketNrar\rr SSLSocketrkrcrrlctd)Nzno ssl support)r6)clsrWrXs rcreate_default_contextzssl.create_default_contexts,- -rN) rJrKrL CERT_NONEr6rbrfrirl classmethodror\rrr^r^sG            .  .rr^ceZdZdZy)UnexpectedSourcez=A DNS query response came from an unexpected address or port.NrJrKrL__doc__r\rrrsrssGrrsceZdZdZy) BadResponsez--'' ' ::g mm### rc|ayr)r)selector_classs r_set_selector_classrs %Or PollSelectorc"t|ddd|y)NTFrsrs r_wait_for_readablers audJ/rc"t|ddd|y)NFTrrs r_wait_for_writablers adJ/rc tjj||d}tjj||d}||k(xr |dd|ddk(S#tjj$rYywxYw)NrF)r r* inet_ptonr SyntaxError)r@a1a2n1n2s r_addresses_equalr s{ XX  BqE * XX  BqE * 8 (12"QR&(( == $ $sAAA:9A:c|syt|||s-tjj|dr |dd|ddk(ry|ryt d|d|)NTrrFzgot a response from z instead of )rr r* is_multicastrs)r@ from_address destinationignore_unexpecteds r_matches_destinationrsh L+6 k!n-,qr2BkRSRTo2U   |nL[MJ rTcd}d} tjj|}|}|r3tjj|}|r||k7r t d|}|r"|s tjj |}|r"tjj ||f|}|r"tjj ||f|}|||fS#t$r|rYwxYw#t$r t dwxYw)Nz5different address families for source and destinationz3source_port specified but address family is unknown)r r*r-r6 ValueError any_for_afr0)wherer:rA source_portwhere_must_be_addressr@rsafs r_destination_and_sourcer&s  BK XX $ $U + hh%%f- by K B6 TXX((,F hh66 T7JBO  116;2GL  V $$?   !, TRS S Ts!C !C CCC4ct||} |jd||j||r|j|d|S|S#t$r|j wxYw)NF)do_handshake_on_connectserver_hostname)socket_factory setblockingbind wrap_socketr6close)r@typerA ssl_contextrrs rr1r1Rsvr4 A e   FF6N **(- /+  H    s9A A A%iFz /dns-queryqrrr:rArone_rr_per_rrsetignore_trailingsessionrHpostr$verifyr"zdns.resolver.Resolverr%returnc tst|r%t|tjs t d|j }t||||d\}}}d}ddi}|mtjj|rN|tjk(rdj||| }n)|tjk(rdj||| }n|}|d}d}n |d}|d }t|d d | || | | }|rt!j"|}ntjd d | | }|5}| r<|j%dt't)|d |j+|||}nKt-j.|j1d}|j3}|j5||d|i}dddj6dks|j6dkDr0t dj||j6|j8tj:j=|j8|j>|j@||}|jBjE|_#|jI|stJ|S#1swYxYw)aReturn 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://:/. *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. Returns a ``dns.message.Message``. z)session parameter must be an httpx.ClientFNacceptzapplication/dns-messagezhttps://{}:{}{}zhttps://[{}]:{}{}rrT)r;http1http2rr#r$r"r%)rrr transport)z content-typezcontent-length)headerscontentr=r )rrparamsi+z2{} responded with status code {} Response body: {}keyring request_macrr)&have_dohryrhttpxClientrto_wirerr r*r+r2AF_INETformatAF_INET6rP contextlib nullcontextupdatestrlenrbase64urlsafe_b64encoderstripdecodeget status_codermessage from_wirerrelapsed total_secondsr is_responserw)rrrr:rArrrrrHrr$rr"r%wirer@r= the_sourcerrurlr;r#cmresponsetwirers rhttpsrfszH  z'5<<8DEE 99;D1 tV[%RJI23G ~#((--e4  #**5$=C 6?? "%,,UD$?C  "1 ] #+ I0:0F0Fw0O \\D9 U w  NN$=&)#d)n  ||C$PW|XH++D188>DKKME{{Wguen#H(c!X%9%9C%? ""(&0D0DhFVFV"W    MM)'  A   + + -AF ==  HGs %B I??Jc` |j|S#t$rt||YnwxYw.)zReads a datagram from the socket. A Timeout exception will be raised if the operation is not completed by the expiration time. )recvfromBlockingIOErrorr)rBmax_sizers r _udp_recvrs9  1==* * 1 tZ 0 1 s ,,c |r|j||S|j|S#t$rt||YnwxYwB)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. )sendtosendrr)rBdatarrs r _udp_sendrsL  1{{455yy& 1 tZ 0 1 s((AArBwhatrrct|tjjr|j }t j }t ||||}||fS)aSend 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. )rr rMessagerr r)rBrrr sent_timens rsend_udprsH,$ ++,||~ I$k:6A y>rrrrraise_on_truncation ignore_errorsqueryc d} t|d|\} } t|j| ||s*tj} tj j | |||||}| r| | j|sz|r|| fS|| | fS#tj j$r.}| r&| $| j|j sYd}~ʂd}~wt$r| rYۂwxYw)aRead 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)rrrrrN) rrr%r r rr Truncatedrr6)rBrrrrrrrrrrrr received_timeres r receive_udpr2s| D (ujA|# KK{4E     %%'!1 /$7 &A6 U.u7H7H7K  }% %}l3 31{{$$ %))!))+6   s$%BC %#C CC C 5c |j} t||||\} }}t|\}}| rtj| }nt | t j|}|5}t|| ||t||||||j|j|| | | \}}||z |_ | s|j|st|cdddS#1swYnxYw J)aReturn 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``. N)rrr)rrr1r2 SOCK_DGRAMrrrmacr rrw)rrrr:rArrrrrrBrrr@r begin_timerrrrrs rudpr sp 99;D 7 tV[!Rf .g6Z 0:0F0Ft0L "f// 8 qD+z2(     II EE      M+q!1 ),  s &ACCudp_socktcp_sockc  t|||||||||d| | } | dfS#tjj$rt ||||||||| } | dfcYSwxYw)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)r r rrtcp) rrrr:rArrrrr r rrs rudp_with_fallbackrsr              %  ;;            $  s4AAcd}|dkDr6 |j|}|dk(rt|t|z}||z }|dkDr6|S#ttj f$rt ||Y/tj$rt||YOwxYw)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. rr) recvEOFErrorrrr^SSLWantReadErrorrSSLWantWriteErrorr)rBcountrrrs r _net_readrOs A !) 1 % ACx SVOE FA !) H  !5!56 1 tZ 0$$ 1 tZ 0 1s/A%B'BBcd}t|}||kr ||j||dz }||kryy#ttjf$rt ||Y/tj $rt||YOwxYw)zWrite the specified data to the socket. A Timeout exception will be raised if the operation is not completed by the expiration time. rN)rrrr^rrrr)rBrrcurrentls r _net_writerds~ G D A A+ 1 tyygh0 0G A+ !6!67 1 tZ 0## 1 tZ 0 1s3%A;A;:A;ct|tjjr|j d}nt |j dd|z}tj}t|||t ||fS)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_lengthbig) rr rrrrto_bytesr r)rBrrtcpmsgrs rsend_tcpr"tsk$$ ++,T2 T##Au-4 ItVZ( K ##rct|d|}tjd|\}t|||}tj} tj j |||||} | | fS)aRead 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)rstructunpackr r rr) rBrrrrrldatarrrrs r receive_tcpr(ssB dAz *E ==u %DQ T1j )DIIKM  )'  A } rcP|j|}|dk(ry|tjtjtjfvr:t |||j tjtj}|dk7rt|tj|yrR) connect_exerrno EINPROGRESS EWOULDBLOCKEALREADYr getsockoptr2 SOL_SOCKETSO_ERROROSErrorosstrerror)rr?rerrs rr4r4s ,,w C ax u  %"3"3U^^DD1j)ll6,,foo> axc2;;s+,,rc |j} t|\} } |rtj|} n-t ||||\} }}t | t j|} | 5}|s t|| t|| | t|| ||j|j|\}}|| z |_ |j|st|cdddS#1swYnxYw J)aReturn 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``. N)rr)rrrr1r2r3r4r"r(rr r rrw)rrrr:rArrrrBrr rrr@rrrrs rrrsV 99;D-g6Z 0:0F0Ft0L$; 4% ![&"f00& 9 q Q Z 0D*%( z+QYY M+}}Q      s &A&CCc |jy#tj$rt||Yn$tj$rt ||YnwxYwXr) do_handshaker^rrrrrs r_tls_handshaker9sS  . NN  ## . q* -$$ . q* - . sAAArcd}d}t|trOtjj |r|}n-tjj |r|}n t dtj||}tjj|_ |d|_ |jdg|durtj|_|S)Nzinvalid verify string)cafilecapathFdot)rrr3rHisfileisdirrr^ro TLSVersionTLSv1_2minimum_versioncheck_hostnameset_alpn_protocolsrp verify_mode)rrr;r<rs r_make_dot_ssl_contextrFs!F F&# 77>>& !F WW]]6 "F45 5,,F6JK"%.."8"8K%* """E7+ "%--  rrc |rt||||||||| S|j} t|\} }t||||\}}}| |s t | | } t |t j|| | 5}t|||t||t|| |t||||j|j|\}}|| z |_|j|st |cdddS#1swYnxYw J)akReturn 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``. N)rr)rrr)rrFr1r2r3r4r9r"r(rr r rrw)rrrr:rArrrrBrrrrr rr@rrrrs rtlsrH1s,z            99;D-g6Z 7 tV[!Rf4+OVD  '   K,q*%D*%( z+QYY M+}}Q !$  s 4A0C..C7 connectionc tjjs tdd|_|j } |rt jd} |} n#tjj| | } | }| 5|sj||||} t|\}} j|5}|j| d|jt|} dddtj}dddtj j#| |j$|j&||}t)z d|_|j+|st,|S#1swYxYw#1swYzxYw)aReturn 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. *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. Returns a ``dns.message.Message``. zDNS-over-QUIC is not available.rN)rE server_nameTrr )r quic have_quicr|idrrrSyncQuicManagerconnectr) make_streamrreceiverr rrrrmaxrrw)rrrr:rArrrrIrrrmanagerthe_connection the_managerstartrstreamfinishrs rrLrLs_d 88  566 AD 99;D5?5K5KD5Q#((**O+  (00fkRN,W5  ' ' 0 :F KKd #>>*Z"89D :   MM)'  A% %AF ==  H : : s$<6E42-E(E4(E1 -E44E=zonerdtyperdclasskeyname relativizer(serialuse_udp keyalgorithmc # Kt|trtjj |}tj j j|}tjj|||}|tj jk(rAtjj |dddd| z}|jj|||j||||j}t!||| | \}}} | r(|tj jk7r t#d| rt$j&nt$j(}t+||| 5}t-| \}}t/|||t1|}| rt3||d|n&t5j6d||z}t9|||d }d }d }d}|r|}tjj:}nd}|}d} |sgt-|\}}!|!||!|kDr|}!| rt=|d |!\}}n2t?|d |!}"t5j@d|"\}t?|||!}|tj jk(}#tjjC||jD|jFd || d |# }$|$jI}%|%tjHjJk7r tM|%|$jN} d}&||$jPr|$jPdj|k7rtjRjUd|$jPd}|jVtj jXk7rtjRjUdd}&|j[}|tj jk(r4tj\j_|dj\| krd }nd }|$jP|&dD]}|rtjRjUd|jVtj jXk(r|j|k(r|r4|dj\| k7rtjRjUdd }n |tj jk(r| }||k(s|tj j`k(s!|tj jk(s|sd }|stj j`}d }|r7|jDr+|$jbstjRjUd|$|sgdddy#1swYyxYww)aReturn 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. rINSOAz. . %u 0 0 0 0N) algorithmzcannot do a UDP AXFRr$FTrrrrxfrorigintsig_ctxmultirz No answer or RRset not for qnamezfirst RRset is not an SOArzanswers after final SOAzIXFR base serial mismatch missing TSIG)2rrr name from_text rdatatype RdataTypemaker make_queryIXFRrrset authorityr,use_tsigrrrr2rr3r1r)r4rrr%packremptyrrr&rrr rcodeNOERROR TransferErrorrianswerr FormErrorr[rdcopyr_SerialAXFRhad_tsig)'rrZr[r\rr:rr]r^r(rArr_r`rarrsrr@r sock_typerr=rrr!done delete_mode expecting_SOA soa_rrsetrhonameri mexpirationr'is_ixfrrrx answer_indexs' rrgrgsJ$xx!!$' ]] $ $ ) )& 1F tVW5A ### ##D!T5:JV:ST 5! 7G| < 99;D 7 tV[!Rf6S]]////00%,!!&2D2DI b)V ,b(2JK, I  atZ 0[[q)D0F q&* -   FHHNNEFE-g6 Q "&;+C( %a < q!!Q 4}}T51 A{3 2 22G %% EE!!(& AGGIE )))#E**zzHL xx188A;#3#3u#<--112TUU <<3==#4#44--112MNN !JJL S]]///zz((1)<)<=G $(, ,-0--112KLL<<3==#4#44u9L$ 8??f4"%--"9"9:U"VV(- 3==#5#55*5o  )#--"4"44"cmm&8&88[#" !]]//F$)M718 !**mm--n==G])bbbs8E)U5+MU)<:U)7U):U)AU) U5)U2.U5ceZdZdZdZdZdZy)UDPModeaHow 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" rrrN)rJrKrLruNEVER TRY_FIRSTONLYr\rrrrs EI Drr txn_managerudp_modec |#tjj|\}} ntjj|} |jdj } | tj jk(} |j} |j} t||||\}}}t|\}}d}|rd}| r&|tjk7rtj}d}ntj }d}t#|||5}t%||||rt'|| d|n/t)j*dt-| | z}t/|||tjj1|| | |5}d}d}|st|\}}||||kDr|}|rt3|d|\}}n2t5|d|}t)j6d|\}t5|||}tj8j;||j<|j>d| || | } |jA|}|jF}|s|s7|j<r+jHstjJjMd dddddd|ryy#tjjB$r0|sJ|tjDk(rd}d}tj}YXwxYw#1swYgxYw#1swYkxYw) aConduct 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.UDPMode.NEVER``, i.e. only use TCP. Other possibilities are ``dns.UDPMode.TRY_FIRST``, which means "try UDP but fallback to TCP if needed", and ``dns.UDPMode.ONLY``, which means "try UDP and raise ``dns.xfr.UseTCP`` if it does not succeed. Raises on errors. NrTFr$rrrfrk)'r rgrqextract_serial_from_queryquestionr[rnrrfrom_wire_originrrr)rrr2rr3r1r4rr%rvrrInboundrrr&rrrr process_messageUseTCPrrirr r|)rrrr:rr(rArrr_r[rrhrr@rr=rretryris_udprr!inboundrrirrwirer'rrs r inbound_xfrrs^ }'',,[92259 ^^A  % %F ***G  ) ) +F ==?D 7 tV[!Rf%X.OQ E  x7==0))IF**IF "i 0, BA Q Z 0!T44T3t95<1fj1fffE% B'5g'>$Q "*".;3K&0 %.q%%E  )!Q <%}}T59 )!Q < -- % $)II %!)#)z)0. A !&66q9 !zzHABqzz--11.AAK% B, B T77>>!% v#w||3!# $#*== !7% B% B, B, BsQ A0K&9B!KJ ,K;9K4K& A KKKKK# K&&K/)T)NNr) NNFFNrFFFN) NrNrFFFFNF) NrNrFFFNNF)NFNrF)NrNrFFN) NUNrFFNNNT) NrNrFFNTN)wrurrenumr+r3os.pathrr2r%r typingrrrrr dns._featuresr dns.exceptiondns.inet dns.messagedns.namedns.quic dns.rcodedns.rdataclass dns.rdatatype dns.serialdns.transactiondns.tsigdns.xfrrr _featureshave _have_httpxhttpcore._backends.syncr7rNetworkBackend_CoreNetworkBackend _backendssync SyncStreamr5r HTTPTransportrPrr^ ImportErrorrr DNSExceptionrsr|rwryr|rgrzr)rrhasattrrrSelectSelectorrrrrrr1rYrrrfloatintboolrrrbytesrrlNametsigKeyrr rrrr"r(r4rr9rirFrlrHrLSyncQuicConnectionrnr rdataclassrcdefault_algorithmro RdataClassIntEnumrr transactionTransactionManagerrr\rrrs $   442 mm  ' ""11((--88O2&-2&h,,,&& .2Hs}}11HG#--))GCMM & & CMM & & %% $$8% 9n% ,,O..O00 ) "=A)%X. $ "!!'+#26",,Q  {{Q Q e_Q   Q SM Q  Q Q Q c]Q  Q  Q  }Q  $) Q ./Q  SMQ  [[!Q h 1 1&#'    ##U* +   3: >"&"&#";?#&! %+/g4 g4#g4g4 g4  g4 d388==#((,,67 8 g4%g4g4g4g4 CKK'' (g4 g4Z $ #"! %X {{X Xe_X  X SM X  XXXXX 3-XX [[X| $ #"!""U  {{U U e_U   U SM U  U U U U smU smU U  3;;   $%U p * 1&#'$ $  ##U* +$$ 3: $@#'";?#&! , ,,,d388==#((,,67 8 , % ,  , 3;;   %&,^- $ "!A {{A Ae_A  A SM A  AAA 3-A [[AH.c],1$),<^^2 $ "!$(,0%)#h {{h he_h  h SM h  hhh 3== !h#..)hc]h $) h [[h\ $ "!8<#%)T  {{T T e_T   T SM T  T T T 445T  $) T c]T  [[T t36--2D2D58^^5F5F#;?37 $ .1hh.H.Hw w  s" #w #--))3. /w3>>,,c1 2 w e_ w  wd388==#((,,67 8weCHHMM3./ 0wwuow SMww ww s*+w  !wt  dll  ,0# $  pB pB33pB CKK'' (pB  pB e_ pB uo pB SMpBpBpB pBC)....s2]]"!]"