%PDF- %PDF-
Mini Shell

Mini Shell

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

�

ӊ�^7 ��N�dZddlmZmZddlmZmZdZ	dZ
d�Zd�Zd�Z
d	�Zd
�Zy)z=Fallback routines for Python's standard library socket module�)�unpack�pack)�_bytes_join�_is_str��
c��t|�stdt|�z��t|�dk7rt	d��dtd|�zS)zR
    Convert an IP address from 32-bit packed binary format to string format.
    zstring type expected, not %s��*invalid length of packed IP address stringz%d.%d.%d.%d�4B)r�	TypeError�type�len�
ValueError�_unpack)�	packed_ips �2/usr/lib/python3/dist-packages/netaddr/fbsocket.py�	inet_ntoarsK���9���6��i��H�I�I�
�9�~����E�F�F��7�4��3�3�3�c���g}g}d}d}t|�D]A\}}|dk(r
|�|}|dz
}n|dkDr|j||f�d}d}|j|��C|dkDr|j||f�t|�dk7rw|jd���|d}|D]}|d|dkDs�|}�|\}	}
|d|
dgz||
|	zdz}|ddk(r|j	dd�|ddk(r|jd�|S)Nr�0�c��|dS)Nr�)�xs r�<lambda>z&_compact_ipv6_tokens.<locals>.<lambda>9s
��Q�q�T�r)�key����)�	enumerate�appendr�sort�insert)�tokens�
new_tokens�	positions�start_index�
num_tokens�idx�token�
best_position�position�length�	start_idxs           r�_compact_ipv6_tokensr/sR���J��I��K��J� ��'�!�
��U��C�<��"�!���!�O�J��A�~�� � �*�k�!:�;��K��J����%� �!��A�~����*�k�2�3��9�~������>��*�!�!��
�!�	)�H���{�]�1�-�-� (�
�	)�,������)�,��t�3�j��V�AS�AT�6U�U�
��a�=�B�����a��$��b�>�R�����b�!��rc
�D�|tk(rt|�S|tk(r�t|�dk7st	|�std��t
d|�D�cgc]}d|z��	}}tt
d|��}d}tt|��D]\}}|}|d|zz}||z}�d|cxkrdks
n|dz	dk(r;td	g|d
dD�cgc]}t|d���c}���}t|�}	|dd
|	gz}djt|��Std
|z��cc}wcc}w)zBConvert an packed IP address of the given family to string format.�rz>8H�%xr�l��� z>2H���N�:zunknown address family %d)�AF_INETr�AF_INET6rrrr�listr �reversed�_pack�int�joinr/)
�afr�ir$�words�int_val�num�word�packed_ipv4�ipv4_strs
          r�	inet_ntoprFLs4��	�W�}���#�#�	�x���y�>�R��w�y�'9��I�J�J�$+�E�9�$=�>�q�$��(�>��>��W�U�I�.�/��������0�	%�F�A�s��D��2��6�>�D���n�G�	%�
�G�)�z�)�W��]�f�-D���J�V�B�C�[�(I���Q���(I�J�K� ��-�H��A�b�\�X�J�.�F��x�x�,�V�4�5�5��4�r�9�:�:��%?��)Js�D�D
c��t|�r�td|z�}|jd�}t|�dk(rwg}|D]e}|j	d�s|j	d�rt|�dkDr|�	t|�}|dz	dk7r|�|j
td	|���gt|�S|�td
t|�z��#t$r|�wxYw)a
    Convert an IP address in string format (123.45.67.89) to the 32-bit packed
    binary format used in low-level network functions. Differs from inet_aton
    by only support decimal octets. Using octal or hexadecimal values will
    raise a ValueError exception.
    �illegal IP address string %r�.r
�0xrr�r�Bz#argument should be a string, not %s)
rr�splitr�
startswithr<r!r;rr)�	ip_string�invalid_addrr$r@r*�octets      r�_inet_pton_af_inetrRks����y��!�"@�9�"L�M������%���v�;�!���E��

0���#�#�D�)�e�.>�.>�s�.C��E�
�UV��&�&�'���J�E��Q�J�1�$�&�&����U�3��.�/�

0��u�%�%���
�:�T�)�_�L�
M�M��"�'�&�&�'�s�3C	�	Cc�(�|tk(rt|�S|tk(�rtd|z�}g}t	|�s|�d|vr|�d|v�r�|dk(rdj�dzS	|j
d�\}}g}g}|dk7r|j
d�}|dk7r|j
d�}t|�rhd|d	vrat|j��}|jd
td|dd
�dz�|jd
td|d
d�dz�t|�t|�z}	d|	cxkrdks|�|�dt|�t|�zz
}
|D�cgc]}tdt|d����c}t|
�D�cgc]}dj���c}z|D�cgc]}tdt|d����c}z}	||zD]}t|d�}
d|
cxkrdkr�|�|�	t|�Sd|v�r8|j
d�}d|vr�|dd	}|dd	gd�k7r|�|d	j�dvr|�t|�dk7r|�t|j��}|jd
td|dd
�dz�|jd
td|d
d�dz�|D�cgc]}tdt|d����}}nt|�dk7r|�	|D�cgc]}t|d���}}|D]}d|cxkrdkr�|�|�	|D�cgc]}td|���}}t|�S|�td|z��#t$r|�wxYwcc}wcc}wcc}w#t$r|�wxYwcc}wcc}w#t$r|�wxYwcc}w)z|
    Convert an IP address from string format to a packed string suitable for
    use with low-level network functions.
    rHrz::�r1rr6rIrr2z>Hrrr
�rKzr3N)rrrrr)r�ffffzUnknown address family %d)r7rRr8rr�encoderMr�popr!rr;r<�range�lowerr)r>rOrP�values�prefix�suffix�l_prefix�l_suffixrE�token_count�gap_sizer?r*rCr$�ipv6_prefixs                r�	inet_ptonrc�s��

�W�}�!�)�,�,�	�x��!�"@�9�"L�M�����y�!����)�����9���D� ��}�}���+�+�
#�!*����!6�����H��H���|�!�<�<��,����|�!�<�<��,���8�}�����!4�-�h�l�l�n�=������w�t�X�a��]�'C�A�'F� F�G�����w�t�X�a��]�'C�A�'F� F�G��h�-�#�h�-�7�K���,�u�,�"�"�-�"�"��S��]�S��]�:�<�H�3;�;�Q��t�S��B�Z�(�;�.3�H�o�>���"�"�$�>�?�2:�;�Q��t�S��B�Z�(�;�<�
�

#�%��0�+�E��u�b�>�D���.��.�*�*�/�*�*�+�Z�6�"�"�K�i��"����-���)�#�"(��"�+�K�"�3�B�'�+D�D�*�*�"�2��,�,�.�m�C�*�*��6�{�a�'�*�*�1�&�*�*�,�?�H��M�M�$���x��!�}�)E�a�)H�"H�I��M�M�$���x��!�}�)E�a�)H�"H�I�?E�F�!�e�D�#�a��*�5�F�F�F��6�{�a�'�*�*�'�:@�A��c�%��n�A�F�A�!'�/�� �E�3�V�3�".�.� 4�".�.�/�39�9�Q�%��a�.�9��9��6�"�"�#�"��4�r�9�:�:��]�
#�"�"�
#��4<��>��;���
#�"�"�
#��.G��B��
"�'�&�&�'��:s`� M	�M�M�'M"�
M'�*M'�3M6�$N�(M;�;N�N�N�	M�'M3�;N�NN)�__doc__�structrrrr;�netaddr.compatrrr7r8rr/rFrRrcrrr�<module>rgs8��D�3�/�
��
��
4�,�^;�>N�Di;r

Zerion Mini Shell 1.0