0x1949 Team - FAZEMRX - MANAGER
Edit File: util.cpython-310.pyc
o MH�d%~ � @ sF d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl Z ddl Z ddlZddlZddl Z ddlZddlZddlmZ ddlmZmZ dZdZg d�Zg d�Zd d gZdd� Zd d� Zdd� Zdd� Zdd� Zdhdd�Zdd� Z dd� Z!dd� Z"dd� Z#did!d"�Z$d#d$� Z%d%d&� Z&d'd(� Z'did)d*�Z(d+d,� Z)ej*d fd-d.�Z+d/d0� Z,d1d2� Z-d3d4� Z.d5d6� Z/e �0� fd7d8�Z1e �0� fd9d:�Z2d;d<� Z3d=d>� Z4d?d@� Z5dAdB� Z6dCdD� Z7dEdF� Z8dGdH� Z9dIdJ� Z:djdKdL�Z;dkdMdN�Z<dOdP� Z=dldQdR�Z>dSdT� Z?dUdV� Z@dWdX� ZAdYdZ� ZBd[d\� ZCd]d^� ZDd_d`� ZEdadb� ZFdmddde�ZGdfdg� ZHdS )nz"util.py: utility functions for ufw� )�print_functionN)�reduce)�mkstemp�mktempF)�tcp�udp�ipv6�esp�ah�igmp�gre)r r r r r r r c C s� d}zt �| � W n ty � w z t �| d� d}W n ty% Y nw zt �| d� |dkr6d}W |S d}W |S tyD Y |S w )z8Get the protocol for a specified port from /etc/services� r r �any)�socket� getservbyname� Exception)�port�proto� r �*/usr/lib/python3/dist-packages/ufw/util.py�get_services_proto. s. �����r c C s� d}d}| � d�}t|�dkr|d }d}||fS t|�dkr9|d }|d }|tv r5td| �}t|��||fS td�}t|��) zParse port or port and protocolr �/� r r � zInvalid port with protocol '%s'zBad port)�split�len�portless_protocols�_� ValueError)�p_strr r �tmp�err_msgr r r �parse_port_protoH s ��r"