summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-03-26 15:18:56 +0000
committerOlivier Blin <oblin@mandriva.com>2008-03-26 15:18:56 +0000
commitcbbe8f594f43927b7e9ebe66863033122da50e4b (patch)
tree41f67f910d08db8cabc305a2e57e2303fc5b6de3 /lib
parent1c5183aed8dd13fcc6ad4c3d8772ed4e8c4eee01 (diff)
downloaddrakx-net-cbbe8f594f43927b7e9ebe66863033122da50e4b.tar
drakx-net-cbbe8f594f43927b7e9ebe66863033122da50e4b.tar.gz
drakx-net-cbbe8f594f43927b7e9ebe66863033122da50e4b.tar.bz2
drakx-net-cbbe8f594f43927b7e9ebe66863033122da50e4b.tar.xz
drakx-net-cbbe8f594f43927b7e9ebe66863033122da50e4b.zip
add set_redirected_ports helper (for drakguard)
Diffstat (limited to 'lib')
-rw-r--r--lib/network/shorewall.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/network/shorewall.pm b/lib/network/shorewall.pm
index d0daca4..136656c 100644
--- a/lib/network/shorewall.pm
+++ b/lib/network/shorewall.pm
@@ -209,6 +209,17 @@ What do you want to do?"),
}
}
+sub set_redirected_ports {
+ my ($conf, $proto, $dest, @ports) = @_;
+ if (@ports) {
+ $conf->{redirects}{$proto}{$_} = $dest foreach @ports;
+ } else {
+ my $r = $conf->{redirects}{$proto};
+ @ports = grep { $r->{$_} eq $dest } keys %$r;
+ delete $r->{$_} foreach @ports;
+ }
+}
+
sub update_interfaces_list {
my ($o_intf) = @_;
$o_intf && member($o_intf, map { $_->[1] } get_config_file('interfaces')) and return;