summaryrefslogtreecommitdiff
path: root/lib/Vyatta
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Vyatta')
-rwxr-xr-xlib/Vyatta/IpTables/IpSet.pm14
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) = @_;