diff options
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) = @_; |