f3ddlmZmZmZmZmZddlZddlZddl Zddl Zddl Zddl Zddl ZddlZddlZddlZGddej"j$ZGddej"j(ZGddej"j$ZGd d Zddddddddej0j2f d ej4j6d eed eeeefdeedeedeedeeej<j>dedeej@jBdeej@jBe"fdeejFjHeeffdZ%dejFjLdeefdZ'y))AnyListOptionalTupleUnionNc"eZdZdZfdZxZS) TransferErrorz.A zone transfer response got a non-zero rcode.cvdtjj|z}t||||_y)NzZone transfer error: %s)dnsrcodeto_textsuper__init__)selfr message __class__s P/var/lib/jenkins/workspace/mettalog/venv/lib/python3.12/site-packages/dns/xfr.pyrzTransferError.__init__#s0+cii.?.?.FF ! )__name__ __module__ __qualname____doc__r __classcell__)rs@rr r s8rr ceZdZdZy)SerialWentBackwardsz:The current serial number is less than the serial we know.Nrrrrrrrr)sDrrceZdZdZy)UseTCPz'This IXFR cannot be completed with UDP.Nrrrrrr-s1rrc eZdZdZej j ddfdejjdej jde e de fdZ d ejjd e fd Zd Zd Zy)Inboundz+ State machine for zone transfers. NF txn_managerrdtypeserialis_udpc"||_d|_||_|tjj k(r |t d|r t d||_||_|j\}}|_ d|_ d|_ d|_ d|_y)aqInitialize an inbound zone transfer. *txn_manager* is a :py:class:`dns.transaction.TransactionManager`. *rdtype* can be `dns.rdatatype.AXFR` or `dns.rdatatype.IXFR` *serial* is the base serial number for IXFRs, and is required in that case. *is_udp*, a ``bool`` indidicates if UDP is being used for this XFR. Nz,a starting serial must be supplied for IXFRszis_udp specified for AXFRF)r"txnr#r rdatatypeIXFR ValueErrorr$r%origin_informationorigin soa_rdatasetdone expecting_SOA delete_mode)rr"r#r$r%_s rrzInbound.__init__6s&':> S]]'' '~ !OPP 89 9  )<<>At{=A " rrreturnc6 |jG|jtjjk(}|j j ||_|j}|tjjk7r t|t|jdkDr|jdj|jk7rtjjd|jdj|jk7rtjjdd}|j |j"r&|j"dj|jk7rtjjd|j"d}|}|jtjj$k7rtjjdd}|j'|_|jtjj(k(r|j dj*|j*k(rd|_n}tj*j/|j dj*|j*krt0|j2r!t|j"|ddk(rt4d|_|j"|dD]w}|j}|}|j,rtjjd |jJ|jtjj$k(rL||jk(r<|jtjj(k(r|j8 |_||j k(r,|jtjjk(s3|jtjj(k(r|j8r|j6rtjjd |jtjj(k(r;|j*|dj*k7rtjjd |jj;|||jj=d|_d|_nd |_|jtjj(k(rx|j8r;|dj*|j*k7rotjjd |dj*|_|jj;||ntjjd|j6rgtjj|_d |_d |_|jj?|j j d|_|j8r|jjA||\|jjC||z|j2r+|j,stjjd|j,S)aZProcess one message in the transfer. The message should have the same relativization as was specified when the `dns.xfr.Inbound` was created. The message should also have been created with `one_rr_per_rrset=True` because order matters. Returns `True` if the transfer is complete, and `False` otherwise. Nrzwrong question namezwrong question rdatatypez&No answer or RRset not for zone originzfirst RRset is not an SOATzanswers after final SOAzempty IXFR sequencezunexpected end of IXFR sequenceFzIXFR base serial mismatchzunexpected origin SOA in AXFRzunexpected end of UDP IXFR)"r'r#r r(AXFRr"writerr NOERRORr lenquestionnamer, exception FormErrorr-answerSOAcopyr)r$r.Serialrr%rr/r0replacecommitrollback delete_exactadd)rr replacementr answer_indexrrsetrdatasetr:s rprocess_messagezInbound.process_messageYs 88 ++););;K''..{;DH  CII%% %& & w 1 $"''4;;6mm--.CDD"))T[[8mm--.HII    $ >>W^^A%6%;%;t{{%Jmm--.VWWNN1%EH#--"3"33mm--.IJJL ( D {{cmm000$$Q'..$++=!%DIZZ&&t'8'8';'B'BCdkkQ--{{s7>>,-+H'IQ'N % *.D& ^^LM2E::DHyymm--.GHH88' ''#--"3"33 8K;;#--"4"44+/+;+;';D$t000KK3==#5#55 s}}'9'99d>N>N ))!mm556KLL s}}'9'99 KK8A;+=+==!mm556WXXHH$$T84HHOO%#DH $DI */D&{{cmm&8&88++'{11T[[@&)mm&=&=$?'"!" +31+*<*lzserial out-of-rangeFz. . z 0 0 0 0T)create) algorithm)r+r*r r(r5 isinstancerUreadergetr$r) get_classr make_queryrdata from_text find_rrset authorityr>rEuse_tsig)r"r$rXrYrZr[r\r]r^r_ zone_originr1r,r#r'rIrdclassqrhrHs rrgrgs> +==?[!V)** ~##  $344 1    ! ,Swwvu-H!!++++++ , , !+##.//##%G   A ##GUd6((4KL KKgs}}/@/@   % 7G| < v;A , ,s /AGGqueryct|tjjs t d|j d}|j tjjk(ry|j tjjk7r t d|j|j|j|jtjj}|djS)a7Extract the SOA serial number from query if it is an IXFR and return it, otherwise return None. *query* is a dns.message.QueryMessage that is an IXFR or AXFR request. Raises if the query is not an IXFR or AXFR, or if an IXFR doesn't have an appropriate SOA RRset in the authority section. zquery not a QueryMessagerNzquery is not an AXFR or IXFR)rcr r QueryMessager*r9r#r(r5r)rjrkr:rnr>r$)rpr9soas rextract_serial_from_queryrtDs eS[[55 6344~~a H#--,,, CMM.. .788    (8(8#--:K:K C q6==r)(typingrrrrr dns.exceptionr dns.messagedns.name dns.rcode dns.rdataset dns.rdatatype dns.serialdns.transactiondns.tsigdns.zoner; DNSExceptionr r<rrr!tsigdefault_algorithmrRrSrUrVednsOptionr:NamestrrrrrgrWrtrrrrs$54CMM..E#--11E2S]] ' '2FFV+/#!%)/3'+.1hh.H.HG33G SMGuS$Y'(G} G c] G c] Gd388??+ ,GGchhmm $G s*+G 3;; # #Xc] 23GTS[[%8%8Xc]r