HEX
Server: LiteSpeed
System: Linux srv146.niagahoster.com 4.18.0-553.30.1.lve.el8.x86_64 #1 SMP Tue Dec 3 01:21:19 UTC 2024 x86_64
User: kodi1989 (1633)
PHP: 8.1.34
Disabled: symlink,shell_exec,exec,popen,system,dl,passthru,escapeshellarg,escapeshellcmd,show_source,pcntl_exec
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/dns/__pycache__/reversename.cpython-37.pyc
B

��f��@s�dZddlZddlZddlZddlZej�d�Zej�d�Z	ee	fe
ejjejjejjd�dd�Zee	fejjejjejje
d�d	d
�Z
dS)zDNS Reverse Map Names.�Nz
in-addr.arpa.z	ip6.arpa.)�text�	v4_origin�	v6_origin�returncCs�yXtj�|�}tj�|�r6dd�|dd�D�}|}n dd�tt�|����D�}|}Wn.tk
r�dd�tj	�|�D�}|}YnXtj
jd�t
|��|d�S)	a�Convert 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``.
    cSsg|]}d|�qS)z%d�)�.0�byterr�@/opt/alt/python37/lib/python3.7/site-packages/dns/reversename.py�
<listcomp>9sz from_address.<locals>.<listcomp>�NcSsg|]}|�qSrr)r�xrrr	r
<scSsg|]}d|�qS)z%dr)rrrrr	r
?s�.)�origin)�dns�ipv6�	inet_atonZ	is_mapped�str�binascii�hexlify�decode�	Exception�ipv4�name�	from_text�join�reversed)rrrZv6�partsrrrr	�from_addresss
r)rrrrc	Cs�|�|�r8|�|�}d�t|j��}tj�tj�|��S|�|�r�|�|�}t	t|j��}g}x4t
dt|�d�D] }|�d�|||d���qpWd�|�}tj
�tj
�|��Stj�d��dS)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 familyN)Zis_subdomainZ
relativizerr�labelsrr�	inet_ntoar�list�range�len�appendr�	exception�SyntaxError)rrrrr"r�irrr	�
to_addressDs



 
r+)�__doc__rZdns.namerZdns.ipv6Zdns.ipv4rrZipv4_reverse_domainZipv6_reverse_domainr�Namerr+rrrr	�<module>s$