+
    G%@iC                     2    ^ RI HtHtHt  ! R R]]4      tR# )    )PluginIndependentPluginSoSPredicatec                   P   a  ] tR t^t o RtRtRtR
tRtRt	R t
R tR tR tRtV tR	# )FirewallTablesa  Collects information about local firewall tables, such as iptables,
and nf_tables (via nft). Note that this plugin does _not_ collect firewalld
information, which is handled by a separate plugin.

Collections from this plugin are largely gated byt the presence of relevant
kernel modules - for example,  the plugin will not collect the nf_tables
ruleset if both the `nf_tables` and `nfnetlink` kernel modules are not
currently loaded (unless using the --allow-system-changes option).
zfirewall tablesfirewall_tablesc                v    RV,           pRV,           R,           pV P                  V\        WR.R7      R7       R# )zCollecting iptables rules for a table loads either kernel module
of the table name (for kernel <= 3), or nf_tables (for kernel >= 4).
If neither module is present, the rules must be empty.iptable_ziptables -t  -nvL	nf_tableskmodspredNadd_cmd_outputr   self	tablenamemodnamecmds   &&  D/usr/lib/python3/dist-packages/sos/report/plugins/firewall_tables.pycollect_iptableFirewallTables.collect_iptable   sA    
 y(y(72dK*@A 	 	C    c                v    RV,           pRV,           R,           pV P                  V\        WR.R7      R7       R# )z%Same as function above, but for ipv6 	ip6table_zip6tables -t r   r   r   r   Nr   r   s   &&  r   collect_ip6tableFirewallTables.collect_ip6table*   sA     	)	)G3dK*@A 	 	Cr   c                N    \        V RR.RR/R7      pV P                  RVRR7      # )	zJCollects nftables rulesets with 'nft' commands if the modules
are present r   	nfnetlinkr   all)r   requiredznft -a list rulesetT)r   changes)r   collect_cmd_output)r   nft_preds   & r   collect_nftablesFirewallTables.collect_nftables3   sB    
  '2K&@*15)9; &&'<8/3 ' 5 	5r   c                   V P                  4       pR . R. /pVR,          ^ 8X  d
   VR,          MRpVP                  4        Fq  pVP                  4       R,          p\        V4      ^8X  g   K,  V^ ,          R8X  g   K<  V^,          V9   g   KL  W%^,          ,          P	                  V^,          4       Ks  	  Rp Rp\        VR	R
R7      ;_uu_ 4       pVP                  4       p	RRR4       X	P                  4        F3  p
TR,          ^ 8X  g   K  YR ,          9   g   K"  T P                  T
4       K5  	   Rp\        TR	R
R7      ;_uu_ 4       pTP                  4       p	RRR4       T	P                  4        F3  p
TR,          ^ 8X  g   K  YR,          9   g   K"  T P                  T
4       K5  	  TR,          ^ 8w  g   RTR ,          9   d!   T P                  R\        T RR.R7      R7       TR,          ^ 8w  g   RTR,          9   d!   T P                  R\        T RR.R7      R7       T P                  . RO4       R#   + '       g   i     EL^; i  \         d    Tp	 ELqi ; i  + '       g   i     EL; i  \         d    Tp	 EL i ; i)ipip6statusoutput :r      Ntablezmangle
filter
nat
z/proc/net/ip_tables_namesrzUTF-8)encodingNz/proc/net/ip6_tables_namesfilterziptables -vnxLiptable_filterr   r   r   zip6tables -vnxLip6table_filter)/etc/nftablesz/etc/sysconfig/nftables.confz/etc/nftables.conf)r'   
splitlinessplitlenappendopenreadIOErrorr   r   r   r   add_copy_spec)r   nft_listnft_ip_tables	nft_lineslinewordsdefault_ip_tablesproc_net_ip_tablesifileip_tables_namesr0   proc_net_ip6_tablesipfiles   &            r   setupFirewallTables.setup>   sF   
 ((*r5"-*28*<*AHX&r	((*DJJL%E5zQ58w#6!H-Ah'..uQx8	 + 4	0!<(#@@E"'**, A %//1E!Q&5$4G+G$$U+ 2	0">)3AAV"(++- B %//1E!Q&5%4H+H%%e, 2 H"h-2E&E !$/?.MN    H"h-2F&F!!$/@+.NO   
 	 
 	E A@@ 	0/O	0 BAA 	0/O	0s`   8I
 H6!I
 1I2 	II2 6I	I
 I
 
III/	)I2 /I2 2JJ N)networksystem)r6   )	ip_tables
ip6_tablesr   r!   ebtables)__name__
__module____qualname____firstlineno____doc__
short_descplugin_nameprofilesfileskernel_modsr   r   r'   rJ   __static_attributes____classdictcell__)__classdict__s   @r   r   r      sB      #J#K$HEK	CC	59 9r   r   N)sos.report.pluginsr   r   r   r   rL   r   r   <module>r`      s    I HkV. kr   