diff options
author | Stig Thormodsrud <stig@io.vyatta.com> | 2009-02-13 14:16:41 -0800 |
---|---|---|
committer | Stig Thormodsrud <stig@io.vyatta.com> | 2009-02-13 14:16:41 -0800 |
commit | de14ea1af63db350e7174f75c9ace4fb13ded6bd (patch) | |
tree | 345fc0bfb1c6d05316bf5ad65f9d2b565ffebeab /lib/Vyatta/IpTables/IpSet.pm | |
parent | 46bd9ea2b372a4668cec4f098af3c606cd3302ac (diff) | |
download | vyatta-cfg-firewall-de14ea1af63db350e7174f75c9ace4fb13ded6bd.tar.gz vyatta-cfg-firewall-de14ea1af63db350e7174f75c9ace4fb13ded6bd.zip |
Add support for "show firewall group".
Diffstat (limited to 'lib/Vyatta/IpTables/IpSet.pm')
-rwxr-xr-x | lib/Vyatta/IpTables/IpSet.pm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Vyatta/IpTables/IpSet.pm b/lib/Vyatta/IpTables/IpSet.pm index a806f20..e38e731 100755 --- a/lib/Vyatta/IpTables/IpSet.pm +++ b/lib/Vyatta/IpTables/IpSet.pm @@ -102,6 +102,20 @@ sub get_type { return $self->{_type}; } +sub get_members { + my ($self) = @_; + + my @members = (); + if (! defined $self->{_type}) { + return @members if ! $self->exists(); + } + my @lines = `ipset -L $self->{_name} -n`; + foreach my $line (@lines) { + push @members, $line if $line =~ /^\d/; + } + return @members; +} + sub create { my ($self) = @_; |