summaryrefslogtreecommitdiffstats
path: root/lib/network/invictus.pm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2007-05-25 15:39:46 +0000
committerOlivier Blin <oblin@mandriva.com>2007-05-25 15:39:46 +0000
commit1d37bfdbbe874abd6dcb5563eea19f531de09e1c (patch)
tree74845e43ed8fa59c7aaafd1a87efaa6b0c83c228 /lib/network/invictus.pm
parentc6ba983db7d5a82ee63599e775be0f8211447c72 (diff)
downloaddrakx-net-1d37bfdbbe874abd6dcb5563eea19f531de09e1c.tar
drakx-net-1d37bfdbbe874abd6dcb5563eea19f531de09e1c.tar.gz
drakx-net-1d37bfdbbe874abd6dcb5563eea19f531de09e1c.tar.bz2
drakx-net-1d37bfdbbe874abd6dcb5563eea19f531de09e1c.tar.xz
drakx-net-1d37bfdbbe874abd6dcb5563eea19f531de09e1c.zip
sync with 2007.1 (because of SVN loss)2007.1
Diffstat (limited to 'lib/network/invictus.pm')
-rw-r--r--lib/network/invictus.pm30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/network/invictus.pm b/lib/network/invictus.pm
new file mode 100644
index 0000000..91806d5
--- /dev/null
+++ b/lib/network/invictus.pm
@@ -0,0 +1,30 @@
+package network::invictus;
+
+use MDK::Common;
+
+my $ucarp_d = "/etc/ucarp.d";
+my $ct_sync_config = "/etc/sysconfig/ct_sync";
+
+sub read_config {
+ my ($invictus) = @_;
+ foreach (all($::prefix . $ucarp_d)) {
+ $invictus->{ucarp}{$_} = +{ getVarsFromSh($::prefix . $ucarp_d . '/' . $_) };
+ }
+ $invictus->{ct_sync} = +{ getVarsFromSh($::prefix . $ct_sync_config) };
+ $invictus->{ct_sync}{CMARKBIT} ||= 30;
+}
+
+sub write_config {
+ my ($invictus) = @_;
+ mkdir_p($::prefix . $ucarp_d);
+ foreach (keys %{$invictus->{ucarp}}) {
+ $invictus->{ucarp}{$_}{UPSCRIPT} ||= '/usr/share/invictus-firewall/ucarp-up.sh';
+ $invictus->{ucarp}{$_}{DOWNSCRIPT} ||= '/usr/share/invictus-firewall/ucarp-down.sh';
+ setVarsInShMode($::prefix . $ucarp_d . '/' . $_, 0600, $invictus->{ucarp}{$_},
+ qw(INTERFACE SRCIP VIRTIP VHID PASSWORD TAKEOVER UPSCRIPT DOWNSCRIPT));
+ }
+ setVarsInSh($::prefix . $ct_sync_config, $invictus->{ct_sync},
+ qw(ENABLE INTERFACE CMARKBIT));
+}
+
+1;