f/@dZddlmZmZmZmZddlZddlZddl Zddl Zddl Zddl Zddl ZddlZGddejj ZGddej$j&ZeZej,Zej.Zej0Zej2Zy)zDNS Dynamic Update Support)AnyListOptionalUnionNc0eZdZdZdZdZdZdZedZ y) UpdateSectionzUpdate sectionsrcy)Nr )clss S/var/lib/jenkins/workspace/mettalog/venv/lib/python3.12/site-packages/dns/update.py_maximumzUpdateSection._maximum(sN) __name__ __module__ __qualname____doc__ZONEPREREQUPDATE ADDITIONAL classmethodrr rrrr s+ D F FJrrcReZdZeZdej jddejjdfde e ejjefdej jde ede ejjde ejjefde ef fd Zed eej*j,fd Zej0d Zed eej*j,fd Zej0d Zed eej*j,fdZej0dZddZdZde ejjefded dfdZde ejjefded dfdZde ejjefded dfdZde ejjefded dfdZ dde ejjefde e ejBjDefd dfdZ#dZ$dZ%xZ&S) UpdateMessageNzonerdclasskeyringkeyname keyalgorithmidcRt|||xjtjj tjj zc_t|trtjj|}||_ tjjj|}||_|jrC|j!|j"|j|tj$j&dd||j)|||yy)axInitialize a new DNS Update object. See the documentation of the Message class for a complete description of the keyring dictionary. *zone*, a ``dns.name.Name``, ``str``, or ``None``, the zone which is being updated. ``None`` should only be used by dnspython's message constructors, as a zone is required for the convenience methods like ``add()``, ``replace()``, etc. *rdclass*, an ``int`` or ``str``, the class of the zone. The *keyring*, *keyname*, and *keyalgorithm* parameters are passed to ``use_tsig()``; see its documentation for details. )r"T)create force_uniqueN) algorithm)super__init__flagsdnsopcodeto_flagsr isinstancestrname from_textorigin rdataclass RdataClassmake zone_rdclass find_rrsetr rdatatypeSOAuse_tsig)selfrrrr r!r" __class__s rr(zUpdateMessage.__init__1s0 B cjj))#***;*;<< dC 88%%d+D ..++009# ;; OO   !!!     MM'7lM C rreturnc |jdS)zThe zone section.rsectionsr:s rrzUpdateMessage.zone\}}Qrc"||jd<y)Nrr>r:vs rrzUpdateMessage.zonea arc |jdS)zThe prerequisite section.r r>r@s r prerequisitezUpdateMessage.prerequisiteerArc"||jd<y)Nr r>rCs rrGzUpdateMessage.prerequisitejrErc |jdS)zThe update section.r r>r@s rupdatezUpdateMessage.updatenrArc"||jd<y)Nr r>rCs rrJzUpdateMessage.updatesrErc | |j}|j}|j|||j|j||dd}|j ||y)z&Add a single RR to the update section.NT)rJcoversr6r5rdtypeadd)r:r/ttlrddeletingsectionrMrrsets r_add_rrzUpdateMessage._add_rrwsW ?kkG T4,,bii4QU   "crct|tr tjj |d}t|dtj j rL|D]F}|r|j||j|D]!}|j||j||#Hyt|}t|jd}t|dtjjr>|r|j||dj|D]}|j||||ytj j"j%|jd}|r|j|||D]M} tjj |j&|| |j(}|j||||Oy)aAdd records. *replace* is the replacement mode. If ``False``, RRs are added to an existing RRset; if ``True``, the RRset is replaced with the specified contents. The second argument is the section to add to. The third argument is always a name. The other arguments can be: - rdataset... - ttl, rdata... - ttl, rdtype, string... Nr)rS)r-r.r*r/r0rdatasetRdatasetdeleterNrUrPlistintpoprdataRdatar7 RdataTyper4r5r1) r:replacerSr/argsrdsrQrPrNss r_addzUpdateMessage._adds^ dC 88%%dD1D d1gs||44 5KKcjj1BLLswwGLD :Ddhhqk"C$q'399??3KKd1gnn5BLLsBL@0055dhhqkBKKf-A,,T->->4;;WBLLsBL@rr/racB|jd|j|g|y)zAdd records. The first argument is always a name. The other arguments can be: - rdataset... - ttl, rdata... - ttl, rdtype, string... FNrdrJr:r/ras rrOzUpdateMessage.adds  %d2T2rc .t|tr tjj |d}t |dk(r|j |j|tjjtjjtjjtjjddyt|dtjjr;|D]5}|D].}|j|d|tjj07yt|}t|dtj j"r4|D].}|j|d|tjj0ytjj$j'|j)d}t |dk(r]|j |j||j*|tjjtjjddy|D]d}tj j |j*|||j,}|j|d|tjjfy)zDelete records. The first argument is always a name. The other arguments can be: - *empty* - rdataset... - rdata... - rdtype, [string...] NrT)r-r.r*r/r0lenr6rJr2ANYr7NONErWrXrUrZr]r^r_r4r\r5r1)r:r/rarbrQlargsrNrcs rrYzUpdateMessage.deletes dC 88%%dD1D t9> OO "" !! """" Q!6!6 7BLLq"cnn.A.ABJE%(CIIOO4BLLq"cnn.A.AB 0055eiilCu:?OO )) **** # YY00 --" KK   T1b#..2E2EF#rcB|jd|j|g|y)abReplace records. The first argument is always a name. The other arguments can be: - rdataset... - ttl, rdata... - ttl, rdtype, string... Note that if you want to replace the entire node, you should do a delete of the name followed by one or more calls to add. TNrfrgs rr`zUpdateMessage.replaces  $ T1D1rc t|tr tjj |d}t |dk(rk|j |j|tjjtjjtjjdddyt|dtjjs5t|dtjjst |dkDrt|dtjjs=t!|}|j#dd|j$d|j|g|y|j$d|j|g|ytjj&j)|d}|j |j|tjj|tjjdddy)aSRequire that an owner name (and optionally an rdata type, or specific rdataset) exists as a prerequisite to the execution of the update. The first argument is always a name. The other arguments can be: - rdataset... - rdata... - rdtype, string... NrTr F)r-r.r*r/r0rir6rGr2rjr7rkrWrXr]r^rZinsertrdr_r4)r:r/rarlrNs rpresentzUpdateMessage.presentsw dC 88%%dD1D t9> OO!!"" !! ""  tAw 5 5 6$q'399??34y1}d1gs||'<'<=T  Q" %!2!2DA5A %!2!2D@4@]],,11$q':F OO!!"" "" rrNc 4t|tr tjj |d}|k|j |j |tjjtjjtjjdddytjjj|}|j |j |tjj|tjjdddy)zRequire that an owner name (and optionally an rdata type) does not exist as a prerequisite to the execution of the update.NT) r-r.r*r/r0r6rGr2rkr7rjr_r4)r:r/rNs rabsentzUpdateMessage.absent<s dC 88%%dD1D > OO!!## !! "" ]],,11&9F OO!!## "" rcy)NTr )r:values r_get_one_rr_per_rrsetz#UpdateMessage._get_one_rr_per_rrset^srcRd}d}|tjk(rbtjj |s)|tj j k7s |jrtjj|jstjj|tjjtjjfvrM|}|jdj}|tjjk(xs|tjk(}||||fS)NFr)rrr*r2 is_metaclassr7r8r exception FormErrorrjrkrr)r:rSr/rrNrRemptys r_parse_rr_headerzUpdateMessage._parse_rr_headerbs m(( (++G4S]]...99mm---99mm---3>>--s~~/B/BCC"))A,.. 2 22UgAUAU6U511r)NN)N)'rrrr _section_enumr*r2INtsigdefault_algorithmrrr/Namer.r3rr[r(propertyrrTRRsetrsetterrGrJrUrdrOrYr`rpr7r_rrrur{ __classcell__)r;s@rrr-s!M59-0^^->->!%+/25((2L2L )DuSXX]]C/01)D**)D# )D #((--( )D CHHMM3./ )D SM)DV d399??+   [[ d399??3   SYY__-   ]] &AP 3chhmmS01 3# 3$ 3:G5!34:GS:GT:Gx2E#((--"452c2d2$3E#((--"453c3d3pAE CHHMM3&' s}}66;<=   D2rr)rtypingrrrr dns.messager*dns.name dns.opcode dns.rdatadns.rdataclass dns.rdataset dns.rdatatypedns.tsigenumIntEnumrmessageMessagerUpdaterrrrr rrrs$!-- CHH$$ H2CKK''H2X         % % r