%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/netaddr/strategy/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/netaddr/strategy/__pycache__/eui64.cpython-312.pyc

�

���^�
���dZddlZddlZddlmZddlmZ	m
ZmZ
mZmZmZmZmZmZdZdZeZdZdZdezdz
ZGd	�d
e �Z!Gd�de!�Z"Gd
�de"�Z#Gd�de!�Z$Gd�de!�Z%e!Z&ddjOdgdz�zdzddjOdgdz�zdzddjOdgdz�zdzddjOdgdz�zdzddjOdgdz�zdzddjOdgdz�zd zfZ(e(D�cgc]}ejR|ejT���!c}Z(d!�Z+d"�Z,d#�Z-d0d$�Z.d%�Z/d&�Z0d0d'�Zd0d(�Z
d0d)�Zd0d*�Zd0d+�Zd0d,�Zd0d-�Zd.�Zd/�Zycc}w)1z6
IEEE 64-bit EUI (Extended Unique Indentifier) logic.
�N)�AddrFormatError)	�valid_words�int_to_words�words_to_int�
valid_bits�bits_to_int�int_to_bits�	valid_bin�
int_to_bin�
bin_to_int�@zEUI-64��c�:�eZdZdZdZeezZdezdz
ZdZdZ	dZ
y)	�
eui64_basez%A standard IEEE EUI-64 dialect class.�rr�-z%.2X�N)�__name__�
__module__�__qualname__�__doc__�	word_size�width�	num_words�max_word�word_sep�word_fmt�	word_base���8/usr/lib/python3/dist-packages/netaddr/strategy/eui64.pyrr+s;��/��I���"�I��I�~��!�H��H��H��Ir!rc�*�eZdZdZdZeezZdZdZdZ	y)�
eui64_unixz'A UNIX-style MAC address dialect class.r�:z%xrN�
rrrrrrrrrrr r!r"r$r$@s#��1��I���"�I��H��H��Ir!r$c��eZdZdZdZy)�eui64_unix_expandedz;A UNIX-style MAC address dialect class with leading zeroes.�%.2xN)rrrrrr r!r"r(r(Is
��E��Hr!r(c�*�eZdZdZdZeezZdZdZdZ	y)�eui64_ciscoz2A Cisco 'triple hextet' MAC address dialect class.r�.�%.4xNr&r r!r"r+r+Ns#��<��I���"�I��H��H��Ir!r+c�*�eZdZdZdZeezZdZdZdZ	y)�
eui64_barez1A bare (no delimiters) MAC address dialect class.r
�z%.16XrNr&r r!r"r/r/Ws#��;��I���"�I��H��H��Ir!r/�^r%z([0-9A-F]{1,2})r�$rz([0-9A-F]{1,4})�z\.z^(r0z[0-9A-F]rz)$c�F�|D]}|j|�}|s�|dcSy)Nr)�findall)�address�formats�regexp�matchs    r"�_get_match_resultr:xs+��������w�'�����8�O�r!c�H�	t|t�ry	y#t$rYywxYw)z�
    :param addr: An IEEE EUI-64 indentifier in string form.

    :return: ``True`` if EUI-64 indentifier is valid, ``False`` otherwise.
    TF)r:�RE_EUI64_FORMATS�	TypeError)�addrs r"�	valid_strr?s6��
��T�#3�4��5�
���
���
�s��	!�!c�:�g}	t|t�}|st�	t	|t
�rn|f}t
|�dk(r8tdj|D�cgc]}dt|d�z��c}�d�}|St
|�dk(r8tdj|D�cgc]}dt|d�z��c}�d�}|St
|�d	k(rtd
t|dd�zd�}|Std|z��#t$rtd|�d���wxYwcc}wcc}w)
z�
    :param addr: An IEEE EUI-64 indentifier in string form.

    :return: An unsigned integer that is equivalent to value represented
        by EUI-64 string address formatted according to the dialect
    z invalid IEEE EUI-64 identifier: �!rr0r)rr3r-rz%016xrz)bad word count for EUI-64 identifier: %r!)	r:r<r=r�
isinstance�tuple�len�int�join)r>�words�w�int_vals    r"�
str_to_intrJ�s0��
�E�O�!�$�(8�9����O��
�%�������
�5�z�Q���b�g�g�E�B�q�v��A�r�
�2�B�C�R�H���N�

�U��q���b�g�g�E�B�q�v��A�r�
�2�B�C�R�H���N�

�U��q���g��E�!�H�b� 1�1�2�6��
�N��7�$�>�@�	@��%�O��t�M�N�N�O��C��Cs�C7�D�D�7Dc��|�t}t||�}|D�cgc]}|j|z��}}|jj	|�}|Scc}w)z�
    :param int_val: An unsigned integer.

    :param dialect: (optional) a Python class defining formatting options

    :return: An IEEE EUI-64 identifier that is equivalent to unsigned integer.
    )rrrrrF)rI�dialectrG�i�tokensr>s      r"�
int_to_strrO�sX��������'�*�E�,1�
2�q�g����"�
2�F�
2���� � ��(�D��K��3s�Ac�D�t|�}tjdg|���S)z�
    :param int_val: the integer to be packed.

    :return: a packed string that is equivalent to value represented by an
    unsigned integer.
    �>8B)r�_struct�pack)rIrGs  r"�
int_to_packedrT�s"��
��!�E��<�<��&��&�&r!c��ttjd|��}d}tt	|��D]\}}|}|d|zz}||z}�|S)a
    :param packed_int: a packed string containing an unsigned integer.
        It is assumed that string is packed in network byte order.

    :return: An unsigned integer equivalent to value of network address
        represented by packed binary string.
    rQrr)�listrR�unpack�	enumerate�reversed)�
packed_intrGrIrM�num�words      r"�
packed_to_intr]�s\��
�����z�2�3�E��G��H�U�O�,�!���3����q�1�u�}���D�.��!�
�Nr!c�T�|�t}t||j|j�S�N)�DEFAULT_EUI64_DIALECT�_valid_wordsrr�rGrLs  r"rr�s'����'����w�0�0�'�2C�2C�D�Dr!c�T�|�t}t||j|j�Sr_)r`�
_int_to_wordsrr�rIrLs  r"rr�s'����'����'�"3�"3�W�5F�5F�G�Gr!c�T�|�t}t||j|j�Sr_)r`�
_words_to_intrrrbs  r"rr�s'����'����� 1� 1�7�3D�3D�E�Er!c�H�|�t}t|t|j�Sr_)r`�_valid_bitsrr��bitsrLs  r"rr�s!����'���t�U�G�$4�$4�5�5r!c�H�|�t}t|t|j�Sr_)r`�_bits_to_intrrrjs  r"rr�s!����'����e�W�%5�%5�6�6r!c�j�|�t}t||j|j|j�Sr_)r`�_int_to_bitsrrrres  r"r	r	�s6����'�����"�"�G�$5�$5�w�7G�7G�I�Ir!c�2�|�t}t|t�Sr_)r`�
_valid_binr)�bin_valrLs  r"r
r
s����'���g�u�%�%r!c�"�t|t�Sr_)�_int_to_binr)rIs r"rr����w��&�&r!c�"�t|t�Sr_)�_bin_to_intr)rrs r"rrrur!r_)1r�structrR�re�_re�netaddr.corer�netaddr.strategyrrarrdrrgrrirrmr	ror
rqrrtrrw�AF_EUI64r�family�family_name�version�max_int�objectrr$r(r+r/r`rFr<�compile�
IGNORECASEr:r?rJrOrTr])�_s0r"�<module>r�s������(������	��
����
���u�*�q�.�����*����*��
�*�����#���#�(�(�%�&��*�
+�+�c�1��#�(�(�%�&��*�
+�+�c�1��#�(�(�%�&��*�
+�+�c�1��#�(�(�%�&��*�
+�+�c�1��%�*�*�'�(�1�,�
-�-��3�	�2�7�7�J�<�"�$�%�%��,���=M�M�q�K�C�K�K��3�>�>�2�M����"�J
� '��&E�H�F�6�7�I�&�'�'��wNs�$E1

Zerion Mini Shell 1.0