NineSec Team Shell
Server IP : 184.107.3.203  /  Your IP : 216.73.216.51
Web Server : Apache
System : Linux dedicated2.avenfashion.com.ph 4.18.0-553.40.1.el8_10.x86_64 #1 SMP Mon Feb 10 12:11:18 EST 2025 x86_64
User : adminteladeoro ( 1015)
PHP Version : 8.2.28
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/lib/python3.6/site-packages/sos/report/plugins/__pycache__/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/lib/python3.6/site-packages/sos/report/plugins/__pycache__/ebpf.cpython-36.pyc
3

~�gq�@s2ddlZddlmZmZmZGdd�dee�ZdS)�N)�Plugin�IndependentPlugin�	PluginOptc@sFeZdZdZdZdZdZedded	d
�gZ	dd�Z
d
d�Zdd�ZdS)�Ebpfz	eBPF toolZebpf�system�kernel�network�bpftool�
namespacesNz0Number of namespaces to collect, 0 for unlimited)�defaultZval_typeZdesccCstg}ytj|�}Wn0tk
rB}z|jd|���|Sd}~XnXx*t|�D]\}}d|krN|j|d�qNW|S)z! Collect the list of program IDs z"Couldn't parse bpftool prog list: N�id)�json�loads�	Exception�	_log_info�	enumerate�append)�selfZ	prog_json�outZ	prog_data�err�_�item�r�/usr/lib/python3.6/ebpf.py�get_bpftool_prog_idsszEbpf.get_bpftool_prog_idscCstg}ytj|�}Wn0tk
rB}z|jd|���|Sd}~XnXx*t|�D]\}}d|krN|j|d�qNW|S)z Collect the list of mapIDs z"Could not parse bpftool map list: Nr)r
rrrrr)rZmap_jsonrZmap_datarrrrrr�get_bpftool_map_ids&szEbpf.get_bpftool_map_idsc
Cs�|jd�}x:|j|d�D](}x"dD]}|jd|�d|���q$WqW|jd�}x&|j|d�D]}|jd|���q`W|jd	d
ddd
g�d}|jd�}x.|j|d�D]}||d}	|j|	d�q�WdS)Nzbpftool -j prog list�output�xlated�jitedzbpftool prog dump z id zbpftool -j map listzbpftool map dump id zbpftool prog listzbpftool map listzbpftool cgroup treezbpftool net listzbpftool struct_ops dumpzip netns exec r
)Zns_max� )rr)Zcollect_cmd_outputrZadd_cmd_outputrZ
get_optionZget_network_namespaces)
rZprogsZprog_idZdumpcmd�mapsZmap_idZ
cmd_prefixZnsps�	namespaceZ
ns_cmd_prefixrrr�setup3s$



z
Ebpf.setup)rrr)r	)
�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesZcommandsr�intZoption_listrrr"rrrrr
s


r)r
Zsos.report.pluginsrrrrrrrr�<module>	s

NineSec Team - 2022