summaryrefslogtreecommitdiff
path: root/lib/Vyatta/Zone.pm
diff options
context:
space:
mode:
authorMohit Mehta <mohit.mehta@vyatta.com>2009-04-16 17:35:25 -0700
committerMohit Mehta <mohit.mehta@vyatta.com>2009-04-16 17:35:25 -0700
commit3e34cfa3e5ce621aadb506a93c4cc543fab0d95a (patch)
tree28e586439c7009cf25fc5f85178403a745e255d8 /lib/Vyatta/Zone.pm
parent8a2b843545cfd0b105aab24341cf77cc7a05cfcc (diff)
downloadvyatta-cfg-3e34cfa3e5ce621aadb506a93c4cc543fab0d95a.tar.gz
vyatta-cfg-3e34cfa3e5ce621aadb506a93c4cc543fab0d95a.zip
add function to get zone default-policy
remove extraneous arguments in function definition
Diffstat (limited to 'lib/Vyatta/Zone.pm')
-rwxr-xr-xlib/Vyatta/Zone.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Vyatta/Zone.pm b/lib/Vyatta/Zone.pm
index 17182be..ed55e42 100755
--- a/lib/Vyatta/Zone.pm
+++ b/lib/Vyatta/Zone.pm
@@ -74,8 +74,14 @@ sub is_local_zone {
return $config->$value_func("zone-policy zone $zone_name local-zone");
}
+sub get_zone_default_policy {
+ my ($value_func, $zone_name) = @_;
+ my $config = new Vyatta::Config;
+ return $config->$value_func("zone-policy zone $zone_name default-policy");
+}
+
sub rule_exists {
- my ($command, $table, $tree, $chain_name, $target, $interface) = @_;
+ my ($command, $table, $chain_name, $target, $interface) = @_;
my $cmd =
"sudo $command -t $table -L " .
"$chain_name -v 2>/dev/null | grep \" $target \" ";
@@ -104,7 +110,7 @@ sub get_zone_chain {
}
sub count_iptables_rules {
- my ($command, $table,$type, $chain) = @_;
+ my ($command, $table, $chain) = @_;
my @lines = `sudo $command -t $table -L $chain -n --line`;
my $cnt = 0;
foreach my $line (@lines) {