summaryrefslogtreecommitdiff
path: root/lib/Vyatta/IpTables
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2011-03-04 19:09:20 -0800
committerAn-Cheng Huang <ancheng@vyatta.com>2011-03-04 19:09:20 -0800
commit4148f9d04c01f8f75b1aadaf1b5f297ded264376 (patch)
tree2568955b7bc8257994e3384660a3b35d6f5ef343 /lib/Vyatta/IpTables
parent585d106c0ae7a65699f96b5a3c0c9056a60b358d (diff)
downloadvyatta-cfg-firewall-4148f9d04c01f8f75b1aadaf1b5f297ded264376.tar.gz
vyatta-cfg-firewall-4148f9d04c01f8f75b1aadaf1b5f297ded264376.zip
changes for ipset 6.0
Diffstat (limited to 'lib/Vyatta/IpTables')
-rwxr-xr-xlib/Vyatta/IpTables/IpSet.pm16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Vyatta/IpTables/IpSet.pm b/lib/Vyatta/IpTables/IpSet.pm
index 894bb84..703a3ac 100755
--- a/lib/Vyatta/IpTables/IpSet.pm
+++ b/lib/Vyatta/IpTables/IpSet.pm
@@ -41,9 +41,9 @@ my %fields = (
);
my %grouptype_hash = (
- 'address' => 'iphash',
- 'network' => 'nethash',
- 'port' => 'portmap'
+ 'address' => 'hash:ip',
+ 'network' => 'hash:net',
+ 'port' => 'bitmap:port'
);
my $logger = 'logger -t IpSet.pm -p local0.warn --';
@@ -95,7 +95,7 @@ sub exists {
return 1 if defined $self->{_exists};
return 0 if ! defined $self->{_name};
- my $cmd = "ipset -n -L $self->{_name} > /dev/null 2>&1";
+ my $cmd = "ipset -L $self->{_name} > /dev/null 2>&1";
my $rc = $self->run_cmd($cmd);
if ($rc eq 0) {
$self->{_exists} = 1;
@@ -109,10 +109,10 @@ sub get_type {
return $self->{_type} if defined $self->{_type};
return if ! $self->exists();
- my @lines = `ipset -n -L $self->{_name}`;
+ my @lines = `ipset -L $self->{_name}`;
my $type;
foreach my $line (@lines) {
- if ($line =~ /^Type:\s+(\w+)$/) {
+ if ($line =~ /^Type:\s+([\w:]+)$/) {
$type = $1;
last;
}
@@ -160,7 +160,7 @@ sub get_members {
my @members = ();
return @members if ! $self->exists();
- my @lines = `ipset -n -L $self->{_name} -s`;
+ my @lines = `ipset -L $self->{_name} -s`;
foreach my $line (@lines) {
push @members, $line if $line =~ /^\d/;
}
@@ -194,7 +194,7 @@ sub references {
my ($self) = @_;
return 0 if ! $self->exists();
- my @lines = `ipset -n -L $self->{_name}`;
+ my @lines = `ipset -L $self->{_name}`;
foreach my $line (@lines) {
if ($line =~ /^References:\s+(\d+)$/) {
return $1;