* keepalived-1.1.5 released.
* Joseph Mack, <mack.joseph@epa.gov> wrote keeplived manpages
in doc/man/man5/keepalived.conf.5 and doc/man/man8/keepalived.8.
* VRRP : Tsuji Akira, <tsuji@centurysys.co.jp> fixed a length
issue while testing password field for auth_pass method.
* VRRP : Willy Tarreau, <willy@w.ods.org> fixed a quick loop
in the watchdog timer thread.
* VRRP : Willy Tarreau, <willy@w.ods.org> extended scheduler
to support stable scheduling time. There is now, only one
time source updated before and after scheduling event. This
solve sliding timer observed on some env, also known as
periodically flapping issue (sometime a VRRP election is
forced).
* VRRP : Willy Tarreau, <willy@w.ods.org> updated the default
media link failure detection strategy to perform a ioctl
ifflags even if NIC driver are supporting MII or ETHTOOL.
Some buggy drivers need this. Anyway the linkwatch patch
still the best solution to support efficient and scalable
media link failure detection.
* Some cosmetics clean-up, removed some dead files, updated
autoconf and Makefile prototypes to support dependencies
libs like kerberos for RedHat/Fedora distro. To compile
keepalived properly on redhat 9 box, for example, run :
CPPFLAGS="-I/usr/kerberos/include" && ./configure
Renamed keywords lb_kind to lvs_method and ld_algo to
lvs_sched. For compatibility reasons, old keywords are still
available.
+2004-01-25 Alexandre Cassen <acassen@linux-vs.org>
+ * keepalived-1.1.5 released.
+ * Joseph Mack, <mack.joseph@epa.gov> wrote keeplived manpages
+ in doc/man/man5/keepalived.conf.5 and doc/man/man8/keepalived.8.
+ * VRRP : Tsuji Akira, <tsuji@centurysys.co.jp> fixed a length
+ issue while testing password field for auth_pass method.
+ * VRRP : Willy Tarreau, <willy@w.ods.org> fixed a quick loop
+ in the watchdog timer thread.
+ * VRRP : Willy Tarreau, <willy@w.ods.org> extended scheduler
+ to support stable scheduling time. There is now, only one
+ time source updated before and after scheduling event. This
+ solve sliding timer observed on some env, also known as
+ periodically flapping issue (sometime a VRRP election is
+ forced).
+ * VRRP : Willy Tarreau, <willy@w.ods.org> updated the default
+ media link failure detection strategy to perform a ioctl
+ ifflags even if NIC driver are supporting MII or ETHTOOL.
+ Some buggy drivers need this. Anyway the linkwatch patch
+ still the best solution to support efficient and scalable
+ media link failure detection.
+ * Some cosmetics clean-up, removed some dead files, updated
+ autoconf and Makefile prototypes to support dependencies
+ libs like kerberos for RedHat/Fedora distro. To compile
+ keepalived properly on redhat 9 box, for example, run :
+ CPPFLAGS="-I/usr/kerberos/include" && ./configure
+ Renamed keywords lb_kind to lvs_method and ld_algo to
+ lvs_sched. For compatibility reasons, old keywords are still
+ available.
+
2003-12-29 Alexandre Cassen <acassen@linux-vs.org>
* keepalived-1.1.4 released.
* Refresh autoconf script to use autoconf 2.5.
+++ /dev/null
-[General]
-DebuggerCmdStr=
-FileVersion=1
-ProgramArgs=
-TTYLevel=7
-WorkingDirectory=
-
-[Memory]
-ColumnWidths=80,0
-NumExprs=0
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP EGREP LINKWATCH_SUPPORT KERN DFLAGS IPVS_SUPPORT VRRP_SUPPORT CI_LINUX IPVS_SYNCD LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP EGREP LINKWATCH_SUPPORT KERN DFLAGS IPVS_SUPPORT VRRP_SUPPORT IPVS_SYNCD LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-kernel-dir=DIR path to linux kernel source directory
- --with-ci_linux Compile with Cluster Infrastructure support (default no)
Some influential environment variables:
CC C compiler command
else
kernelinc="/usr/src/linux/include"
fi;
-
-# Check whether --with-ci_linux or --without-ci_linux was given.
-if test "${with_ci_linux+set}" = set; then
- withval="$with_ci_linux"
- ci_linux=$withval
-else
- ci_linux="no"
-fi;
# Check whether --enable-debug or --disable-debug was given.
if test "${enable_debug+set}" = set; then
enableval="$enable_debug"
done
-if test "${ci_linux}" = "yes"; then
-
-for ac_header in linux/cluster.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc in
- yes:no )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
- no:yes )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-else
- { { echo "$as_me:$LINENO: error: linux/cluster.h file not found" >&5
-echo "$as_me: error: linux/cluster.h file not found" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-done
-
-fi
echo "$as_me:$LINENO: checking for MD5_Init in -lcrypto" >&5
{ (exit 1); exit 1; }; }
fi
-if test "${ci_linux}" = "yes"; then
-
-echo "$as_me:$LINENO: checking for cluster_maxnodes in -lcluster" >&5
-echo $ECHO_N "checking for cluster_maxnodes in -lcluster... $ECHO_C" >&6
-if test "${ac_cv_lib_cluster_cluster_maxnodes+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcluster $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char cluster_maxnodes ();
-int
-main ()
-{
-cluster_maxnodes ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_cluster_cluster_maxnodes=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_cluster_cluster_maxnodes=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_cluster_cluster_maxnodes" >&5
-echo "${ECHO_T}$ac_cv_lib_cluster_cluster_maxnodes" >&6
-if test $ac_cv_lib_cluster_cluster_maxnodes = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBCLUSTER 1
-_ACEOF
-
- LIBS="-lcluster $LIBS"
-
-else
- { { echo "$as_me:$LINENO: error: libcluster libraries are required" >&5
-echo "$as_me: error: libcluster libraries are required" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-fi
CPPFLAGS="$CPPFLAGS -I$kernelinc"
-CFLAGS="$CFLAGS -I$kernelinc"
echo "$as_me:$LINENO: checking for kernel >= 2.4.0" >&5
echo $ECHO_N "checking for kernel >= 2.4.0... $ECHO_C" >&6
if test "$cross_compiling" = yes; then
fi
fi
-if test "${ci_linux}" = "yes"; then
- if test "${IPVS_SUPPORT}" = "_WITHOUT_LVS_"; then
- echo
- echo "!!!WARN!!! Keepalived cannot be configured with CI-LINUX without LVS support !!!WARN!!!"
- echo
- exit 1
- else
- CI_LINUX="_WITH_CI_LINUX_"
- fi
-fi
-
if test "${enable_debug}" = "yes"; then
DFLAGS="-D_DEBUG_"
-
IPVS_SYNCD="_WITHOUT_IPVS_SYNCD_"
if test "$IPVS_SUPPORT" = "_WITH_LVS_"; then
echo "$as_me:$LINENO: checking for LVS syncd support" >&5
s,@DFLAGS@,$DFLAGS,;t t
s,@IPVS_SUPPORT@,$IPVS_SUPPORT,;t t
s,@VRRP_SUPPORT@,$VRRP_SUPPORT,;t t
-s,@CI_LINUX@,$CI_LINUX,;t t
s,@IPVS_SYNCD@,$IPVS_SYNCD,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
else
echo "Use LinkWatch : No"
fi
-if test "${CI_LINUX}" = "_WITH_CI_LINUX_"; then
- echo "Use CI_LINUX Framework : Yes"
-else
- echo "Use CI_LINUX Framework : No"
-fi
if test "${DFLAGS}" = "-D_DEBUG_"; then
echo "Use Debug flags : Yes"
else
[ --with-kernel-dir=DIR path to linux kernel source directory],
[kernelinc="$withval/include"],
[kernelinc="/usr/src/linux/include"])
-AC_ARG_WITH(ci_linux,
- [ --with-ci_linux Compile with Cluster Infrastructure support (default no)],
- [ci_linux=$withval],
- [ci_linux="no"])
AC_ARG_ENABLE(debug,
[ --enable-debug compile with debugging flags])
AC_ARG_ENABLE(profile,
AC_CHECK_HEADERS(openssl/ssl.h openssl/md5.h openssl/err.h,,AC_MSG_ERROR([
!!! OpenSSL is not properly installed on your system. !!!
!!! Can not include OpenSSL headers files. !!!]))
-if test "${ci_linux}" = "yes"; then
- AC_CHECK_HEADERS(linux/cluster.h,,AC_MSG_ERROR([linux/cluster.h file not found]))
-fi
dnl ----[ Checks for libraries ]----
AC_CHECK_LIB(crypto, MD5_Init,,AC_MSG_ERROR([OpenSSL libraries are required]))
AC_CHECK_LIB(ssl, SSL_CTX_new,,AC_MSG_ERROR([OpenSSL libraries are required]))
AC_CHECK_LIB(popt, poptGetContext,,AC_MSG_ERROR([Popt libraries is required]))
-if test "${ci_linux}" = "yes"; then
- AC_CHECK_LIB(cluster,cluster_maxnodes,,AC_MSG_ERROR([libcluster libraries are required]))
-fi
dnl ----[ Kernel version check ]----
CPPFLAGS="$CPPFLAGS -I$kernelinc"
-CFLAGS="$CFLAGS -I$kernelinc"
AC_MSG_CHECKING([for kernel >= 2.4.0])
AC_TRY_RUN([
#include <stdlib.h>
])
fi
-if test "${ci_linux}" = "yes"; then
- if test "${IPVS_SUPPORT}" = "_WITHOUT_LVS_"; then
- echo
- echo "!!!WARN!!! Keepalived cannot be configured with CI-LINUX without LVS support !!!WARN!!!"
- echo
- exit 1
- else
- CI_LINUX="_WITH_CI_LINUX_"
- fi
-fi
-
if test "${enable_debug}" = "yes"; then
DFLAGS="-D_DEBUG_"
AC_SUBST(DFLAGS)
AC_SUBST(IPVS_SUPPORT)
AC_SUBST(VRRP_SUPPORT)
-AC_SUBST(CI_LINUX)
dnl ----[ LVS syncd support probe ]---
dnl Sync daemon is supported since LVS 0.9.2 for kernel 2.4
else
echo "Use LinkWatch : No"
fi
-if test "${CI_LINUX}" = "_WITH_CI_LINUX_"; then
- echo "Use CI_LINUX Framework : Yes"
-else
- echo "Use CI_LINUX Framework : No"
-fi
if test "${DFLAGS}" = "-D_DEBUG_"; then
echo "Use Debug flags : Yes"
else
--- /dev/null
+.TH KEEPALIVED.CONF 5 "Jan 2004" V1.0\r
+.UC 4\r
+.SH NAME\r
+/etc/keepalived/keepalived.conf - configuration file for keepalived\r
+.br\r
+.SH DESCRIPTION\r
+.B keepalived.conf\r
+is the configuration file which describes all the keepalived keywords.\r
+keywords are placed in hierachies of blocks (and subblocks), \r
+each layer being delimited by '{' and '}' pairs. \r
+.PP\r
+Comments start with '#' or '!' to the end of the line and can start \r
+anywhere in a line.\r
+.SH TOP HIERACHY\r
+.PP\r
+.B GLOBAL CONFIGURATION\r
+.PP\r
+.B VRRPD CONFIGURATION\r
+.PP\r
+.B LVS CONFIGURATION\r
+.PP\r
+.SH GLOBAL CONFIGURATION\r
+contains subblocks of \r
+.B Global definitions\r
+and\r
+.B Static routes\r
+.PP\r
+.SH Global definitions\r
+.PP\r
+ global_defs # Block id\r
+ { \r
+ notification_email # To:\r
+ {\r
+ admin@example1.com \r
+ ...\r
+ }\r
+ # From: from address that will be in header\r
+ notification_email_from admin@example.com \r
+ smtp_server 127.0.0.1 # IP\r
+ smtp_connect_timeout 30 # integer, seconds\r
+ lvs_id my_hostname # string identifying the machine,\r
+ # (doesn't have to be hostname).\r
+ }\r
+\r
+\r
+.SH Static routes/addresses\r
+.PP\r
+keepalived can configure static addresses and routes \r
+with \r
+.I ip\r
+(ie if addresses are not already on the machine). These addresses are\r
+.B NOT\r
+moved by vrrpd, they stay on the machine. \r
+If you already have IPs and routes on your machines and\r
+your machines can ping each other, you don't need this section.\r
+.PP\r
+The whole string is fed to \r
+.I ip addr add.\r
+You can truncate the string anywhere you like and let\r
+.I ip addr add \r
+use defaults for the rest of the string. If you just\r
+feed the string "192.168.1.1", the IP will be 192.168.1.1/32,\r
+which you probably don't want.\r
+This is different to \r
+.I ifconfig\r
+which will configure the IP with the standard class, here \r
+192.168.1.1/24. \r
+The minimum string then would be the IP/netmask, eg 192.168.1.1/24\r
+.PP\r
+ static_ipaddress\r
+ {\r
+ 192.168.1.1/24 brd + dev eth0 scope global\r
+ ...\r
+ }\r
+.PP\r
+The whole string is fed to \r
+.I ip route add. \r
+You can truncate the string allowing \r
+.I ip route add \r
+to use defaults.\r
+.PP\r
+ static_routes\r
+ {\r
+ src $SRC_IP to $DST_IP dev $SRC_DEVICE \r
+ ...\r
+ src $SRC_IP to $DST_IP via $GW dev $SRC_DEVICE\r
+ }\r
+.PP\r
+.SH VRRPD CONFIGURATION\r
+contains subblocks of \r
+.B VRRP synchronization group(s)\r
+and\r
+.B VRRP instance(s)\r
+.PP\r
+.SH VRRP synchronization group(s)\r
+.PP\r
+ #string, name of group of IPs that failover together\r
+ vrrp_sync_group VG_1 { \r
+ group {\r
+ inside_network # name of vrrp_instance (below) \r
+ outside_network # One for each moveable IP. \r
+ ... \r
+ }\r
+ \r
+ # notify scripts and alerts are optional\r
+ #\r
+ # filenames of scripts to run on transitions\r
+ # can be unquoted (if just filename) \r
+ # or quoted (if has parameters)\r
+ # to MASTER transition\r
+ notify_master /path/to_master.sh \r
+ # to BACKUP transition\r
+ notify_backup /path/to_backup.sh \r
+ # FAULT transition \r
+ notify_fault "/path/fault.sh VG_1" \r
+\r
+ # for ANY state transition.\r
+ # "notify" script is called AFTER the \r
+ # notify_* script(s) and is executed \r
+ # with 3 arguments provided by keepalived\r
+ # (ie don't include parameters in the notify line).\r
+ # arguments\r
+ # $1 = "GROUP"|"INSTANCE"\r
+ # $2 = name of group or instance\r
+ # $3 = target state of transition \r
+ # ("MASTER"|"BACKUP"|"FAULT")\r
+ notify /path/notify.sh \r
+\r
+ # Send email notifcation during state transition, \r
+ # using addresses in global_defs above.\r
+ smtp_alert\r
+ }\r
+\r
+.SH VRRP instance(s)\r
+.PP\r
+describes the moveable IP for each instance of a group in vrrp_sync_group.\r
+Here are described two IPs (on inside_network and on outside_network), \r
+on machine "my_hostname", which belong to the group VG_1 and\r
+which will transition together on any state change.\r
+.PPa\r
+ #You will need to write another block for outside_network.\r
+ vrrp_instance inside_network {\r
+ # Initial state, MASTER|BACKUP\r
+ # As soon as the other machine(s) come up, \r
+ # an election will be held and the machine \r
+ # with the highest "priority" will become MASTER.\r
+ # So the entry here doesn't matter a whole lot.\r
+ state MASTER\r
+\r
+ # interface for inside_network, bound by vrrp\r
+ interface eth0\r
+\r
+ # optional, monitor these as well. \r
+ # go to FAULT state if any of these go down.\r
+ track_interface {\r
+ eth0 \r
+ eth1 \r
+ ...\r
+ }\r
+\r
+ #default IP for binding vrrpd is the primary IP \r
+ #on interface. If you want to hide location of vrrpd, \r
+ #use this IP as src_addr for multicast vrrp packets.\r
+ #(since it's multicast, vrrpd will get the reply \r
+ #packet no matter what src_addr is used).\r
+ #optional\r
+ mcast_src_ip <IPADDR> \r
+\r
+ # Binding interface for lvs syncd\r
+ lvs_sync_daemon_interface eth1 \r
+\r
+ # delay for gratuitous ARP after transition to MASTER\r
+ garp_master_delay 10 # secs, default 5 \r
+\r
+ # arbitary unique number 0..255\r
+ # used to differentiate multiple instances of vrrpd\r
+ # running on the same NIC (and hence same socket).\r
+ virtual_router_id 51\r
+\r
+ # for electing MASTER, highest priority wins.\r
+ # to be MASTER, make 50 more than other machines.\r
+ priority 100\r
+\r
+ # VRRP Advert interval, secs (use default)\r
+ advert_int 1\r
+ authentication { # Authentication block\r
+ # PASS||AH\r
+ # PASS - Simple Passwd (suggested) \r
+ # AH - IPSEC (not recommended))\r
+ auth_type PASS\r
+ # Password for accessing vrrpd.\r
+ # should be the same for all machines.\r
+ auth_pass 1234\r
+\r
+ #addresses add|del on change to MASTER, to BACKUP.\r
+ #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
+ 192.168.200.17/24 dev eth1\r
+ 192.168.200.18/24 dev eth2\r
+ }\r
+\r
+ #VRRP IP excluded from VRRP\r
+ #optional.\r
+ #For cases with large numbers (eg 200) of IPs \r
+ #on the same interface. To decrease the number \r
+ #of packets sent in adverts, you can exclude \r
+ #most IPs from adverts.\r
+ #The IPs are add|del as for virtual_ipaddress.\r
+ virtual_ipaddress_excluded { \r
+ <IPADDR>/<MASK> brd <IPADDR> dev <STRING> scope <SCOPE> \r
+ <IPADDR>/<MASK> brd <IPADDR> dev <STRING> scope <SCOPE>\r
+ ...\r
+ }\r
+ # routes add|del when changing to MASTER, to BACKUP\r
+ virtual_routes {\r
+ # src <IPADDR> [to] <IPADDR>/<MASK> via|gw <IPADDR> dev <STRING> scope <SCOPE> tab\r
+ src 192.168.100.1 to 192.168.109.0/24 via 192.168.200.254 dev eth1\r
+ 192.168.110.0/24 via 192.168.200.254 dev eth1\r
+ 192.168.111.0/24 dev eth2\r
+ 192.168.112.0/24 via 192.168.100.254\r
+ }\r
+ \r
+ #VRRP preempt mode (default set), \r
+ #Normally failover toggles, ie the backup\r
+ #stays as master, after the old master comes\r
+ #back on line.\r
+ #preempt allows the old master to resume\r
+ #the master role when it comes back online.\r
+ preempt \r
+\r
+ # Debug level, not implemented yet.\r
+ debug\r
+\r
+ # notify scripts, alert as above\r
+ notify_master <STRING>|<QUOTED-STRING>\r
+ notify_backup <STRING>|<QUOTED-STRING>\r
+ notify_fault <STRING>|<QUOTED-STRING> \r
+ notify <STRING>|<QUOTED-STRING> \r
+ smtp_alert \r
+ }\r
+\r
+.SH LVS CONFIGURATION\r
+contains subblocks of \r
+.B Virtual server group(s)\r
+and\r
+.B Virtual server(s)\r
+.PP\r
+The subblocks contain arguments for \r
+.I ipvsadm(8). \r
+A knowlege of \r
+.I ipvsadm(8)\r
+will be helpful here.\r
+.PP\r
+.SH Virtual server group(s)\r
+.PP\r
+ # optional\r
+ # this groups allows a service on a real_server \r
+ # to belong to multiple virtual services \r
+ # and to be only health checked once.\r
+ # Only for very large LVSs.\r
+ virtual_server_group <STRING> {\r
+ #VIP port\r
+ <IPADDR> <PORT> \r
+ <IPADDR> <PORT>\r
+ ...\r
+ #\r
+ # <IPADDR RANGE> has the form \r
+ # XXX.YYY.ZZZ.WWW-VVV eg 192.168.200.1-10 \r
+ # range includes both .1 and .10 address\r
+ <IPADDR RANGE> <PORT># VIP range VPORT\r
+ <IPADDR RANGE> <PORT>\r
+ ...\r
+ fwmark <INT> # fwmark\r
+ fwmark <INT>\r
+ ...\r
+}\r
+\r
+.SH Virtual server(s)\r
+.PP\r
+A virtual_server can be a declaration of one of \r
+.TP \r
+.B vip vport (IPADDR PORT pair)\r
+.TP\r
+.B fwmark <INT>\r
+.TP\r
+.B (virtual server) group <STRING>\r
+\r
+ #setup service\r
+ virtual_server IP port |\r
+ virtual_server fwmark int |\r
+ virtual_server group string\r
+ {\r
+ # delay timer for service polling\r
+ delay_loop <INT> \r
+\r
+ # LVS scheduler \r
+ lb_algo rr|wrr|lc|wlc|lblc|sh|dh \r
+ # LVS forwarding method\r
+ lb_kind NAT|DR|TUN \r
+ # LVS persistence timeout, sec\r
+ persistence_timeout <INT> \r
+ # LVS granularity mask (-M in ipvsadm)\r
+ persistence_granularity <NETMASK> \r
+ # Only TCP is implemented\r
+ protocol TCP \r
+ # If VS IP address is not set, \r
+ # suspend healthchecker's activity\r
+ ha_suspend\r
+ \r
+ # VirtualHost string for HTTP_GET or SSL_GET\r
+ # eg virtualhost www.firewall.loc\r
+ virtualhost <STRING> \r
+\r
+ # setup realserver(s)\r
+\r
+ # RS to add when all realservers are down\r
+ sorry_server <IPADDR> <PORT>\r
+ \r
+ # one entry for each realserver \r
+ real_server <IPADDR> <PORT> \r
+ {\r
+ # relative weight to use, default: 1\r
+ weight <INT> \r
+ # Set weight to 0\r
+ # when healthchecker detects failure\r
+ inhibit_on_failure \r
+ \r
+ # Script to launch when healthchecker\r
+ # considers service as up.\r
+ notify_up <STRING>|<QUOTED-STRING> \r
+ # Script to launch when healthchecker\r
+ # considers service as down.\r
+ notify_down <STRING>|<QUOTED-STRING> \r
+ \r
+ # pick one healthchecker\r
+ # HTTP_GET|SSL_GET|TCP_CHECK|MISC_CHECK\r
+ \r
+ # HTTP and SSL healthcheckers\r
+ HTTP_GET|SSL_GET \r
+ { \r
+ # A url to test\r
+ # can have multiple entries here\r
+ url {\r
+ #eg path / , or path /mrtg2/\r
+ path <STRING> \r
+ # healthcheck needs status_code\r
+ # or status_code and digest\r
+ # Digest computed with genhash\r
+ # eg digest 9b3a0c85a887a256d6939da88aabd8cd\r
+ digest <STRING>\r
+ # status code returned in the HTTP header\r
+ # eg status_code 200\r
+ status_code <INT> \r
+ } \r
+ #IP, tcp port for service on realserver \r
+ connect_port <PORT> \r
+ bindto <IPADDR>\r
+ # Timeout connection, sec\r
+ connect_timeout <INT> \r
+ # number of get retry\r
+ nb_get_retry <INT> \r
+ # delay before retry\r
+ delay_before_retry <INT>\r
+ } #HTTP_GET|SSL_GET\r
+ \r
+ #TCP healthchecker (bind to IP port)\r
+ TCP_CHECK \r
+ { \r
+ connect_port <PORT>\r
+ bindto <IPADDR>\r
+ connect_timeout <INT> \r
+ } #TCP_CHECK\r
+ \r
+ #MISC healthchecker, run a program\r
+ MISC_CHECK \r
+ {\r
+ # External system script or program\r
+ misc_path <STRING>|<QUOTED-STRING>\r
+ # Script execution timeout\r
+ misc_timeout <INT>\r
+ }\r
+ } # realserver defn\r
+ } # virtual service\r
+\r
+\r
+.SH AUTHOR \r
+.br\r
+Joseph Mack. \r
+.br\r
+Information derived from doc/keepalived.conf.SYNOPSIS,\r
+doc/samples/keepalived.conf.* and Changelog by Alexandre Cassen \r
+for keepalived-1.1.4, \r
+and from HOWTOs by Adam Fletcher and Vince Worthington.\r
+.SH "SEE ALSO"\r
+ipvsadm(8), ip --help.\r
+.\" Local Variables:\r
+.\" mode: nroff\r
+.\" End:\r
--- /dev/null
+.\"\r
+.\" keepalived(8)\r
+.\"\r
+.\" Copyright (C) 2004 Joseph Mack\r
+.TH keepalived 8 "Jan 2004"\r
+.SH NAME\r
+keepalived. \- keepalive demon\r
+.SH SYNOPSIS\r
+.B "/usr/sbin/keepalived [-n] [-f keepalived.conf] [-d] [-h] [-v]"\r
+.SH DESCRIPTION\r
+The\r
+.B keepalived\r
+The keepalived server implements the vrrpd routing demon \r
+which enables routing failover for a pair (or set) of routers \r
+(or LVS directors) \r
+and the keepalived demon which sets up and does the health checking \r
+of virtual services in a Linux Virtual Servier.\r
+.SH OPTIONS\r
+.TP\r
+.B --vrrp, -P\r
+Only run the VRRP subsystem.\r
+.TP\r
+.B --check, -C \r
+Only run the healthchecker subsystem.\r
+.TP\r
+.B --dont-release-vrrp, -V \r
+leave (don't remove) VRRP VIPs & VROUTEs on daemon stop.\r
+.TP\r
+--dont-release-ipvs, -I \r
+Dont remove IPVS topology on daemon stop.\r
+.TP\r
+--dont-fork, -n\r
+Dont fork the daemon process.\r
+.TP\r
+--use-file, -f keepalived.conf_file \r
+Use the specified configuration file.\r
+.TP\r
+--wdog-vrrp, -R\r
+Define VRRP watchdog polling delay (default=5s)\r
+.TP\r
+--wdog-check, -H \r
+Define healthchecker's watchdog polling delay (default=5s)\r
+.TP\r
+--dump-conf, -d\r
+Dump the configuration data.\r
+.TP\r
+--log-console, -l\r
+Log messages to local console.\r
+.TP\r
+--log-detail, -D \r
+Detailed log messages (the default with the rc script provided).\r
+.TP\r
+--log-facility, -S \r
+0-7 Set syslog facility to LOG_LOCAL[0-7] (default=LOG_DAEMON)\r
+.TP\r
+--help, -h \r
+Display a short inlined help screen.\r
+.TP\r
+--version, -v \r
+Display the version number.\r
+\r
+.SH FILES\r
+.BR /etc/keepalived/keepalived.conf\r
+.SH SEE ALSO\r
+.BR keepalived.conf(5)\r
+.SH AUTHORS\r
+.br\r
+Joseph Mack\r
+.br\r
+from inspection of the output of \r
+.I keepalived --help \r
+from keepalived-1.1.4\r
CC = @CC@
INCLUDES = -I../lib
-CFLAGS = @CFLAGS@ $(INCLUDES) \
+CFLAGS = @CFLAGS@ @CPPFLAGS@ $(INCLUDES) \
-Wall -Wunused -Wstrict-prototypes
LDFLAGS = -lssl -lpopt
Name: keepalived
Summary: HA monitor built upon LVS, VRRP and services poller
Packager: Christophe Varoqui, <christophe.varoqui@free.fr>
-Version: 1.1.4
+Version: 1.1.5
Release: 1
Source: http://www.keepalived.org/software/%{name}-%{version}.tar.gz
Copyright: GPL
for i in $(SUBDIRS); do \
$(MAKE) -C $$i || exit 1; done && \
echo "Building $(BIN)/$(EXEC)" && \
- $(CC) -o $(BIN)/$(EXEC) $(LDFLAGS) `find $(SUBDIRS) ../lib -name '*.[oa]'`
+ $(CC) -o $(BIN)/$(EXEC) `find $(SUBDIRS) ../lib -name '*.[oa]'` $(LDFLAGS)
strip $(BIN)/$(EXEC)
@echo ""
@echo "Make complete"
for i in $(SUBDIRS); do \
$(MAKE) -C $$i || exit 1; done && \
echo "Building $(BIN)/$(EXEC)" && \
- $(CC) -o $(BIN)/$(EXEC) $(LDFLAGS) `find $(SUBDIRS) ../lib -name '*.[oa]'`
+ $(CC) -o $(BIN)/$(EXEC) `find $(SUBDIRS) ../lib -name '*.[oa]'` $(LDFLAGS)
@echo ""
@echo "Make complete"
for i in $(SUBDIRS); do \
$(MAKE) -C $$i || exit 1; done && \
echo "Building $(BIN)/$(EXEC)" && \
- $(CC) -o $(BIN)/$(EXEC) $(LDFLAGS) -pg `find $(SUBDIRS) ../lib -name '*.[oa]'`
+ $(CC) -o $(BIN)/$(EXEC) `find $(SUBDIRS) ../lib -name '*.[oa]'` $(LDFLAGS) -pg
@echo ""
@echo "Make complete"
KERNEL = @KERN@
CC = @CC@
-CI_LINUX = @CI_LINUX@
-ifeq ($(CI_LINUX),_WITH_CI_LINUX_)
-CI_LINUX_OBJ = check_ci.o
-CIFLAGS = -D$(CI_LINUX)
-endif
INCLUDES = -I../include -I../../lib
-CFLAGS = @CFLAGS@ $(INCLUDES) \
+CFLAGS = @CFLAGS@ @CPPFLAGS@ $(INCLUDES) \
-Wall -Wunused -Wstrict-prototypes
DEFS = -D$(KERNEL) -D@IPVS_SUPPORT@ -D@IPVS_SYNCD@ -D@VRRP_SUPPORT@ @DFLAGS@ $(CIFLAGS)
COMPILE = $(CC) $(CFLAGS) $(DEFS)
OBJS = check_daemon.o check_data.o check_parser.o \
check_api.o check_tcp.o check_http.o check_ssl.o \
- check_misc.o ipwrapper.o ipvswrapper.o $(CI_LINUX_OBJ)
+ check_misc.o ipwrapper.o ipvswrapper.o
ifeq ($(KERNEL),_KRNL_2_2_)
OBJS += ipfwwrapper.o
*
* Part: Checkers registration.
*
- * Version: $Id: check_api.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: check_api.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
#include "check_tcp.h"
#include "check_http.h"
#include "check_ssl.h"
-#ifdef _WITH_CI_LINUX_
-#include "check_ci.h"
-#endif
/* External vars */
extern thread_master *master;
install_tcp_check_keyword();
install_http_check_keyword();
install_ssl_check_keyword();
-#ifdef _WITH_CI_LINUX_
- install_ci_check_keyword();
-#endif
}
+++ /dev/null
-/*
- * Soft: Keepalived is a failover program for the LVS project
- * <www.linuxvirtualserver.org>. It monitor & manipulate
- * a loadbalanced server pool using multi-layer checks.
- *
- * Part: CI-LINUX checker. Integration to Compaq Cluster Infrastructure.
- *
- * Version: $Id: check_ci.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
- *
- * Authors: Alexandre Cassen, <acassen@linux-vs.org>
- * Aneesh Kumar K.V, <aneesh.kumar@digital.com>
- *
- * 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.
- *
- * 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.
- *
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
- */
-
-#include "check_ci.h"
-#include "check_api.h"
-#include "memory.h"
-#include "parser.h"
-#include "smtp.h"
-#include "ipwrapper.h"
-
-/* CI nodemap declaration */
-static nodenum_ip_map_t *nodemap;
-
-/* Configuration stream handling */
-void
-free_ci_check(void *data)
-{
- if (nodemap) {
- FREE(nodemap);
- nodemap = NULL;
- }
-}
-void
-dump_ci_check(void *data)
-{
- syslog(LOG_INFO, " Keepalive method = CI-LINUX");
-}
-
-void
-ci_get_handler(vector strvec)
-{
- int size = sizeof (nodenum_ip_map_t) * cluster_maxnodes() + 1;
- nodemap = (nodenum_ip_map_t *) ALLOC(size);
-
- /*
- * If we can not initialize node map we don t queue a new checker.
- * The default action if so is:
- * The realserver activity will not be monitored by the CI-LINUX
- * Healchecker. This mean that this realserver will be present into
- * LVS topology even if it is failing.
- */
- if (initialize_nodemap(nodemap) < 0) {
- syslog(LOG_ERR,
- "[CI-LINUX] Failed to initialize the node map from %s",
- CLUSTERTAB);
- } else
- queue_checker(free_ci_check, dump_ci_check, ci_check_thread,
- NULL);
-}
-
-void
-install_ci_check_keyword(void)
-{
- install_keyword("CI-LINUX", &ci_get_handler);
-}
-
-int
-initialize_nodemap(nodenum_ip_map_t * nodemap)
-{
- FILE *fp;
- char buf[BUFFSIZE];
- int node_number;
-
- if ((fp = fopen(CLUSTERTAB, "r")) == NULL)
- return -1;
-
- while (fscanf(fp, "%s", buf) != EOF) {
- if (buf[0] == '#') {
- if (fscanf(fp, "%[^\n]", buf) == EOF) {
- syslog(LOG_ERR,
- "[CI-LINUX] %s File Format Error",
- CLUSTERTAB);
- return -1;
- }
- bzero(buf, BUFFSIZE);
- continue;
- }
- node_number = atoi(buf);
- if (node_number > cluster_maxnodes()) {
- syslog(LOG_ERR,
- "[CI-LINUX] Node number greater than MAX node num\n");
- return -1;
- }
- if (fscanf(fp, "%s", buf) == EOF) {
- syslog(LOG_ERR, "[CI-LINUX] %s File Format Error",
- CLUSTERTAB);
- return -1;
- }
- inet_ston(buf, &nodemap[node_number].addr_ip);
- if (fscanf(fp, "%[^\n]", buf) == EOF) {
- syslog(LOG_ERR, "[CI-LINUX] %s File Format Error",
- CLUSTERTAB);
- return -1;
- }
- bzero(buf, BUFFSIZE);
- }
- return 1;
-}
-
-clusternode_t
-address_to_nodenum(uint32_t addr_ip)
-{
- int i;
- int max_nodes = cluster_maxnodes();
-
- for (i = 1; i <= max_nodes; i++) {
- if (nodemap[i].addr_ip == addr_ip)
- return i;
- }
- return 0; /* Not a valid node */
-}
-
-int
-nodestatus(uint32_t addr_ip)
-{
- int node_num;
- clusternode_info_t ni;
-
- if ((node_num = address_to_nodenum(addr_ip)) == 0)
- return UNKNOWN_NODE;
-
- if (clusternode_info(node_num, sizeof (ni), &ni) >= 0)
- /*
- * I am insterested only in two state
- * either fully up or down.
- */
- return (ni.node_state == CLUSTERNODE_UP) ? UP : DOWN;
- else
- syslog(LOG_ERR,
- "[CI-LINUX] Error in getting the cluster information");
-
- return UNKNOWN_NODE;
-}
-
-/* Cluster Infrastructure checker thread */
-int
-ci_check_thread(thread * thread)
-{
- checker *checker = THREAD_ARG(thread);
- int status;
-
- /*
- * Register a new checker thread & return
- * if checker is disabled
- */
- if (!CHECKER_ENABLED(checker)) {
- thread_add_timer(thread->master, ci_check_thread, checker,
- checker->vs->delay_loop);
- return 0;
- }
-
- /* Check the CI node status */
- status = nodestatus(CHECKER_RIP(checker));
-
- switch (status) {
- case UP:
- if (!svr_checker_up(checker->id, checker->rs)) {
- smtp_alert(thread->master, checker->rs, NULL, NULL, "UP",
- "=> CI-Linux CHECK succeed on service <=");
- update_svr_checker_state(UP, checker->id
- , checker->vs
- , checker->rs);
- }
- break;
- case DOWN:
- if (svr_checker_up(checker->id, checker->rs)) {
- smtp_alert(thread->master, checker->rs, NULL, NULL, "DOWN",
- "=> CI-Linux CHECK failed on service <=");
- update_svr_checker_state(DOWN, checker->id
- , checker->vs
- , checker->rs);
- }
- break;
- default:
- syslog(LOG_ERR, "[CI-LINUX] Unknown node status");
- }
-
- /* Register the next check */
- thread_add_timer(thread->master, ci_check_thread, checker,
- checker->vs->delay_loop);
- return 0;
-}
*
* Part: Healthcheckrs child process handling.
*
- * Version: $Id: check_daemon.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: check_daemon.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Healthcheckers dynamic data structure definition.
*
- * Version: $Id: check_data.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: check_data.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: WEB CHECK. Common HTTP/SSL checker primitives.
*
- * Version: $Id: check_http.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: check_http.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
* Part: MISC CHECK. Perform a system call to run an extra
* system prog or script.
*
- * Version: $Id: check_misc.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: check_misc.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Eric Jarman, <ehj38230@cmsu2.cmsu.edu>
* data structure representation the conf file representing
* the loadbalanced server pool.
*
- * Version: $Id: check_parser.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: check_parser.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
install_keyword_root("virtual_server", &vs_handler);
install_keyword("delay_loop", &delay_handler);
install_keyword("lb_algo", &lbalgo_handler);
+ install_keyword("lvs_sched", &lbalgo_handler);
install_keyword("lb_kind", &lbkind_handler);
+ install_keyword("lvs_method", &lbkind_handler);
install_keyword("nat_mask", &natmask_handler);
install_keyword("persistence_timeout", &pto_handler);
install_keyword("persistence_granularity", &pgr_handler);
* url, compute a MD5 over this result and match it to the
* expected value.
*
- * Version: $Id: check_ssl.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: check_ssl.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
*
* Part: TCP checker.
*
- * Version: $Id: check_tcp.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: check_tcp.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* library to add/remove server MASQ rules to the kernel
* firewall framework.
*
- * Version: $Id: ipfwwrapper.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: ipfwwrapper.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* Part: IPVS Kernel wrapper. Use setsockopt call to add/remove
* server to/from the loadbalanced server pool.
*
- * Version: $Id: ipvswrapper.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: ipvswrapper.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Manipulation functions for IPVS & IPFW wrappers.
*
- * Version: $id: ipwrapper.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $id: ipwrapper.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
CC = @CC@
INCLUDES = -I../include -I../../lib
-CFLAGS = @CFLAGS@ $(INCLUDES) \
+CFLAGS = @CFLAGS@ @CPPFLAGS@ $(INCLUDES) \
-Wall -Wunused -Wstrict-prototypes
DEFS = -D@KERN@ -D@IPVS_SUPPORT@ -D@VRRP_SUPPORT@ @DFLAGS@
COMPILE = $(CC) $(CFLAGS) $(DEFS)
*
* Part: Main program structure.
*
- * Version: $Id: main.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: main.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Dynamic data structure definition.
*
- * Version: $Id: global_data.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: global_data.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* data structure representation the conf file representing
* the loadbalanced server pool.
*
- * Version: $Id: global_parser.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: global_parser.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* Part: Layer4 checkers handling. Register worker threads &
* upper layer checkers.
*
- * Version: $Id: layer4.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: layer4.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Main program structure.
*
- * Version: $Id: main.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: main.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: pidfile utility.
*
- * Version: $Id: pidfile.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: pidfile.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* using the smtp protocol according to the RFC 821. A non blocking
* timeouted connection is used to handle smtp protocol.
*
- * Version: $Id: smtp.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: smtp.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Checkers arguments structures definitions.
*
- * Version: $Id: check_api.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: check_api.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
+++ /dev/null
-/*
- * Soft: Keepalived is a failover program for the LVS project
- * <www.linuxvirtualserver.org>. It monitor & manipulate
- * a loadbalanced server pool using multi-layer checks.
- *
- * Part: check_ci.c include file.
- *
- * Version: $Id: check_ci.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
- *
- * Authors: Alexandre Cassen, <acassen@linux-vs.org>
- * Aneesh Kumar K.V, <aneesh.kumar@digital.com>
- *
- * 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.
- *
- * 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.
- *
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
- */
-
-#ifndef _CI_LINUX_H
-#define _CI_LINUX_H
-
-/* system includes */
-#include <signal.h>
-#include <pthread.h>
-#include <linux/cluster.h> /* Should change this to cluster.h alone */
-#include <syslog.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/* local includes */
-#include "scheduler.h"
-
-#define CLUSTERTAB "/etc/clustertab"
-#define BUFFSIZE 100
-#define UP 1
-#define DOWN 2
-#define UNKNOWN_NODE 0
-
-typedef struct nodenum_ip_map {
- uint32_t addr_ip;
-} nodenum_ip_map_t;
-
-/* Prototypes defs */
-extern int initialize_nodemap(nodenum_ip_map_t * nodemap);
-extern clusternode_t address_to_nodenum(uint32_t addr_ip);
-extern int nodestatus(uint32_t addr_ip);
-extern void install_ci_check_keyword(void);
-extern int ci_check_thread(thread * thread);
-
-#endif
*
* Part: check_daemon.c include file.
*
- * Version: $Id: check_daemon.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: check_daemon.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Healthcheckers dynamic data structure definition.
*
- * Version: $Id: check_data.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: check_data.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: check_http.c include file.
*
- * Version: $Id: check_http.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: check_http.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
*
* Part: check_misc.c include file.
*
- * Version: $Id: check_misc.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: check_misc.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
* Eric Jarman, <ehj38230@cmsu2.cmsu.edu>
*
* Part: check_parser.c include file.
*
- * Version: $Id: check_parser.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: check_parser.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: check_http.c include file.
*
- * Version: $Id: check_http.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: check_http.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
*
* Part: check_tcp.c include file.
*
- * Version: $Id: check_tcp.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: check_tcp.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Daemon process handling.
*
- * Version: $Id: daemon.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: daemon.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Dynamic data structure definition.
*
- * Version: $Id: global_data.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: global_data.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vrrp_parser.c include file.
*
- * Version: $Id: global_parser.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: global_parser.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: ipfwwrapper.c include file.
*
- * Version: $Id: ipfwwrapper.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: ipfwwrapper.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: ipvswrapper.c include file.
*
- * Version: $Id: ipvswrapper.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: ipvswrapper.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: ipwrapper.c include file.
*
- * Version: $Id: ipwrapper.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: ipwrapper.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: layer4.c include file.
*
- * Version: $Id: layer4.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: layer4.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Main program include file.
*
- * Version: $Id: main.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: main.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
#define LOG_FACILITY_MAX 7
#define PROG "Keepalived"
-#define VERSION_CODE 0x010104
-#define DATE_CODE 0x1D0C03
+#define VERSION_CODE 0x010105
+#define DATE_CODE 0x190104
#define KEEPALIVED_VERSION(version) \
(version >> 16) & 0xFF, \
*
* Part: pidfile.c include file.
*
- * Version: $Id: pidfile.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: pidfile.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: smtp.c include file.
*
- * Version: $Id: smtp.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: smtp.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vrrp.c program include file.
*
- * Version: $Id: vrrp.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vrrp_arp.c include file.
*
- * Version: $Id: vrrp_arp.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_arp.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vrrp_daemon.c include file.
*
- * Version: $Id: vrrp_daemon.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_daemon.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Dynamic data structure definition.
*
- * Version: $Id: vrrp_data.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_data.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vrrp_if.c include file.
*
- * Version: $Id: vrrp_if.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_if.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
#else
#define IF_ISUP(X) (((X)->flags & IFF_UP) && \
((X)->flags & IFF_RUNNING) && \
- if_linkbeat(X))
+ IF_LINKBEAT(X))
#endif
/* prototypes */
extern interface *if_get_by_ifindex(const int ifindex);
extern interface *if_get_by_ifname(const char *ifname);
-extern int if_linkbeat(const interface * ifp);
extern int if_mii_probe(const char *ifname);
extern int if_ethtool_probe(const char *ifname);
extern void if_add_queue(interface * ifp);
*
* Part: vrrp_index.c include file.
*
- * Version: $Id: vrrp_index.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_index.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vrrp_ipaddress.c include file.
*
- * Version: $Id: vrrp_ipaddress.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_ipaddress.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vrrp_iproute.c include file.
*
- * Version: $Id: vrrp_iproute.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_iproute.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vrrp_ipsecah.c include file.
*
- * Version: $Id: vrrp_ipsecah.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_ipsecah.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vrrp_netlink.c include file.
*
- * Version: $Id: vrrp_netlink.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_netlink.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vrrp_notify.c include file.
*
- * Version: $Id: vrrp_notify.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_notify.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vrrp_parser.c include file.
*
- * Version: $Id: vrrp_parser.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_parser.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vrrp_scheduler.c include file.
*
- * Version: $Id: vrrp_scheduler.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_scheduler.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vrrp_sync.c include file.
*
- * Version: $Id: vrrp_sync.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_sync.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vrrp_track.c include file.
*
- * Version: $Id: vrrp_track.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_track.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
# Makefile to make libipvsc.
CC = @CC@
-CFLAGS = @CFLAGS@ -Wall -Wunused
+CFLAGS = @CFLAGS@ @CPPFLAGS@ -Wall -Wunused
export OBJS += libipvs.a
CC = @CC@
INCLUDES = -I../include -I../../lib
-CFLAGS = @CFLAGS@ $(INCLUDES) \
+CFLAGS = @CFLAGS@ @CPPFLAGS@ $(INCLUDES) \
-Wall -Wunused -Wstrict-prototypes
DEFS = -D@KERN@ -D@LINKWATCH_SUPPORT@ -D@IPVS_SUPPORT@ -D@IPVS_SYNCD@ @DFLAGS@
COMPILE = $(CC) $(CFLAGS) $(DEFS)
* master fails, a backup server takes over.
* The original implementation has been made by jerome etienne.
*
- * Version: $Id: vrrp.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
if (hd->auth_type == VRRP_AUTH_PASS) {
char *pw = (char *) ip + ntohs(ip->tot_len)
- sizeof (vrrp->auth_data);
- if (strncmp(pw, vrrp->auth_data, strlen(vrrp->auth_data)) != 0) {
+ if (memcmp(pw, vrrp->auth_data, sizeof(vrrp->auth_data)) != 0) {
syslog(LOG_INFO, "receive an invalid passwd!");
return VRRP_PACKET_KO;
}
*
* Part: ARP primitives.
*
- * Version: $Id: vrrp_arp.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_arp.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: VRRP child process handling.
*
- * Version: $Id: vrrp_daemon.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_daemon.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Dynamic data structure definition.
*
- * Version: $Id: vrrp_data.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_data.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Interfaces manipulation.
*
- * Version: $Id: vrrp_if.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_if.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
else if (IF_ETHTOOL_SUPPORTED(ifp))
ifp->linkbeat = (if_ethtool_probe(ifp->ifname)) ? 1 : 0;
else
- if_ioctl_flags(ifp);
+ ifp->linkbeat = 1;
+
+ /*
+ * update ifp->flags to get the new IFF_RUNNING status.
+ * Some buggy drivers need this...
+ */
+ if_ioctl_flags(ifp);
/* Register next polling thread */
thread_add_timer(master, if_linkbeat_refresh_thread, ifp, POLLING_DELAY);
, POLLING_DELAY);
}
}
-
-int
-if_linkbeat(const interface * ifp)
-{
- if (IF_MII_SUPPORTED(ifp) || IF_ETHTOOL_SUPPORTED(ifp))
- return IF_LINKBEAT(ifp);
- return 1;
-}
#endif
/* Interface queue helpers*/
*
* Part: VRRP instance index table.
*
- * Version: $Id: vrrp_index.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_index.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: NETLINK IPv4 address manipulation.
*
- * Version: $Id: vrrp_ipaddress.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_ipaddress.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: NETLINK IPv4 routes manipulation.
*
- * Version: $Id: vrrp_iproute.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_iproute.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* authentication data encryption using HMAC MD5 according to
* RFCs 2085 & 2104.
*
- * Version: $Id: vrrp_ipsecah.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_ipsecah.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: NETLINK kernel command channel.
*
- * Version: $Id: vrrp_netlink.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_netlink.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: VRRP state transition notification scripts handling.
*
- * Version: $Id: vrrp_notify.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_notify.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* data structure representation the conf file representing
* the loadbalanced server pool.
*
- * Version: $Id: vrrp_parser.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_parser.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
int max_size = sizeof (vrrp->auth_data);
int size;
- size = (strlen(str) >= max_size) ? max_size - 1 : strlen(str);
+ size = (strlen(str) >= max_size) ? max_size : strlen(str);
memcpy(vrrp->auth_data, str, size);
}
static void
*
* Part: Sheduling framework for vrrp code.
*
- * Version: $Id: vrrp_scheduler.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_scheduler.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
static long
vrrp_timer_fd(const int fd)
{
- TIMEVAL timer, vrrp_timer, now;
+ TIMEVAL timer, vrrp_timer;
long vrrp_long;
timer = vrrp_compute_timer(fd);
- now = timer_now();
- vrrp_timer = timer_sub(timer, now);
+ vrrp_timer = timer_sub(timer, time_now);
vrrp_long = TIMER_LONG(vrrp_timer);
return (vrrp_long < 0) ? TIMER_MAX_SEC : vrrp_long;
*
* Part: VRRP synchronization framework.
*
- * Version: $Id: vrrp_sync.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_sync.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
void
vrrp_init_instance_sands(vrrp_rt * vrrp)
{
- TIMEVAL timer = timer_now();
-
if (vrrp->state == VRRP_STATE_MAST ||
vrrp->state == VRRP_STATE_GOTO_MASTER ||
vrrp->state == VRRP_STATE_GOTO_FAULT) {
- vrrp->sands.tv_sec = timer.tv_sec + vrrp->adver_int / TIMER_HZ;
- vrrp->sands.tv_usec = timer.tv_usec;
+ vrrp->sands.tv_sec = time_now.tv_sec + vrrp->adver_int / TIMER_HZ;
+ vrrp->sands.tv_usec = time_now.tv_usec;
return;
}
if (vrrp->state == VRRP_STATE_BACK || vrrp->state == VRRP_STATE_FAULT)
- vrrp->sands = timer_add_long(timer, vrrp->ms_down_timer);
+ vrrp->sands = timer_add_long(time_now, vrrp->ms_down_timer);
}
/* Instance name lookup */
*
* Part: Interface tracking framework.
*
- * Version: $Id: vrrp_track.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vrrp_track.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: HTML stream parser utility functions.
*
- * Version: $Id: html.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: html.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: parser.c include file.
*
- * Version: $Id: html.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: html.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: List structure manipulation.
*
- * Version: $Id: list.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: list.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: list.c include file.
*
- * Version: $Id: list.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: list.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* Part: Memory management framework. This framework is used to
* find any memory leak.
*
- * Version: $Id: memory.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: memory.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
*
* Part: memory.c include file.
*
- * Version: $Id: memory.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: memory.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
*
* Part: Forked system call to launch an extra script.
*
- * Version: $Id: notify.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: notify.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: notify.c include file.
*
- * Version: $Id: notify.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: notify.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* data structure representation the conf file representing
* the loadbalanced server pool.
*
- * Version: $Id: parser.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: parser.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: cfreader.c include file.
*
- * Version: $Id: parser.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: parser.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* the thread management routine (thread.c) present in the
* very nice zebra project (http://www.zebra.org).
*
- * Version: $Id: scheduler.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: scheduler.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
thread->u.fd = fd;
/* Compute read timeout value */
- thread->sands = timer_add_long(timer_now(), timer);
+ thread->sands = timer_add_long(time_now, timer);
/* Sort the thread. */
thread_list_add_timeval(&m->read, thread);
thread->u.fd = fd;
/* Compute write timeout value */
- thread->sands = timer_add_long(timer_now(), timer);
+ thread->sands = timer_add_long(time_now, timer);
/* Sort the thread. */
thread_list_add_timeval(&m->write, thread);
thread->arg = arg;
/* Do we need jitter here? */
- thread->sands = timer_add_long(timer_now(), timer);
+ thread->sands = timer_add_long(time_now, timer);
/* Sort by timeval. */
thread_list_add_timeval(&m->timer, thread);
thread->u.c.status = 0;
/* Compute write timeout value */
- thread->sands = timer_add_long(timer_now(), timer);
+ thread->sands = timer_add_long(time_now, timer);
/* Sort by timeval. */
thread_list_add_timeval(&m->child, thread);
TIMEVAL *
thread_compute_timer(thread_master * m, TIMEVAL * timer_wait)
{
- TIMEVAL time_now;
TIMEVAL timer_min;
TIMER_RESET(timer_min);
- time_now = timer_now();
if (m->timer.head)
timer_min = m->timer.head->sands;
fd_set readfd;
fd_set writefd;
fd_set exceptfd;
- TIMEVAL time_now;
TIMEVAL *timer_wait;
int status;
sigset_t sigset, dummy_sigset, block_sigset, pending;
return fetch;
}
- /* Calculate select wait timer. Take care of timeouted fd */
+ /*
+ * Re-read the current time to get the maximum accuracy.
+ * Calculate select wait timer. Take care of timeouted fd.
+ */
+ set_time_now();
timer_wait = thread_compute_timer(m, timer_wait);
/* Call select function. */
sigprocmask(SIG_SETMASK, &saveset, NULL);
}
+ /* Update current time */
+ set_time_now();
+
if (ret < 0) {
if (errno != EINTR) {
/* Real error. */
}
/* Timeout children */
- time_now = timer_now();
thread = m->child.head;
while (thread) {
struct _thread *t;
}
/* Read thead. */
- time_now = timer_now();
thread = m->read.head;
-
while (thread) {
struct _thread *t;
}
/* Write thead. */
- time_now = timer_now();
thread = m->write.head;
-
while (thread) {
struct _thread *t;
/*... */
/* Timer update. */
- time_now = timer_now();
-
thread = m->timer.head;
while (thread) {
struct _thread *t;
*
* Part: scheduler.c include file.
*
- * Version: $Id: scheduler.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: scheduler.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Timer manipulations.
*
- * Version: $Id: timer.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: timer.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
#include <string.h>
#include "timer.h"
+/* time_now holds current time */
+TIMEVAL time_now = { tv_sec: 0, tv_usec: 0 };
+
/* set a timer to a specific value */
TIMEVAL
timer_dup(TIMEVAL b)
return timer_now;
}
+/* sets and returns current time from system time */
+TIMEVAL
+set_time_now(void)
+{
+ /* init timer */
+ TIMER_RESET(time_now);
+ gettimeofday(&time_now, NULL);
+
+ return time_now;
+}
+
/* timer sub from current time */
TIMEVAL
timer_sub_now(TIMEVAL a)
{
- return timer_sub(timer_now(), a);
+ return timer_sub(time_now, a);
}
/* print timer value */
*
* Part: timer.c include file.
*
- * Version: $Id: timer.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: timer.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
typedef struct timeval TIMEVAL;
+/* Global vars */
+extern TIMEVAL time_now;
+
/* macro utilities */
#define TIMER_HZ 1000000
#define TIMER_MAX_SEC 1000
/* prototypes */
extern TIMEVAL timer_now(void);
+extern TIMEVAL set_time_now(void);
extern TIMEVAL timer_dup(TIMEVAL b);
extern int timer_cmp(TIMEVAL a, TIMEVAL b);
extern TIMEVAL timer_sub(TIMEVAL a, TIMEVAL b);
*
* Part: General program utils.
*
- * Version: $Id: utils.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: utils.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: utils.h include file.
*
- * Version: $Id: utils.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: utils.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Vector structure manipulation.
*
- * Version: $Id: vector.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vector.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vector.c include file.
*
- * Version: $Id: vector.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: vector.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Software watchdog framework.
*
- * Version: $Id: watchdog.c,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: watchdog.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: watchdog.c include file.
*
- * Version: $Id: watchdog.h,v 1.1.4 2003/12/29 12:12:04 acassen Exp $
+ * Version: $Id: watchdog.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
} wdog_data;
/* watchdog definition */
-#define WATCHDOG_TIMER 30
+#define WATCHDOG_TIMER (30 * TIMER_HZ)
#define WATCHDOG_DELAY (5 * TIMER_HZ)
#define WATCHDOG_STRING "hello"
#define WDOG_READ_BUFSIZ 32