PATH:
opt
/
imunify360
/
venv
/
lib
/
python3.11
/
site-packages
/
im360
/
internals
/
core
/
firewall
/
__pycache__
� ��i$ � �T � d dl Z d dlmZ d dlmZmZ d dlmZ d dlm Z d dl mZmZ d dl mZmZ dd lmZmZmZmZmZ dd lmZ eedf Z ed�� � d � � � Z e� � defd�� � Zdefd�Z ed�� � d� � � Zdedefd�Z G d� d� � Z dS )� N)� lru_cache)�AbstractSet�Tuple)� subprocess)�LooseVersion)�Firewall�UnifiedAccessLogger)�IP� IPVersion� )�_find_executable�get_ip6tables_exe�get_ip6tables_restore_exe�get_iptables_exe�get_iptables_restore_exe)�Iptables.)�maxsizec �� � t � � dg} t j | t j �� � }|� � � � d� � \ }}|� � � S )Nz-V)�stderr�v)r r �check_output�PIPE�decode�split�strip)�cmd�out�_�vstrings �[/opt/imunify360/venv/lib/python3.11/site-packages/im360/internals/core/firewall/__init__.py�iptables_versionr! sV � ����t� $�C� � !�#�j�o� >� >� >�C������#�#�C�(�(�J�A�w��=�=�?�?�� � ip_versionc �d � | t j k rdS t � � t d� � k S )z�ip6tables nat table correctly works only with kernel version >= 3.8 and iptables version >= 1.4.18 https://sector7g.be/posts/ipv6-nat-pre-routing-with-iptables Tz1.4.18)r �V4r! r �r# s r �is_nat_availabler'