o
    O6uf~	  ã                   @   s.   d dl mZmZmZmZ G dd„ deeƒZdS )é    )ÚPluginÚIndependentPluginÚSoSPredicateÚ	PluginOptc                   @   s6   e Zd ZdZdZdZdZeddedd�gZ	d	d
„ Z
dS )Ú	Conntrackz)conntrack - netfilter connection trackingÚ	conntrack)ÚnetworkÚcluster)zconntrack-toolsr   Ú
conntrackdÚ
namespacesNz0Number of namespaces to collect, 0 for unlimited)ÚdefaultÚval_typeÚdescc                 C   sŒ   |   d¡ |  g d¢¡ t| g d¢ddid�}| jddg|d	� d
}|  d¡}| j|d�D ]}|| d }|  |d ¡ |  |d ¡ q-d S )Nz/etc/conntrackd/conntrackd.conf)zconntrackd -s networkzconntrackd -s cachezconntrackd -s runtimezconntrackd -s linkzconntrackd -s rsqueuezconntrackd -s queuezconntrackd -s ctzconntrackd -s expect)Únf_conntrackÚnf_conntrack_netlinkÚnf_defrag_ipv4Únf_defrag_ipv6Ú	nfnetlinkÚkmodsÚall)r   Úrequiredzconntrack -L -o extendedzconntrack -S)Úpredzip netns exec r   )Úns_maxú )Úadd_copy_specÚadd_cmd_outputr   Ú
get_optionÚget_network_namespaces)ÚselfÚct_predÚ
cmd_prefixÚnspsÚ	namespaceÚns_cmd_prefix© r$   ú>/usr/lib/python3/dist-packages/sos/report/plugins/conntrack.pyÚsetup   s&   
úþý
ýzConntrack.setup)Ú__name__Ú
__module__Ú__qualname__Ú
short_descÚplugin_nameÚprofilesÚpackagesr   ÚintÚoption_listr&   r$   r$   r$   r%   r      s    ÿÿr   N)Úsos.report.pluginsr   r   r   r   r   r$   r$   r$   r%   Ú<module>   s   	