U
    -_g~	                     @   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)ZnetworkZcluster)zconntrack-toolsr   Z
conntrackd
namespacesNz0Number of namespaces to collect, 0 for unlimited)defaultZval_typeZdescc              
   C   s   |  d | dddddddd	g t| d
ddddgddid}| jddg|d d}| d}| j|dD ],}|| d }| |d  | |d  qld S )Nz/etc/conntrackd/conntrackd.confzconntrackd -s networkzconntrackd -s cachezconntrackd -s runtimezconntrackd -s linkzconntrackd -s rsqueuezconntrackd -s queuezconntrackd -s ctzconntrackd -s expectZnf_conntrackZnf_conntrack_netlinkZnf_defrag_ipv4Znf_defrag_ipv6Z	nfnetlinkkmodsall)r
   Zrequiredzconntrack -L -o extendedzconntrack -S)Zpredzip netns exec r   )Zns_max )Zadd_copy_specZadd_cmd_outputr   Z
get_optionZget_network_namespaces)selfZct_predZ
cmd_prefixZnsps	namespaceZns_cmd_prefix r   >/usr/lib/python3/dist-packages/sos/report/plugins/conntrack.pysetup   s@    

zConntrack.setup)__name__
__module____qualname__Z
short_descZplugin_nameZprofilesZpackagesr   intZoption_listr   r   r   r   r   r      s   r   N)Zsos.report.pluginsr   r   r   r   r   r   r   r   r   <module>
   s   