+\hex# dZddlZddlZddlZddlZddlZddlZddlZddl m Z m Z m Z m Z mZmZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlmZddlmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)e(rddl*Z*ejVjXZ-dZ.dFdZ/ dFdej`jbd eejdjfe4fd e d e e5d e e6e5ff d Z7 dGdej`jbd e e d e e5de8de8de e ejrjtejvjxfde e4de8de8de8de ejdjfd e fdZ= dHdejdjfde>de e5de6de e>de6de8de8de8de8de ej`jbde ej`j~de8d ejdjffd Z@ dIdejdjfde>de e5de6de e>de6de8de8de8d!e ej`jbd"e ej`jde ej`j~de8d e ejdjfe8ffd#ZB dFdej`jd eejdjfe4fd e e5d e e6e5ffd$ZCd%ZD dJdej`jd e e5de8de e ejrjtejvjxfde e4de8d e ejdjfe5ffd&ZE dKdejdjfde>de e5de6de e>de6de8de8de ej`jde ej`j~d ejdjffd'ZF dLdejdjfde>de e5de6de e>de6de8de8de ej`jde ej`j~d)e e)jd*e e>d+ee8e>fd ejdjffd,ZHd-e d.d d.fd/ZIdd0dddddd1d(d(ddejejfdejdjfde>de e5de6de e>de6de8de8d2e d3d4e>d5e8d+ee8e>fd6e e>d-e d.d7e6d8ed ejdjff"d9ZL dMdejdjfde>d:e>de e5de6de e>de6de8de8d+ee8e>fde ej`j~d;e e>d5e8d ejdjffd<ZM dNdejdjfde>de e5de6de e>de6de8de8d=e ejjd+ee8e>fde ej`j~d;e e>d*e e>d ejdjffd>ZNd?ejjd@ej`jdejdjfdAe e6de e5d e5d e fdBZSdddddde"jdfde>d?ejjde ejdjfde6de e5dCe e5de e>de6dDe"de ej`j~d dfdEZUy)OzTalk to a DNS server.N)AnyDictOptionalTupleUnioncast) NullContext) BadResponse HTTPVersionNoDOHNoDOQUDPMode _check_status_compute_times_make_dot_ssl_context_matches_destination _remaininghave_dohsslc|s|rF|@|tjk(rd}||fS|tjk(rd}||fStd|||fSy)Nz0.0.0.0z::zunknown address family )socketAF_INETAF_INET6NotImplementedError)afaddressports Q/root/niggaflix-v3/playground/venv/lib/python3.12/site-packages/dns/asyncquery.py _source_tupler>sl$ ?V^^##  v&*,CB4*HIIcR|%|stj}t||z dSyNr)timemax) expirationnows r_timeoutr'Ns+))+C:#Q''r sockwhat destinationr%returncKt|tjjr|j }t j }|j ||t||d{}||fS7w)aSend a DNS message to the specified UDP socket. *sock*, a ``dns.asyncbackend.DatagramSocket``. *what*, a ``bytes`` or ``dns.message.Message``, the message to send. *destination*, a destination tuple appropriate for the address family of the socket, specifying where to send the query. *expiration*, a ``float`` or ``None``, the absolute time at which a timeout exception should be raised. If ``None``, no timeout will occur. The expiration value is meaningless for the asyncio backend, as asyncio's transport sendto() never blocks. Returns an ``(int, float)`` tuple of bytes sent and the sent time. N) isinstancednsmessageMessageto_wirer#sendtor')r(r)r*r% sent_timens rsend_udpr5Ws^.$ ++,||~ Ikk$ Xj)-LMMA y> NsA)A6+A4, A6Fignore_unexpectedone_rr_per_rrsetkeyring request_macignore_trailingraise_on_truncation ignore_errorsqueryc Kd} |jdt|d{\} } t|j| ||s@t j} t j j| |||||}| r| | j|s|| | fS7u#t j j$r.}| r&| $| j|j sYd}~܂d}~wt$r| rYwxYww)ajRead a DNS message from a UDP socket. *sock*, a ``dns.asyncbackend.DatagramSocket``. See :py:func:`dns.query.receive_udp()` for the documentation of the other parameters, and exceptions. Returns a ``(dns.message.Message, float, tuple)`` tuple of the received message, the received time, and the address where the message arrived from. r N)r8r9r7r:r;) recvfromr'rfamilyr#r.r/ from_wire Truncated is_response Exception)r(r*r%r6r7r8r9r:r;r<r=wire from_address received_timeres r receive_udprKus0 D %)]]5(::N%OO|# KK{4E     %%'!1 /$7 &A. U.u7H7H7K =,//A P{{$$ %))!))+6   sK"C7B4C7%B?C7C49#C"C7!C""C40C72C44C75qwheretimeoutrsource source_portbackendc K|j} t|\}}tjj |}t ||f|}| r t | }no| stjj} t|||}| jr||f}nd}| j|tjd||d{}|4d{}t|| ||d{t||||||j |j"|| | | d{\}}}||z |_| s|j'|st(|cdddd{S777s7D7 #1d{7swYyxYww)aFReturn the response obtained after sending a query via UDP. *sock*, a ``dns.asyncbackend.DatagramSocket``, or ``None``, the socket to use for the query. If ``None``, the default, a socket is created. Note that if a socket is provided, the *source*, *source_port*, and *backend* are ignored. *backend*, a ``dns.asyncbackend.Backend``, or ``None``. If ``None``, the default, then dnspython will use the default backend. See :py:func:`dns.query.udp()` for the documentation of the other parameters, exceptions, and return type of this method. Nr)r1rr.inetaf_for_address_lltupler asyncbackendget_default_backendrdatagram_connection_required make_socketr SOCK_DGRAMr5rKr8macr#rDr )rMrNrOrrPrQr6r7r:r;r(rRr<rF begin_timer%rr*cmstupledtuplesrIrH_s rudprcsw8 99;D-g6Z   'BE4="-K 5@5F&&:: ??? K ##@sB B B BcKd}|dkDrL|j|t|d{}|dk(r td|t|z }||z}|dkDrL|S7/w)z|Read the specified number of bytes from stream. Keep trying until we either get the desired amount, or we hit EOF. r rNEOF)recvr'EOFErrorrn)r(countr%rar4s r _read_exactlyrxQsh A !)))E8J#78 8 85/ !A E !) H 9s&AA,AAcKt|d|d{}tjd|\}t|||d{}tj} tj j |||||} | | fS7m7Bw)zRead a DNS message from a TCP socket. *sock*, a ``dns.asyncbackend.StreamSocket``. See :py:func:`dns.query.receive_tcp()` for the documentation of the other parameters, exceptions, and return type of this method. rlN!Hr8r9r7r:)rxstructunpackr#r.r/rB) r(r%r7r8r9r:ldatalrFrHrIs r receive_tcpr_s  a4 4E ==u %DQtQ 3 3DIIKM  )'  A }  5 3s"BB,BBABBc K|j} t|\} } |r$|jd{t|} n|tj j |}t|||}||f}| stjj} | j|tjd|||d{} | 4d{}t|| | d{t|| ||j|j |d{\}}|| z |_|j%|st&|cdddd{S7777n7D7#1d{7swYyxYww)aOReturn the response obtained after sending a query via TCP. *sock*, a ``dns.asyncbacket.StreamSocket``, or ``None``, the socket to use for the query. If ``None``, the default, a socket is created. Note that if a socket is provided *where*, *port*, *source*, *source_port*, and *backend* are ignored. *backend*, a ``dns.asyncbackend.Backend``, or ``None``. If ``None``, the default, then dnspython will use the default backend. See :py:func:`dns.query.tcp()` for the documentation of the other parameters, exceptions, and return type of this method. Nr)r1r getpeernamer r.rTrUrrWrXrZr SOCK_STREAMrrrr8r\r#rDr )rMrNrOrrPrQr7r:r(rRrFr]r%r^rr_r`rarIrHs rrgrg}s_4 99;D-g6Z    5@5FXX $ $U +r6;7&&::E ? E( E  E( EE +E E )E4 E(EE( E( E( EEE(E%E E%!E(T ssl_contextserver_hostnameverifyc ZKt|\} }|r t|}n| t| | } tjj |}t |||}||f}| stjj} | j|tjd|||| | d{}|4d{}t|}t|||||||||| d{}tj}|| z |_|cdddd{S7g7^797 #1d{7swYyxYww)aReturn the response obtained after sending a query via TLS. *sock*, an ``asyncbackend.StreamSocket``, 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 connected SSL stream socket, and *where*, *port*, *source*, *source_port*, *backend*, *ssl_context*, and *server_hostname* are ignored. *backend*, a ``dns.asyncbackend.Backend``, or ``None``. If ``None``, the default, then dnspython will use the default backend. See :py:func:`dns.query.tls()` for the documentation of the other parameters, exceptions, and return type of this method. Nr)rr rr.rTrUrrWrXrZrrr'rgr#)rMrNrOrrPrQr7r:r(rRrrrr]r%r^rr_r`rarhend_times rtlsrsE< .g6Z 5@5F  /HK XX $ $U +r6;7&&::jA}|d}d }n|}|}|r tC|}n7|jE|||| || | | }t5j6||| |}|4d{}| rT|jGd tItK|d|jM|jO||||d{}nctQjR|jUd}|jW} |jM|jY|d| i||d{}dddd{jZdks|jZdkDr't|d|jZd|j\tj^ja|j\|jb|jd||}!|jfji|!_5|jm|!stn|!S#t$rd}YDwxYw7777S77#1d{7swYxYww)aReturn the response obtained after sending a query via DNS-over-HTTPS. *client*, a ``httpx.AsyncClient``. If provided, the client to use for the query. Unlike the other dnspython async functions, a backend cannot be provided in this function because httpx always auto-detects the async backend. See :py:func:`dns.query.https()` for the documentation of the other parameters, exceptions, and return type of this method. Nzhttps://:z https://[z]:zno hostname in URL sni_hostname)rrz.session parameter must be an httpx.AsyncClientacceptzapplication/dns-messager) local_addresshttp1http2r local_portrrrA)rrr transport)z content-typezcontent-length)headerscontent extensions=r.)rparamsri+z responded with status code z Response body: r{)8r.rTrU ValueError is_addressrrrurllibparseurlparsehostnamerr H3DEFAULTrr resolve_namerandomchoicelist addresses_http3r r-httpx AsyncClientr1H1H2rWrXr get_transport_classupdatestrrnwait_forrbase64urlsafe_b64encoderstripdecodeget status_coderr/rBr8r9elapsed total_secondsr#rDr )"rMrNrOrrPrQr7r:rrrrrrrArrurlrparsedanswersrFrh1h2rRrrr^r the_clientrhtwirerIs" rhttpsr si< XX $ $U + ~#((--e4  UG1TF4&1C 6?? "eWBtfTF3CJ &&s+ ?? "12 2 88  v / & )/J~ & ;; ";;D{~~% +++H  $*84H??. ..$11&//6JJG & d73D3D3F.G H               j):):;IJJ 99;D23G +..+*=*=> >B +..+*=*=> >B224G ~     5@5H1G//1'!/    Rr&I VZ  NN$=&)#d)n  %--# )   H++D188>DKKME$--#!5>)  H-Dc!X%9%9C%?g1(2F2F1G 0 03 5    MM)'  A   + + -AF ==  HG  8K  h-sRQER>Q+?A RQ. DR Q1 RAQ;!Q4"A#Q;Q7Q; RQ9CR Q($R'Q((R.R1R4Q;7Q;9R;R R R  Rrrc Ktjjs tdtj j |} | j} | j | j}d|_ |j}tjj| \}}|4d{}||| | d4d{}|j||||}t|\}}|j|d{}|4d{|j||| |j!t#|d{}t%|j'||dddd{t)j(}dddd{tj*j-||j.|j0||}dddd{t3z d_|j5|st6|S7Y7G7777#1d{7swYxYw7#1d{7swYxYw7m#1d{7swY}xYww)Nz DNS-over-HTTP3 is not available.rT) verify_mode server_nameh3r{)r.quic have_quicr rrrrridr1factories_for_backendconnectr make_streamsend_h3receiverrrr#r/rBr8r9r$rDr )rMrNrrOrrPrQr7r:rrRrr url_partsrFcfactorymfactorycontext the_managerthe_connectionstartr%streamfinishrIs rrrs 88  677 %%c*I!!H~~!~~ AD 99;D8899'BXxz  W X$ ! ! (00fkRN"0"9 UJ)55g>>F = =sD$/#^^Jz,BCCfnn.t<  = = YY[F ! ! KK ! ! II -+ "   (% %AF ==  H/  ! ? =D = = = = ! ! ! !    sB-I/H0I3IH I7H/?H H/ H H/1H?H H H/*H+H/ IH->F D Dkk$---#^^Jz,BCC D DYY[F ! ! KK ! ! II -+ "   *% %AF ==  H1  !? D-C D D D D ! ! ! !    sB)I+G1,I/H/?G4H/9H<G7= HG9 H H!G; "!HG= H HG?H, H/7H8}|s|j8r+j@stjBjEd dddy77X777#1swYyxYww) z'Given a socket, does the zone transfer.rNrzFr?rlT)r8r9xfrorigintsig_ctxmultir7z missing TSIG)#questionrdtyper. rdatatypeIXFRfrom_wire_originr1typerr[rrWDatagramSocketr2r' StreamSocketr|packrnrprInboundrr@rxr}r/rBr8r\process_messagerhad_tsig exception FormError)rrar=rrOr%ris_ixfrrrFis_udprdrerqinbounddonerrb mexpirationrwirer~rrIs r _inbound_xfrr(s9^^A  % %F ***G  ) ) +F ==?D VVv(( (F ((77;oodD(:*>???((55q9T3t9-4vz222 fff =:-g6 Q "&;+C( ";/#+#4#4UG#DD +HaEE}}T51+HaEE %% !II!!z!(& A**1-DGzzH34 ==--)).9 9=:: @ 3EEE::s{B9J ;I1> w||+,        Ws&DIF! I'F#(I+H-F;=F'F%F'F;0I7H8 IHIH2HHHH2!I#I%F''F;) I4F75I;1G/,H.G//H2 I=H>IH H HIIHH2 I+H.,I2I8H; 9II)N) NNFFNr FFFN) NrLNrFFFFNNF) NrLNrFFFNNNF)NFNr F)NrLNrFFNN) NUNrFFNNNNT) Nr NrFFTNNT) Nr NrFFNTNNN)V__doc__r contextlibrrr|r# urllib.parsertypingrrrrrrdns.asyncbackendr. dns.exceptiondns.inet dns.messagedns.namedns.quic dns.rcodedns.rdataclass dns.rdatatypedns.transactiondns._asyncbackendr dns.queryr r r r rrrrrrrrrrTlow_level_address_tuplerVrr'rWrr/r0bytesfloatintr5boolnameNametsigKeyrKrBackendrcrrirrrxrrg SSLContextrr AF_UNSPECrrrrAsyncQuicConnection transactionTransactionManagerSocketrrrr rr+s $  ::)      88 + +  #'    ) )  ##U* +   3: @"&"&#";?#&! %+/:0   ) ):0#:0:0 :0  :0 d388==#((,,67 8 :0%:0:0:0:0 CKK'' (:0 :0@ $ #"! %6:26? {{? ?e_?  ? SM ?  ????? 3##22 3?c&&.. /?? [[?J $ #"!:>8<26A  {{A A e_A   A SM A  A A A A s''667A s''445A c&&.. /A A  3;;   $%A N#'$   ' '$  ##U* +$$ 3: $2  #'";?#&!    ' 'd388==#((,,67 8  %    3;;   %&B $ "!48265 {{5 5e_5  5 SM 5  555 3##00 15c&&.. /5 [[5v $ "!4826,0%)#C {{C Ce_C  C SM C  CCC 3##00 1Cc&&.. /C#..)Cc]C $) C [[CL 34 ! " $ "!,0#'+7;"" + 3 3!c  {{c c e_c   c SM c  c c c  ( )c  c  c  $) c  }c 34c  c !c " [[#c T $ "!#26"2  {{2 2  2 e_ 2  2 SM 2 2 2 2  $) 2 c&&.. /2 sm2  2  [[2 p $ "!9=#26"%)A  {{A A e_A   A SM A  A A A 556A  $) A c&&.. /A smA c]A  [[A H3:333: 3: ;;  3: SM 3: e_ 3:  3: 3:r,0# $  263 3333 CKK'' (3  3 e_ 3 uo 3 SM333c&&.. /3 3r