HEX
Server: Apache
System: Linux dinesh8189 5.15.98-grsec-sharedvalley-2.lc.el8.x86_64 #1 SMP Thu Mar 9 09:07:30 -03 2023 x86_64
User: cgmgerenciamento1 (814285)
PHP: 8.1.26
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: //usr/lib64/python3.6/site-packages/setools/diff/__pycache__/netifcon.cpython-36.pyc
3

�^��@slddlmZddlmZddlmZddlmZmZedddd	d
dg�Z	Gdd
�d
e�Z
Gdd�de�ZdS)�)�
namedtuple�)�ContextWrapper)�DiffResultDescriptor)�
Difference�WrapperZmodified_netifconZrule�
added_context�removed_context�added_packet�removed_packetc@s8eZdZdZed�Zed�Zed�Zdd�Zdd�Z	dS)�NetifconsDifferencez;Determine the difference in netifcons between two policies.�diff_netifconscCs�|jjdj|��|jdd�|jj�D�dd�|jj�D��\|_|_}g|_	x�|D]|\}}t
|j�t
|j�kr~|j}|j}nd}d}t
|j�t
|j�kr�|j}|j}nd}d}|s�|rT|j	j
t|||||��qTWdS)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�n�r� /usr/lib64/python3.6/netifcon.py�	<genexpr>0sz5NetifconsDifference.diff_netifcons.<locals>.<genexpr>css|]}t|�VqdS)N)r)rrrrrr1sN)�log�info�formatZ	_set_diffZleft_policyZ	netifconsZright_policy�added_netifcons�removed_netifcons�modified_netifconsr�contextZpacket�append�modified_netifcon_record)�selfZmatched_netifconsZ
left_netifconZright_netifconr	rrr
rrrr
)s(
 z"NetifconsDifference.diff_netifconscCs"|jjd�d|_d|_d|_dS)z%Reset diff results on policy changes.zResetting netifcon differencesN)r�debugrrr)rrrr�_reset_diffNszNetifconsDifference._reset_diffN)
�__name__�
__module__�__qualname__�__doc__rrrrr
rrrrrr!s%rc@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)rz+Wrap netifcon statements for diff purposes.�netifcCs||_|j|_t|�|_dS)N)�originr$�hash�key)rZoconrrr�__init__\szNetifconWrapper.__init__cCs|jS)N)r')rrrr�__hash__aszNetifconWrapper.__hash__cCs|j|jkS)N)r$)r�otherrrr�__lt__dszNetifconWrapper.__lt__cCs|j|jkS)N)r$)rr*rrr�__eq__gszNetifconWrapper.__eq__N)	r r!r"r#�	__slots__r(r)r+r,rrrrrVsrN)�collectionsrrrZdescriptorsr�
differencerrrrrrrrr�<module>s5