File: //opt/alt/python311/lib/python3.11/site-packages/pyroute2/bsd/__pycache__/util.cpython-311.pyc
�
�;f� � � � d Z ddlZddlZddlZ G d� de� � Z G d� de� � Z G d� de� � Z G d � d
e� � ZdS )z�
Utility to parse ifconfig, netstat etc.
PF_ROUTE may be effectively used only to get notifications. To fetch
info from the system we have to use ioctl or external utilities.
Maybe some day it will be ioctl. For now it's ifconfig and netstat.
� Nc �$ � e Zd ZddgZdd�Zd� ZdS )�CMD�unamez-sNc � � |� || _ d S d S �N)�cmd)�selfr s �D/opt/alt/python311/lib/python3.11/site-packages/pyroute2/bsd/util.py�__init__zCMD.__init__ s � ��?��D�H�H�H� �?� c �. � dx}} t j | j t j �� � }|� � � \ }}n$# t
$ r |� � � Y nw xY w|� � � n# |� � � w xY w|S )z0
Run the command and get stdout
� )�stdout)�
subprocess�Popenr �PIPE�communicate� Exception�kill�wait)r r �stderr�processs r
�runzCMD.run s� � � ���� � �&�t�x�
��H�H�H�G�&�2�2�4�4��V�V�V��� � � ��L�L�N�N�N�N�N� ����
�L�L�N�N�N�N��G�L�L�N�N�N�N�����
s) �<A �A<