HEX
Server: Apache
System: Linux ns517114.ip-158-69-26.net 6.12.0-124.55.3.el10_1.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:54:02 EDT 2026 x86_64
User: urgentelectrical (1063)
PHP: 8.2.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib64/python3.12/site-packages/setools/diff/__pycache__/portcon.cpython-312.opt-1.pyc
�

���i�
���ddlmZddlmZmZddlmZddlmZddl	m
Z
mZmZedd�	�Gd
�de��Z
Gd�d
e
�ZGd�dee�Zy)�)�	dataclass�)�Context�Portcon�)�ContextWrapper)�DiffResultDescriptor)�
Difference�DifferenceResult�WrapperT)�frozen�orderc�0�eZdZUdZeed<eed<eed<y)�ModifiedPortconz*Difference details for a modified portcon.�rule�
added_context�removed_contextN)�__name__�
__module__�__qualname__�__doc__r�__annotations__r���;/usr/lib64/python3.12/site-packages/setools/diff/portcon.pyrrs��5�
�M����rrc�b�eZdZdZdd�Zeee�Zeee�Zee	e�Z
dd�Zy)�PortconsDifferencez:Determine the difference in portcons between two policies.Nc�6�|jjd|j�d|j���|j	d�|jj�D�d�|jj�D��\|_|_}tt�|_
|D]k\}}t|j�t|j�k7s�2|jjt||j|j���my)z9Generate the difference in portcons between the policies.z$Generating portcon differences from z to c3�2K�|]}t|����y�w�N��PortconWrapper��.0�ns  r�	<genexpr>z3PortconsDifference.diff_portcons.<locals>.<genexpr>#s����D�(C�1�^�A�
�(C���c3�2K�|]}t|����y�wr r!r#s  rr&z3PortconsDifference.diff_portcons.<locals>.<genexpr>$s����E�(D�1�^�A�
�(D�r'N)�log�info�left_policy�right_policy�	_set_diff�portcons�added_portcons�removed_portcons�listr�modified_portconsr�context�append)�self�matched_portcons�left_portcon�
right_portcons    r�
diff_portconsz PortconsDifference.diff_portconss���	
���
�
�2�4�3C�3C�2D�D��IZ�IZ�H[�\�	^�HL�~�~�D��(8�(8�(A�(A�(C�D�E��(9�(9�(B�(B�(D�E�HG�D���T�2�4D�"&�o�!6�!8���+;�'�L�-��l�2�2�3�~�m�F[�F[�7\�\��&�&�-�-�o�l�>K�>S�>S�>J�>R�>R�/T�U�	,<rc�F�|jjd�|`|`|`y)z%Reset diff results on policy changes.zResetting portcon differencesN)r)�debugr/r0r2�r5s r�_reset_diffzPortconsDifference._reset_diff7s%�������6�7����!��"r)�returnN)rrrrr9r	rr/r0rr2r=rrrrrsJ��D�U�(3�)�'�2�=�A�N�4�+�G�4�]�C��=�,�_�=�m�L��
#rrc�6�eZdZdZdZdeddfd�Zd�Zd�Zd	�Z	y)
r"z*Wrap portcon statements for diff purposes.��protocol�low�high�oconr>Nc���||_|j|_|jj|jjc|_|_t|�|_yr )�originrA�portsrBrC�hash�key)r5rDs  r�__init__zPortconWrapper.__init__Es?������
�
��
�"�j�j�n�n�d�j�j�o�o����$�)���:��rc��|jSr )rIr<s r�__hash__zPortconWrapper.__hash__Ks���x�x�rc�4�|j|jkSr )rF�r5�others  r�__lt__zPortconWrapper.__lt__Ns���{�{�U�\�\�)�)rc��|j|jk(xr4|j|jk(xr|j|jk(Sr r@rNs  r�__eq__zPortconWrapper.__eq__QsA���}�}����.�$��H�H��	�	�!�$��I�I����#�	$r)
rrrr�	__slots__rrJrLrPrRrrrr"r"?s,��4�+�I��W�����*�$rr"N)�dataclassesr�	policyreprrr3r�descriptorsr	�
differencer
rrrrr"rrr�<module>rXsZ��
"�(�#�-�=�=��$�d�#��&��$��$#��$#�N$�W�W�%�$r