f dZddlZddlZddlZddlZej jdZej jdZ ee fde dej jdej jdej jfd Z ee fd ej jdej jdej jde fd Z y) zDNS Reverse Map Names.Nz in-addr.arpa.z ip6.arpa.text v4_origin v6_originreturnc8 tjj|}tjj|r|ddDcgc]}d|z }}|}n;t t j |jDcgc]}|}}|}tjjdjt||Scc}wcc}w#t$r:tjj|Dcgc]}d|z ncc}w}}|}YwxYw)aConvert an IPv4 or IPv6 address in textual form into a Name object whose value is the reverse-map domain name of the address. *text*, a ``str``, is an IPv4 or IPv6 address in textual form (e.g. '127.0.0.1', '::1') *v4_origin*, a ``dns.name.Name`` to append to the labels corresponding to the address if the address is an IPv4 address, instead of the default (in-addr.arpa.) *v6_origin*, a ``dns.name.Name`` to append to the labels corresponding to the address if the address is an IPv6 address, instead of the default (ip6.arpa.) Raises ``dns.exception.SyntaxError`` if the address is badly formed. Returns a ``dns.name.Name``. Nz%d.)origin)dnsipv6 inet_aton is_mappedstrbinasciihexlifydecode Exceptionipv4name from_textjoinreversed)rrrv6bytepartsr xs X/var/lib/jenkins/workspace/mettalog/venv/lib/python3.12/site-packages/dns/reversename.py from_addressrs0  XX   % 88  b !-/W5TTD[5E5F #H$4$4R$8$?$?$A BC1QCECF 88  chhx7  GG6D ),););D)ABBBBs<AC C 3C CC C*D D  DDrc |j|rq|j|}djt|j}t j jt j j|S|j|r|j|}tt|j}g}tdt|dD](}|jdj|||dz*dj|}t jjt jj|St jjd)aConvert a reverse map domain name into textual address form. *name*, a ``dns.name.Name``, an IPv4 or IPv6 address in reverse-map name form. *v4_origin*, a ``dns.name.Name`` representing the top-level domain for IPv4 addresses, instead of the default (in-addr.arpa.) *v6_origin*, a ``dns.name.Name`` representing the top-level domain for IPv4 addresses, instead of the default (ip6.arpa.) Raises ``dns.exception.SyntaxError`` if the name does not have a reverse-map form. Returns a ``str``. .r:z"unknown reverse-map address family) is_subdomain relativizerrlabelsr r inet_ntoar listrangelenappendr exception SyntaxError)rrrrr&ris r to_addressr/Ds, #y)yy$++./xx!!#(("4"4T":;;  9 %y)ht{{+,q#f+q)A LL&QU"34 5*yyxx!!#(("4"4T":;;mm''(LMMr")__doc__rdns.ipv4r dns.ipv6dns.namerripv4_reverse_domainipv6_reverse_domainrNamerr/r"rr8s$hh((9hh((5 32#H #Hxx}}#Hxx}}#H XX]] #HP 32%N ((--%Nxx}}%Nxx}}%N %Nr"