* keepalived-1.1.14 released.
* Shinji Tanaka, <stanaka at hatena.ne.jp> extended parsing
framework to support "include" directives. For more
informations and documentation please refer to Shinji
website :
http://misccs.dyndns.org/index.php?keepalived%20include%20patch
* Tobias Klausmann, <klausman at schwarzvogel.de> add error loggin
while parsing configuration file.
* Merged patches from rpmforge.net on Makefile and redhat specfile.
* Create a goodies directory to store nice scripts received from
users. Add Steve Milton (milton AT isomedia.com) arpreset script
to delete a single ARP entry from a CISCO router.
* VRRP : David Woodhouse, <dwmw2 at redhat.com> fixed vrrp_arp
includes.
* VRRP : Pierre-Yves Ritschard, <pyr at spootnik.org> fixed negative
weights in script.
* VRRP : Michael Smith, <msmith at cbnco.com> extended
virtual_ipaddress setting to support Old-style Linux interface
aliases like eth0:1.
* VRRP : Ward Wouts, <ward.wouts at gmail.com> add support to
vrrp_script logging.
+2007-09-13 Alexandre Cassen <acassen@linux-vs.org>
+ * keepalived-1.1.14 released.
+ * Shinji Tanaka, <stanaka at hatena.ne.jp> extended parsing
+ framework to support "include" directives. For more
+ informations and documentation please refer to Shinji
+ website :
+ http://misccs.dyndns.org/index.php?keepalived%20include%20patch
+ * Tobias Klausmann, <klausman at schwarzvogel.de> add error loggin
+ while parsing configuration file.
+ * Merged patches from rpmforge.net on Makefile and redhat specfile.
+ * Create a goodies directory to store nice scripts received from
+ users. Add Steve Milton (milton AT isomedia.com) arpreset script
+ to delete a single ARP entry from a CISCO router.
+ * VRRP : David Woodhouse, <dwmw2 at redhat.com> fixed vrrp_arp
+ includes.
+ * VRRP : Pierre-Yves Ritschard, <pyr at spootnik.org> fixed negative
+ weights in script.
+ * VRRP : Michael Smith, <msmith at cbnco.com> extended
+ virtual_ipaddress setting to support Old-style Linux interface
+ aliases like eth0:1.
+ * VRRP : Ward Wouts, <ward.wouts at gmail.com> add support to
+ vrrp_script logging.
+
2006-10-11 Alexandre Cassen <acassen@linux-vs.org>
* keepalived-1.1.13 released.
* VRRP : Added a new notify script to be launch during vrrp
auth_pass <STRING> # Password string
}
virtual_ipaddress { # VRRP IP addres block
- <IP ADDRESS>/<MASK> brd <IP ADDRESS> dev <STRING> scope <SCOPE>
- <IP ADDRESS>/<MASK> brd <IP ADDRESS> dev <STRING> scope <SCOPE>
+ <IP ADDRESS>/<MASK> brd <IP ADDRESS> dev <STRING> scope <SCOPE> label <LABEL>
+ <IP ADDRESS>/<MASK> brd <IP ADDRESS> dev <STRING> scope <SCOPE> label <LABEL>
...
}
virtual_ipaddress_excluded { # VRRP IP excluded from VRRP
* nowhere
* global
+LABEL is optional and creates a name for the alias. For compatibility with
+"ifconfig", it should be of the form <realdev>:<anytext>, for example
+eth0:1 for an alias on eth0.
+
When a weight is specified in track_interface, instead of setting the vrrp
instance to the FAULT state in case of failure, its priority will be
increased by the weight when the interface is up (for positive weights),
#With the same entries on other machines,\r
#the opposite transition will be occuring.\r
virtual_ipaddress {\r
- <IPADDR>/<MASK> brd <IPADDR> dev <STRING> scope <SCOPE>\r
+ <IPADDR>/<MASK> brd <IPADDR> dev <STRING> scope <SCOPE> label <LABEL>\r
192.168.200.17/24 dev eth1\r
- 192.168.200.18/24 dev eth2\r
+ 192.168.200.18/24 dev eth2 label eth2:1\r
}\r
\r
#VRRP IP excluded from VRRP\r
192.168.200.16
192.168.200.17
192.168.200.18
+
+ # optional label. should be of the form "realdev:sometext" for
+ # compatibility with ifconfig.
+ 192.168.200.18 label eth0:1
}
}
-Alexandre Cassen, <Alexandre.Cassen@wanadoo.fr>
+Alexandre Cassen, <acassen@freebox.fr>
# Makefile.in
#
-# Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+# Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
EXEC = genhash
BIN = ../bin
prefix = @prefix@
exec_prefix = @exec_prefix@
-bindir = @bindir@
+bindir = @bindir@
+mandir = @mandir@
CC = @CC@
STRIP = @STRIP@
LDFLAGS = @LIBS@ @LDFLAGS@
OBJS = main.o sock.o layer4.o http.o ssl.o
-LIB_OBJS = ../lib/timer.o ../lib/scheduler.o \
- ../lib/memory.o ../lib/list.o ../lib/utils.o \
- ../lib/html.o ../lib/signals.o
+LIB_OBJS = ../lib/timer.o ../lib/scheduler.o ../lib/memory.o ../lib/list.o \
+ ../lib/utils.o ../lib/html.o ../lib/signals.o
all: $(BIN)/$(EXEC)
$(STRIP) $(BIN)/$(EXEC)
uninstall:
rm -f $(DESTDIR)$(bindir)/$(EXEC)
- rm -f $(DESTDIR)@mandir@/man/man1/genhash.1
+ rm -f $(DESTDIR)$(mandir)/man/man1/genhash.1
install:
install -d $(DESTDIR)$(bindir)
install -m 755 $(BIN)/$(EXEC) $(DESTDIR)$(bindir)/
- install -d $(DESTDIR)@mandir@/man/man1
- install -m 644 ../doc/man/man1/genhash.1 $(DESTDIR)@mandir@/man/man1
+ install -d $(DESTDIR)$(mandir)/man/man1
+ install -m 644 ../doc/man/man1/genhash.1 $(DESTDIR)$(mandir)/man/man1
mrproper: clean distclean
rm -f config.*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2005 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <errno.h>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2005 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _HTTP_H
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2005 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "layer4.h"
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2005 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _LAYER4_H
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2005 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <signal.h>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2005 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _MAIN_H
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2005 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <string.h>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2005 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _SOCK_H
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2005 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <openssl/err.h>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2005 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _SSL_H
--- /dev/null
+#!/usr/bin/perl -w
+
+###################################################################
+# arpreset 0.2
+# Copyright (C) 2005 Steve Milton (milton AT isomedia.com)
+#
+# Utility for deleting a single ARP entry from a cisco router.
+# Script adapted from description on Cisco tech article.
+# http://www.cisco.com/warp/public/477/SNMP/clear_arp.shtml
+#
+# The Cisco router needs to have a read/write community setup
+# for the utility to work. I recommend using the following
+# IOS commands to setup a restricted community that can only
+# work with the MAC table. You will need ENABLE level access
+# to the router to execute these commands.
+#
+# access-list 50 permit 123.123.123.123
+# access-list 50 permit 123.123.123.124
+# access-list 50 deny any
+# snmp-server view arpchange ipNetToMediaEntry.4 included
+# snmp-server community blahblah view arpchange RW 50
+#
+# Set the access-list permit to the IP addresses of the systems
+# you want to be able to make changes to the MAC table. Set
+# the community name (above blahblah) to something random and
+# password-like.
+###################################################################
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+###################################################################
+
+use strict;
+use Getopt::Long;
+&Getopt::Long::config('auto_abbrev');
+
+my ($router,$community,$address,$help,$check);
+$router=$community=$address=$help=$check="";
+
+my $status = GetOptions("router:s" => \$router,
+ "community:s" => \$community,
+ "address:s" => \$address,
+ "help" => \$help,
+ "check" => \$check);
+
+if (($status == 0) or $help) {
+ &PrintUsage;
+ exit 1;
+}
+
+if (!$router or !$community or !$address) {
+ &PrintUsage;
+ exit 1;
+}
+
+# OID for the ARP table entries
+my $ciscoOID = ".1.3.6.1.2.1.4.22.1.4";
+my $target = "";
+
+# Walk the SNMP ARP table on the router to locate the target address
+open(GET, "/usr/bin/snmpwalk -v1 -c $community $router $ciscoOID |");
+while(<GET>) {
+ if (/^(.*?\.$address)\s/) {
+ $target = $1;
+ print $_;
+ }
+}
+close(GET);
+if ($target and !$check) {
+ print "-- changed to --\n";
+ # set the target address to "invalid"
+ system("/usr/bin/snmpset -v1 -c $community $router $target i 2");
+} elsif (!$check) {
+ print "No target OID located.";
+ exit 1;
+}
+exit;
+
+sub PrintUsage {
+ print "arpreset 0.2\nCopyright (c) 2005 by Steve Milton\narpreset comes with ABSOLUTELY NO WARRANTY\n\n";
+ print "Usage: arpreset --router=routeraddress --community=rwcommunity --address=ipaddress\n";
+ print " arpreset --help\n";
+ print "\nWhere ipaddress is the IP address in the Cisco router that you want to invalidate\nfrom the MAC address cache.\n";
+ print "\nYou can add --check to the command to make it NOT update the router, but check for\nthe entry only.\n";
+ exit;
+}
-Name: keepalived
+# $Id$
+# Authority: dag
+
+# Ugly, but we need headers from a kernel to rebuild against
+%define kernel %(rpm -q kernel-devel --qf '%{RPMTAG_VERSION}-%{RPMTAG_RELEASE}\\n' 2>/dev/null | head -1)
+
Summary: HA monitor built upon LVS, VRRP and services poller
-Packager: Christophe Varoqui, <christophe.varoqui@free.fr>
-Version: @VERSION@
-Release: 1
-Source: http://www.keepalived.org/software/%{name}-%{version}.tar.gz
-Copyright: GPL
+Name: keepalived
+Version: 1.1.13
+Release: 5
+License: GPL
Group: Applications/System
-BuildRoot: /tmp/%{name}-%{version}.build
+URL: http://www.keepalived.org/
+
+Source0: http://www.keepalived.org/software/keepalived-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
-%define _exec_prefix /
+BuildRequires: openssl-devel
+# We need both of these for proper LVS support
+BuildRequires: kernel, kernel-devel
+Requires(post): /sbin/chkconfig
+Requires(preun): /sbin/service, /sbin/chkconfig
+Requires(postun): /sbin/service
%description
-The main goal of the keepalived project is to add a strong & robust keepalive facility to the Linux Virtual Server project. This project is written in C with multilayer TCP/IP stack checks. Keepalived implements a framework based on three family checks : Layer3, Layer4 & Layer5. This framework gives the daemon the ability of checking a LVS server pool states. When one of the server of the LVS server pool is down, keepalived informs the linux kernel via a setsockopt call to remove this server entrie from the LVS topology. In addition keepalived implements a VRRPv2 stack to handle director failover. So in short keepalived is a userspace daemon for LVS cluster nodes healthchecks and LVS directors failover.
+The main goal of the keepalived project is to add a strong & robust keepalive
+facility to the Linux Virtual Server project. This project is written in C with
+multilayer TCP/IP stack checks. Keepalived implements a framework based on
+three family checks : Layer3, Layer4 & Layer5/7. This framework gives the
+daemon the ability to check the state of an LVS server pool. When one of the
+servers of the LVS server pool is down, keepalived informs the linux kernel via
+a setsockopt call to remove this server entry from the LVS topology. In
+addition keepalived implements an independent VRRPv2 stack to handle director
+failover. So in short keepalived is a userspace daemon for LVS cluster nodes
+healthchecks and LVS directors failover.
+
%prep
-rm -rf %{buildroot}
-%setup -q
+%setup
+
%build
-export CFLAGS=-D__KERNGLUE__
-# the setting of mandir should be %{buildroot}/usr/share/man, but the
-# makefile adds "man" itself.
-./configure --prefix=%{buildroot} \
- --exec-prefix=%{buildroot} \
- --sysconfdir=%{buildroot}/etc \
- --with-kernel-dir=/lib/modules/$(uname -r)/build \
- --mandir=%{buildroot}/usr/share \
- --enable-syncd
-make
+%{?el3:export CPPFLAGS="-I/usr/kerberos/include"}
+%{?rh9:export CPPFLAGS="-I/usr/kerberos/include"}
+%configure \
+%{?el3:--includedir="/usr/kerberos/include"} \
+%{?rh9:--includedir="/usr/kerberos/include"} \
+ --with-kernel-dir="/lib/modules/%{kernel}/build"
+%{__make} %{?_smp_mflags} STRIP=/bin/true
+
%install
-rm -rf %{buildroot}
-%makeinstall
-rm -rf %{buildroot}/etc/keepalived/samples
+%{__rm} -rf %{buildroot}
+%{__make} install DESTDIR=%{buildroot}
+# Remove "samples", as we include them in %%doc
+%{__rm} -rf %{buildroot}%{_sysconfdir}/keepalived/samples/
+
+%check
+# A build could silently have LVS support disabled if the kernel includes can't
+# be properly found, we need to avoid that.
+if ! grep -q "IPVS_SUPPORT='_WITH_LVS_'" config.log; then
+ echo "ERROR: We do not want keeepalived lacking LVS support."
+ exit 1
+fi
+
%clean
-rm -rf %{buildroot}
+%{__rm} -rf %{buildroot}
+
%post
/sbin/chkconfig --add keepalived
%preun
-/sbin/chkconfig --del keepalived
+if [ $1 -eq 0 ]; then
+ /sbin/service keepalived stop &>/dev/null || :
+ /sbin/chkconfig --del keepalived
+fi
+
+%postun
+if [ $1 -ge 1 ]; then
+ /sbin/service keepalived condrestart &>/dev/null || :
+fi
+
%files
-%defattr(-,root,root)
+%defattr(-, root, root, 0755)
+%doc AUTHOR ChangeLog CONTRIBUTORS COPYING README TODO
+%doc doc/keepalived.conf.SYNOPSIS doc/samples/
+%dir %{_sysconfdir}/keepalived/
+%attr(0600, root, root) %config(noreplace) %{_sysconfdir}/keepalived/keepalived.conf
+%attr(0600, root, root) %config(noreplace) %{_sysconfdir}/sysconfig/keepalived
+%{_sysconfdir}/rc.d/init.d/keepalived
%{_bindir}/genhash
%{_sbindir}/keepalived
-%{_sysconfdir}/init.d/keepalived
-%dir %{_sysconfdir}/keepalived/
-%config %{_sysconfdir}/keepalived/keepalived.conf
-%doc %{_mandir}/man5/keepalived.conf.5.gz
-%doc %{_mandir}/man1/genhash.1.gz
-%doc %{_mandir}/man8/keepalived.8.gz
-%doc doc
-%doc AUTHOR CONTRIBUTORS TODO COPYING README INSTALL VERSION ChangeLog
+%{_mandir}/man1/genhash.1*
+%{_mandir}/man5/keepalived.conf.5*
+%{_mandir}/man8/keepalived.8*
+
+
+%changelog
+* Thu Sep 13 2007 Alexandre Cassen <acassen@linux-vs.org> 1.1.14
+- Merge work done by freshrpms.net... Thanks guys !!! ;)
+
+* Wed Feb 14 2007 Matthias Saou <http://freshrpms.net/> 1.1.13-5
+- Add missing scriplet requirements.
+
+* Tue Feb 13 2007 Matthias Saou <http://freshrpms.net/> 1.1.13-4
+- Add missing \n to the kernel define, for when multiple kernels are installed.
+- Pass STRIP=/bin/true to "make" in order to get a useful debuginfo package.
+
+* Tue Feb 13 2007 Matthias Saou <http://freshrpms.net/> 1.1.13-3
+- Add %%check section to make sure any build without LVS support will fail.
+
+* Mon Feb 5 2007 Matthias Saou <http://freshrpms.net/> 1.1.13-2
+- Use our own init script, include a sysconfig entry used by it for options.
+
+* Thu Jan 25 2007 Matthias Saou <http://freshrpms.net/> 1.1.13-1
+- Update to 1.1.13.
+- Change mode of configuration file to 0600.
+- Don't include all of "doc" since it meant re-including all man pages.
+- Don't include samples in the main configuration path, they're in %%doc.
+- Include patch to add an optional label to interfaces.
+
+* Sat Apr 08 2006 Dries Verachtert <dries@ulyssis.org> - 1.1.12-1.2
+- Rebuild for Fedora Core 5.
+
+* Sun Mar 12 2006 Dag Wieers <dag@wieers.com> - 1.1.12-1
+- Updated to release 1.1.12.
+
+* Fri Mar 04 2005 Dag Wieers <dag@wieers.com> - 1.1.11-1
+- Updated to release 1.1.11.
+
+* Wed Feb 23 2005 Dag Wieers <dag@wieers.com> - 1.1.10-2
+- Fixed IPVS/LVS support. (Joe Sauer)
+
+* Tue Feb 15 2005 Dag Wieers <dag@wieers.com> - 1.1.10-1
+- Updated to release 1.1.10.
+
+* Mon Feb 07 2005 Dag Wieers <dag@wieers.com> - 1.1.9-1
+- Updated to release 1.1.9.
+
+* Sun Oct 17 2004 Dag Wieers <dag@wieers.com> - 1.1.7-2
+- Fixes to build with kernel IPVS support. (Tim Verhoeven)
+
+* Fri Sep 24 2004 Dag Wieers <dag@wieers.com> - 1.1.7-1
+- Updated to release 1.1.7. (Mathieu Lubrano)
+
+* Mon Feb 23 2004 Dag Wieers <dag@wieers.com> - 1.1.6-0
+- Updated to release 1.1.6.
+
+* Mon Jan 26 2004 Dag Wieers <dag@wieers.com> - 1.1.5-0
+- Updated to release 1.1.5.
+
+* Mon Dec 29 2003 Dag Wieers <dag@wieers.com> - 1.1.4-0
+- Updated to release 1.1.4.
+
+* Fri Jun 06 2003 Dag Wieers <dag@wieers.com> - 1.0.3-0
+- Initial package. (using DAR)
+
exec_prefix = @exec_prefix@
sbindir = @sbindir@
sysconfdir = @sysconfdir@
-init_script = etc/init.d/keepalived.init
-conf_file = etc/keepalived/keepalived.conf
+mandir = @mandir@
+init_dir = $(sysconfdir)/rc.d/init.d
+conf_dir = $(sysconfdir)/keepalived
+sysconf_dir = $(sysconfdir)/sysconfig
CC = @CC@
STRIP = @STRIP@
uninstall:
rm -f $(DESTDIR)$(sbindir)/$(EXEC)
+ rm -f $(DESTDIR)$(init_dir)/keepalived.init
+ rm -f $(DESTDIR)$(sysconf_dir)/keepalived
rm -rf $(DESTDIR)$(sysconfdir)/keepalived
- rm -f $(DESTDIR)$(init_dir)/$(init_script)
- rm -f $(DESTDIR)@mandir@/man/man5/keepalived.conf.5
- rm -f $(DESTDIR)@mandir@/man/man8/keepalived.8
+ rm -f $(DESTDIR)$(mandir)/man/man5/keepalived.conf.5
+ rm -f $(DESTDIR)$(mandir)/man/man8/keepalived.8
install:
install -d $(DESTDIR)$(sbindir)
install -m 700 $(BIN)/$(EXEC) $(DESTDIR)$(sbindir)/
- install -d $(DESTDIR)$(sysconfdir)/init.d
- install -m 755 $(init_script) $(DESTDIR)$(sysconfdir)/init.d/keepalived
+ install -d $(DESTDIR)$(init_dir)
+ install -m 755 etc/init.d/keepalived.init $(DESTDIR)$(init_dir)/keepalived
+ install -d $(DESTDIR)$(sysconf_dir)
+ install -m 755 etc/init.d/keepalived.sysconfig $(DESTDIR)$(sysconf_dir)/keepalived
install -d $(DESTDIR)$(sysconfdir)/keepalived/samples
- install -m 644 $(conf_file) $(DESTDIR)$(sysconfdir)/keepalived/
+ install -m 644 etc/keepalived/keepalived.conf $(DESTDIR)$(sysconfdir)/keepalived/
install -m 644 ../doc/samples/* $(DESTDIR)$(sysconfdir)/keepalived/samples/
- install -d $(DESTDIR)@mandir@/man/man5
- install -d $(DESTDIR)@mandir@/man/man8
- install -m 644 ../doc/man/man5/keepalived.conf.5 $(DESTDIR)@mandir@/man/man5
- install -m 644 ../doc/man/man8/keepalived.8 $(DESTDIR)@mandir@/man/man8
+ install -d $(DESTDIR)$(mandir)/man5
+ install -d $(DESTDIR)$(mandir)/man8
+ install -m 644 ../doc/man/man5/keepalived.conf.5 $(DESTDIR)$(mandir)/man5
+ install -m 644 ../doc/man/man8/keepalived.8 $(DESTDIR)$(mandir)/man8
#
# Keepalived OpenSource project.
#
-# Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+# Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
KERNEL = @KERN@
CC = @CC@
*
* Part: Checkers registration.
*
- * Version: $Id: check_api.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: check_api.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <dirent.h>
*
* Part: Healthcheckrs child process handling.
*
- * Version: $Id: check_daemon.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: check_daemon.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "check_daemon.h"
*
* Part: Healthcheckers dynamic data structure definition.
*
- * Version: $Id: check_data.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: check_data.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "check_data.h"
*
* Part: WEB CHECK. Common HTTP/SSL checker primitives.
*
- * Version: $Id: check_http.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: check_http.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <openssl/err.h>
* Part: MISC CHECK. Perform a system call to run an extra
* system prog or script.
*
- * Version: $Id: check_misc.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: check_misc.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Eric Jarman, <ehj38230@cmsu2.cmsu.edu>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "check_misc.h"
* data structure representation the conf file representing
* the loadbalanced server pool.
*
- * Version: $Id: check_parser.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: check_parser.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "check_parser.h"
*
* Part: SMTP CHECK. Check an SMTP-server.
*
- * Version: $Id: check_smtp.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: check_smtp.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Authors: Jeremy Rumpf, <jrumpf@heavyload.net>
* Alexandre Cassen, <acassen@linux-vs.org>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <ctype.h>
* url, compute a MD5 over this result and match it to the
* expected value.
*
- * Version: $Id: check_ssl.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: check_ssl.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <openssl/err.h>
*
* Part: TCP checker.
*
- * Version: $Id: check_tcp.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: check_tcp.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "check_tcp.h"
* library to add/remove server MASQ rules to the kernel
* firewall framework.
*
- * Version: $Id: ipfwwrapper.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: ipfwwrapper.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "ipfwwrapper.h"
* Part: IPVS Kernel wrapper. Use setsockopt call to add/remove
* server to/from the loadbalanced server pool.
*
- * Version: $Id: ipvswrapper.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: ipvswrapper.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "ipvswrapper.h"
*
* Part: Manipulation functions for IPVS & IPFW wrappers.
*
- * Version: $Id: ipwrapper.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: ipwrapper.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "ipwrapper.h"
#
# Keepalived OpenSource project.
#
-# Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+# Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
CC = @CC@
INCLUDES = -I../include -I../../lib
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <syslog.h>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <syslog.h>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "global_parser.h"
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "layer4.h"
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "main.h"
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "pidfile.h"
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <time.h>
# processname: keepalived
# pidfile: /var/run/keepalived.pid
# config: /etc/keepalived/keepalived.conf
-# chkconfig: 35 21 79
+# chkconfig: - 21 79
# description: Start and stop Keepalived
-# Global definitions
-PID_FILE="/var/run/keepalived.pid"
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Source configuration file (we set KEEPALIVED_OPTIONS there)
+. /etc/sysconfig/keepalived
+
+RETVAL=0
+
+prog="keepalived"
+
+start() {
+ echo -n $"Starting $prog: "
+ daemon keepalived ${KEEPALIVED_OPTIONS}
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
+}
+
+stop() {
+ echo -n $"Stopping $prog: "
+ killproc keepalived
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
+}
+
+reload() {
+ echo -n $"Reloading $prog: "
+ killproc keepalived -1
+ RETVAL=$?
+ echo
+}
# See how we were called.
case "$1" in
- start)
- echo -n "Starting Keepalived for LVS: "
- keepalived -D
- touch /var/lock/subsys/keepalived
- echo
- ;;
- stop)
- echo -n "Shutting down Keepalived for LVS: "
- PID=`cat $PID_FILE`
- kill $PID
- rm -rf /var/lock/subsys/keepalived
- echo
- ;;
- restart)
- echo -n "Shutting down Keepalived for LVS: "
- PID=`cat $PID_FILE`
- kill $PID
- echo
- echo -n "Starting Keepalived for LVS: "
- keepalived -D
- echo
- ;;
- reload)
- echo -n "Reloading Keepalived config: "
- killall -HUP keepalived
- echo
- ;;
- *)
- echo "Usage: $0 {start|stop|restart|reload}"
- exit 1
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ reload)
+ reload
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ condrestart)
+ if [ -f /var/lock/subsys/$prog ]; then
+ stop
+ start
+ fi
+ ;;
+ status)
+ status keepalived
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|reload|restart|condrestart|status}"
+ exit 1
esac
-exit 0
+exit $RETVAL
--- /dev/null
+# Options for keepalived. See `keepalived --help' output and keepalived(8) and
+# keepalived.conf(5) man pages for a list of all options. Here are the most
+# common ones :
+#
+# --vrrp -P Only run with VRRP subsystem.
+# --check -C Only run with Health-checker subsystem.
+# --dont-release-vrrp -V Dont remove VRRP VIPs & VROUTEs on daemon stop.
+# --dont-release-ipvs -I Dont remove IPVS topology on daemon stop.
+# --dump-conf -d Dump the configuration data.
+# --log-detail -D Detailed log messages.
+# --log-facility -S 0-7 Set local syslog facility (default=LOG_DAEMON)
+#
+
+KEEPALIVED_OPTIONS="-D"
+
*
* Part: Checkers arguments structures definitions.
*
- * Version: $Id: check_api.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: check_api.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _CHECK_API_H
*
* Part: check_daemon.c include file.
*
- * Version: $Id: check_daemon.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: check_daemon.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _CHECK_DAEMON_H
*
* Part: Healthcheckers dynamic data structure definition.
*
- * Version: $Id: check_data.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: check_data.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _CHECK_DATA_H
*
* Part: check_http.c include file.
*
- * Version: $Id: check_http.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: check_http.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _CHECK_HTTP_H
*
* Part: check_misc.c include file.
*
- * Version: $Id: check_misc.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: check_misc.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
* Eric Jarman, <ehj38230@cmsu2.cmsu.edu>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _CHECK_MISC_H
*
* Part: check_parser.c include file.
*
- * Version: $Id: check_parser.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: check_parser.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _CHECK_PARSER_H
*
* Part: check_smtp.c include file.
*
- * Version: $Id: check_smtp.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: check_smtp.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
* Jeremy Rumpf, <jrumpf@heavyload.net>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _CHECK_SMTP_H
*
* Part: check_http.c include file.
*
- * Version: $Id: check_http.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: check_http.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _CHECK_SSL_H
*
* Part: check_tcp.c include file.
*
- * Version: $Id: check_tcp.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: check_tcp.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _CHECK_TCP_H
*
* Part: Configuration include file.
*
- * Version: $Id: config.h.in,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: config.h.in,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Jacob Rief, <jacob.rief@tiscover.com>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _CONFIG_H
*
* Part: Daemon process handling.
*
- * Version: $Id: daemon.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: daemon.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _DAEMON_H
*
* Part: Dynamic data structure definition.
*
- * Version: $Id: global_data.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: global_data.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _GLOBAL_DATA_H
*
* Part: vrrp_parser.c include file.
*
- * Version: $Id: global_parser.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: global_parser.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _GLOBAL_PARSER_H
*
* Part: ipfwwrapper.c include file.
*
- * Version: $Id: ipfwwrapper.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: ipfwwrapper.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _IPFWWRAPPER_H
*
* Part: ipvswrapper.c include file.
*
- * Version: $Id: ipvswrapper.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: ipvswrapper.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _IPVSWRAPPER_H
*
* Part: ipwrapper.c include file.
*
- * Version: $Id: ipwrapper.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: ipwrapper.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _IPWRAPPER_H
*
* Part: layer4.c include file.
*
- * Version: $Id: layer4.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: layer4.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _LAYER4_H
*
* Part: Main program include file.
*
- * Version: $Id: main.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: main.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _MAIN_H
*
* Part: pidfile.c include file.
*
- * Version: $Id: pidfile.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: pidfile.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _PIDFILE_H
*
* Part: smtp.c include file.
*
- * Version: $Id: smtp.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: smtp.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _SMTP_H
*
* Part: vrrp.c program include file.
*
- * Version: $Id: vrrp.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_H
*
* Part: vrrp_arp.c include file.
*
- * Version: $Id: vrrp_arp.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_arp.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_ARP_H
*
* Part: vrrp_daemon.c include file.
*
- * Version: $Id: vrrp_daemon.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_daemon.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_DAEMON_H
*
* Part: Dynamic data structure definition.
*
- * Version: $Id: vrrp_data.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_data.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_DATA_H
*
* Part: vrrp_if.c include file.
*
- * Version: $Id: vrrp_if.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_if.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_IF_H
*
* Part: vrrp_index.c include file.
*
- * Version: $Id: vrrp_index.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_index.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_INDEX_H
*
* Part: vrrp_ipaddress.c include file.
*
- * Version: $Id: vrrp_ipaddress.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_ipaddress.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_IPADDR_H
int ifindex; /* Interface index owning IP address */
interface *ifp; /* Interface owning IP address */
int scope; /* the ip address scope */
+ char *label; /* Alias name, e.g. eth0:1 */
int set; /* TRUE if addr is set */
} ip_address;
*
* Part: vrrp_iproute.c include file.
*
- * Version: $Id: vrrp_iproute.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_iproute.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_IPROUTE_H
*
* Part: vrrp_ipsecah.c include file.
*
- * Version: $Id: vrrp_ipsecah.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_ipsecah.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_IPSEC_AH_H
*
* Part: vrrp_netlink.c include file.
*
- * Version: $Id: vrrp_netlink.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_netlink.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_NETLINK_H
*
* Part: vrrp_notify.c include file.
*
- * Version: $Id: vrrp_notify.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_notify.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_NOTIFY_H
*
* Part: vrrp_parser.c include file.
*
- * Version: $Id: vrrp_parser.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_parser.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_PARSER_H
*
* Part: vrrp_scheduler.c include file.
*
- * Version: $Id: vrrp_scheduler.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_scheduler.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_SCHEDULER_H
*
* Part: vrrp_sync.c include file.
*
- * Version: $Id: vrrp_sync.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_sync.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_SYNC_H
*
* Part: vrrp_track.c include file.
*
- * Version: $Id: vrrp_track.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_track.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_TRACK_H
#
# Keepalived OpenSource project.
#
-# Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+# Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
CC = @CC@
INCLUDES = -I../include -I../../lib
* master fails, a backup server takes over.
* The original implementation has been made by jerome etienne.
*
- * Version: $Id: vrrp.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
/* local include */
*
* Part: ARP primitives.
*
- * Version: $Id: vrrp_arp.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_arp.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
-/* system includes */
-#include <linux/if_packet.h>
-
/* local includes */
#include "vrrp_arp.h"
#include "memory.h"
#include "utils.h"
+/* system includes */
+#include <linux/if_packet.h>
+
/* global vars */
char *garp_buffer;
int garp_fd;
*
* Part: VRRP child process handling.
*
- * Version: $Id: vrrp_daemon.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_daemon.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "vrrp_daemon.h"
*
* Part: Dynamic data structure definition.
*
- * Version: $Id: vrrp_data.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_data.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "vrrp_data.h"
*
* Part: Interfaces manipulation.
*
- * Version: $Id: vrrp_if.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_if.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
/* global include */
*
* Part: VRRP instance index table.
*
- * Version: $Id: vrrp_index.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_index.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
/* local include */
*
* Part: NETLINK IPv4 address manipulation.
*
- * Version: $Id: vrrp_ipaddress.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_ipaddress.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
/* local include */
addattr_l(&req.n, sizeof (req), IFA_BROADCAST,
&ipaddr->broadcast, sizeof (ipaddr->broadcast));
+ if (ipaddr->label)
+ addattr_l(&req.n, sizeof (req), IFA_LABEL,
+ ipaddr->label, strlen(ipaddr->label) + 1);
+
if (netlink_talk(&nl_cmd, &req.n) < 0)
status = -1;
return status;
void
free_ipaddress(void *if_data_obj)
{
- FREE(if_data_obj);
+ ip_address *ip_addr = if_data_obj;
+
+ FREE_PTR(ip_addr->label);
+ FREE(ip_addr);
}
void
dump_ipaddress(void *if_data_obj)
{
ip_address *ip_addr = if_data_obj;
- syslog(LOG_INFO, " %s/%d brd %s dev %s scope %s"
+ syslog(LOG_INFO, " %s/%d brd %s dev %s scope %s%s%s"
, inet_ntop2(ip_addr->addr)
, ip_addr->mask
, inet_ntop2(ip_addr->broadcast)
, IF_NAME(if_get_by_ifindex(ip_addr->ifindex))
- , netlink_scope_n2a(ip_addr->scope));
+ , netlink_scope_n2a(ip_addr->scope)
+ , ip_addr->label ? " label " : ""
+ , ip_addr->label ? ip_addr->label : "");
}
void
alloc_ipaddress(list ip_list, vector strvec, interface *ifp)
new->scope = netlink_scope_a2n(VECTOR_SLOT(strvec, ++i));
} else if (!strcmp(str, "broadcast") || !strcmp(str, "brd")) {
inet_ston(VECTOR_SLOT(strvec, ++i), &new->broadcast);
+ } else if (!strcmp(str, "label")) {
+ new->label = MALLOC(IFNAMSIZ);
+ strncpy(new->label, VECTOR_SLOT(strvec, ++i), IFNAMSIZ);
} else {
if (inet_ston(VECTOR_SLOT(strvec, i), &ipaddr)) {
inet_ston(VECTOR_SLOT(strvec, i), &new->addr);
*
* Part: NETLINK IPv4 routes manipulation.
*
- * Version: $Id: vrrp_iproute.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_iproute.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
/* local include */
* authentication data encryption using HMAC MD5 according to
* RFCs 2085 & 2104.
*
- * Version: $Id: vrrp_ipsecah.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_ipsecah.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "vrrp_ipsecah.h"
*
* Part: NETLINK kernel command channel.
*
- * Version: $Id: vrrp_netlink.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_netlink.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
/* global include */
*
* Part: VRRP state transition notification scripts handling.
*
- * Version: $Id: vrrp_notify.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_notify.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
/* system include */
* data structure representation the conf file representing
* the loadbalanced server pool.
*
- * Version: $Id: vrrp_parser.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_parser.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "vrrp_parser.h"
*
* Part: Sheduling framework for vrrp code.
*
- * Version: $Id: vrrp_scheduler.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_scheduler.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "vrrp_scheduler.h"
if (WIFEXITED(wait_status)) {
int status;
status = WEXITSTATUS(wait_status);
+ if (status == 0 && vscript->result != VRRP_SCRIPT_STATUS_GOOD) {
+ syslog(LOG_INFO, "VRRP_Script(%s) succeeded", vscript->sname);
+ }
+ if (status != 0 && vscript->result != VRRP_SCRIPT_STATUS_NONE) {
+ syslog(LOG_INFO, "VRRP_Script(%s) failed", vscript->sname);
+ }
vscript->result = (status == 0) ? VRRP_SCRIPT_STATUS_GOOD :
VRRP_SCRIPT_STATUS_NONE;
}
*
* Part: VRRP synchronization framework.
*
- * Version: $Id: vrrp_sync.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_sync.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "vrrp_sync.h"
*
* Part: Interface tracking framework.
*
- * Version: $Id: vrrp_track.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vrrp_track.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
/* local include */
tsc = (tracked_sc *) MALLOC(sizeof (tracked_sc));
tsc->scr = vsc;
tsc->weight = weight;
- if (weight > 0)
+ if (weight != 0)
vsc->inuse++;
list_add(track_list, tsc);
}
#
# Keepalived OpenSource project.
#
-# Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+# Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
CC = @CC@
INCLUDES = -I.
*
* Part: HTML stream parser utility functions.
*
- * Version: $Id: html.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: html.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <string.h>
*
* Part: parser.c include file.
*
- * Version: $Id: html.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: html.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _HTML_H
*
* Part: List structure manipulation.
*
- * Version: $Id: list.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: list.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "list.h"
*
* Part: list.c include file.
*
- * Version: $Id: list.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: list.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _LIST_H
* Part: Memory management framework. This framework is used to
* find any memory leak.
*
- * Version: $Id: memory.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: memory.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "memory.h"
*
* Part: memory.c include file.
*
- * Version: $Id: memory.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: memory.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _MEMORY_H
*
* Part: Forked system call to launch an extra script.
*
- * Version: $Id: notify.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: notify.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <unistd.h>
*
* Part: notify.c include file.
*
- * Version: $Id: notify.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: notify.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _NOTIFY_H
* data structure representation the conf file representing
* the loadbalanced server pool.
*
- * Version: $Id: parser.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: parser.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
+#include <glob.h>
+#include <unistd.h>
+#include <libgen.h>
+#include <errno.h>
#include "parser.h"
#include "memory.h"
/* global vars */
vector keywords;
-FILE *stream;
+FILE *current_stream;
+char *current_conf_file;
int reload = 0;
/* local vars */
}
}
+void read_conf_file(char *conf_file)
+{
+ FILE *stream;
+
+ glob_t globbuf;
+
+ globbuf.gl_offs = 0;
+ glob(conf_file, 0, NULL, &globbuf);
+
+ int i;
+ for(i = 0; i < globbuf.gl_pathc; i++){
+ syslog(LOG_INFO, "Opening file '%s'.\n",globbuf.gl_pathv[i]);
+ stream = fopen(globbuf.gl_pathv[i], "r");
+ if (!stream) {
+ syslog(LOG_INFO, "Configuration file '%s' open problem (%s)...\n"
+ , globbuf.gl_pathv[i], strerror(errno));
+ return;
+ }
+ current_stream = stream;
+ current_conf_file = globbuf.gl_pathv[i];
+
+ char prev_path[MAXBUF];
+ getcwd(prev_path, MAXBUF);
+
+ char *confpath = strdup(globbuf.gl_pathv[i]);
+ dirname(confpath);
+ chdir(confpath);
+ process_stream(keywords);
+ fclose(stream);
+
+ chdir(prev_path);
+ }
+
+ globfree(&globbuf);
+}
+
+int
+check_include(char *buf)
+{
+ char *str;
+ vector strvec;
+
+ strvec = alloc_strvec(buf);
+
+ if (!strvec){
+ return 0;
+ }
+ str = VECTOR_SLOT(strvec, 0);
+
+ if (!strcmp(str, EOB)) {
+ free_strvec(strvec);
+ return 0;
+ }
+
+ if(!strcmp("include", str) && VECTOR_SIZE(strvec) == 2){
+ char *conf_file = VECTOR_SLOT(strvec, 1);
+
+ FILE *prev_stream = current_stream;
+ char *prev_conf_file = current_conf_file;
+ char prev_path[MAXBUF];
+ getcwd(prev_path, MAXBUF);
+ read_conf_file(conf_file);
+ current_stream = prev_stream;
+ current_conf_file = prev_conf_file;
+ chdir(prev_path);
+ return 1;
+ }
+ free_strvec(strvec);
+ return 0;
+}
+
int
read_line(char *buf, int size)
{
int ch;
- int count = 0;
- while ((ch = fgetc(stream)) != EOF && (int) ch != '\n'
- && (int) ch != '\r') {
- if (count < size)
- buf[count] = (int) ch;
- else
- break;
- count++;
- }
+ do {
+ int count = 0;
+ memset(buf, 0, MAXBUF);
+ while ((ch = fgetc(current_stream)) != EOF && (int) ch != '\n'
+ && (int) ch != '\r') {
+ if (count < size)
+ buf[count] = (int) ch;
+ else
+ break;
+ count++;
+ }
+ } while (check_include(buf) == 1);
return (ch == EOF) ? 0 : 1;
}
void
init_data(char *conf_file, vector (*init_keywords) (void))
{
- stream = fopen((conf_file) ? conf_file : CONF, "r");
- if (!stream) {
- syslog(LOG_INFO, "Configuration file open problem...\n");
- return;
- }
-
/* Init Keywords structure */
keywords = vector_alloc();
(*init_keywords) ();
-/* Dump configuration *
-vector_dump(keywords);
-dump_keywords(keywords, 0);
-*/
+#if 0
+ /* Dump configuration */
+ vector_dump(keywords);
+ dump_keywords(keywords, 0);
+#endif
/* Stream handling */
- process_stream(keywords);
- fclose(stream);
+ read_conf_file((conf_file) ? conf_file : CONF);
free_keywords(keywords);
}
*
* Part: cfreader.c include file.
*
- * Version: $Id: parser.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: parser.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _PARSER_H
/* global vars exported */
extern vector keywords;
-extern FILE *stream;
+extern FILE *current_stream;
extern int reload;
/* Prototypes */
* the thread management routine (thread.c) present in the
* very nice zebra project (http://www.zebra.org).
*
- * Version: $Id: scheduler.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: scheduler.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <signal.h>
*
* Part: scheduler.c include file.
*
- * Version: $Id: scheduler.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: scheduler.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _SCHEDULER_H
*
* Part: Signals framework.
*
- * Version: $Id: signals.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: signals.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Kevin Lindsay, <kevinl@netnation.com>
* Alexandre Cassen, <acassen@linux-vs.org>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <signal.h>
*
* Part: signals.c include file.
*
- * Version: $Id: signals.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: signals.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Kevin Lindsay, <kevinl@netnation.com>
* Alexandre Cassen, <acassen@linux-vs.org>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _SIGNALS_H
*
* Part: Timer manipulations.
*
- * Version: $Id: timer.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: timer.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <stdio.h>
*
* Part: timer.c include file.
*
- * Version: $Id: timer.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: timer.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _TIMER_H
*
* Part: General program utils.
*
- * Version: $Id: utils.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: utils.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "utils.h"
*
* Part: utils.h include file.
*
- * Version: $Id: utils.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: utils.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _UTILS_H
*
* Part: Vector structure manipulation.
*
- * Version: $Id: vector.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vector.c,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "vector.h"
*
* Part: vector.c include file.
*
- * Version: $Id: vector.h,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
+ * Version: $Id: vector.h,v 1.1.14 2007/09/13 21:12:33 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VECTOR_H