summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaurav Sinha <gaurav.sinha@vyatta.com>2012-11-17 01:33:33 -0800
committerGaurav Sinha <gaurav.sinha@vyatta.com>2012-11-19 10:25:08 -0800
commit48abdef97b582c8d857fe338d69492f55dfffdf2 (patch)
tree016489c93eb836c76422c20c9ce612de994b466c
parented9540b4a92d2abb6719d36418f3827ac313a59d (diff)
downloadvyatta-cfg-firewall-48abdef97b582c8d857fe338d69492f55dfffdf2.tar.gz
vyatta-cfg-firewall-48abdef97b582c8d857fe338d69492f55dfffdf2.zip
Add show functions for allowed scripts for firewall groups
(cherry picked from commit 8a2bc83dff27b99a6cde3c396936741d96dc915c)
-rwxr-xr-xscripts/firewall/vyatta-ipset.pl28
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/firewall/vyatta-ipset.pl b/scripts/firewall/vyatta-ipset.pl
index 0f8c27e..ddac0b9 100755
--- a/scripts/firewall/vyatta-ipset.pl
+++ b/scripts/firewall/vyatta-ipset.pl
@@ -313,6 +313,30 @@ sub prune_deleted_sets {
exit 0;
}
+sub show_network_groups {
+ my $config = new Vyatta::Config;
+ my @port_groups = $config->listOrigNodes("firewall group network-group");
+ my $group;
+ foreach $group (@port_groups) {
+ print "$group\n";
+ }
+}
+sub show_address_groups {
+ my $config = new Vyatta::Config;
+ my @port_groups = $config->listOrigNodes("firewall group address-group");
+ my $group;
+ foreach $group (@port_groups) {
+ print "$group\n";
+ }
+}
+sub show_port_groups {
+ my $config = new Vyatta::Config;
+ my @port_groups = $config->listOrigNodes("firewall group port-group");
+ my $group;
+ foreach $group (@port_groups) {
+ print "$group\n";
+ }
+}
#
# main
#
@@ -329,6 +353,10 @@ GetOptions("action=s" => \$action,
die "undefined action" if ! defined $action;
my $rc;
+show_port_groups() if $action eq 'show-port-groups';
+show_address_groups() if $action eq 'show-address-groups';
+show_network_groups() if $action eq 'show-network-groups';
+
$rc = ipset_reset($set_name, $set_type) if $action eq 'reset-set';
$rc = ipset_create($set_name, $set_type) if $action eq 'create-set';