HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //lib64/python3.9/site-packages/setools/diff/__pycache__/netifcon.cpython-39.pyc
a

q�qe7�@s�ddlmZmZddlmZmZddlmZddlm	Z	ddl
mZmZGdd	�d	e�Z
Gd
d�de�ZGdd
�d
ee�ZdS)�)�
NamedTuple�Optional�)�Context�Netifcon�)�ContextWrapper)�DiffResultDescriptor)�
Difference�Wrapperc@sJeZdZUdZeed<eeed<eeed<eeed<eeed<dS)�ModifiedNetifconz+Difference details for a modified netifcon.Zrule�
added_context�removed_context�added_packet�removed_packetN)�__name__�
__module__�__qualname__�__doc__r�__annotations__rr�rr�;/usr/lib64/python3.9/site-packages/setools/diff/netifcon.pyrs
rc@sDeZdZdZed�Zed�Zed�Zdd�dd�Zdd�dd�Z	dS)	�NetifconsDifferencez;Determine the difference in netifcons between two policies.�diff_netifconsN)�returnc	Cs�|j�d�|��|�dd�|j��D�dd�|j��D��\|_|_}g|_	|D]|\}}t
|j�t
|j�kr||j}|j}nd}d}t
|j�t
|j�kr�|j}|j}nd}d}|s�|rR|j	�
t|||||��qRdS)z:Generate the difference in netifcons between the policies.zHGenerating netifcon differences from {0.left_policy} to {0.right_policy}css|]}t|�VqdS�N��NetifconWrapper��.0�nrrr�	<genexpr>(�z5NetifconsDifference.diff_netifcons.<locals>.<genexpr>css|]}t|�VqdSrrrrrrr!)r"N)�log�info�formatZ	_set_diffZleft_policyZ	netifconsZright_policy�added_netifcons�removed_netifcons�modified_netifconsr�contextZpacket�appendr)�selfZmatched_netifconsZ
left_netifconZright_netifconrr
rrrrrr!s.
��
�z"NetifconsDifference.diff_netifconscCs"|j�d�d|_d|_d|_dS)z%Reset diff results on policy changes.zResetting netifcon differencesN)r#�debugr&r'r(�r+rrr�_reset_diffFszNetifconsDifference._reset_diff)
rrrrr	r&r'r(rr.rrrrrs%rc@s<eZdZdZdZedd�dd�Zdd�Zd	d
�Zdd�Z	dS)
rz+Wrap netifcon statements for diff purposes.�netifN)�oconrcCs||_|j|_t|�|_dSr)�originr/�hash�key)r+r0rrr�__init__TszNetifconWrapper.__init__cCs|jSr)r3r-rrr�__hash__YszNetifconWrapper.__hash__cCs|j|jkSr�r/�r+�otherrrr�__lt__\szNetifconWrapper.__lt__cCs|j|jkSrr6r7rrr�__eq___szNetifconWrapper.__eq__)
rrrr�	__slots__rr4r5r9r:rrrrrNsrN)�typingrrZ	policyreprrr)rZdescriptorsr	�
differencer
rrrrrrrr�<module>s5