%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/sos/cleaner/mappings/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/sos/cleaner/mappings/__pycache__/mac_map.cpython-312.pyc

�

i��d��6�ddlZddlZddlmZGd�de�Zy)�N)�SoSMapc�J��eZdZdZddgZdZdZdZdZ�fd�Z	�fd	�Z
d
�Z�xZS)�	SoSMacMapa�Mapping store for MAC addresses

    MAC addresses added to this map will be broken into two halves, vendor and
    device like how MAC addresses are normally crafted. For the vendor hextets,
    obfuscation will take the form of 53:4f:53, or 'SOS' in hex. The following
    device hextets will be randomized, for example a MAC address of
    '60:55:cb:4b:c9:27' may be obfuscated into '53:4f:53:79:ac:29' or similar

    This map supports both 48-bit and 64-bit MAC addresses.

    48-bit address may take the form of either:

            MM:MM:MM:SS:SS:SS
            MM-MM-MM-SS-SS-SS

    For 64-bit addresses, the identifier injected by IPv6 standards is
    used in obfuscated returns. These addresses may take either of these forms:

        MM:MM:MM:FF:FE:SS:SS:SS
        MMMM:MMFF:FESS:SSSS

    All mapped mac addresses are converted to lower case.
    Dash delimited styles will be converted to colon-delimited style.
    zff:ff:ff:ff:ff:ffz00:00:00:00:00:00z53:4f:53:%s:%s:%sz53:4f:53:ff:fe:%s:%s:%sz534f:53ff:fe%s:%s%sFc���|jdd�j�jd�j�}tt|�|�S�N�-�:z=.,)�replace�lower�strip�superr�add��self�item�	__class__s  ��>/usr/lib/python3/dist-packages/sos/cleaner/mappings/mac_map.pyrz
SoSMacMap.add5�B����|�|�C��%�+�+�-�3�3�E�:�@�@�B���Y��)�$�/�/�c���|jdd�j�jd�j�}tt|�|�Sr)r
rrr
r�getrs  �rrz
SoSMacMap.get9rrc	���d�g}tdd�D]4}|jdj�fd�td�D����6t|�}t	j
d|�r|j|zSt	j
d|�r|j|zSt	j
d	|�r|j|zSy
)zVRandomize the device hextets, and append those to our 'vendor'
        hextet
        �0123456789abdcefr��c3�H�K�|]}tj�����y�w)N)�random�choice)�.0�x�	hexdigitss  �r�	<genexpr>z*SoSMacMap.sanitize_item.<locals>.<genexpr>Ds�����"N��6�=�=��#;�"N�s�"�z$(([0-9a-fA-F]{2}:){7}[0-9a-fA-F]{2})z&(([0-9a-fA-F]{4}:){3}([0-9a-fA-F]){4})z([0-9a-fA-F][:_]?){12}N)	�range�append�join�tuple�re�match�
mac6_template�mac6_quad_template�mac_template)rr�hextets�ir!s    @r�
sanitize_itemzSoSMacMap.sanitize_item=s����'�	����q�!��	P�A��N�N�2�7�7�"N�U�1�X�"N�N�O�	P���.��
�8�8�:�D�A��%�%��/�/�
�8�8�<�d�C��*�*�W�4�4�
�8�8�,�d�3��$�$�w�.�.�4r)
�__name__�
__module__�__qualname__�__doc__�ignore_matchesr,r*r+�compile_regexesrrr/�
__classcell__)rs@rrrs=����4	���N�
'�L�-�M�.���O�0�0�/rr)rr(�sos.cleaner.mappingsrr�rr�<module>r9s���	�'�>/��>/r

Zerion Mini Shell 1.0