summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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';