f JdZddlZddlZddlZddlZddlmZmZm Z m Z m Z m Z m Z ddlZddlZddlZddlZddlZej(j+drddlZdZndZe defZGdd ej4j6Zej:Zej>Z ejBZ"ejFZ$ejJZ&Gd d ejNjPZ)Gd d ejNjPZ*GddejNjVZ,GddejNjVZ-GddejNj\Z/GddejNjVZ0GddejNjPZ1GddejNj\Z2GddejNj\Z3GddejNj\Z4GddejNj\Z5Gd d!ejNj\Z6d"Z7d#Z8d$e e9e:fd%e:fd&Z;Gd'd(Z<Gd)d*e<Z=Gd+d,e<Z>e=dZ?e=dZ@e?ZAe>ddddZBe>ddddZCe>ddddZDe>ddddZEeBZFd-e e9d.fd%dfd/ZGd$e e9e:fd%e9fd0ZHejjGd1dZJeJd2gZKeJgZLeKdfd3e:d4e eJd5e e<d%eJfd6ZMd3e:d%eNfd7ZOeKdfd3e e9e:fd4e eJd5e e<d%eJfd8ZPd9d:d%eJfd;ZQdZRd?ZSeTeSZUeJeSgZVd@ZWeTeWZXeTdAZYeTdBZZdCZ[dDZ\dEZ]dFeJd4eJdGeNd%eJfdHZ^dFeJd4eJdGeNd%eJfdIZ_dJeeJeJeNgeJfdFeJd4eJdGeNd%eJf dKZ`y)Lz DNS Names. N)AnyCallableDictIterableOptionalTupleUnionidnaTFNamecDeZdZdZdZdZdZdZdZe dZ e dZ y ) NameRelationz(Name relation result from fullcompare().rc|jSN)COMMONANCESTORclss Q/var/lib/jenkins/workspace/mettalog/venv/lib/python3.12/site-packages/dns/name.py_maximumzNameRelation._maximum<s!!!c|jSr)__name__rs r _short_namezNameRelation._short_name@s ||rN) r __module__ __qualname____doc__NONE SUPERDOMAIN SUBDOMAINEQUALr classmethodrrrrr r +sF2 DKI EN""rr ceZdZdZy) EmptyLabelzA DNS label is empty.Nrrrrr%rrr'r'Msrr'ceZdZdZy) BadEscapez8An escaped code in a text format of DNS name is invalid.Nr(r%rrr*r*QsBrr*ceZdZdZy) BadPointerz=A DNS compression pointer points forward instead of backward.Nr(r%rrr,r,UsGrr,ceZdZdZy) BadLabelTypez2The label type in DNS name wire format is unknown.Nr(r%rrr.r.Ys 255 octets long.Nr(r%rrr2r2b*rr2ceZdZdZy) LabelTooLongz A DNS label is > 63 octets long.Nr(r%rrr5r5fr3rr5ceZdZdZy)AbsoluteConcatenationz]An attempt was made to append anything other than the empty name to an absolute DNS name.Nr(r%rrr7r7js+rr7ceZdZdZy)NoParentzMAn attempt was made to get the parent of the root name or the empty name.Nr(r%rrr9r9osrr9ceZdZdZy) NoIDNA2008zLIDNA 2008 processing was requested but the idna module is not available.Nr(r%rrr;r;tsrr;c,eZdZdZdhZdZfdZxZS) IDNAExceptionz$IDNA processing raised an exception.idna_exceptionz+IDNA processing exception: {idna_exception}c$t||i|yr)super__init__)selfargskwargs __class__s rrAzIDNAException.__init__s $)&)r)rrrr supp_kwargsfmtrA __classcell__rEs@rr=r=ys.#$K 7C**rr=ceZdZdZy)NeedSubdomainOfOriginzNAn absolute name was provided that is not a subdomain of the specified origin.Nr(r%rrrKrKsXrrKs"().;\@$z"().;\@$labelreturnct|trFd}|D]=}|tvr|dt|zz }|dkDr|dkr|t|z }6|d|zz }?|Sd}|D]/}|tvr |d|zz }|dkr|dt |zz }+||z }1|S)zaEscape the characters in label which need it. @returns: the escaped string @rtype: string\ z\%03d ) isinstancebytes_escapedchr _escaped_textord)rLtextcucs r _escapifyr]s%AH}s1v %Ta$hA1 $   D   D2I D 6\ Hs2w& &D BJD  KrcFeZdZdZdZdedefdZdedefdZ dedefdZ y) IDNACodecz.Abstract base class for IDNA encoder/decoders.cyrr%rBs rrAzIDNACodec.__init__s rrLrMc@|jjdS)Nsxn--)lower startswithrBrLs ris_idnazIDNACodec.is_idnas{{}''00rctr)NotImplementedErrorres rencodezIDNACodec.encodes!!rc|j|r |ddjd}t|St|S#t$r}t |d}~wwxYw)Nrpunycoder>)rfdecoder] Exceptionr=)rBrLslabeles rrmzIDNACodec.decodes^ <<  6qr))*5 ((U# # 6#155 6s= A AAN) rrrrrArUboolrfstrrirmr%rrr_r_sC8 1U1t1"C"E" $E $c $rr_cNeZdZdZddeffd ZdedefdZdedeffd Z xZ S) IDNA2003CodeczIDNA 2003 encoder/decoder. strict_decodec0t|||_y)zInitialize the IDNA 2003 encoder/decoder. *strict_decode* is a ``bool``. If `True`, then IDNA2003 checking is done when decoding. This can cause failures if the name was encoded with IDNA2008. The default is `False`. N)r@rAru)rBrurEs rrAzIDNA2003Codec.__init__s *rrLrMct|dk(ry tjj|S#t$rtwxYw)zEncode *label*.rOr) encodingsr ToASCII UnicodeErrorr5res rrizIDNA2003Codec.encodes= B; >>))%0 0   s'7c|jst| |S|dk(ry ttj j |S#t$r}t|d}~wwxYw)zDecode *label*.rrOrlN) rur@rmr]rxr ToUnicodernr=)rBrLrprEs rrmzIDNA2003Codec.decodes_!!7>%( ( C< 2Y^^55e<= = 2q1 1 2s'A A& A!!A&F rrrrrqrArrrUrirmrHrIs@rrtrts=$ +d +CE 2E 2c 2 2rrtc beZdZdZ d dedededeffd Zdedefd Zdedeffd Z xZ S) IDNA2008CodeczIDNA 2008 encoder/decoder.uts_46 transitionalallow_pure_asciirucZt|||_||_||_||_y)a Initialize the IDNA 2008 encoder/decoder. *uts_46* is a ``bool``. If True, apply Unicode IDNA compatibility processing as described in Unicode Technical Standard #46 (https://unicode.org/reports/tr46/). If False, do not apply the mapping. The default is False. *transitional* is a ``bool``: If True, use the "transitional" mode described in Unicode Technical Standard #46. The default is False. *allow_pure_ascii* is a ``bool``. If True, then a label which consists of only ASCII characters is allowed. This is less strict than regular IDNA 2008, but is also necessary for mixed names, e.g. a name with starting with "_sip._tcp." and ending in an IDN suffix which would otherwise be disallowed. The default is False. *strict_decode* is a ``bool``: If True, then IDNA2008 checking is done when decoding. This can cause failures if the name was encoded with IDNA2003. The default is False. N)r@rArrrru)rBrrrrurEs rrAzIDNA2008Codec.__init__s/:  ( 0*rrLrMc|dk(ry|jr2t|r'|jd}t|dkDrt|St st  |jr!tj|d|j}tj|S#tj$r)}|jddk(rtt|d}~wwxYw) NrOrascii?FrzLabel too longrl)r is_all_asciirilenr5have_idna_2008r;rr uts46_remapralabel IDNAErrorrCr=)rBrLencodedrps rrizIDNA2008Codec.encode s B;  \%%8ll7+G7|b ""N  6{{((t7H7HI;;u% %~~ 6vvay,,""#155  6sABC'$C  CcT|jst| |S|dk(rytst t j |}|jr!t j|d|j}t|S#t jtf$r}t|d}~wwxYw)NrrOFrl)rur@rmrr;r ulabelrrrr]rrzr=)rBrLrrprEs rrmzIDNA2008Codec.decode s!!7>%( ( C<  2[['F{{))&%9J9JKV$ $ - 2q1 1 2sA A==B' B""B')FFFFr~rIs@rrrsk$"!&# !+!+!+ !+  !+F6C6E6( 2E 2c 2 2rrlabels.ct|}d}d}d}|D]1}t|}||dzz }|dkDrt|dkr|dk(r|}|dz }3|dkDrt|dk\r||dz k7rtyy)aXCheck for empty labels in the middle of a label sequence, labels that are too long, and for too many labels. Raises ``dns.name.NameTooLong`` if the name as a whole is too long. Raises ``dns.name.EmptyLabel`` if a label is empty (i.e. the root label) and appears in a position other than the end of the label sequence rrrrN)rr5r2r')rltotalijrLlls r_validate_labelsr:s F A E A A Z a 7  q5Uc\A Q s{Av!q1u*vrcrt|tr|St|tr|jSt)zcIf label is ``str``, convert it to ``bytes``. If it is already ``bytes`` just return it. )rTrUrrri ValueError)rLs r_maybe_convert_to_binaryrXs/ % %||~ rc eZdZdZdgZdeeeeffdZ dZ dZ dZ fdZ defd Zdefd Zdefd Zd ddeeeeffd Zd ddefdZd ddefdZd3dZdZdZdZdZdZdZdZdZ d4dedefdZ! d5dede"e#defdZ$d6de"ddefdZ% d7de"e&d e"e'de"dd!ede"ef d"Z(defd#Z)d$Z*d%Z+d&Z,d'eded(fd)Z-d8d*Z.d9d+Z/d9d,Z0 d:de"dd-eddfd.Z1d3d/Z2d;ddd0eddfd1Z3d;ddd0eddfd2Z4xZ5S) B3(>>rcZt|jdkDxr|jddk(S)zdIs this name wild? (I.e. Is the least significant label '*'?) Returns a ``bool``. r*rras ris_wildz Name.is_wilds* 4;;!#> A$(>>rcld}|jD]"}|jD] }||dz|zz }$|S)zQReturn a case-insensitive hash of the name. Returns an ``int``. rr)rrc)rBhrLr[s r__hash__z Name.__hash__s@ [[E[[]a1f\!#!rotherc|j}|j}||k7r(|rtjddfStjddfSt|j}t|j}||z }|dkr|}n|}d}d} tj} |dkDr|dz}|dz}|dz}|j|j } |j|j } | | krd}| dkDrtj } | || fS| | kDrd}| dkDrtj } | || fS| dz } |dkDr|}|dkrtj} n&|dkDrtj} ntj} | || fS)aCompare two names, returning a 3-tuple ``(relation, order, nlabels)``. *relation* describes the relation ship between the names, and is one of: ``dns.name.NameRelation.NONE``, ``dns.name.NameRelation.SUPERDOMAIN``, ``dns.name.NameRelation.SUBDOMAIN``, ``dns.name.NameRelation.EQUAL``, or ``dns.name.NameRelation.COMMONANCESTOR``. *order* is < 0 if *self* < *other*, > 0 if *self* > *other*, and == 0 if *self* == *other*. A relative name is always less than an absolute name. If both names have the same relativity, then the DNSSEC order relation is used to order them. *nlabels* is the number of significant labels that the two names have in common. Here are some examples. Names ending in "." are absolute names, those not ending in "." are relative names. ============= ============= =========== ===== ======= self other relation order nlabels ============= ============= =========== ===== ======= www.example. www.example. equal 0 3 www.example. example. subdomain > 0 2 example. www.example. superdomain < 0 2 example1.com. example2.com. common anc. < 0 2 example1 example2. none < 0 0 example1. example2 none > 0 0 ============= ============= =========== ===== ======= rrr) rr r rrrcrr!r"r#) rBrsabsoabsl1l2ldiffrordernlabelsnamerelnlabel1label2s r fullcomparezName.fullcompares@!  " 4<$))1a00$))2q11    R 19AA$$!e FA !GB !GB[[_**,F\\"%++-FQ;+::H %11&Q;+::H %11 qLG!!e" 19#//H QY#--H#))H%))rc||j|\}}}|tjk(s|tjk(ryy)zIs self a subdomain of other? Note that the notion of subdomain includes equality, e.g. "dnspython.org" is a subdomain of itself. Returns a ``bool``. TF)rr r"r#rBrnr_s r is_subdomainzName.is_subdomains;%%e, Q '' '21C1C+Crc||j|\}}}|tjk(s|tjk(ryy)zIs self a superdomain of other? Note that the notion of superdomain includes equality, e.g. "dnspython.org" is a superdomain of itself. Returns a ``bool``. TF)rr r!r#rs ris_superdomainzName.is_superdomains;%%e, Q )) )R<3E3E-Ercnt|jDcgc]}|jc}Scc}w)zcReturn a name which is equal to the current name, but is in DNSSEC canonical form. )r rrc)rBrs r canonicalizezName.canonicalize s'  41QWWY4554s2cRt|tr|j|ddk(Sy)NrrFrTr rrBrs r__eq__z Name.__eq__s* eT "##E*1-2 2rcRt|tr|j|ddk7Sy)NrrTrrs r__ne__z Name.__ne__s* eT "##E*1-2 2rc\t|tr|j|ddkStSNrrrTr rNotImplementedrs r__lt__z Name.__lt__- eT "##E*1-1 1! !rc\t|tr|j|ddkStSrrrs r__le__z Name.__le__"- eT "##E*1-2 2! !rc\t|tr|j|ddk\StSrrrs r__ge__z Name.__ge__(rrc\t|tr|j|ddkDStSrrrs r__gt__z Name.__gt__.rrc.d|jzdzS)Nz )__str__ras r__repr__z Name.__repr__4sdlln,s22rc$|jdS)NF)to_textras rrz Name.__str__7s||E""romit_final_dotc(t|jdk(ryt|jdk(r|jddk(ry|r |jr|jdd}n |j}djt t |}|S)zConvert name to DNS text format. *omit_final_dot* is a ``bool``. If True, don't emit the final dot (denoting the root label) for absolute names. The default is False. Returns a ``str``. r@rr.Nr)rrrjoinmapr])rBrrss rrz Name.to_text:s| t{{ q  t{{ q T[[^s%: d..0 CR A A HHSA& 'r idna_codecc\t|jdk(ryt|jdk(r|jddk(ry|r |jr|jdd}n |j}|t}dj |Dcgc]}|j |c}Scc}w)atConvert name to Unicode text format. IDN ACE labels are converted to Unicode. *omit_final_dot* is a ``bool``. If True, don't emit the final dot (denoting the root label) for absolute names. The default is False. *idna_codec* specifies the IDNA encoder/decoder. If None, the dns.name.IDNA_2003_Practical encoder/decoder is used. The IDNA_2003_Practical decoder does not impose any policy, it just decodes punycode, so if you don't want checking for compliance, you can use this decoder for IDNA2008 as well. Returns a ``str``. rrrrrNr)rrrIDNA_2003_Practicalrrm)rBrrrrs r to_unicodezName.to_unicodeOs( t{{ q  t{{ q T[[^s%: d..0 CR A A  ,Jxxq9!**1-9::9s B)originc4|j|d}|J|S)a@Convert name to a format suitable for digesting in hashes. The name is canonicalized and converted to uncompressed wire format. All names in wire format are absolute. If the name is a relative name, then an origin must be supplied. *origin* is a ``dns.name.Name`` or ``None``. If the name is relative and origin is not ``None``, then origin will be appended to the name. Raises ``dns.name.NeedAbsoluteNameOrOrigin`` if the name is relative and no origin was provided. Returns a ``bytes``. T)rr)to_wire)rBrdigests r to_digestablezName.to_digestableos'"V$?!!! rfilecompressrc`|t}|jD]7}|jt||r||j z }3||z }9|j s^||j st |jD]7}|jt||r||j z }3||z }9t|S|j sR||j st t|j}|jt|jn |j}d}|D]}t||d} |dz }||j| } nd} | .d| z} tjd| } |j| y|(t| dkDr|j} | dkr| || <t|} |jtjd| | dkDs|r |j|j |j|y)aConvert name to wire format, possibly compressing it. *file* is the file where the name is emitted (typically an io.BytesIO file). If ``None`` (the default), a ``bytes`` containing the wire name will be returned. *compress*, a ``dict``, is the compression table to use. If ``None`` (the default), names will not be compressed. Note that the compression code assumes that compression offset 0 is the start of *file*, and thus compression will not be correct if this is not the case. *origin* is a ``dns.name.Name`` or ``None``. If the name is relative and origin is not ``None``, then *origin* will be appended to it. *canonicalize*, a ``bool``, indicates whether the name should be canonicalized; that is, converted to a format suitable for digesting in hashes. Raises ``dns.name.NeedAbsoluteNameOrOrigin`` if the name is relative and no origin was provided. Returns a ``bytes`` or ``None``. Nrriz!Hi?!B) bytearrayrappendrrcrr0rUlistextendr getstructpackwritetell)rBrrrroutrLrrnposvaluerrs rrz Name.to_wiresB <+C 3u:&5;;=(C5LC % ##%>););)=22#]]EJJs5z*#u{{},u  + : !~V%7%7%9..$++&F MM$v}}- .[[F EVABZ A FA#ll1o KKe, 1 'CFQJ))+Cf}&) J 6;;tQ/0q5# 5;;=1 5)/0rc,t|jS)zIThe length of the name (in labels). Returns an ``int``. rras r__len__z Name.__len__s 4;;rc |j|Srr)rBindexs r __getitem__zName.__getitem__s{{5!!rc$|j|Sr) concatenaters r__add__z Name.__add__s&&rc$|j|Sr) relativizers r__sub__z Name.__sub__su%%rdepth)r r ct|j}|dk(r|tjjfS||k(rtjj|fS|dks||kDr t dt |d| t || dfS)a(Split a name into a prefix and suffix names at the specified depth. *depth* is an ``int`` specifying the number of labels in the suffix Raises ``ValueError`` if *depth* was not >= 0 and <= the length of the name. Returns the tuple ``(prefix, suffix)``. rz0depth must be >= 0 and <= the length of the nameN)rrdnsnameemptyrr )rBrrs rsplitz Name.splits   A:#((..) ) aZHHNND) ) QY%!)OP PT'E6]#T$vw-%899rc|jrt|dkDrtt|j}|j t|jt |S)zReturn a new name which is the concatenation of self and other. Raises ``dns.name.AbsoluteConcatenation`` if the name is absolute and *other* is not the empty name. Returns a ``dns.name.Name``. r)rrr7rrrr )rBrrs rrzName.concatenatesM    #e*q.' 'dkk" d5<<()F|rc\|)|j|rt|dt| S|S)aIf the name is a subdomain of *origin*, return a new name which is the name relative to origin. Otherwise return the name. For example, relativizing ``www.dnspython.org.`` to origin ``dnspython.org.`` returns the name ``www``. Relativizing ``example.`` to origin ``dnspython.org.`` returns ``example.``. Returns a ``dns.name.Name``. N)rr rrBrs rrzName.relativizes4  $"3"3F";^F |,- -KrcH|js|j|S|S)aIf the name is a relative name, return a new name which is the concatenation of the name and origin. Otherwise return the name. For example, derelativizing ``www`` to origin ``dnspython.org.`` returns the name ``www.dnspython.org.``. Derelativizing ``example.`` to origin ``dnspython.org.`` returns ``example.``. Returns a ``dns.name.Name``. )rrrs r derelativizezName.derelativizes&!##F+ +KrrcR|r$|r|j|S|j|S|S)a8Return a name with the relativity desired by the caller. If *origin* is ``None``, then the name is returned. Otherwise, if *relativize* is ``True`` the name is relativized, and if *relativize* is ``False`` the name is derelativized. Returns a ``dns.name.Name``. )rr )rBrrs rchoose_relativityzName.choose_relativity/s/ v..((00Krcb|tk(s |tk(rtt|jddS)aReturn the parent of the name. For example, the parent of ``www.dnspython.org.`` is ``dnspython.org``. Raises ``dns.name.NoParent`` if the name is either the root name or the empty name, and thus has no parent. Returns a ``dns.name.Name``. rN)rootrr9r rras rparentz Name.parentDs+ 4<45=NDKKO$$r prefix_okc&tt|||S)aReturn the maximal predecessor of *name* in the DNSSEC ordering in the zone whose origin is *origin*, or return the longest name under *origin* if the name is origin (i.e. wrap around to the longest name, which may still be *origin* due to length considerations. The relativity of the name is preserved, so if this name is relative then the method will return a relative name, and likewise if this name is absolute then the predecessor will be absolute. *prefix_ok* indicates if prefixing labels is allowed, and defaults to ``True``. Normally it is good to allow this, but if computing a maximal predecessor at a zone cut point then ``False`` must be specified. )_handle_relativity_and_call_absolute_predecessorrBrr&s r predecessorzName.predecessorSs+ !4  rc&tt|||S)a;Return the minimal successor of *name* in the DNSSEC ordering in the zone whose origin is *origin*, or return *origin* if the successor cannot be computed due to name length limitations. Note that *origin* is returned in the "too long" cases because wrapping around to the origin is how NSEC records express "end of the zone". The relativity of the name is preserved, so if this name is relative then the method will return a relative name, and likewise if this name is absolute then the successor will be absolute. *prefix_ok* indicates if prefixing a new minimal label is allowed, and defaults to ``True``. Normally it is good to allow this, but if computing a minimal successor at a zone cut point then ``False`` must be specified. )r(_absolute_successorr*s r successorzName.successores ++>fiXXr)rMr r})FNr)NNNF)rr rMr )rr rMr )NT)T)6rrrr __slots__rr rUrrrArrrrrqrrintrrr rrrrrrrrrrrrrrr_rrr CompressTyperr rrrrrrr r"r%r+r.rHrIs@rr r es2 I&xeSj(9:&!6'&?T??? # J*J*E,S2H,IJ*X & T  F t 6  " " " " 3#ds,OS;";8@8K; ;@HV$4.#+/#'" UsmU<(U U  U % Un  "'&:3:5#8:(  "CGv&;? * % & T V $YY4Y6YrrrZrrcxt|ts td|t|ts tdg}d}d}d}d}|t}|dk(rd}|r |dvr tdgS|D]}|rs|dk(r)|j rt |}|d z }+||z }d}3|j st|d z}|t |z }|d z }|d k(sgd}|t|z }x|dvr7t|dk(rt|j|j|d}|d k(rd }d}d}||z }|rtt|dkDr!|j|j|n|jdt|dk(s|ddk7r&|$|jt|jt|S)aConvert unicode text into a Name object. Labels are encoded in IDN ACE form according to rules specified by the IDNA codec. *text*, a ``str``, is the text to convert into a name. *origin*, a ``dns.name.Name``, specifies the origin to append to non-absolute names. The default is the root name. *idna_codec*, a ``dns.name.IDNACodec``, specifies the IDNA encoder/decoder. If ``None``, the default IDNA 2003 encoder/decoder is used. Returns a ``dns.name.Name``. z0input to from_unicode() must be a unicode stringorigin must be a Name or NonerOFrr)ru。u.u。rr rrPTr)rTrrrr IDNA_2003isdigitr0r*rWrr'rrirrr) rZrrrrLescapingedigitsrr[s r from_unicoder9s( dC KLL Nj6899 F EHG E  s{ 6 6; Aa<yy{ #A1  #(99;'RKESVOEqLG!|#(U+99u:?$$ j//67d 9: O u:> MM*++E2 3 MM#  F qF2J#-63E d6==)* <rc2|D]}t|dkDsyy)NrRFT)rY)rZr[s rrrs  q6D= rct|tr)t|s t|||S|j d}t|t s t d|t|ts t dg}d}d}d}d}|dk(rd}|r%|dk(r tdgS|D]}tjd |} |r~|dk(r)| jrt| }|d z }A|| z }d}I| jst|d z}|t| z }|d z }|d k(s}d}|tjd |z }| dk(r(t|dk(rt|j|d}| d k(rd}d}d}|| z }|rtt|dkDr|j|n|jdt|dk(s|ddk7r&|$|j!t#|j$t|S)aConvert text into a Name object. *text*, a ``bytes`` or ``str``, is the text to convert into a name. *origin*, a ``dns.name.Name``, specifies the origin to append to non-absolute names. The default is the root name. *idna_codec*, a ``dns.name.IDNACodec``, specifies the IDNA encoder/decoder. If ``None``, the default IDNA 2003 encoder/decoder is used. Returns a ``dns.name.Name``. rz%input to from_text() must be a stringr3rFr@.rrr4r\Tr)rTrrrr9rirUrr rrr6r0r*rr'rrrr) rZrrrrLr7r8rr[byte_s r from_textr@s&$D!fj9 9{{7# dE "@AA Nj6899 F EHG E t| 4<; AKKa(Ea<}} #E 1 #( ==?'RKESZ'EqLG!|#(T5!99$u:?$$ e$%;< O u:> MM% MM#  F qF2J#-63E d6==)* <rparserzdns.wire.Parsercg}|j}|j5|j}|dk7r|dkr!|j|j |nC|dk\r8|dzdz|jz}||k\rt |}|j |nt|j}|dk7r|jddddt|S#1swYt|SxYw)a7Convert possibly compressed wire format into a Name. *parser* is a dns.wire.Parser. Raises ``dns.name.BadPointer`` if a compression pointer did not point backwards in the message. Raises ``dns.name.BadLabelType`` if an invalid label type was encountered. Returns a ``dns.name.Name`` r@rrN) currentrestore_furthest get_uint8r get_bytesr,seekr.r )rArbiggest_pointercountrFs rfrom_wire_parserrM-sFnnO  "  "qjrz f..u56# 4<3.1A1A1CCo-$$") G$""$$&Eqj  c < <sBC4CC+messagerFct|ts tdtjj ||}t |}||j|z fS)a^Convert possibly compressed wire format into a Name. *message* is a ``bytes`` containing an entire DNS message in DNS wire form. *current*, an ``int``, is the offset of the beginning of the name from the start of the message Raises ``dns.name.BadPointer`` if a compression pointer did not point backwards in the message. Raises ``dns.name.BadLabelType`` if an invalid label type was encountered. Returns a ``(dns.name.Name, int)`` tuple consisting of the name that was read and the number of bytes of the wire format message which were consumed reading it. z*input to from_wire() must be a byte string)rTrUrrwireParserrMrF)rNrFrArs r from_wirerRNsL& gu %EFF XX__Wg .F F #D &..7* ++rr[c2tjd|dS)Nc$|t|zdzS)Nr)r)vrs rz_wire_length..tsSVarr) functoolsreducers r _wire_lengthr\ss   7 CCrc:dt|jz }g}|dkDr#|jtdz|dz}|dkDr#|dk\r|jt|dz zt t |}|j |jt|S)NrrCrrr)r\rr_MAXIMAL_OCTETrreversedrr )rneeded new_labelss r_pad_to_max_namerbws < , ,FJ 2+.2-."  2+{.FQJ78hz*+Jdkk"  rct|}dt|z |z dz }|dkr|Std|z |}|t|zzS)Nrrrr)rr\minr^)rL suffix_labelslength remainingr`s r_pad_to_max_labelrhsP ZFl=11F:Q>IA~ fi (F >F* **rrr&c||k(r t|S|d}|tk(r|jS|d}|jdd}|tk(r|ddg}nBt |}|d}|t k(rt}n|dz}||d<t|}t||g}|j|t|}|r t|S|S)Nrrr) rb_MINIMAL_OCTETr%r_MINIMAL_OCTET_VALUEr_LEFT_SQUARE_BRACKET_VALUE_AT_SIGN_VALUErUrhrr ) rrr&least_significant_label least_octetreraoctetsoctets rr)r)s  v~%%"1g.0{{})"-KKKOM**-cr23 23r  . ."E QJEr "'-'(?OP m$  D%% rc|r tj|S||k7r|d}t|dkrH|tzg}|j |j dd tjj|St|}tt|dz ddD]g}||}|tk(r|tk(rt}n|dz }|||<t|d|dzg}|j |j ddt|cS|j!}||k7r|S#t$rYwxYw#tjj$rYwxYw)Nrrrr)_SUCCESSOR_PREFIXrr2rrjrrrrr rrange_MAXIMAL_OCTET_VALUErmrlrUr%)rrr&rnrarprrqs rr-r-sj  $006 6 &."&q' & '" ,2NBCJ   dkk!"o . xx}}Z00 23s6{QB/A1IE,,&2 F1IwQ01J   dkk!"o . # #+00{{}W &.^ Mc   88''  s#DD/ D,+D,/EEfunctionc|jst|j }|r|j|}n|j|st||||}|r|j |}|Sr)rr0r rrKr)rvrrr&relative result_names rr(r(su    &&##%%H  (   v &##43K!,,V4 r)arrencodings.idnarxrZrtypingrrrrrrr dns._featuresrdns.enum dns.exception dns.immutabledns.wire _featureshaver rr0r1enumIntEnumr r NAMERELN_NONEr!NAMERELN_SUPERDOMAINr"NAMERELN_SUBDOMAINr#NAMERELN_EQUALrNAMERELN_COMMONANCESTOR exception SyntaxErrorr'r* FormErrorr,r. DNSExceptionr0r2r5r7r9r;r=rKrVrXrUrrr]r_rtrrIDNA_2003_Strictr5IDNA_2008_PracticalIDNA_2008_UTS_46IDNA_2008_StrictIDNA_2008_Transitional IDNA_2008rr immutabler r$rr9rqrr@rMrRrjrYrkrsr^rurmrlr\rbrhr)r-r(r%rrrs$  HHH==fNNFCK 388##6!! #//!++##&55 ** C ))CH((H=3==**=Ds}}99D +#--))++3==,,++CMM66+ s}})) ++ *CMM.. *YCMM66Y  U5#:&3:$$0!2I!2HG2IG2T$E* &  #D%u= ueU; ud;&tT5%@  U5#:.4< E%*$5 % OYOYOYf SE{ R)-PTJ J~J:B9:MJ JZst"&*T s T TNT#T Tt.4B,u,s,uT3Y/?,8>*.)*>*S XD  +dtB;d;D;T;d;|dD)4/0     r