diff options
Diffstat (limited to 'scripts/firewall/vyatta-show-firewall.pl')
-rwxr-xr-x | scripts/firewall/vyatta-show-firewall.pl | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/firewall/vyatta-show-firewall.pl b/scripts/firewall/vyatta-show-firewall.pl index f4a161a..2de9061 100755 --- a/scripts/firewall/vyatta-show-firewall.pl +++ b/scripts/firewall/vyatta-show-firewall.pl @@ -89,6 +89,12 @@ my %description_hash = ( 'name' => 'IPv4', 'ipv6-modify' => 'IPv6 Modify'); +# mapping from config node to IP version string. +my %ip_version_hash = ( 'name' => 'ipv4', + 'ipv6-name' => 'ipv6', + 'modify' => 'ipv4', + 'ipv6-modify' => 'ipv6'); + sub show_chain($$$) { my ($chain, $fh, $tree) = @_; @@ -121,6 +127,7 @@ sub show_chain($$$) { my $bytes = shift @stats; my $rule = new Vyatta::IpTables::Rule; $rule->setupOrig("firewall $tree $chain rule $_"); + $rule->set_ip_version($ip_version_hash{$tree}); my $ipt_rules = $rule->get_num_ipt_rules(); splice(@stats, 0, (($ipt_rules - 1) * 2)); @@ -145,6 +152,7 @@ sub show_chain($$$) { print $fh " <bytes>$bytes</bytes>\n"; my $rule = new Vyatta::IpTables::Rule; $rule->setupDummy(); + $rule->set_ip_version($ip_version_hash{$tree}); $rule->outputXml($fh); print $fh " </row>\n"; } |