keepalived-1.1.5 v1.1.5
authorAlexandre Cassen <acassen@freebox.fr>
Mon, 26 Jan 2004 05:19:37 +0000 (06:19 +0100)
committerAlexandre Cassen <acassen@freebox.fr>
Mon, 28 Sep 2009 08:58:59 +0000 (10:58 +0200)
* 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.

102 files changed:
ChangeLog
VERSION
bin/.kdbgrc.genhash [deleted file]
configure
configure.in
doc/man/man5/keepalived.conf.5 [new file with mode: 0644]
doc/man/man8/keepalived.8 [new file with mode: 0644]
genhash/Makefile.in
keepalived.spec
keepalived/Makefile.in
keepalived/check/Makefile.in
keepalived/check/check_api.c
keepalived/check/check_ci.c [deleted file]
keepalived/check/check_daemon.c
keepalived/check/check_data.c
keepalived/check/check_http.c
keepalived/check/check_misc.c
keepalived/check/check_parser.c
keepalived/check/check_ssl.c
keepalived/check/check_tcp.c
keepalived/check/ipfwwrapper.c
keepalived/check/ipvswrapper.c
keepalived/check/ipwrapper.c
keepalived/core/Makefile.in
keepalived/core/daemon.c
keepalived/core/global_data.c
keepalived/core/global_parser.c
keepalived/core/layer4.c
keepalived/core/main.c
keepalived/core/pidfile.c
keepalived/core/smtp.c
keepalived/include/check_api.h
keepalived/include/check_ci.h [deleted file]
keepalived/include/check_daemon.h
keepalived/include/check_data.h
keepalived/include/check_http.h
keepalived/include/check_misc.h
keepalived/include/check_parser.h
keepalived/include/check_ssl.h
keepalived/include/check_tcp.h
keepalived/include/daemon.h
keepalived/include/global_data.h
keepalived/include/global_parser.h
keepalived/include/ipfwwrapper.h
keepalived/include/ipvswrapper.h
keepalived/include/ipwrapper.h
keepalived/include/layer4.h
keepalived/include/main.h
keepalived/include/pidfile.h
keepalived/include/smtp.h
keepalived/include/vrrp.h
keepalived/include/vrrp_arp.h
keepalived/include/vrrp_daemon.h
keepalived/include/vrrp_data.h
keepalived/include/vrrp_if.h
keepalived/include/vrrp_index.h
keepalived/include/vrrp_ipaddress.h
keepalived/include/vrrp_iproute.h
keepalived/include/vrrp_ipsecah.h
keepalived/include/vrrp_netlink.h
keepalived/include/vrrp_notify.h
keepalived/include/vrrp_parser.h
keepalived/include/vrrp_scheduler.h
keepalived/include/vrrp_sync.h
keepalived/include/vrrp_track.h
keepalived/libipvs/Makefile.in
keepalived/vrrp/Makefile.in
keepalived/vrrp/vrrp.c
keepalived/vrrp/vrrp_arp.c
keepalived/vrrp/vrrp_daemon.c
keepalived/vrrp/vrrp_data.c
keepalived/vrrp/vrrp_if.c
keepalived/vrrp/vrrp_index.c
keepalived/vrrp/vrrp_ipaddress.c
keepalived/vrrp/vrrp_iproute.c
keepalived/vrrp/vrrp_ipsecah.c
keepalived/vrrp/vrrp_netlink.c
keepalived/vrrp/vrrp_notify.c
keepalived/vrrp/vrrp_parser.c
keepalived/vrrp/vrrp_scheduler.c
keepalived/vrrp/vrrp_sync.c
keepalived/vrrp/vrrp_track.c
lib/html.c
lib/html.h
lib/list.c
lib/list.h
lib/memory.c
lib/memory.h
lib/notify.c
lib/notify.h
lib/parser.c
lib/parser.h
lib/scheduler.c
lib/scheduler.h
lib/timer.c
lib/timer.h
lib/utils.c
lib/utils.h
lib/vector.c
lib/vector.h
lib/watchdog.c
lib/watchdog.h

index 91bdd6c..3035a20 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+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.
diff --git a/VERSION b/VERSION
index 65087b4..e25d8d9 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.1.4
+1.1.5
diff --git a/bin/.kdbgrc.genhash b/bin/.kdbgrc.genhash
deleted file mode 100644 (file)
index d60ea17..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-[General]
-DebuggerCmdStr=
-FileVersion=1
-ProgramArgs=
-TTYLevel=7
-WorkingDirectory=
-
-[Memory]
-ColumnWidths=80,0
-NumExprs=0
index 8d3f507..96ab3a1 100755 (executable)
--- a/configure
+++ b/configure
@@ -308,7 +308,7 @@ ac_includes_default="\
 # 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.
@@ -849,7 +849,6 @@ Optional Packages:
   --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
@@ -2263,14 +2262,6 @@ if test "${with_kernel_dir+set}" = set; then
 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"
@@ -3259,154 +3250,6 @@ fi
 
 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
@@ -3612,79 +3455,8 @@ echo "$as_me: error: Popt libraries is required" >&2;}
    { (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
@@ -4056,17 +3828,6 @@ rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext
 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_"
 
@@ -4080,7 +3841,6 @@ fi
 
 
 
-
 IPVS_SYNCD="_WITHOUT_IPVS_SYNCD_"
 if test "$IPVS_SUPPORT" = "_WITH_LVS_"; then
   echo "$as_me:$LINENO: checking for LVS syncd support" >&5
@@ -5186,7 +4946,6 @@ s,@KERN@,$KERN,;t t
 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
@@ -5462,11 +5221,6 @@ if test "${LINKWATCH_SUPPORT}" = "_WITH_LINKWATCH_"; then
 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
index 0c6da37..d2b1c25 100644 (file)
@@ -26,10 +26,6 @@ AC_ARG_WITH(kernel-dir,
   [  --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,
@@ -43,21 +39,14 @@ AC_CHECK_HEADERS(linux/netlink.h linux/rtnetlink.h)
 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>
@@ -163,17 +152,6 @@ if test "$enable_vrrp" != "no"; then
     ])
 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)
@@ -185,7 +163,6 @@ fi
 
 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
@@ -278,11 +255,6 @@ if test "${LINKWATCH_SUPPORT}" = "_WITH_LINKWATCH_"; then
 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
diff --git a/doc/man/man5/keepalived.conf.5 b/doc/man/man5/keepalived.conf.5
new file mode 100644 (file)
index 0000000..64aaccf
--- /dev/null
@@ -0,0 +1,400 @@
+.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
diff --git a/doc/man/man8/keepalived.8 b/doc/man/man8/keepalived.8
new file mode 100644 (file)
index 0000000..e325639
--- /dev/null
@@ -0,0 +1,72 @@
+.\"\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
index 09f08ea..3aa273d 100644 (file)
@@ -10,7 +10,7 @@ bindir     = @bindir@
 
 CC = @CC@
 INCLUDES = -I../lib
-CFLAGS = @CFLAGS@ $(INCLUDES) \
+CFLAGS = @CFLAGS@ @CPPFLAGS@ $(INCLUDES) \
         -Wall -Wunused -Wstrict-prototypes
 LDFLAGS = -lssl -lpopt
 
index 243f0ab..401a12a 100644 (file)
@@ -1,7 +1,7 @@
 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
index 89aac8a..547a2cb 100644 (file)
@@ -42,7 +42,7 @@ all:
        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"
@@ -52,7 +52,7 @@ debug:
        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"
 
@@ -61,7 +61,7 @@ profile:
        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"
 
index 084aa98..0a38e80 100644 (file)
@@ -6,20 +6,15 @@
 
 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
index 231f239..34a6065 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
@@ -30,9 +30,6 @@
 #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;
@@ -170,7 +167,4 @@ install_checkers_keyword(void)
        install_tcp_check_keyword();
        install_http_check_keyword();
        install_ssl_check_keyword();
-#ifdef _WITH_CI_LINUX_
-       install_ci_check_keyword();
-#endif
 }
diff --git a/keepalived/check/check_ci.c b/keepalived/check/check_ci.c
deleted file mode 100644 (file)
index 6fd99ca..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * 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;
-}
index 7624640..9c7b748 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 4cea099..7bafdf0 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 6e79f7f..70dc608 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
index 00d505f..8871470 100644 (file)
@@ -6,7 +6,7 @@
  * 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>
index 3498da3..07aecbd 100644 (file)
@@ -7,7 +7,7 @@
  *              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>
  *              
@@ -219,7 +219,9 @@ check_init_keywords(void)
        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);
index c3579fa..bee944d 100644 (file)
@@ -7,7 +7,7 @@
  *              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>
index 1e4bc90..7763743 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 7158a8a..b5f5903 100644 (file)
@@ -7,7 +7,7 @@
  *              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>
  *
index e65d19e..ff9e220 100644 (file)
@@ -6,7 +6,7 @@
  * 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>
  *              
index 068527f..f348426 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 37a2e53..7914609 100644 (file)
@@ -6,7 +6,7 @@
 
 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)
index 3ec0aaf..cec941d 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 756d6db..757bcaa 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index aa1b685..6ef0990 100644 (file)
@@ -7,7 +7,7 @@
  *              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>
  *              
index 120f043..ed80e06 100644 (file)
@@ -6,7 +6,7 @@
  * 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>
  *
index 1b8cd14..9cf9f61 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 2ef4663..c851710 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 8a34bb7..01953b2 100644 (file)
@@ -7,7 +7,7 @@
  *              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>
  *
index 367e3d5..5af271f 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
diff --git a/keepalived/include/check_ci.h b/keepalived/include/check_ci.h
deleted file mode 100644 (file)
index 193582d..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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
index 87cfe40..d422be3 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *              
index 923dc1c..ab8db8b 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index c8481e6..57114a1 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
index bac3a52..f1c406a 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
index 2807f2b..7c4339f 100644 (file)
@@ -5,7 +5,7 @@
  * 
  * 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>
  *
index 97ea550..3142438 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
index 616a45a..848b6c6 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 82ead55..c66f408 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index d3b3221..1631d41 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 91b7b28..83fa86a 100644 (file)
@@ -5,7 +5,7 @@
  * 
  * 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>
  *
index 9d691eb..8545c55 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 38ec8b2..6240aa1 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 604ef11..2defc02 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 75223be..753cbf7 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 1a080ae..c38b7d4 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
@@ -59,8 +59,8 @@ int linkwatch = 0;            /* Use linkwatch kernel netlink reflection */
 #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,         \
index 00a5cbe..cece1d0 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 2306c52..df27c4a 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 8a001e3..7c741d5 100644 (file)
@@ -6,7 +6,7 @@
  *
  * 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>
  *
index 4e37d81..f176696 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 6a5c30b..ffbd3bc 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *              
index 7af1756..3af17e8 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index a3f9adc..d8f0388 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
@@ -88,13 +88,12 @@ list if_queue;
 #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);
index 6c7c00d..b494f57 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index db714ce..0f3b193 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index a920a8d..0022833 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index f3f84e7..e36a390 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *              
index 05a5b5b..c74eed1 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index afe13df..704c698 100644 (file)
@@ -6,7 +6,7 @@
  *
  * 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>
  *
index ab8a127..ab67081 100644 (file)
@@ -5,7 +5,7 @@
  * 
  * 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>
  *
index 5fa1f72..9ccac26 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *              
index d690d0f..1ffd0d6 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *              
index c8b0c00..a20d20c 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 863cb67..79ef8ce 100644 (file)
@@ -1,7 +1,7 @@
 # Makefile to make libipvsc.
 
 CC     = @CC@
-CFLAGS = @CFLAGS@ -Wall -Wunused
+CFLAGS = @CFLAGS@ @CPPFLAGS@ -Wall -Wunused
 
 export OBJS += libipvs.a
 
index b2f6c99..8a1d9de 100644 (file)
@@ -6,7 +6,7 @@
 
 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)
index 3140b83..91daf42 100644 (file)
@@ -8,7 +8,7 @@
  *              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>
  *
@@ -278,7 +278,7 @@ vrrp_in_chk(vrrp_rt * vrrp, char *buffer)
        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;
                }
index ee54cbb..399cbd6 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 605c8e8..fe53b58 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index e4ffed5..f967e3c 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 8ff1c1d..fae17d2 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
@@ -310,7 +310,13 @@ if_linkbeat_refresh_thread(thread * thread)
        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);
@@ -344,14 +350,6 @@ init_if_linkbeat(void)
                                 , 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*/
index 1cbbc36..a016648 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 8bc8a21..b81449e 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 93b47e7..0c0754d 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 1620c36..a956dde 100644 (file)
@@ -7,7 +7,7 @@
  *              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>
  *
index 97b174a..9155054 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 5c832c3..d123355 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index c678b26..b8461ba 100644 (file)
@@ -7,7 +7,7 @@
  *              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>
  *              
@@ -263,7 +263,7 @@ vrrp_auth_pass_handler(vector strvec)
        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
index 53ae829..8405353 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
@@ -258,12 +258,11 @@ vrrp_compute_timer(const int fd)
 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;
index 41def6a..8303e82 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
@@ -36,18 +36,16 @@ extern vrrp_conf_data *vrrp_data;
 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 */
index 0aa3b73..5dd1d9c 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index b665c49..e255abe 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 22ccd30..993d194 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 149158f..9617399 100644 (file)
@@ -5,7 +5,7 @@
  * 
  * 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>
  *              
index 727f44a..224b451 100644 (file)
@@ -5,7 +5,7 @@
  * 
  * 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>
  *
index 2431611..ebcdebc 100644 (file)
@@ -6,7 +6,7 @@
  * 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>
index 174b034..419b50f 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
index 950b0fa..128acb7 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 00cacb2..119b378 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index f2371eb..6378d1c 100644 (file)
@@ -7,7 +7,7 @@
  *              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>
  *              
index c0434e4..a714dc3 100644 (file)
@@ -5,7 +5,7 @@
  * 
  * 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>
  *
index 220a5ef..ce39dd8 100644 (file)
@@ -7,7 +7,7 @@
  *              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>
  *
@@ -234,7 +234,7 @@ thread_add_read(thread_master * m, int (*func) (thread *)
        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);
@@ -266,7 +266,7 @@ thread_add_write(thread_master * m, int (*func) (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);
@@ -291,7 +291,7 @@ thread_add_timer(thread_master * m, int (*func) (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);
@@ -318,7 +318,7 @@ thread_add_child(thread_master * m, int (*func) (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);
@@ -431,11 +431,9 @@ thread_cancel_event(thread_master * m, void *arg)
 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;
@@ -487,7 +485,6 @@ thread_fetch(thread_master * m, thread * fetch)
        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;
@@ -535,7 +532,11 @@ retry:     /* When thread can't fetch try to find next thread again. */
                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. */
@@ -570,6 +571,9 @@ retry:      /* When thread can't fetch try to find next thread again. */
                sigprocmask(SIG_SETMASK, &saveset, NULL);
        }
 
+       /* Update current time */
+       set_time_now();
+
        if (ret < 0) {
                if (errno != EINTR) {
                        /* Real error. */
@@ -608,7 +612,6 @@ retry:      /* When thread can't fetch try to find next thread again. */
        }
 
        /* Timeout children */
-       time_now = timer_now();
        thread = m->child.head;
        while (thread) {
                struct _thread *t;
@@ -624,9 +627,7 @@ retry:      /* When thread can't fetch try to find next thread again. */
        }
 
        /* Read thead. */
-       time_now = timer_now();
        thread = m->read.head;
-
        while (thread) {
                struct _thread *t;
 
@@ -650,9 +651,7 @@ retry:      /* When thread can't fetch try to find next thread again. */
        }
 
        /* Write thead. */
-       time_now = timer_now();
        thread = m->write.head;
-
        while (thread) {
                struct _thread *t;
 
@@ -678,8 +677,6 @@ retry:      /* When thread can't fetch try to find next thread again. */
        /*... */
 
        /* Timer update. */
-       time_now = timer_now();
-
        thread = m->timer.head;
        while (thread) {
                struct _thread *t;
index 6c91cea..9b4dbe1 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 4e1ba51..4a62e65 100644 (file)
@@ -5,7 +5,7 @@
  * 
  * 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>
  *              
@@ -26,6 +26,9 @@
 #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)
@@ -102,11 +105,22 @@ timer_now(void)
        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 */
index 6ebb196..3fe6db1 100644 (file)
@@ -5,7 +5,7 @@
  * 
  * 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>
  *
@@ -29,6 +29,9 @@
 
 typedef struct timeval TIMEVAL;
 
+/* Global vars */
+extern TIMEVAL time_now;
+
 /* macro utilities */
 #define TIMER_HZ      1000000
 #define TIMER_MAX_SEC 1000
@@ -39,6 +42,7 @@ typedef struct timeval TIMEVAL;
 
 /* 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);
index 36401d8..30bcdcd 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index a1d0876..ca97d5e 100644 (file)
@@ -5,7 +5,7 @@
  *
  * 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>
  *
index 3b43387..6cad32a 100644 (file)
@@ -5,7 +5,7 @@
  * 
  * 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>
  *              
index f047225..dece2b3 100644 (file)
@@ -5,7 +5,7 @@
  * 
  * 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>
  *
index 109054a..70fb0eb 100644 (file)
@@ -5,7 +5,7 @@
  * 
  * 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>
  *              
index 2e94918..daa3488 100644 (file)
@@ -5,7 +5,7 @@
  * 
  * 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>
  *
@@ -38,7 +38,7 @@ typedef struct _wdog_data {
 } 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