* keepalived-1.1.6 released.
* VRRP : Fixed scheduling timer update. Global scheduling timer is
updated before each thread registering and after scheduling I/O MUX.
Since is needed to take care of scheduling jitter introduced by
overhead (VRRP is using low low timer so more sensitive to overhead).
Thanks to Nathan Neulinger, <nneul@umr.edu> for his quick feedback
debugging time.
* VRRP : Nathan Neulinger, <nneul@umr.edu> updated vrrp dropping
strategy to not reply to incoming bogus adverts. Since this can
introduce flooding loop, bogus adverts are now simply silently
dropped.
* VRRP : Fixed a linkbeat issue while polling NIC flags.
* Updated autoconf and Makefile to support 2.6 kernel IPVS code. For
code readability, created 2 differents libipvs for 2.4 and 2.6 kernel
. Fixed autoconf generated warning.
* Extended ipvswrapper to support shared buffer user rule. This
increase performances by limiting memory allocation. OTOH, created
two new ipvs helpers ipvs_start & ipvs_stop to initialize ipvs
subsystem.
* Andres Salomon, <dilinger@voxel.net> made some cosmetics update
in Makefiles to support $(DESTDIR) and $(BIN)/$(EXEC) path split.
export CPPFLAGS="-I/usr/kerberos/include" && ./configure
+2004-02-23 Alexandre Cassen <acassen@linux-vs.org>
+ * keepalived-1.1.6 released.
+ * VRRP : Fixed scheduling timer update. Global scheduling timer is
+ updated before each thread registering and after scheduling I/O MUX.
+ Since is needed to take care of scheduling jitter introduced by
+ overhead (VRRP is using low low timer so more sensitive to overhead).
+ Thanks to Nathan Neulinger, <nneul@umr.edu> for his quick feedback
+ debugging time.
+ * VRRP : Nathan Neulinger, <nneul@umr.edu> updated vrrp dropping
+ strategy to not reply to incoming bogus adverts. Since this can
+ introduce flooding loop, bogus adverts are now simply silently
+ dropped.
+ * VRRP : Fixed a linkbeat issue while polling NIC flags.
+ * Updated autoconf and Makefile to support 2.6 kernel IPVS code. For
+ code readability, created 2 differents libipvs for 2.4 and 2.6 kernel
+ . Fixed autoconf generated warning.
+ * Extended ipvswrapper to support shared buffer user rule. This
+ increase performances by limiting memory allocation. OTOH, created
+ two new ipvs helpers ipvs_start & ipvs_stop to initialize ipvs
+ subsystem.
+ * Andres Salomon, <dilinger@voxel.net> made some cosmetics update
+ in Makefiles to support $(DESTDIR) and $(BIN)/$(EXEC) path split.
+
2004-01-25 Alexandre Cassen <acassen@linux-vs.org>
* keepalived-1.1.5 released.
* Joseph Mack, <mack.joseph@epa.gov> wrote keeplived manpages
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
+ export 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.
rm -f Makefile
mrproper: distclean
- rm -f bin/*
rm -f config.*
uninstall:
# 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 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 IPVS_SYNCD DFLAGS IPVS_SUPPORT VRRP_SUPPORT LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
-for ac_header in linux/netlink.h linux/rtnetlink.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
-
-fi
-
-done
-
-
-
for ac_header in openssl/ssl.h openssl/md5.h openssl/err.h
do
CPPFLAGS="$CPPFLAGS -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
+echo "$as_me:$LINENO: checking for kernel version" >&5
+echo $ECHO_N "checking for kernel version... $ECHO_C" >&6
if test "$cross_compiling" = yes; then
- KERN="_KRNL_2_2_"
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ LINUX_MAJOR="0"
+ LINUX_MINOR="0"
+ LINUX_PATCH="0"
else
cat >conftest.$ac_ext <<_ACEOF
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
- #include <stdlib.h>
- #include <linux/version.h>
- int main (void) {
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
- return 0;
- #else
- return 1;
- #endif
- }
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <linux/version.h>
+ int main (void) {
+ FILE *fp = fopen ("linuxinfo", "w");
+ if (!fp) return 1;
+ fprintf (fp, "%s\n", UTS_RELEASE);
+ fclose (fp);
+ return 0;
+ }
+
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- KERN="_KRNL_2_4_"
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+ LINUX_MAJOR=`cat linuxinfo | cut -d'.' -f1`
+ LINUX_MINOR=`cat linuxinfo | cut -d'.' -f2`
+ LINUX_PATCH=`cat linuxinfo | cut -d'.' -f3`
else
echo "$as_me: program exited with status $ac_status" >&5
( exit $ac_status )
- KERN="_KRNL_2_2_"
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ LINUX_MAJOR="0"
+ LINUX_MINOR="0"
+ LINUX_PATCH="0"
fi
rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
+ rm -f linuxinfo
+ echo "$as_me:$LINENO: result: $LINUX_MAJOR.$LINUX_MINOR.$LINUX_PATCH" >&5
+echo "${ECHO_T}$LINUX_MAJOR.$LINUX_MINOR.$LINUX_PATCH" >&6
+ if test "$LINUX_MINOR" = "6"; then
+ KERN="_KRNL_2_6_"
+ elif test "$LINUX_MINOR" = "4"; then
+ KERN="_KRNL_2_4_"
+ else
+ KERN="_KRNL_2_2_"
+ fi
+ if test "$LINUX_MAJOR" = "0" -a "$LINUX_MINOR" = "0" -a "$LINUX_PATCH" = "0"; then
+ { echo "$as_me:$LINENO: WARNING: Cannot determine Linux Kernel version." >&5
+echo "$as_me: WARNING: Cannot determine Linux Kernel version." >&2;}
+ fi
echo "$as_me:$LINENO: checking for /usr/src/linux/net/core/link_watch.c" >&5
echo $ECHO_N "checking for /usr/src/linux/net/core/link_watch.c... $ECHO_C" >&6
{ (exit 1); exit 1; }; }
fi
+
+IPVS_SYNCD="_WITHOUT_IPVS_SYNCD_"
+if test "$IPVS_SUPPORT" = "_WITH_LVS_"; then
+ echo "$as_me:$LINENO: checking for IPVS syncd support" >&5
+echo $ECHO_N "checking for IPVS syncd support... $ECHO_C" >&6
+ if test "$KERN" = "_KRNL_2_6_"; then
+ IPVS_SYNCD="_HAVE_IPVS_SYNCD_"
+ elif test "$IPVS_MAJOR" -ge 1 -a "$KERN" = "_KRNL_2_4_"; then
+ IPVS_SYNCD="_HAVE_IPVS_SYNCD_"
+ elif test "$IPVS_MINOR" -ge 9 -a "$IPVS_PATCH" -ge 2 -a "$KERN" = "_KRNL_2_4_"; then
+ IPVS_SYNCD="_HAVE_IPVS_SYNCD_"
+ else
+ IPVS_SYNCD="_WITHOUT_IPVS_SYNCD_"
+ fi
+
+ if test "${IPVS_SUPPORT}" = "_WITHOUT_LVS_" -o "$enable_lvs_syncd" = "no"; then
+ IPVS_SYNCD="_WITHOUT_IPVS_SYNCD_"
+ fi
+
+ if test "$IPVS_SYNCD" = "_HAVE_IPVS_SYNCD_"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ fi
+fi
+
+
+
VRRP_SUPPORT="_WITHOUT_VRRP_"
if test "$enable_vrrp" != "no"; then
echo "$as_me:$LINENO: checking for kernel netlink support" >&5
-
-IPVS_SYNCD="_WITHOUT_IPVS_SYNCD_"
-if test "$IPVS_SUPPORT" = "_WITH_LVS_"; then
- echo "$as_me:$LINENO: checking for LVS syncd support" >&5
-echo $ECHO_N "checking for LVS syncd support... $ECHO_C" >&6
- if test "$IPVS_MAJOR" -ge 1 -a "$KERN" = "_KRNL_2_4_"; then
- IPVS_SYNCD="_HAVE_IPVS_SYNCD_"
- elif test "$IPVS_MINOR" -ge 9 -a "$IPVS_PATCH" -ge 2 -a "$KERN" = "_KRNL_2_4_"; then
- IPVS_SYNCD="_HAVE_IPVS_SYNCD_"
- else
- IPVS_SYNCD="_WITHOUT_IPVS_SYNCD_"
- fi
-
- if test "${IPVS_SUPPORT}" = "_WITHOUT_LVS_" -o "$enable_lvs_syncd" = "no"; then
- IPVS_SYNCD="_WITHOUT_IPVS_SYNCD_"
- fi
-
- if test "$IPVS_SYNCD" = "_HAVE_IPVS_SYNCD_"; then
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
- else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
- fi
-fi
-
-
-
echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
if test "${ac_cv_c_const+set}" = set; then
fi
fi
+echo "$as_me:$LINENO: checking for working memcmp" >&5
+echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6
+if test "${ac_cv_func_memcmp_working+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_memcmp_working=no
+else
+ 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. */
+
+int
+main ()
+{
+
+ /* Some versions of memcmp are not 8-bit clean. */
+ char c0 = 0x40, c1 = 0x80, c2 = 0x81;
+ if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
+ exit (1);
+
+ /* The Next x86 OpenStep bug shows up only when comparing 16 bytes
+ or more and with at least one buffer not starting on a 4-byte boundary.
+ William Lewis provided this test program. */
+ {
+ char foo[21];
+ char bar[21];
+ int i;
+ for (i = 0; i < 4; i++)
+ {
+ char *a = foo + i;
+ char *b = bar + i;
+ strcpy (a, "--------01111111");
+ strcpy (b, "--------10000000");
+ if (memcmp (a, b, 16) >= 0)
+ exit (1);
+ }
+ exit (0);
+ }
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f 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='./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_func_memcmp_working=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_memcmp_working=no
+fi
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5
+echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6
+test $ac_cv_func_memcmp_working = no && LIBOBJS="$LIBOBJS memcmp.$ac_objext"
+
echo "$as_me:$LINENO: checking return type of signal handlers" >&5
echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
if test "${ac_cv_type_signal+set}" = set; then
fi
if test "$IPVS_SUPPORT" = "_WITH_LVS_"; then
OUTPUT_TARGET="$OUTPUT_TARGET keepalived/check/Makefile"
- if test "$KERN" = "_KRNL_2_4_"; then
- OUTPUT_TARGET="$OUTPUT_TARGET keepalived/libipvs/Makefile"
+ if test "$KERN" = "_KRNL_2_6_"; then
+ OUTPUT_TARGET="$OUTPUT_TARGET keepalived/libipvs-2.6/Makefile"
+ elif test "$KERN" = "_KRNL_2_4_"; then
+ OUTPUT_TARGET="$OUTPUT_TARGET keepalived/libipvs-2.4/Makefile"
else
OUTPUT_TARGET="$OUTPUT_TARGET keepalived/libipfwc/Makefile"
fi
s,@EGREP@,$EGREP,;t t
s,@LINKWATCH_SUPPORT@,$LINKWATCH_SUPPORT,;t t
s,@KERN@,$KERN,;t t
+s,@IPVS_SYNCD@,$IPVS_SYNCD,;t t
s,@DFLAGS@,$DFLAGS,;t t
s,@IPVS_SUPPORT@,$IPVS_SUPPORT,;t t
s,@VRRP_SUPPORT@,$VRRP_SUPPORT,;t t
-s,@IPVS_SYNCD@,$IPVS_SYNCD,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
CEOF
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h syslog.h unistd.h sys/ioctl.h sys/time.h)
-AC_CHECK_HEADERS(linux/netlink.h linux/rtnetlink.h)
+dnl [do we really need this ?] 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. !!!]))
dnl ----[ Kernel version check ]----
CPPFLAGS="$CPPFLAGS -I$kernelinc"
-AC_MSG_CHECKING([for kernel >= 2.4.0])
+AC_MSG_CHECKING([for kernel version])
AC_TRY_RUN([
- #include <stdlib.h>
- #include <linux/version.h>
- int main (void) {
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
- return 0;
- #else
- return 1;
- #endif
- }], [
- KERN="_KRNL_2_4_"
- AC_MSG_RESULT(yes)
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <linux/version.h>
+ int main (void) {
+ FILE *fp = fopen ("linuxinfo", "w");
+ if (!fp) return 1;
+ fprintf (fp, "%s\n", UTS_RELEASE);
+ fclose (fp);
+ return 0;
+ }
], [
- KERN="_KRNL_2_2_"
- AC_MSG_RESULT(no)
+ LINUX_MAJOR=`cat linuxinfo | cut -d'.' -f1`
+ LINUX_MINOR=`cat linuxinfo | cut -d'.' -f2`
+ LINUX_PATCH=`cat linuxinfo | cut -d'.' -f3`
], [
- KERN="_KRNL_2_2_"
- AC_MSG_RESULT(no)
+ LINUX_MAJOR="0"
+ LINUX_MINOR="0"
+ LINUX_PATCH="0"
+ ], [
+ LINUX_MAJOR="0"
+ LINUX_MINOR="0"
+ LINUX_PATCH="0"
])
+ rm -f linuxinfo
+ AC_MSG_RESULT([$LINUX_MAJOR.$LINUX_MINOR.$LINUX_PATCH])
+ if test "$LINUX_MINOR" = "6"; then
+ KERN="_KRNL_2_6_"
+ elif test "$LINUX_MINOR" = "4"; then
+ KERN="_KRNL_2_4_"
+ else
+ KERN="_KRNL_2_2_"
+ fi
+ if test "$LINUX_MAJOR" = "0" -a "$LINUX_MINOR" = "0" -a "$LINUX_PATCH" = "0"; then
+ AC_MSG_WARN([Cannot determine Linux Kernel version.])
+ fi
AC_CHECK_FILE(/usr/src/linux/net/core/link_watch.c, [
LINKWATCH_SUPPORT="_WITH_LINKWATCH_"
AC_MSG_ERROR([keepalived MUST be compiled at least with LVS or VRRP framework])
fi
+dnl ----[ IPVS syncd support probe ]---
+dnl Sync daemon is supported since IPVS 0.9.2 for kernel 2.4
+
+IPVS_SYNCD="_WITHOUT_IPVS_SYNCD_"
+if test "$IPVS_SUPPORT" = "_WITH_LVS_"; then
+ AC_MSG_CHECKING([for IPVS syncd support])
+ if test "$KERN" = "_KRNL_2_6_"; then
+ IPVS_SYNCD="_HAVE_IPVS_SYNCD_"
+ elif test "$IPVS_MAJOR" -ge 1 -a "$KERN" = "_KRNL_2_4_"; then
+ IPVS_SYNCD="_HAVE_IPVS_SYNCD_"
+ elif test "$IPVS_MINOR" -ge 9 -a "$IPVS_PATCH" -ge 2 -a "$KERN" = "_KRNL_2_4_"; then
+ IPVS_SYNCD="_HAVE_IPVS_SYNCD_"
+ else
+ IPVS_SYNCD="_WITHOUT_IPVS_SYNCD_"
+ fi
+
+ if test "${IPVS_SUPPORT}" = "_WITHOUT_LVS_" -o "$enable_lvs_syncd" = "no"; then
+ IPVS_SYNCD="_WITHOUT_IPVS_SYNCD_"
+ fi
+
+ if test "$IPVS_SYNCD" = "_HAVE_IPVS_SYNCD_"; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+fi
+
+AC_SUBST(IPVS_SYNCD)
+
dnl ----[ Checks for kernel netlink support ]----
VRRP_SUPPORT="_WITHOUT_VRRP_"
if test "$enable_vrrp" != "no"; then
AC_SUBST(IPVS_SUPPORT)
AC_SUBST(VRRP_SUPPORT)
-dnl ----[ LVS syncd support probe ]---
-dnl Sync daemon is supported since LVS 0.9.2 for kernel 2.4
-
-IPVS_SYNCD="_WITHOUT_IPVS_SYNCD_"
-if test "$IPVS_SUPPORT" = "_WITH_LVS_"; then
- AC_MSG_CHECKING([for LVS syncd support])
- if test "$IPVS_MAJOR" -ge 1 -a "$KERN" = "_KRNL_2_4_"; then
- IPVS_SYNCD="_HAVE_IPVS_SYNCD_"
- elif test "$IPVS_MINOR" -ge 9 -a "$IPVS_PATCH" -ge 2 -a "$KERN" = "_KRNL_2_4_"; then
- IPVS_SYNCD="_HAVE_IPVS_SYNCD_"
- else
- IPVS_SYNCD="_WITHOUT_IPVS_SYNCD_"
- fi
-
- if test "${IPVS_SUPPORT}" = "_WITHOUT_LVS_" -o "$enable_lvs_syncd" = "no"; then
- IPVS_SYNCD="_WITHOUT_IPVS_SYNCD_"
- fi
-
- if test "$IPVS_SYNCD" = "_HAVE_IPVS_SYNCD_"; then
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- fi
-fi
-
-AC_SUBST(IPVS_SYNCD)
-
dnl ----[ Checks for typedefs, structures, and compiler characteristics ]----
AC_C_CONST
AC_TYPE_PID_T
dnl ----[ Checks for library functions ]----
AC_PROG_GCC_TRADITIONAL
-dnl AC_FUNC_MEMCMP
+AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(gettimeofday select socket strerror strtol uname)
fi
if test "$IPVS_SUPPORT" = "_WITH_LVS_"; then
OUTPUT_TARGET="$OUTPUT_TARGET keepalived/check/Makefile"
- if test "$KERN" = "_KRNL_2_4_"; then
- OUTPUT_TARGET="$OUTPUT_TARGET keepalived/libipvs/Makefile"
+ if test "$KERN" = "_KRNL_2_6_"; then
+ OUTPUT_TARGET="$OUTPUT_TARGET keepalived/libipvs-2.6/Makefile"
+ elif test "$KERN" = "_KRNL_2_4_"; then
+ OUTPUT_TARGET="$OUTPUT_TARGET keepalived/libipvs-2.4/Makefile"
else
OUTPUT_TARGET="$OUTPUT_TARGET keepalived/libipfwc/Makefile"
fi
# Makefile.in
#
-# Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+# Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
-EXEC = ../bin/genhash
+EXEC = genhash
+BIN = ../bin
prefix = @prefix@
exec_prefix = @exec_prefix@
INCLUDES = -I../lib
CFLAGS = @CFLAGS@ @CPPFLAGS@ $(INCLUDES) \
-Wall -Wunused -Wstrict-prototypes
-LDFLAGS = -lssl -lpopt
+LDFLAGS = @LIBS@ @LDFLAGS@
OBJS = main.o sock.o layer4.o http.o ssl.o
LIB_OBJS = ../lib/timer.o ../lib/scheduler.o \
../lib/memory.o ../lib/list.o ../lib/utils.o \
../lib/html.o
-all: $(EXEC)
- strip $(EXEC)
+all: $(BIN)/$(EXEC)
+ strip $(BIN)/$(EXEC)
@echo ""
@echo "Make complete"
-$(EXEC): $(LIB_OBJS) $(OBJS)
- $(CC) $(LIB_OBJS) $(OBJS) -o $(EXEC) $(LDFLAGS)
+$(BIN)/$(EXEC): $(LIB_OBJS) $(OBJS)
+ $(CC) $(LIB_OBJS) $(OBJS) -o $(BIN)/$(EXEC) $(LDFLAGS)
clean:
rm -f core *.o
distclean: clean
- rm -f Makefile
+ rm -f Makefile $(BIN)/$(EXEC)
uninstall:
- rm -f $(bindir)/$(EXEC)
+ rm -f $(DESTDIR)$(bindir)/$(EXEC)
install:
- install -d $(bindir)
- install -m 755 $(EXEC) $(bindir)/
+ install -d $(DESTDIR)$(bindir)
+ install -m 755 $(BIN)/$(EXEC) $(DESTDIR)$(bindir)/
mrproper: clean distclean
rm -f config.*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include <errno.h>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _HTTP_H
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "layer4.h"
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _LAYER4_H
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include <signal.h>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _MAIN_H
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include <string.h>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _SOCK_H
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include <openssl/err.h>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _SSL_H
Name: keepalived
Summary: HA monitor built upon LVS, VRRP and services poller
Packager: Christophe Varoqui, <christophe.varoqui@free.fr>
-Version: 1.1.5
+Version: 1.1.6
Release: 1
Source: http://www.keepalived.org/software/%{name}-%{version}.tar.gz
Copyright: GPL
#
# Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
-EXEC = keepalived
+EXEC = keepalived
BIN = ../bin
KERNEL = @KERN@
IPVS_FLAG = @IPVS_SUPPORT@
ifeq ($(KERNEL),_KRNL_2_2_)
SUBDIRS += libipfwc
else
- SUBDIRS += libipvs
+ ifeq ($(KERNEL),_KRNL_2_4_)
+ SUBDIRS += libipvs-2.4
+ else
+ SUBDIRS += libipvs-2.6
+ endif
endif
endif
@set -e; \
for i in $(SUBDIRS); do \
$(MAKE) -C $$i distclean; done
- rm -f Makefile
+ rm -f Makefile $(BIN)/$(EXEC)
mrproper: distclean
rm -f config.*
uninstall:
- rm -f $(sbindir)/$(EXEC)
- rm -rf $(sysconfdir)/keepalived
- rm -f $(init_dir)/$(init_script)
+ rm -f $(DESTDIR)$(sbindir)/$(EXEC)
+ rm -rf $(DESTDIR)$(sysconfdir)/keepalived
+ rm -f $(DESTDIR)$(init_dir)/$(init_script)
install:
- install -d $(sbindir)
- install -m 700 $(BIN)/$(EXEC) $(sbindir)/
- install -d $(sysconfdir)/init.d
- install -m 755 $(init_script) $(sysconfdir)/init.d/keepalived
- install -d $(sysconfdir)/keepalived/samples
- install -m 644 $(conf_file) $(sysconfdir)/keepalived/
- install -m 644 ../doc/samples/* $(sysconfdir)/keepalived/samples/
+ install -d $(DESTDIR)$(sbindir)
+ install -m 700 $(BIN)/$(EXEC) $(DESTDIR)$(sbindir)/
+ install -d $(DESTDIR)$(sysconfdir)/init.d
+ install -m 755 $(init_script) $(DESTDIR)$(sysconfdir)/init.d/keepalived
+ install -d $(DESTDIR)$(sysconfdir)/keepalived/samples
+ install -m 644 $(conf_file) $(DESTDIR)$(sysconfdir)/keepalived/
+ install -m 644 ../doc/samples/* $(DESTDIR)$(sysconfdir)/keepalived/samples/
#
# Keepalived OpenSource project.
#
-# Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+# Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
KERNEL = @KERN@
CC = @CC@
check_daemon.o: check_daemon.c ../include/check_daemon.h \
../include/check_parser.h ../include/check_data.h ../include/check_api.h \
- ../include/global_data.h ../include/ipwrapper.h ../include/pidfile.h \
- ../include/daemon.h ../../lib/list.h ../../lib/memory.h \
+ ../include/global_data.h ../include/ipwrapper.h ../include/ipwrapper.h \
+ ../include/pidfile.h ../include/daemon.h ../../lib/list.h ../../lib/memory.h \
../../lib/parser.h ../../lib/watchdog.h ../include/vrrp_netlink.h \
../include/vrrp_if.h
check_data.o: check_data.c ../include/check_data.h \
*
* Part: Checkers registration.
*
- * Version: $Id: check_api.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: check_api.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "check_api.h"
*
* Part: Healthcheckrs child process handling.
*
- * Version: $Id: check_daemon.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: check_daemon.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "check_daemon.h"
#include "check_api.h"
#include "global_data.h"
#include "ipwrapper.h"
+#include "ipvswrapper.h"
#include "pidfile.h"
#include "daemon.h"
#include "list.h"
free_ssl();
if (!(debug & 16))
clear_services();
+ ipvs_stop();
/* Stop daemon */
pidfile_rm(CHECKERS_PID_FILE);
start_check(void)
{
/* Initialize sub-system */
+ ipvs_start();
init_checkers_queue();
#ifdef _WITH_VRRP_
init_interface_queue();
free_global_data(data);
free_checkers_queue();
free_ssl();
+ ipvs_stop();
/* free watchdog sd */
wdog_close(check_wdog_sd, WDOG_CHECK);
/* Launch the scheduling I/O multiplexer */
launch_scheduler();
- /* Finish VRRP daemon process */
+ /* Finish healthchecker daemon process */
stop_check();
exit(0);
}
*
* Part: Healthcheckers dynamic data structure definition.
*
- * Version: $Id: check_data.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: check_data.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "check_data.h"
*
* Part: WEB CHECK. Common HTTP/SSL checker primitives.
*
- * Version: $Id: check_http.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: check_http.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include <openssl/err.h>
* Part: MISC CHECK. Perform a system call to run an extra
* system prog or script.
*
- * Version: $Id: check_misc.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: check_misc.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Eric Jarman, <ehj38230@cmsu2.cmsu.edu>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "check_misc.h"
* data structure representation the conf file representing
* the loadbalanced server pool.
*
- * Version: $Id: check_parser.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: check_parser.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "check_parser.h"
* url, compute a MD5 over this result and match it to the
* expected value.
*
- * Version: $Id: check_ssl.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: check_ssl.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include <openssl/err.h>
*
* Part: TCP checker.
*
- * Version: $Id: check_tcp.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: check_tcp.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "check_tcp.h"
* library to add/remove server MASQ rules to the kernel
* firewall framework.
*
- * Version: $Id: ipfwwrapper.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: ipfwwrapper.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "ipfwwrapper.h"
* Part: IPVS Kernel wrapper. Use setsockopt call to add/remove
* server to/from the loadbalanced server pool.
*
- * Version: $Id: ipvswrapper.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: ipvswrapper.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "ipvswrapper.h"
static int string_to_number(const char *, int, int);
static int modprobe_ipvs(void);
-#ifdef _KRNL_2_2_ /* KERNEL 2.2 LVS handling */
+/* fetch virtual server group from group name */
+virtual_server_group *
+ipvs_get_group_by_name(char *gname, list l)
+{
+ element e;
+ virtual_server_group *vsg;
+
+ for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
+ vsg = ELEMENT_DATA(e);
+ if (!strcmp(vsg->gname, gname))
+ return vsg;
+ }
+ return NULL;
+}
+
+#ifdef _KRNL_2_2_ /* KERNEL 2.2 IPVS handling */
+
+/* Simple fake func for compatibility */
+int
+ipvs_start(void)
+{
+ return IPVS_SUCCESS;
+}
+void
+ipvs_stop(void)
+{
+}
int
ipvs_syncd_cmd(int cmd, char *ifname, int state)
}
-#else /* KERNEL 2.4 LVS handling */
+#elif _KRNL_2_4_ /* KERNEL 2.4 IPVS handling */
-static int
-ipvs_talk(int cmd, struct ip_vs_rule_user *urule)
-{
- int result;
+/* Global module def IPVS rules */
+static struct ip_vs_rule_user *urule;
+/* Initialization helpers */
+int
+ipvs_start(void)
+{
/* Init IPVS kernel channel */
if (ipvs_init()) {
/* try to insmod the ip_vs module if ipvs_init failed */
}
}
- result = ipvs_command(cmd, urule);
- if (result)
- syslog(LOG_INFO, "IPVS : %s", ipvs_strerror(errno));
+ /* Allocate global user rules */
+ urule = (struct ip_vs_rule_user *) MALLOC(sizeof (struct ip_vs_rule_user));
+ return IPVS_SUCCESS;
+}
+
+void
+ipvs_stop(void)
+{
+ /* Clean up the room */
+ FREE(urule);
ipvs_close();
+}
+
+static int
+ipvs_talk(int cmd)
+{
+ if (ipvs_command(cmd, urule))
+ syslog(LOG_INFO, "IPVS : %s", ipvs_strerror(errno));
return IPVS_SUCCESS;
}
{
#ifdef _HAVE_IPVS_SYNCD_
- struct ip_vs_rule_user urule;
-
- memset(&urule, 0, sizeof (struct ip_vs_rule_user));
+ memset(urule, 0, sizeof (struct ip_vs_rule_user));
/* prepare user rule */
- urule.state = state;
+ urule->state = state;
if (ifname != NULL)
- strncpy(urule.mcast_ifn, ifname, IP_VS_IFNAME_MAXLEN);
+ strncpy(urule->mcast_ifn, ifname, IP_VS_IFNAME_MAXLEN);
/* Talk to the IPVS channel */
- return ipvs_talk(cmd, &urule);
+ return ipvs_talk(cmd);
#else
syslog(LOG_INFO, "IPVS : Sync daemon not supported");
#endif
}
-/* fetch virtual server group from group name */
-virtual_server_group *
-ipvs_get_group_by_name(char *gname, list l)
-{
- element e;
- virtual_server_group *vsg;
-
- for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
- vsg = ELEMENT_DATA(e);
- if (!strcmp(vsg->gname, gname))
- return vsg;
- }
- return NULL;
-}
-
/* IPVS group range rule */
static int
-ipvs_group_range_cmd(int cmd, struct ip_vs_rule_user *urule
- , virtual_server_group_entry *vsg_entry)
+ipvs_group_range_cmd(int cmd, virtual_server_group_entry *vsg_entry)
{
uint32_t addr_ip;
int err = 0;
urule->vport = SVR_PORT(vsg_entry);
/* Talk to the IPVS channel */
- err = ipvs_talk(cmd, urule);
+ err = ipvs_talk(cmd);
}
return err;
/* set IPVS group rules */
static int
-ipvs_group_cmd(int cmd, list vs_group, real_server * rs
- , struct ip_vs_rule_user *urule
- , char * vsgname)
+ipvs_group_cmd(int cmd, list vs_group, real_server * rs, char * vsgname)
{
virtual_server_group *vsg = ipvs_get_group_by_name(vsgname, vs_group);
virtual_server_group_entry *vsg_entry;
/* Talk to the IPVS channel */
if (IPVS_ALIVE(cmd, vsg_entry, rs)) {
- err = ipvs_talk(cmd, urule);
+ err = ipvs_talk(cmd);
IPVS_SET_ALIVE(cmd, vsg_entry);
}
}
/* Talk to the IPVS channel */
if (IPVS_ALIVE(cmd, vsg_entry, rs)) {
- err = ipvs_talk(cmd, urule);
+ err = ipvs_talk(cmd);
IPVS_SET_ALIVE(cmd, vsg_entry);
}
}
/* Talk to the IPVS channel */
if (IPVS_ALIVE(cmd, vsg_entry, rs)) {
- err = ipvs_group_range_cmd(cmd, urule, vsg_entry);
+ err = ipvs_group_range_cmd(cmd, vsg_entry);
IPVS_SET_ALIVE(cmd, vsg_entry);
}
}
}
/* Fill IPVS rule with root vs infos */
-struct ip_vs_rule_user *
+void
ipvs_set_rule(int cmd, virtual_server * vs, real_server * rs)
{
- struct ip_vs_rule_user *urule;
-
- /* Allocate target rule */
- urule = (struct ip_vs_rule_user *) MALLOC(sizeof (struct ip_vs_rule_user));
+ /* Clean up target rule */
+ memset(urule, 0, sizeof (struct ip_vs_rule_user));
strncpy(urule->sched_name, vs->sched, IP_VS_SCHEDNAME_MAXLEN);
urule->weight = 1;
urule->dport = SVR_PORT(rs);
}
}
-
- return urule;
}
/* Set/Remove a RS from a VS */
int
ipvs_cmd(int cmd, list vs_group, virtual_server * vs, real_server * rs)
{
- struct ip_vs_rule_user *urule = ipvs_set_rule(cmd, vs, rs);
int err = 0;
+ /* Prepare target rule */
+ ipvs_set_rule(cmd, vs, rs);
+
/* Does the service use inhibit flag ? */
if (cmd == IP_VS_SO_SET_DELDEST && rs->inhibit) {
urule->weight = 0;
/* Set vs rule and send to kernel */
if (vs->vsgname) {
- err = ipvs_group_cmd(cmd, vs_group, rs, urule, vs->vsgname);
+ err = ipvs_group_cmd(cmd, vs_group, rs, vs->vsgname);
} else {
if (vs->vfwmark) {
urule->vfwmark = vs->vfwmark;
}
/* Talk to the IPVS channel */
- err = ipvs_talk(cmd, urule);
+ err = ipvs_talk(cmd);
}
- FREE(urule);
return err;
}
int
ipvs_group_remove_entry(virtual_server *vs, virtual_server_group_entry *vsge)
{
- struct ip_vs_rule_user *urule = NULL;
real_server *rs;
int err = 0;
element e;
list l = vs->rs;
+ /* Clean target rules */
+ memset(urule, 0, sizeof (struct ip_vs_rule_user));
+
/* Process realserver queue */
for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
rs = ELEMENT_DATA(e);
if (rs->alive) {
/* Prepare the IPVS rule */
- if (!urule) {
+ if (urule->daddr) {
/* Setting IPVS rule with vs root rs */
- urule = ipvs_set_rule(IP_VS_SO_SET_DELDEST, vs, rs);
+ ipvs_set_rule(IP_VS_SO_SET_DELDEST, vs, rs);
} else {
urule->weight = rs->weight;
urule->daddr = SVR_IP(rs);
/* Set vs rule */
if (vsge->range) {
- ipvs_group_range_cmd(IP_VS_SO_SET_DELDEST, urule, vsge);
+ ipvs_group_range_cmd(IP_VS_SO_SET_DELDEST, vsge);
} else {
urule->vfwmark = vsge->vfwmark;
urule->vaddr = SVR_IP(vsge);
urule->vport = SVR_PORT(vsge);
/* Talk to the IPVS channel */
- err = ipvs_talk(IP_VS_SO_SET_DELDEST, urule);
+ err = ipvs_talk(IP_VS_SO_SET_DELDEST);
}
}
}
/* Remove VS entry */
if (vsge->range)
- err = ipvs_group_range_cmd(IP_VS_SO_SET_DEL, urule, vsge);
+ err = ipvs_group_range_cmd(IP_VS_SO_SET_DEL, vsge);
else
- err = ipvs_talk(IP_VS_SO_SET_DEL, urule);
-
- FREE(urule);
+ err = ipvs_talk(IP_VS_SO_SET_DEL);
return err;
}
+#else /* KERNEL 2.6 IPVS handling */
+
+/* Global module def IPVS rules */
+static struct ip_vs_service_user *srule;
+static struct ip_vs_dest_user *drule;
+static struct ip_vs_daemon_user *daemonrule;
+
+/* Initialization helpers */
+int
+ipvs_start(void)
+{
+ /* Initialize IPVS module */
+ if (ipvs_init()) {
+ if (modprobe_ipvs() || ipvs_init()) {
+ syslog(LOG_INFO, "IPVS: Can't initialize ipvs: %s",
+ ipvs_strerror(errno));
+ return IPVS_ERROR;
+ }
+ }
+
+ /* Allocate global user rules */
+ srule = (struct ip_vs_service_user *) MALLOC(sizeof (struct ip_vs_service_user));
+ drule = (struct ip_vs_dest_user *) MALLOC(sizeof (struct ip_vs_dest_user));
+ daemonrule = (struct ip_vs_daemon_user *) MALLOC(sizeof (struct ip_vs_daemon_user));
+ return IPVS_SUCCESS;
+}
+
+void
+ipvs_stop(void)
+{
+ /* Clean up the room */
+ FREE(srule);
+ FREE(drule);
+ FREE(daemonrule);
+ ipvs_close();
+}
+
+/* Send user rules to IPVS module */
+static void
+ipvs_talk(int cmd)
+{
+ int result = -1;
+
+ switch (cmd) {
+ case IP_VS_SO_SET_STARTDAEMON:
+ result = ipvs_start_daemon(daemonrule);
+ break;
+ case IP_VS_SO_SET_STOPDAEMON:
+ result = ipvs_stop_daemon(daemonrule);
+ break;
+ case IP_VS_SO_SET_ADD:
+ result = ipvs_add_service(srule);
+ break;
+ case IP_VS_SO_SET_DEL:
+ result = ipvs_del_service(srule);
+ break;
+ case IP_VS_SO_SET_EDIT:
+ result = ipvs_update_service(srule);
+ break;
+ case IP_VS_SO_SET_ZERO:
+ result = ipvs_zero_service(srule);
+ break;
+ case IP_VS_SO_SET_ADDDEST:
+ result = ipvs_add_dest(srule, drule);
+ break;
+ case IP_VS_SO_SET_DELDEST:
+ result = ipvs_del_dest(srule, drule);
+ break;
+ case IP_VS_SO_SET_EDITDEST:
+ result = ipvs_update_dest(srule, drule);
+ break;
+ }
+
+ if (result)
+ syslog(LOG_INFO, "IPVS: %s", ipvs_strerror(errno));
+}
+
+int
+ipvs_syncd_cmd(int cmd, char *ifname, int state)
+{
+ memset(daemonrule, 0, sizeof (struct ip_vs_daemon_user));
+
+ /* prepare user rule */
+ daemonrule->state = state;
+ if (ifname != NULL)
+ strncpy(daemonrule->mcast_ifn, ifname, IP_VS_IFNAME_MAXLEN);
+
+ /* Talk to the IPVS channel */
+ ipvs_talk(cmd);
+ return IPVS_SUCCESS;
+}
+
+/* IPVS group range rule */
+static void
+ipvs_group_range_cmd(int cmd, virtual_server_group_entry *vsg_entry)
+{
+ uint32_t addr_ip;
+
+ /* Parse the whole range */
+ for (addr_ip = SVR_IP(vsg_entry);
+ ((addr_ip >> 24) & 0xFF) <= vsg_entry->range;
+ addr_ip += 0x01000000) {
+ srule->addr = addr_ip;
+ srule->port = SVR_PORT(vsg_entry);
+
+ /* Talk to the IPVS channel */
+ ipvs_talk(cmd);
+ }
+}
+
+/* set IPVS group rules */
+static void
+ipvs_group_cmd(int cmd, list vs_group, real_server * rs, char * vsgname)
+{
+ virtual_server_group *vsg = ipvs_get_group_by_name(vsgname, vs_group);
+ virtual_server_group_entry *vsg_entry;
+ list l;
+ element e;
+
+ /* return if jointure fails */
+ if (!vsg) return;
+
+ /* visit addr_ip list */
+ l = vsg->addr_ip;
+ for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
+ vsg_entry = ELEMENT_DATA(e);
+ srule->addr = SVR_IP(vsg_entry);
+ srule->port = SVR_PORT(vsg_entry);
+
+ /* Talk to the IPVS channel */
+ if (IPVS_ALIVE(cmd, vsg_entry, rs)) {
+ ipvs_talk(cmd);
+ IPVS_SET_ALIVE(cmd, vsg_entry);
+ }
+ }
+
+ /* visit vfwmark list */
+ l = vsg->vfwmark;
+ srule->addr = 0;
+ srule->port = 0;
+ for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
+ vsg_entry = ELEMENT_DATA(e);
+ srule->fwmark = vsg_entry->vfwmark;
+
+ /* Talk to the IPVS channel */
+ if (IPVS_ALIVE(cmd, vsg_entry, rs)) {
+ ipvs_talk(cmd);
+ IPVS_SET_ALIVE(cmd, vsg_entry);
+ }
+ }
+
+ /* visit range list */
+ l = vsg->range;
+ srule->fwmark = 0;
+ for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
+ vsg_entry = ELEMENT_DATA(e);
+
+ /* Talk to the IPVS channel */
+ if (IPVS_ALIVE(cmd, vsg_entry, rs)) {
+ ipvs_group_range_cmd(cmd, vsg_entry);
+ IPVS_SET_ALIVE(cmd, vsg_entry);
+ }
+ }
+}
+
+/* Fill IPVS rule with root vs infos */
+void
+ipvs_set_rule(int cmd, virtual_server * vs, real_server * rs)
+{
+ /* Clean target rule */
+ memset(drule, 0, sizeof (struct ip_vs_dest_user));
+
+ drule->weight = 1;
+ drule->conn_flags = vs->loadbalancing_kind;
+ strncpy(srule->sched_name, vs->sched, IP_VS_SCHEDNAME_MAXLEN);
+ srule->netmask = ((u_int32_t) 0xffffffff);
+ srule->protocol = vs->service_type;
+
+ if (!parse_timeout(vs->timeout_persistence, &srule->timeout))
+ syslog(LOG_INFO,
+ "IPVS : Virtual service [%s:%d] illegal timeout.",
+ inet_ntop2(SVR_IP(vs)), ntohs(SVR_PORT(vs)));
+
+ if (srule->timeout != 0 || vs->granularity_persistence)
+ srule->flags = IP_VS_SVC_F_PERSISTENT;
+
+ if (cmd == IP_VS_SO_SET_ADD || cmd == IP_VS_SO_SET_DEL)
+ if (vs->granularity_persistence)
+ srule->netmask = vs->granularity_persistence;
+
+ /* SVR specific */
+ if (rs) {
+ if (cmd == IP_VS_SO_SET_ADDDEST || cmd == IP_VS_SO_SET_DELDEST) {
+ drule->weight = rs->weight;
+ drule->addr = SVR_IP(rs);
+ drule->port = SVR_PORT(rs);
+ }
+ }
+}
+
+/* Set/Remove a RS from a VS */
+int
+ipvs_cmd(int cmd, list vs_group, virtual_server * vs, real_server * rs)
+{
+ /* Allocate the room */
+ memset(srule, 0, sizeof (struct ip_vs_service_user));
+ ipvs_set_rule(cmd, vs, rs);
+
+ /* Does the service use inhibit flag ? */
+ if (cmd == IP_VS_SO_SET_DELDEST && rs->inhibit) {
+ drule->weight = 0;
+ cmd = IP_VS_SO_SET_EDITDEST;
+ }
+ if (cmd == IP_VS_SO_SET_ADDDEST && rs->inhibit && rs->set)
+ cmd = IP_VS_SO_SET_EDITDEST;
+
+ /* Set flag */
+ if (cmd == IP_VS_SO_SET_ADDDEST && !rs->set)
+ rs->set = 1;
+ if (cmd == IP_VS_SO_SET_DELDEST && rs->set)
+ rs->set = 0;
+
+ /* Set vs rule and send to kernel */
+ if (vs->vsgname) {
+ ipvs_group_cmd(cmd, vs_group, rs, vs->vsgname);
+ } else {
+ if (vs->vfwmark) {
+ srule->fwmark = vs->vfwmark;
+ } else {
+ srule->addr = SVR_IP(vs);
+ srule->port = SVR_PORT(vs);
+ }
+
+ /* Talk to the IPVS channel */
+ ipvs_talk(cmd);
+ }
+
+ return IPVS_SUCCESS;
+}
+
+/* Remove a specific vs group entry */
+int
+ipvs_group_remove_entry(virtual_server *vs, virtual_server_group_entry *vsge)
+{
+ real_server *rs;
+ element e;
+ list l = vs->rs;
+
+ /* Clean target rules */
+ memset(srule, 0, sizeof (struct ip_vs_service_user));
+ memset(drule, 0, sizeof (struct ip_vs_dest_user));
+
+ /* Process realserver queue */
+ for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
+ rs = ELEMENT_DATA(e);
+
+ if (rs->alive) {
+ /* Prepare the IPVS rule */
+ if (!drule->addr) {
+ /* Setting IPVS rule with vs root rs */
+ ipvs_set_rule(IP_VS_SO_SET_DELDEST, vs, rs);
+ } else {
+ drule->weight = rs->weight;
+ drule->addr = SVR_IP(rs);
+ drule->port = SVR_PORT(rs);
+ }
+
+ /* Set vs rule */
+ if (vsge->range) {
+ ipvs_group_range_cmd(IP_VS_SO_SET_DELDEST, vsge);
+ } else {
+ srule->fwmark = vsge->vfwmark;
+ srule->addr = SVR_IP(vsge);
+ srule->port = SVR_PORT(vsge);
+
+ /* Talk to the IPVS channel */
+ ipvs_talk(IP_VS_SO_SET_DELDEST);
+ }
+ }
+ }
+
+ /* Remove VS entry */
+ if (vsge->range)
+ ipvs_group_range_cmd(IP_VS_SO_SET_DEL, vsge);
+ else
+ ipvs_talk(IP_VS_SO_SET_DEL);
+ return IPVS_SUCCESS;
+}
+
#endif
/*
*
* Part: Manipulation functions for IPVS & IPFW wrappers.
*
- * Version: $id: ipwrapper.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $id: ipwrapper.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "ipwrapper.h"
if (!LIST_ISEMPTY(vs->rs))
if (!init_service_rs(vs, vs->rs))
return 0;
-
return 1;
}
#
# Keepalived OpenSource project.
#
-# Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+# Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
CC = @CC@
INCLUDES = -I../include -I../../lib
*
* Part: Main program structure.
*
- * Version: $Id: main.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: main.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include <syslog.h>
*
* Part: Dynamic data structure definition.
*
- * Version: $Id: global_data.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: global_data.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include <syslog.h>
* data structure representation the conf file representing
* the loadbalanced server pool.
*
- * Version: $Id: global_parser.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: global_parser.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "global_parser.h"
* Part: Layer4 checkers handling. Register worker threads &
* upper layer checkers.
*
- * Version: $Id: layer4.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: layer4.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "layer4.h"
*
* Part: Main program structure.
*
- * Version: $Id: main.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: main.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "main.h"
*
* Part: pidfile utility.
*
- * Version: $Id: pidfile.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: pidfile.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "pidfile.h"
* 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.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: smtp.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "smtp.h"
*
* Part: Checkers arguments structures definitions.
*
- * Version: $Id: check_api.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: check_api.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _CHECK_API_H
*
* Part: check_daemon.c include file.
*
- * Version: $Id: check_daemon.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: check_daemon.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _CHECK_DAEMON_H
*
* Part: Healthcheckers dynamic data structure definition.
*
- * Version: $Id: check_data.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: check_data.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _CHECK_DATA_H
*
* Part: check_http.c include file.
*
- * Version: $Id: check_http.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: check_http.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _HTTP_H
*
* Part: check_misc.c include file.
*
- * Version: $Id: check_misc.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: check_misc.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
* Eric Jarman, <ehj38230@cmsu2.cmsu.edu>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _MISC_H
*
* Part: check_parser.c include file.
*
- * Version: $Id: check_parser.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: check_parser.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _CHECK_PARSER_H
*
* Part: check_http.c include file.
*
- * Version: $Id: check_http.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: check_http.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _SSL_H
*
* Part: check_tcp.c include file.
*
- * Version: $Id: check_tcp.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: check_tcp.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _TCP_H
*
* Part: Daemon process handling.
*
- * Version: $Id: daemon.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: daemon.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _DAEMON_H
*
* Part: Dynamic data structure definition.
*
- * Version: $Id: global_data.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: global_data.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _GLOBAL_DATA_H
*
* Part: vrrp_parser.c include file.
*
- * Version: $Id: global_parser.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: global_parser.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _GLOBAL_PARSER_H
*
* Part: ipfwwrapper.c include file.
*
- * Version: $Id: ipfwwrapper.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: ipfwwrapper.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _IPFWWRAPPER_H
*
* Part: ipvswrapper.c include file.
*
- * Version: $Id: ipvswrapper.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: ipvswrapper.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _IPVSWRAPPER_H
#ifdef _WITH_LVS_
#ifdef _KRNL_2_2_
-#include <linux/ip_fw.h>
-#include <net/ip_masq.h>
-#else
-#include "../libipvs/libipvs.h"
+ #include <linux/ip_fw.h>
+ #include <net/ip_masq.h>
+#elif _KRNL_2_4_
+ #include "../libipvs-2.4/libipvs.h"
+#elif _KRNL_2_6_
+ #include "../libipvs-2.6/libipvs.h"
#endif
-#include <net/ip_vs.h>
+ #include <net/ip_vs.h>
#endif
#ifndef IP_VS_TEMPLATE_TIMEOUT
} while (0)
/* prototypes */
+extern int ipvs_start(void);
+extern void ipvs_stop(void);
extern virtual_server_group *ipvs_get_group_by_name(char *gname, list l);
extern int ipvs_group_remove_entry(virtual_server * vs,
virtual_server_group_entry * vsge);
*
* Part: ipwrapper.c include file.
*
- * Version: $Id: ipwrapper.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: ipwrapper.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _IPWRAPPER_H
*
* Part: layer4.c include file.
*
- * Version: $Id: layer4.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: layer4.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _LAYER4_H
*
* Part: Main program include file.
*
- * Version: $Id: main.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: main.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _MAIN_H
#define LOG_FACILITY_MAX 7
#define PROG "Keepalived"
-#define VERSION_CODE 0x010105
-#define DATE_CODE 0x190104
+#define VERSION_CODE 0x010106
+#define DATE_CODE 0x170204
#define KEEPALIVED_VERSION(version) \
(version >> 16) & 0xFF, \
*
* Part: pidfile.c include file.
*
- * Version: $Id: pidfile.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: pidfile.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _PIDFILE_H
*
* Part: smtp.c include file.
*
- * Version: $Id: smtp.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: smtp.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _SMTP_H
*
* Part: vrrp.c program include file.
*
- * Version: $Id: vrrp.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_H
*
* Part: vrrp_arp.c include file.
*
- * Version: $Id: vrrp_arp.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_arp.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_ARP_H
*
* Part: vrrp_daemon.c include file.
*
- * Version: $Id: vrrp_daemon.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_daemon.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_DAEMON_H
*
* Part: Dynamic data structure definition.
*
- * Version: $Id: vrrp_data.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_data.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_DATA_H
*
* Part: vrrp_if.c include file.
*
- * Version: $Id: vrrp_if.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_if.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_IF_H
#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.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_index.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_INDEX_H
*
* Part: vrrp_ipaddress.c include file.
*
- * Version: $Id: vrrp_ipaddress.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_ipaddress.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_IPADDR_H
*
* Part: vrrp_iproute.c include file.
*
- * Version: $Id: vrrp_iproute.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_iproute.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_IPROUTE_H
*
* Part: vrrp_ipsecah.c include file.
*
- * Version: $Id: vrrp_ipsecah.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_ipsecah.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_IPSEC_AH_H
*
* Part: vrrp_netlink.c include file.
*
- * Version: $Id: vrrp_netlink.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_netlink.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_NETLINK_H
*
* Part: vrrp_notify.c include file.
*
- * Version: $Id: vrrp_notify.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_notify.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_NOTIFY_H
*
* Part: vrrp_parser.c include file.
*
- * Version: $Id: vrrp_parser.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_parser.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_PARSER_H
*
* Part: vrrp_scheduler.c include file.
*
- * Version: $Id: vrrp_scheduler.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_scheduler.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_SCHEDULER_H
*
* Part: vrrp_sync.c include file.
*
- * Version: $Id: vrrp_sync.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_sync.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_SYNC_H
*
* Part: vrrp_track.c include file.
*
- * Version: $Id: vrrp_track.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_track.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_TRACK_H
--- /dev/null
+# Makefile to make libipfwc.
+
+CC = gcc
+CFLAGS = -g -O2 -Wall -Wunused
+
+export OBJS += libipfwc.a
+
+all: libipfwc.a
+
+libipfwc.a: libipfwc.a(libipfwc.o)
+
+libipfwc.o: libipfwc.h ipfwc_kernel_headers.h
+
+clean:
+ rm -f *.a *.o *~
+
+distclean: clean
+ rm -f Makefile
--- /dev/null
+# Makefile to make libipvsc.
+
+CC = gcc
+CFLAGS = -g -O2 -I/usr/src/linux/include -Wall -Wunused
+
+export OBJS += libipvs.a
+
+all: libipvs.a
+
+libipvs.a: libipvs.a(libipvs.o)
+
+libipvsc.o: libipvs.h
+
+clean:
+ rm -f *.a *.o *~
+
+distclean: clean
+ rm -f Makefile
--- /dev/null
+# Makefile for libipvs
+
+CC = @CC@
+CFLAGS = @CFLAGS@ @CPPFLAGS@ -Wall -Wunused
+
+.PHONY = all clean install dist distclean rpm rpms
+STATIC_LIB = libipvs.a
+
+all: $(STATIC_LIB)
+
+$(STATIC_LIB): libipvs.o
+ ar rv $@ $^
+
+%.o: %.c
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+clean:
+ rm -f *.[ao] *~ *.orig *.rej core
+
+distclean: clean
+ rm -f Makefile
--- /dev/null
+/*
+ * libipvs: Library for manipulating IPVS through [gs]etsockopt
+ *
+ * Version: $Id: libipvs.c,v 1.7 2003/06/08 09:31:39 wensong Exp $
+ *
+ * Authors: Wensong Zhang <wensong@linuxvirtualserver.org>
+ *
+ * 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.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <netinet/in.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include "libipvs.h"
+
+
+typedef struct ipvs_servicedest_s {
+ ipvs_service_t svc;
+ ipvs_dest_t dest;
+} ipvs_servicedest_t;
+
+static int sockfd = -1;
+static void* ipvs_func = NULL;
+struct ip_vs_getinfo ipvs_info;
+
+
+int ipvs_init(void)
+{
+ socklen_t len;
+
+ len = sizeof(ipvs_info);
+ if ((sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) == -1)
+ return -1;
+
+ if (getsockopt(sockfd, IPPROTO_IP, IP_VS_SO_GET_INFO,
+ (char *)&ipvs_info, &len))
+ return -1;
+
+ return 0;
+}
+
+
+int ipvs_getinfo(void)
+{
+ socklen_t len;
+
+ len = sizeof(ipvs_info);
+ return getsockopt(sockfd, IPPROTO_IP, IP_VS_SO_GET_INFO,
+ (char *)&ipvs_info, &len);
+}
+
+
+unsigned int ipvs_version(void)
+{
+ return ipvs_info.version;
+}
+
+
+int ipvs_flush(void)
+{
+ return setsockopt(sockfd, IPPROTO_IP, IP_VS_SO_SET_FLUSH,
+ NULL, 0);
+}
+
+
+int ipvs_add_service(ipvs_service_t *svc)
+{
+ ipvs_func = ipvs_add_service;
+ return setsockopt(sockfd, IPPROTO_IP,
+ IP_VS_SO_SET_ADD, (char *)svc, sizeof(*svc));
+}
+
+
+int ipvs_update_service(ipvs_service_t *svc)
+{
+ ipvs_func = ipvs_update_service;
+ return setsockopt(sockfd, IPPROTO_IP,
+ IP_VS_SO_SET_EDIT, (char *)svc, sizeof(*svc));
+}
+
+
+int ipvs_del_service(ipvs_service_t *svc)
+{
+ ipvs_func = ipvs_del_service;
+ return setsockopt(sockfd, IPPROTO_IP,
+ IP_VS_SO_SET_DEL, (char *)svc, sizeof(*svc));
+}
+
+
+int ipvs_zero_service(ipvs_service_t *svc)
+{
+ ipvs_func = ipvs_zero_service;
+ return setsockopt(sockfd, IPPROTO_IP,
+ IP_VS_SO_SET_ZERO, (char *)svc, sizeof(*svc));
+}
+
+
+int ipvs_add_dest(ipvs_service_t *svc, ipvs_dest_t *dest)
+{
+ ipvs_servicedest_t svcdest = {*svc, *dest};
+
+ ipvs_func = ipvs_add_dest;
+ return setsockopt(sockfd, IPPROTO_IP, IP_VS_SO_SET_ADDDEST,
+ (char *)&svcdest, sizeof(svcdest));
+}
+
+
+int ipvs_update_dest(ipvs_service_t *svc, ipvs_dest_t *dest)
+{
+ ipvs_servicedest_t svcdest = {*svc, *dest};
+
+ ipvs_func = ipvs_update_dest;
+ return setsockopt(sockfd, IPPROTO_IP, IP_VS_SO_SET_EDITDEST,
+ (char *)&svcdest, sizeof(svcdest));
+}
+
+
+int ipvs_del_dest(ipvs_service_t *svc, ipvs_dest_t *dest)
+{
+ ipvs_servicedest_t svcdest = {*svc, *dest};
+
+ ipvs_func = ipvs_del_dest;
+ return setsockopt(sockfd, IPPROTO_IP, IP_VS_SO_SET_DELDEST,
+ (char *)&svcdest, sizeof(svcdest));
+}
+
+
+int ipvs_set_timeout(ipvs_timeout_t *to)
+{
+ ipvs_func = ipvs_set_timeout;
+ return setsockopt(sockfd, IPPROTO_IP, IP_VS_SO_SET_TIMEOUT,
+ (char *)to, sizeof(*to));
+}
+
+
+int ipvs_start_daemon(ipvs_daemon_t *dm)
+{
+ ipvs_func = ipvs_start_daemon;
+ return setsockopt(sockfd, IPPROTO_IP, IP_VS_SO_SET_STARTDAEMON,
+ (char *)dm, sizeof(*dm));
+}
+
+
+extern int ipvs_stop_daemon(ipvs_daemon_t *dm)
+{
+ ipvs_func = ipvs_stop_daemon;
+ return setsockopt(sockfd, IPPROTO_IP, IP_VS_SO_SET_STOPDAEMON,
+ (char *)dm, sizeof(*dm));
+}
+
+
+struct ip_vs_get_services *ipvs_get_services(void)
+{
+ struct ip_vs_get_services *get;
+ socklen_t len;
+
+ len = sizeof(*get) +
+ sizeof(ipvs_service_entry_t)*ipvs_info.num_services;
+ if (!(get = malloc(len)))
+ return NULL;
+
+ ipvs_func = ipvs_get_services;
+ get->num_services = ipvs_info.num_services;
+ if (getsockopt(sockfd, IPPROTO_IP,
+ IP_VS_SO_GET_SERVICES, get, &len) < 0) {
+ free(get);
+ return NULL;
+ }
+ return get;
+}
+
+
+typedef int (*qsort_cmp_t)(const void *, const void *);
+
+int
+ipvs_cmp_services(ipvs_service_entry_t *s1, ipvs_service_entry_t *s2)
+{
+ int r;
+
+ r = s1->fwmark - s2->fwmark;
+ if (r != 0)
+ return r;
+
+ r = s1->protocol - s2->protocol;
+ if (r != 0)
+ return r;
+
+ r = ntohl(s1->addr) - ntohl(s2->addr);
+ if (r != 0)
+ return r;
+
+ return ntohs(s1->port) - ntohs(s2->port);
+}
+
+
+void
+ipvs_sort_services(struct ip_vs_get_services *s, ipvs_service_cmp_t f)
+{
+ qsort(s->entrytable, s->num_services,
+ sizeof(ipvs_service_entry_t), (qsort_cmp_t)f);
+}
+
+
+struct ip_vs_get_dests *ipvs_get_dests(ipvs_service_entry_t *svc)
+{
+ struct ip_vs_get_dests *d;
+ socklen_t len;
+
+ len = sizeof(*d) + sizeof(ipvs_dest_entry_t)*svc->num_dests;
+ if (!(d = malloc(len)))
+ return NULL;
+
+ ipvs_func = ipvs_get_dests;
+
+ d->fwmark = svc->fwmark;
+ d->protocol = svc->protocol;
+ d->addr = svc->addr;
+ d->port = svc->port;
+ d->num_dests = svc->num_dests;
+
+ if (getsockopt(sockfd, IPPROTO_IP,
+ IP_VS_SO_GET_DESTS, d, &len) < 0) {
+ free(d);
+ return NULL;
+ }
+ return d;
+}
+
+
+int ipvs_cmp_dests(ipvs_dest_entry_t *d1, ipvs_dest_entry_t *d2)
+{
+ int r;
+
+ r = ntohl(d1->addr) - ntohl(d2->addr);
+ if (r != 0)
+ return r;
+
+ return ntohs(d1->port) - ntohs(d2->port);
+}
+
+
+void ipvs_sort_dests(struct ip_vs_get_dests *d, ipvs_dest_cmp_t f)
+{
+ qsort(d->entrytable, d->num_dests,
+ sizeof(ipvs_dest_entry_t), (qsort_cmp_t)f);
+}
+
+
+ipvs_service_entry_t *
+ipvs_get_service(__u32 fwmark, __u16 protocol, __u32 addr, __u16 port)
+{
+ ipvs_service_entry_t *svc;
+ socklen_t len;
+
+ len = sizeof(*svc);
+ if (!(svc = malloc(len)))
+ return NULL;
+
+ ipvs_func = ipvs_get_service;
+
+ svc->fwmark = fwmark;
+ svc->protocol = protocol;
+ svc->addr = addr;
+ svc->port = port;
+ if (getsockopt(sockfd, IPPROTO_IP, IP_VS_SO_GET_SERVICE,
+ (char *)svc, &len)) {
+ free(svc);
+ return NULL;
+ }
+ return svc;
+}
+
+
+ipvs_timeout_t *ipvs_get_timeout(void)
+{
+ ipvs_timeout_t *u;
+ socklen_t len;
+
+ len = sizeof(*u);
+ if (!(u = malloc(len)))
+ return NULL;
+
+ ipvs_func = ipvs_get_timeout;
+ if (getsockopt(sockfd, IPPROTO_IP, IP_VS_SO_GET_TIMEOUT,
+ (char *)u, &len)) {
+ free(u);
+ return NULL;
+ }
+ return u;
+}
+
+
+ipvs_daemon_t *ipvs_get_daemon(void)
+{
+ ipvs_daemon_t *u;
+ socklen_t len;
+
+ /* note that we need to get the info about two possible
+ daemons, master and backup. */
+ len = sizeof(*u) * 2;
+ if (!(u = malloc(len)))
+ return NULL;
+
+ ipvs_func = ipvs_get_daemon;
+ if (getsockopt(sockfd, IPPROTO_IP,
+ IP_VS_SO_GET_DAEMON, (char *)u, &len)) {
+ free(u);
+ return NULL;
+ }
+ return u;
+}
+
+
+void ipvs_close(void)
+{
+ close(sockfd);
+}
+
+
+const char *ipvs_strerror(int err)
+{
+ unsigned int i;
+ struct table_struct {
+ void *func;
+ int err;
+ const char *message;
+ } table [] = {
+ { 0, EPERM, "Permission denied (you must be root)" },
+ { 0, EINVAL, "Module is wrong version" },
+ { 0, ENOPROTOOPT, "Protocol not available" },
+ { 0, ENOMEM, "Memory allocation problem" },
+ { ipvs_add_service, EEXIST, "Service already exists" },
+ { ipvs_add_service, ENOENT, "Scheduler not found" },
+ { ipvs_update_service, ESRCH, "No such service" },
+ { ipvs_update_service, ENOENT, "Scheduler not found" },
+ { ipvs_del_service, ESRCH, "No such service" },
+ { ipvs_zero_service, ESRCH, "No such service" },
+ { ipvs_add_dest, ESRCH, "Service not defined" },
+ { ipvs_add_dest, EEXIST, "Destination already exists" },
+ { ipvs_update_dest, ESRCH, "Service not defined" },
+ { ipvs_update_dest, ENOENT, "No such destination" },
+ { ipvs_del_dest, ESRCH, "Service not defined" },
+ { ipvs_del_dest, ENOENT, "No such destination" },
+ { ipvs_start_daemon, EEXIST, "Daemon has already run" },
+ { ipvs_stop_daemon, ESRCH, "No daemon is running" },
+ { ipvs_get_services, ESRCH, "No such service" },
+ { ipvs_get_dests, ESRCH, "No such service" },
+ { ipvs_get_service, ESRCH, "No such service" },
+ };
+
+ for (i = 0; i < sizeof(table)/sizeof(struct table_struct); i++) {
+ if ((!table[i].func || table[i].func == ipvs_func)
+ && table[i].err == err)
+ return table[i].message;
+ }
+
+ return strerror(err);
+}
--- /dev/null
+/*
+ * libipvs.h: header file for the library ipvs
+ *
+ * Version: $Id: libipvs.h,v 1.7 2003/06/08 09:31:39 wensong Exp $
+ *
+ * Authors: Wensong Zhang <wensong@linuxvirtualserver.org>
+ *
+ */
+
+#ifndef _LIBIPVS_H
+#define _LIBIPVS_H
+
+#include <net/ip_vs.h>
+
+#define MINIMUM_IPVS_VERSION_MAJOR 1
+#define MINIMUM_IPVS_VERSION_MINOR 1
+#define MINIMUM_IPVS_VERSION_PATCH 4
+
+#ifndef IPVS_VERSION
+#define IPVS_VERSION(x,y,z) (((x)<<16)+((y)<<8)+(z))
+#endif
+
+/*
+ * The default IPVS_SVC_PERSISTENT_TIMEOUT is a little larger than average
+ * connection time plus IPVS TCP FIN timeout (2*60 seconds). Because the
+ * connection template won't be released until its controlled connection
+ * entries are expired.
+ * If IPVS_SVC_PERSISTENT_TIMEOUT is too less, the template will expire
+ * soon and will be put in expire again and again, which causes additional
+ * overhead. If it is too large, the same will always visit the same
+ * server, which may make dynamic load imbalance worse.
+ */
+#define IPVS_SVC_PERSISTENT_TIMEOUT (6*60)
+
+
+typedef struct ip_vs_service_user ipvs_service_t;
+typedef struct ip_vs_dest_user ipvs_dest_t;
+typedef struct ip_vs_timeout_user ipvs_timeout_t;
+typedef struct ip_vs_daemon_user ipvs_daemon_t;
+typedef struct ip_vs_service_entry ipvs_service_entry_t;
+typedef struct ip_vs_dest_entry ipvs_dest_entry_t;
+
+
+/* ipvs info variable */
+extern struct ip_vs_getinfo ipvs_info;
+
+/* init socket and get ipvs info */
+extern int ipvs_init(void);
+
+/* get ipvs info separately */
+extern int ipvs_getinfo(void);
+
+/* get the version number */
+extern unsigned int ipvs_version(void);
+
+/* flush all the rules */
+extern int ipvs_flush(void);
+
+/* add a virtual service */
+extern int ipvs_add_service(ipvs_service_t *svc);
+
+/* update a virtual service with new options */
+extern int ipvs_update_service(ipvs_service_t *svc);
+
+/* delete a virtual service */
+extern int ipvs_del_service(ipvs_service_t *svc);
+
+/* zero the counters of a service or all */
+extern int ipvs_zero_service(ipvs_service_t *svc);
+
+/* add a destination server into a service */
+extern int ipvs_add_dest(ipvs_service_t *svc, ipvs_dest_t *dest);
+
+/* update a destination server with new options */
+extern int ipvs_update_dest(ipvs_service_t *svc, ipvs_dest_t *dest);
+
+/* remove a destination server from a service */
+extern int ipvs_del_dest(ipvs_service_t *svc, ipvs_dest_t *dest);
+
+/* set timeout */
+extern int ipvs_set_timeout(ipvs_timeout_t *to);
+
+/* start a connection synchronizaiton daemon (master/backup) */
+extern int ipvs_start_daemon(ipvs_daemon_t *dm);
+
+/* stop a connection synchronizaiton daemon (master/backup) */
+extern int ipvs_stop_daemon(ipvs_daemon_t *dm);
+
+
+/* get all the ipvs services */
+extern struct ip_vs_get_services *ipvs_get_services(void);
+
+/* sort the service entries */
+typedef int (*ipvs_service_cmp_t)(ipvs_service_entry_t *,
+ ipvs_service_entry_t *);
+extern int ipvs_cmp_services(ipvs_service_entry_t *s1,
+ ipvs_service_entry_t *s2);
+extern void ipvs_sort_services(struct ip_vs_get_services *s,
+ ipvs_service_cmp_t f);
+
+/* get the destination array of the specified service */
+extern struct ip_vs_get_dests *ipvs_get_dests(ipvs_service_entry_t *svc);
+
+/* sort the destination entries */
+typedef int (*ipvs_dest_cmp_t)(ipvs_dest_entry_t *,
+ ipvs_dest_entry_t *);
+extern int ipvs_cmp_dests(ipvs_dest_entry_t *d1,
+ ipvs_dest_entry_t *d2);
+extern void ipvs_sort_dests(struct ip_vs_get_dests *d,
+ ipvs_dest_cmp_t f);
+
+/* get an ipvs service entry */
+extern ipvs_service_entry_t *
+ipvs_get_service(__u32 fwmark, __u16 protocol, __u32 addr, __u16 port);
+
+/* get ipvs timeout */
+extern ipvs_timeout_t *ipvs_get_timeout(void);
+
+/* get ipvs daemon information */
+extern ipvs_daemon_t *ipvs_get_daemon(void);
+
+/* close the socket */
+extern void ipvs_close(void);
+
+extern const char *ipvs_strerror(int err);
+
+#endif /* _LIBIPVS_H */
#
# Keepalived OpenSource project.
#
-# Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+# Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
CC = @CC@
INCLUDES = -I../include -I../../lib
* master fails, a backup server takes over.
* The original implementation has been made by jerome etienne.
*
- * Version: $Id: vrrp.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
/* local include */
syslog(LOG_INFO,
"VRRP_Instance(%s) Dropping received VRRP packet...",
vrrp->iname);
- vrrp_send_adv(vrrp, vrrp->priority);
return 0;
} else if (hd->priority < vrrp->priority) {
/* We receive a lower prio adv we just refresh remote ARP cache */
syslog(LOG_INFO,
"VRRP_Instance(%s) Dropping received VRRP packet...",
vrrp->iname);
- vrrp_send_adv(vrrp, vrrp->priority);
return 0;
} else if (vrrp->priority > hd->priority ||
hd->priority == VRRP_PRIO_OWNER)
*
* Part: ARP primitives.
*
- * Version: $Id: vrrp_arp.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_arp.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
/* system includes */
*
* Part: VRRP child process handling.
*
- * Version: $Id: vrrp_daemon.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_daemon.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "vrrp_daemon.h"
*
* Part: Dynamic data structure definition.
*
- * Version: $Id: vrrp_data.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_data.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "vrrp_data.h"
*
* Part: Interfaces manipulation.
*
- * Version: $Id: vrrp_if.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_if.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
/* global include */
, 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.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_index.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
/* local include */
*
* Part: NETLINK IPv4 address manipulation.
*
- * Version: $Id: vrrp_ipaddress.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_ipaddress.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
/* local include */
*
* Part: NETLINK IPv4 routes manipulation.
*
- * Version: $Id: vrrp_iproute.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_iproute.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
/* local include */
* authentication data encryption using HMAC MD5 according to
* RFCs 2085 & 2104.
*
- * Version: $Id: vrrp_ipsecah.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_ipsecah.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "vrrp_ipsecah.h"
*
* Part: NETLINK kernel command channel.
*
- * Version: $Id: vrrp_netlink.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_netlink.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
/* global include */
*
* Part: VRRP state transition notification scripts handling.
*
- * Version: $Id: vrrp_notify.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_notify.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
/* system include */
* data structure representation the conf file representing
* the loadbalanced server pool.
*
- * Version: $Id: vrrp_parser.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_parser.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "vrrp_parser.h"
*
* Part: Sheduling framework for vrrp code.
*
- * Version: $Id: vrrp_scheduler.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_scheduler.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "vrrp_scheduler.h"
*
* Part: VRRP synchronization framework.
*
- * Version: $Id: vrrp_sync.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_sync.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "vrrp_sync.h"
void
vrrp_init_instance_sands(vrrp_rt * vrrp)
{
+ set_time_now();
+
if (vrrp->state == VRRP_STATE_MAST ||
vrrp->state == VRRP_STATE_GOTO_MASTER ||
vrrp->state == VRRP_STATE_GOTO_FAULT) {
*
* Part: Interface tracking framework.
*
- * Version: $Id: vrrp_track.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vrrp_track.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
/* local include */
#
# Keepalived OpenSource project.
#
-# Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+# Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
CC = @CC@
INCLUDES = -I.
*
* Part: HTML stream parser utility functions.
*
- * Version: $Id: html.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: html.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include <string.h>
*
* Part: parser.c include file.
*
- * Version: $Id: html.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: html.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _HTML_H
*
* Part: List structure manipulation.
*
- * Version: $Id: list.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: list.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "list.h"
/* fetch element number num */
for (i = 0; i < num; i++)
if (e)
- e = ELEMENT_NEXT(e);
+ ELEMENT_NEXT(e);
if (e)
return ELEMENT_DATA(e);
*
* Part: list.c include file.
*
- * Version: $Id: list.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: list.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _LIST_H
* Part: Memory management framework. This framework is used to
* find any memory leak.
*
- * Version: $Id: memory.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: memory.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "memory.h"
*
* Part: memory.c include file.
*
- * Version: $Id: memory.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: memory.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _MEMORY_H
*
* Part: Forked system call to launch an extra script.
*
- * Version: $Id: notify.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: notify.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include <unistd.h>
*
* Part: notify.c include file.
*
- * Version: $Id: notify.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: notify.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _NOTIFY_H
* data structure representation the conf file representing
* the loadbalanced server pool.
*
- * Version: $Id: parser.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: parser.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "parser.h"
*
* Part: cfreader.c include file.
*
- * Version: $Id: parser.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: parser.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _PARSER_H
* the thread management routine (thread.c) present in the
* very nice zebra project (http://www.zebra.org).
*
- * Version: $Id: scheduler.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: scheduler.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include <signal.h>
thread->u.fd = fd;
/* Compute read timeout value */
+ set_time_now();
thread->sands = timer_add_long(time_now, timer);
/* Sort the thread. */
thread->u.fd = fd;
/* Compute write timeout value */
+ set_time_now();
thread->sands = timer_add_long(time_now, timer);
/* Sort the thread. */
thread->arg = arg;
/* Do we need jitter here? */
+ set_time_now();
thread->sands = timer_add_long(time_now, timer);
/* Sort by timeval. */
thread->u.c.status = 0;
/* Compute write timeout value */
+ set_time_now();
thread->sands = timer_add_long(time_now, timer);
/* Sort by timeval. */
*
* Part: scheduler.c include file.
*
- * Version: $Id: scheduler.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: scheduler.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _SCHEDULER_H
*
* Part: Timer manipulations.
*
- * Version: $Id: timer.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: timer.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include <stdio.h>
*
* Part: timer.c include file.
*
- * Version: $Id: timer.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: timer.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _TIMER_H
*
* Part: General program utils.
*
- * Version: $Id: utils.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: utils.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "utils.h"
*
* Part: utils.h include file.
*
- * Version: $Id: utils.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: utils.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _UTILS_H
*
* Part: Vector structure manipulation.
*
- * Version: $Id: vector.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vector.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "vector.h"
*
* Part: vector.c include file.
*
- * Version: $Id: vector.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: vector.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VECTOR_H
*
* Part: Software watchdog framework.
*
- * Version: $Id: watchdog.c,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: watchdog.c,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include <unistd.h>
*
* Part: watchdog.c include file.
*
- * Version: $Id: watchdog.h,v 1.1.5 2004/01/25 23:14:31 acassen Exp $
+ * Version: $Id: watchdog.h,v 1.1.6 2004/02/21 02:31:28 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
+ * Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _WATCHDOG_H