%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/dns/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/dns/__pycache__/ipv4.cpython-312.pyc

�

5��e�	��h�dZddlZddlmZddlZdedefd�Zdeeefdefd�Z	deeefdefd	�Z
y)
zIPv4 helper functions.�N)�Union�address�returnc�|�t|�dk7rtjj�d|d|d|d|dfzS)z�Convert an IPv4 address in binary form to text form.

    *address*, a ``bytes``, the IPv4 address in binary form.

    Returns a ``str``.
    �z%u.%u.%u.%ur���)�len�dns�	exception�SyntaxError)rs �*/usr/lib/python3/dist-packages/dns/ipv4.py�	inet_ntoarsD���7�|�q���m�m�'�'�'��G�A�J���
�G�A�J���
�K�K�K��textc�F�t|t�s|j�}n|}|jd�}t	|�dk7rt
jj�|D]f}|j�st
jj�t	|�dkDs�<|dtd�k(s�Nt
jj�	|D�cgc]
}t|���}}tjdg|���Scc}w#t$rt
jj�wxYw)z�Convert an IPv4 address in text form to binary form.

    *text*, a ``str`` or ``bytes``, the IPv4 address in textual form.

    Returns a ``bytes``.
    �.rrr�0�BBBB)�
isinstance�bytes�encode�splitrrr
r�isdigit�ord�int�struct�pack�	Exception)r�btext�parts�part�bs     r�	inet_atonr%'s����d�E�"����
�����K�K���E�
�5�z�Q���m�m�'�'�'��,���|�|�~��-�-�+�+�+��t�9�q�=�T�!�W��C��0��-�-�+�+�+�,�(�#(�)�4�S��Y�)��)��{�{�6�&�A�&�&��
*���(��m�m�'�'�'�(�s�	C<�
C7�C<�7C<�<$D c�z�tjjtjj|��S)z�Verify that *address* is a valid text form IPv4 address and return its
    canonical text form.

    *text*, a ``str`` or ``bytes``, the IPv4 address in textual form.

    Raises ``dns.exception.SyntaxError`` if the text is not valid.
    )r�ipv4rr%)rs r�canonicalizer(Cs(���8�8���c�h�h�0�0��6�7�7r)�__doc__r�typingr�
dns.exceptionrr�strrr%r(�rr�<module>r.sa��$�
���
L�u�
L��
L�(�E�#�u�*�%�(�%�(�8
8�u�S�%�Z�(�
8�S�
8r

Zerion Mini Shell 1.0