Server IP : 172.24.0.40 / Your IP : 216.73.216.10 Web Server : Apache System : Linux dbweb26.ust.edu.ph 4.18.0-513.5.1.el8_9.x86_64 #1 SMP Fri Sep 29 05:21:10 EDT 2023 x86_64 User : apache ( 48) PHP Version : 8.2.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib64/python3.6/site-packages/setools/diff/__pycache__/ |
Upload File : |
3 �^� � @ sl d dl mZ ddlmZ ddlmZ ddlmZmZ edddd d dg�Z G dd � d e�Z G dd� de�ZdS )� )� namedtuple� )�ContextWrapper)�DiffResultDescriptor)� Difference�WrapperZmodified_netifconZrule� added_context�removed_context�added_packet�removed_packetc @ s8 e Zd ZdZed�Zed�Zed�Zdd� Zdd� Z dS )�NetifconsDifferencez;Determine the difference in netifcons between two policies.�diff_netifconsc C s� | j jdj| �� | 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|||||�� qTW dS )z:Generate the difference in netifcons between the policies.zHGenerating netifcon differences from {0.left_policy} to {0.right_policy}c s s | ]}t |�V qd S )N)�NetifconWrapper)�.0�n� r � /usr/lib64/python3.6/netifcon.py� <genexpr>0 s z5NetifconsDifference.diff_netifcons.<locals>.<genexpr>c s s | ]}t |�V qd S )N)r )r r r r r r 1 s N)�log�info�formatZ _set_diffZleft_policyZ netifconsZright_policy�added_netifcons�removed_netifcons�modified_netifconsr �contextZpacket�append�modified_netifcon_record)�selfZmatched_netifconsZ left_netifconZright_netifconr r r r r r r r ) s( z"NetifconsDifference.diff_netifconsc C s"