diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-03-26 15:18:56 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-03-26 15:18:56 +0000 |
commit | cbbe8f594f43927b7e9ebe66863033122da50e4b (patch) | |
tree | 41f67f910d08db8cabc305a2e57e2303fc5b6de3 /lib | |
parent | 1c5183aed8dd13fcc6ad4c3d8772ed4e8c4eee01 (diff) | |
download | drakx-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.pm | 11 |
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; |