summaryrefslogtreecommitdiff
path: root/scripts/keepalived/VyattaKeepalived.pm
diff options
context:
space:
mode:
authorrbalocca <rbalocca@fugazi.vyatta.com>2007-12-18 14:18:21 -0800
committerrbalocca <rbalocca@fugazi.vyatta.com>2007-12-18 14:18:21 -0800
commit7a4610e0fb11946ba40ac1fe1eafbddd39a15e48 (patch)
tree7f9dace2de1c4881b2cbbaa7e36fbf61c74bf8eb /scripts/keepalived/VyattaKeepalived.pm
parent94fbe9b07d0f556fcd2d9bcb3b7e00a1fb2df16b (diff)
parentc30fc4752c878c12255101aa928c64f7a3511020 (diff)
downloadvyatta-cfg-quagga-7a4610e0fb11946ba40ac1fe1eafbddd39a15e48.tar.gz
vyatta-cfg-quagga-7a4610e0fb11946ba40ac1fe1eafbddd39a15e48.zip
Merge branch 'master' into glendale
Diffstat (limited to 'scripts/keepalived/VyattaKeepalived.pm')
-rwxr-xr-xscripts/keepalived/VyattaKeepalived.pm17
1 files changed, 14 insertions, 3 deletions
diff --git a/scripts/keepalived/VyattaKeepalived.pm b/scripts/keepalived/VyattaKeepalived.pm
index c2d446e4..e0e84af3 100755
--- a/scripts/keepalived/VyattaKeepalived.pm
+++ b/scripts/keepalived/VyattaKeepalived.pm
@@ -129,6 +129,17 @@ sub get_state_files {
return @state_files;
}
+sub get_vips_per_intf {
+ my ($intf) = @_;
+
+ my $config = new VyattaConfig;
+ my @groups = ();
+
+ $config->setLevel("interfaces ethernet $intf vrrp vrrp-group");
+ @groups = $config->listOrigNodes();
+ return scalar(@groups);
+}
+
sub vrrp_get_config {
my ($intf, $group) = @_;
@@ -144,8 +155,8 @@ sub vrrp_get_config {
$primary_addr = $1;
}
- $config->setLevel("interfaces ethernet $intf vrrp");
- my $vip = $config->returnOrigValue("virtual-address");
+ $config->setLevel("interfaces ethernet $intf vrrp vrrp-group $group");
+ my @vips = $config->returnOrigValues("virtual-address");
my $priority = $config->returnOrigValue("priority");
if (!defined $priority) {
$priority = 1;
@@ -165,7 +176,7 @@ sub vrrp_get_config {
} else {
$auth_type = uc($auth_type);
}
- return ($primary_addr, $vip, $priority, $preempt, $advert_int, $auth_type);
+ return ($primary_addr, $priority, $preempt, $advert_int, $auth_type, @vips);
}
sub vrrp_state_parse {