ó #ŠSc@sddZddlZddlZddlZejjdƒZejjdƒZd„Z d„Z dS(sDNS Reverse Map Names. @var ipv4_reverse_domain: The DNS IPv4 reverse-map domain, in-addr.arpa. @type ipv4_reverse_domain: dns.name.Name object @var ipv6_reverse_domain: The DNS IPv6 reverse-map domain, ip6.arpa. @type ipv6_reverse_domain: dns.name.Name object iÿÿÿÿNs in-addr.arpa.s ip6.arpa.cCsÛystjj|ƒ}tjj|ƒrWg|dD]}dt|ƒ^q2}t}nt|jdƒƒ}t}Wn<gtj j|ƒD]}dt|ƒ^qŒ}t}nX|j ƒtj j dj |ƒd|ƒS(sConvert an IPv4 or IPv6 address in textual form into a Name object whose value is the reverse-map domain name of the address. @param text: an IPv4 or IPv6 address in textual form (e.g. '127.0.0.1', '::1') @type text: str @rtype: dns.name.Name object i s%dt hex_codect.torigin(tdnstipv6t inet_atont is_mappedtordtipv4_reverse_domaintlisttencodetipv6_reverse_domaintipv4treversetnamet from_texttjoin(ttexttv6tbytetpartsR((s5/usr/lib64/python2.7/site-packages/dns/reversename.pyt from_addresss'  /  cCs0|jtƒrb|jtƒ}t|jƒ}|jƒdj|ƒ}tjj tjj |ƒƒS|jt ƒr|jt ƒ}t|jƒ}|jƒg}d}t |ƒ}x;||krî|j dj|||d!ƒƒ|d7}q´Wdj|ƒ}tjj tjj |ƒƒStjjdƒ‚dS(s´Convert a reverse map domain name into textual address form. @param name: an IPv4 or IPv6 address in reverse-map form. @type name: dns.name.Name object @rtype: str Ritit:s"unknown reverse-map address familyN(t is_subdomainRt relativizeR tlabelsR RRR t inet_ntoaRR tlentappendRt exceptiont SyntaxError(RRRRtitl((s5/usr/lib64/python2.7/site-packages/dns/reversename.pyt to_address5s&   !( t__doc__tdns.nameRtdns.ipv6tdns.ipv4RRRR RR"(((s5/usr/lib64/python2.7/site-packages/dns/reversename.pyts