* keepalived-1.1.16 released.
* Code clean-up.
* Stefan Rompf, <stefan@loplof.de> extended scheduler to
synchronize signal handling by sending the signal number through
a self pipe, making signals select()able. Child reaping has been
moved to a simple signal synchronous signal handler. Signal
shutdown handling has been centralized.
* Denis Ovsienko, <pilot@etcnet.org> extended healthchecker
framework to support alpha/omega design. It provides virtual
service control in a more fine-graned maner. You may have a
look to the SYNOPSIS file to have full picture on configation.
It addresses the following issues :
- A virtual service is considered up even with an empty RS pool.
- There is no reliable mean to avoid service regression, when
the server pool becomes too small.
- There is no mean to escalate any of the above fault/recovery
events.
- Real servers are assumed alive initially. This leads to
unnecessary state flap on keepalived start.
- notify_down isn't executed for working real servers on
keepalived shutdown.
- There is no reliable mean to handle keepalived stop to move
the virtual service over another load balancer.
* Stephan Mayr, <Mayr.Stefan@swm.de> fixed default value for
checker loop... a missing TIMER_HZ.
* Merge keepalived.init.suse.
* Robin Garner, <robin.garner@scu.edu.au> added support to
--log-console facility.
* Tobias Klausmann, <klausman@schwarzvogel.de> fixed an openfile
leak while performing reload.
* Leo Baltus, <Leo.Baltus@omroep.nl> extended pidfile handling
to allow keepalived to start using configurated pidfile.
* VRRP : Siim Poder, <siim@p6drad-teel.net> fixed IPSEC AH auth
to skip IPv4 id field of zero. If zeroed kernel will fill it
and lead to an unwanted protocol re-election.
* VRRP : Siim Poder, <siim@p6drad-teel.net> fixed reloading issue.
New ip addresses are added (from configuration). State is kept
instead of starting from whatever is in configuration file.
If prios are changed in such a way, state change can occur after
reload.
* VRRP : Vincent Bernat, <bernat@luffy.cx> extended virtual_route
to support virtual "black hole" route as well as multihop route.
* VRRP : Stig Thormodsrud, <stig@vyatta.com> fixed a crash while
using virtual_router_id set to 255.
* VRRP: Jon DeVree, <jadevree@arbor.net> fixed arp handling to
to initialize the target hardware address, using 0xff as found
in arping. Let scripts work without dealing with weight, if the
script fails, VRRP fails.
* VRRP : Pierre-Yves Ritschard, <pierre-yves@spootnik.org> removed
the GOTO_FAULT state from FSM.
* VRRP : Willy Tarreau, <w@1wt.eu> fixed link detection handling
to support right ioctl values for recent kernel ! It can lead
to issue while running instance on a bonding interface.
* VRRP : Willy Tarreau, <w@1wt.eu> extended scheduler to catch
time drift. It implements an internal monotonic clock. It
maintains an offset between sysclock and monotonic clock, if
computed time if anterior to monotonic time then just update
offset. If time computed if fare away into the future then
limit delay and recompute offset.
* VRRP : Willy Tarreau, <w@1wt.eu> fixed autoconf issues.
+2009-02-15 Alexandre Cassen <acassen@linux-vs.org>
+ * keepalived-1.1.16 released.
+ * Code clean-up.
+ * Stefan Rompf, <stefan@loplof.de> extended scheduler to
+ synchronize signal handling by sending the signal number through
+ a self pipe, making signals select()able. Child reaping has been
+ moved to a simple signal synchronous signal handler. Signal
+ shutdown handling has been centralized.
+ * Denis Ovsienko, <pilot@etcnet.org> extended healthchecker
+ framework to support alpha/omega design. It provides virtual
+ service control in a more fine-graned maner. You may have a
+ look to the SYNOPSIS file to have full picture on configation.
+ It addresses the following issues :
+ - A virtual service is considered up even with an empty RS pool.
+ - There is no reliable mean to avoid service regression, when
+ the server pool becomes too small.
+ - There is no mean to escalate any of the above fault/recovery
+ events.
+ - Real servers are assumed alive initially. This leads to
+ unnecessary state flap on keepalived start.
+ - notify_down isn't executed for working real servers on
+ keepalived shutdown.
+ - There is no reliable mean to handle keepalived stop to move
+ the virtual service over another load balancer.
+ * Stephan Mayr, <Mayr.Stefan@swm.de> fixed default value for
+ checker loop... a missing TIMER_HZ.
+ * Merge keepalived.init.suse.
+ * Robin Garner, <robin.garner@scu.edu.au> added support to
+ --log-console facility.
+ * Tobias Klausmann, <klausman@schwarzvogel.de> fixed an openfile
+ leak while performing reload.
+ * Leo Baltus, <Leo.Baltus@omroep.nl> extended pidfile handling
+ to allow keepalived to start using configurated pidfile.
+ * VRRP : Siim Poder, <siim@p6drad-teel.net> fixed IPSEC AH auth
+ to skip IPv4 id field of zero. If zeroed kernel will fill it
+ and lead to an unwanted protocol re-election.
+ * VRRP : Siim Poder, <siim@p6drad-teel.net> fixed reloading issue.
+ New ip addresses are added (from configuration). State is kept
+ instead of starting from whatever is in configuration file.
+ If prios are changed in such a way, state change can occur after
+ reload.
+ * VRRP : Vincent Bernat, <bernat@luffy.cx> extended virtual_route
+ to support virtual "black hole" route as well as multihop route.
+ * VRRP : Stig Thormodsrud, <stig@vyatta.com> fixed a crash while
+ using virtual_router_id set to 255.
+ * VRRP: Jon DeVree, <jadevree@arbor.net> fixed arp handling to
+ to initialize the target hardware address, using 0xff as found
+ in arping. Let scripts work without dealing with weight, if the
+ script fails, VRRP fails.
+ * VRRP : Pierre-Yves Ritschard, <pierre-yves@spootnik.org> removed
+ the GOTO_FAULT state from FSM.
+ * VRRP : Willy Tarreau, <w@1wt.eu> fixed link detection handling
+ to support right ioctl values for recent kernel ! It can lead
+ to issue while running instance on a bonding interface.
+ * VRRP : Willy Tarreau, <w@1wt.eu> extended scheduler to catch
+ time drift. It implements an internal monotonic clock. It
+ maintains an offset between sysclock and monotonic clock, if
+ computed time if anterior to monotonic time then just update
+ offset. If time computed if fare away into the future then
+ limit delay and recompute offset.
+ * VRRP : Willy Tarreau, <w@1wt.eu> fixed autoconf issues.
+
2007-09-15 Alexandre Cassen <acassen@linux-vs.org>
* keepalived-1.1.15 released.
* Matthias Saou, <matthias at rpmforge.net> fixed genhash
#
# Keepalived OpenSource project.
#
-# Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
+# Copyright (C) 2001-2009 Alexandre Cassen, <acassen@linux-vs.org>
TARFILES = AUTHOR bin ChangeLog configure configure.in CONTRIBUTORS COPYING \
doc genhash INSTALL install-sh keepalived keepalived.spec.in lib Makefile.in \
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59.
+# Generated by GNU Autoconf 2.61.
#
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## --------------------- ##
## M4sh Initialization. ##
## --------------------- ##
-# Be Bourne compatible
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
fi
-DUALCASE=1; export DUALCASE # for MKS sh
# Support unset when possible.
if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
fi
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+fi
+
# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
PS1='$ '
PS2='> '
PS4='+ '
if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
eval $as_var=C; export $as_var
else
- $as_unset $as_var
+ ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
fi
done
# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
# Name of the executable.
-as_me=`$as_basename "$0" ||
+as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)$' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+# CDPATH.
+$as_unset CDPATH
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
+if test "x$CONFIG_SHELL" = x; then
+ if (eval ":") 2>/dev/null; then
+ as_have_required=yes
+else
+ as_have_required=no
fi
+ if test $as_have_required = yes && (eval ":
+(as_func_return () {
+ (exit \$1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" || {
- # Find who we are. Look in the path if we contain no path at all
- # relative or not.
- case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
- ;;
- esac
- # We did not find ourselves, most probably we were run as `sh COMMAND'
- # in which case we are not to be found in the path.
- if test "x$as_myself" = x; then
- as_myself=$0
- fi
- if test ! -f "$as_myself"; then
- { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
- { (exit 1); exit 1; }; }
- fi
- case $CONFIG_SHELL in
- '')
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+ as_lineno_1=\$LINENO
+ as_lineno_2=\$LINENO
+ test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+ test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+ :
+else
+ as_candidate_shells=
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for as_base in sh bash ksh sh5; do
- case $as_dir in
+ case $as_dir in
/*)
- if ("$as_dir/$as_base" -c '
+ for as_base in sh bash ksh sh5; do
+ as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+ done;;
+ esac
+done
+IFS=$as_save_IFS
+
+
+ for as_shell in $as_candidate_shells $SHELL; do
+ # Try only shells that exist, to save several forks.
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+ CONFIG_SHELL=$as_shell
+ as_have_required=yes
+ if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+ (exit $1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
as_lineno_1=$LINENO
as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
- CONFIG_SHELL=$as_dir/$as_base
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
- fi;;
- esac
- done
-done
-;;
- esac
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+ break
+fi
+
+fi
+
+ done
+
+ if test "x$CONFIG_SHELL" != x; then
+ for as_var in BASH_ENV ENV
+ do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ done
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+ if test $as_have_required = no; then
+ echo This script requires a shell more modern than all the
+ echo shells that I found on your system. Please install a
+ echo modern shell, or manually run the script under such a
+ echo shell if you do have one.
+ { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+ (exit \$1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+ echo No shell found that supports shell functions.
+ echo Please tell autoconf@gnu.org about your system,
+ echo including any error possibly output before this
+ echo message
+}
+
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
# Create $as_me.lineno as a copy of $as_myself, but with $LINENO
# uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line before each line; the second 'sed' does the real
- # work. The second script uses 'N' to pair each line-number line
- # with the numbered line, and appends trailing '-' during
- # substitution so that $LINENO is not a special case at line end.
+ # line-number line after each line using $LINENO; the second 'sed'
+ # does the real work. The second script uses 'N' to pair each
+ # line-number line with the line containing $LINENO, and appends
+ # trailing '-' during substitution so that $LINENO is not a special
+ # case at line end.
# (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
- sed '=' <$as_myself |
+ # scripts with optimization help from Paolo Bonzini. Blame Lee
+ # E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
N
- s,$,-,
- : loop
- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
t loop
- s,-$,,
- s,^['$as_cr_digits']*\n,,
+ s/-\n.*//
' >$as_me.lineno &&
- chmod +x $as_me.lineno ||
+ chmod +x "$as_me.lineno" ||
{ echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
{ (exit 1); exit 1; }; }
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensible to this).
- . ./$as_me.lineno
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
esac
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir
+fi
echo >conf$$.file
if ln -s conf$$.file conf$$ 2>/dev/null; then
- # We could just check for DJGPP; but this test a) works b) is more generic
- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
- if test -f conf$$.exe; then
- # Don't use ln at all; we don't have any links
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -p'
- else
- as_ln_s='ln -s'
- fi
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -p'
fi
-rm -f conf$$ conf$$.exe conf$$.file
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
if mkdir -p . 2>/dev/null; then
as_mkdir_p=:
as_mkdir_p=false
fi
-as_executable_p="test -f"
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
+exec 7<&0 </dev/null 6>&1
# Name of the host.
# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-exec 6>&1
-
#
# Initializations.
#
ac_default_prefix=/usr/local
+ac_clean_files=
ac_config_libobj_dir=.
+LIBOBJS=
cross_compiling=no
subdirs=
MFLAGS=
MAKEFLAGS=
SHELL=${CONFIG_SHELL-/bin/sh}
-# Maximum number of lines to put in a shell here document.
-# This variable seems obsolete. It should probably be removed, and
-# only ac_max_sed_lines should be used.
-: ${ac_max_here_lines=38}
-
# Identity of this package.
PACKAGE_NAME=
PACKAGE_TARNAME=
# Factoring default headers for most tests.
ac_includes_default="\
#include <stdio.h>
-#if HAVE_SYS_TYPES_H
+#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
-#if HAVE_SYS_STAT_H
+#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
-#if STDC_HEADERS
+#ifdef STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#else
-# if HAVE_STDLIB_H
+# ifdef HAVE_STDLIB_H
# include <stdlib.h>
# endif
#endif
-#if HAVE_STRING_H
-# if !STDC_HEADERS && HAVE_MEMORY_H
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
# include <memory.h>
# endif
# include <string.h>
#endif
-#if HAVE_STRINGS_H
+#ifdef HAVE_STRINGS_H
# include <strings.h>
#endif
-#if HAVE_INTTYPES_H
+#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
-#else
-# if HAVE_STDINT_H
-# include <stdint.h>
-# endif
#endif
-#if HAVE_UNISTD_H
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
# 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 STRIP ac_ct_STRIP CPP EGREP LINKWATCH_SUPPORT KERN IPVS_SYNCD DFLAGS VERSION VERSION_DATE IPVS_SUPPORT VRRP_SUPPORT 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
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+CPPFLAGS
+ac_ct_CC
+EXEEXT
+OBJEXT
+INSTALL_PROGRAM
+INSTALL_SCRIPT
+INSTALL_DATA
+STRIP
+CPP
+GREP
+EGREP
+LINKWATCH_SUPPORT
+KERN
+IPVS_SYNCD
+DFLAGS
+VERSION
+VERSION_DATE
+IPVS_SUPPORT
+VRRP_SUPPORT
+LIBOBJS
+LTLIBOBJS'
ac_subst_files=''
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP'
+
# Initialize some variables set by options.
ac_init_help=
# and all the variables that are supposed to be based on exec_prefix
# by default will actually change.
# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
includedir='${prefix}/include'
oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
+docdir='${datarootdir}/doc/${PACKAGE}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
ac_prev=
+ac_dashdash=
for ac_option
do
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
- eval "$ac_prev=\$ac_option"
+ eval $ac_prev=\$ac_option
ac_prev=
continue
fi
- ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+ case $ac_option in
+ *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *) ac_optarg=yes ;;
+ esac
# Accept the important Cygnus configure options, so we can diagnose typos.
- case $ac_option in
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
--config-cache | -C)
cache_file=config.cache ;;
- -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ -datadir | --datadir | --datadi | --datad)
ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
- | --da=*)
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
datadir=$ac_optarg ;;
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
-disable-* | --disable-*)
ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
{ echo "$as_me: error: invalid feature name: $ac_feature" >&2
{ (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
- eval "enable_$ac_feature=no" ;;
+ ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+ eval enable_$ac_feature=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
-enable-* | --enable-*)
ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
{ echo "$as_me: error: invalid feature name: $ac_feature" >&2
{ (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
- case $ac_option in
- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
- *) ac_optarg=yes ;;
- esac
- eval "enable_$ac_feature='$ac_optarg'" ;;
+ ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+ eval enable_$ac_feature=\$ac_optarg ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
-host=* | --host=* | --hos=* | --ho=*)
host_alias=$ac_optarg ;;
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
-includedir | --includedir | --includedi | --included | --include \
| --includ | --inclu | --incl | --inc)
ac_prev=includedir ;;
| --libexe=* | --libex=* | --libe=*)
libexecdir=$ac_optarg ;;
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
-localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst \
- | --locals | --local | --loca | --loc | --lo)
+ | --localstate | --localstat | --localsta | --localst | --locals)
ac_prev=localstatedir ;;
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* \
- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
localstatedir=$ac_optarg ;;
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
| --progr-tra=* | --program-tr=* | --program-t=*)
program_transform_name=$ac_optarg ;;
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-with-* | --with-*)
ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
{ echo "$as_me: error: invalid package name: $ac_package" >&2
{ (exit 1); exit 1; }; }
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- case $ac_option in
- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
- *) ac_optarg=yes ;;
- esac
- eval "with_$ac_package='$ac_optarg'" ;;
+ ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+ eval with_$ac_package=\$ac_optarg ;;
-without-* | --without-*)
ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
{ echo "$as_me: error: invalid package name: $ac_package" >&2
{ (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/-/_/g'`
- eval "with_$ac_package=no" ;;
+ ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+ eval with_$ac_package=no ;;
--x)
# Obsolete; use --with-x.
expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
{ echo "$as_me: error: invalid variable name: $ac_envvar" >&2
{ (exit 1); exit 1; }; }
- ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
- eval "$ac_envvar='$ac_optarg'"
+ eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
*)
{ (exit 1); exit 1; }; }
fi
-# Be sure to have absolute paths.
-for ac_var in exec_prefix prefix
-do
- eval ac_val=$`echo $ac_var`
- case $ac_val in
- [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
- localstatedir libdir includedir oldincludedir infodir mandir
+# Be sure to have absolute directory names.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
do
- eval ac_val=$`echo $ac_var`
+ eval ac_val=\$$ac_var
case $ac_val in
- [\\/$]* | ?:[\\/]* ) ;;
- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; };;
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
esac
+ { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; }
done
# There might be people who depend on the old broken behavior: `$host'
test "$silent" = yes && exec 6>/dev/null
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ { echo "$as_me: error: Working directory cannot be determined" >&2
+ { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ { echo "$as_me: error: pwd does not report name of working directory" >&2
+ { (exit 1); exit 1; }; }
+
+
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
- # Try the directory containing this script, then its parent.
- ac_confdir=`(dirname "$0") 2>/dev/null ||
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$0" ||
$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$0" : 'X\(//\)[^/]' \| \
X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$0" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
srcdir=$ac_confdir
- if test ! -r $srcdir/$ac_unique_file; then
+ if test ! -r "$srcdir/$ac_unique_file"; then
srcdir=..
fi
else
ac_srcdir_defaulted=no
fi
-if test ! -r $srcdir/$ac_unique_file; then
- if test "$ac_srcdir_defaulted" = yes; then
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
{ (exit 1); exit 1; }; }
- else
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
- { (exit 1); exit 1; }; }
- fi
fi
-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
- { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
{ (exit 1); exit 1; }; }
-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
-ac_env_build_alias_set=${build_alias+set}
-ac_env_build_alias_value=$build_alias
-ac_cv_env_build_alias_set=${build_alias+set}
-ac_cv_env_build_alias_value=$build_alias
-ac_env_host_alias_set=${host_alias+set}
-ac_env_host_alias_value=$host_alias
-ac_cv_env_host_alias_set=${host_alias+set}
-ac_cv_env_host_alias_value=$host_alias
-ac_env_target_alias_set=${target_alias+set}
-ac_env_target_alias_value=$target_alias
-ac_cv_env_target_alias_set=${target_alias+set}
-ac_cv_env_target_alias_value=$target_alias
-ac_env_CC_set=${CC+set}
-ac_env_CC_value=$CC
-ac_cv_env_CC_set=${CC+set}
-ac_cv_env_CC_value=$CC
-ac_env_CFLAGS_set=${CFLAGS+set}
-ac_env_CFLAGS_value=$CFLAGS
-ac_cv_env_CFLAGS_set=${CFLAGS+set}
-ac_cv_env_CFLAGS_value=$CFLAGS
-ac_env_LDFLAGS_set=${LDFLAGS+set}
-ac_env_LDFLAGS_value=$LDFLAGS
-ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
-ac_cv_env_LDFLAGS_value=$LDFLAGS
-ac_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_env_CPPFLAGS_value=$CPPFLAGS
-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_cv_env_CPPFLAGS_value=$CPPFLAGS
-ac_env_CPP_set=${CPP+set}
-ac_env_CPP_value=$CPP
-ac_cv_env_CPP_set=${CPP+set}
-ac_cv_env_CPP_value=$CPP
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
#
# Report the --help message.
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure dir or \`..']
-_ACEOF
-
- cat <<_ACEOF
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[$ac_default_prefix]
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data [PREFIX/share]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
- --infodir=DIR info documentation [PREFIX/info]
- --mandir=DIR man documentation [PREFIX/man]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
_ACEOF
cat <<\_ACEOF
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
- CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
- headers in a nonstandard directory <include dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
CPP C preprocessor
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
_ACEOF
+ac_status=$?
fi
if test "$ac_init_help" = "recursive"; then
# If there are subdirs, report their specific --help.
- ac_popdir=`pwd`
for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d $ac_dir || continue
+ test -d "$ac_dir" || continue
ac_builddir=.
-if test "$ac_dir" != .; then
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
case $srcdir in
- .) # No --srcdir option. We are building in place.
+ .) # We are building in place.
ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
-
- cd $ac_dir
- # Check for guested configure; otherwise get Cygnus style configure.
- if test -f $ac_srcdir/configure.gnu; then
- echo
- $SHELL $ac_srcdir/configure.gnu --help=recursive
- elif test -f $ac_srcdir/configure; then
- echo
- $SHELL $ac_srcdir/configure --help=recursive
- elif test -f $ac_srcdir/configure.ac ||
- test -f $ac_srcdir/configure.in; then
- echo
- $ac_configure --help
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
else
echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi
- cd $ac_popdir
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
done
fi
-test -n "$ac_init_help" && exit 0
+test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
+configure
+generated by GNU Autoconf 2.61
-Copyright (C) 2003 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
- exit 0
+ exit
fi
-exec 5>config.log
-cat >&5 <<_ACEOF
+cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by $as_me, which was
-generated by GNU Autoconf 2.59. Invocation command line was
+generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
_ACEOF
+exec 5>>config.log
{
cat <<_ASUNAME
## --------- ##
/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
test -z "$as_dir" && as_dir=.
echo "PATH: $as_dir"
done
+IFS=$as_save_IFS
} >&5
ac_configure_args=
ac_configure_args0=
ac_configure_args1=
-ac_sep=
ac_must_keep_next=false
for ac_pass in 1 2
do
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
continue ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ *\'*)
ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
case $ac_pass in
-* ) ac_must_keep_next=true ;;
esac
fi
- ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
- # Get rid of the leading space.
- ac_sep=" "
+ ac_configure_args="$ac_configure_args '$ac_arg'"
;;
esac
done
# When interrupted or exit'd, cleanup temporary files, and complete
# config.log. We remove comments because anyway the quotes in there
# would cause problems or look ugly.
-# WARNING: Be sure not to use single quotes in there, as some shells,
-# such as our DU 5.0 friend, will then `close' the trap.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
trap 'exit_status=$?
# Save into config.log some information that might help in debugging.
{
_ASBOX
echo
# The following way of writing the cache mishandles newlines in values,
-{
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ *) $as_unset $ac_var ;;
+ esac ;;
+ esac
+ done
(set) 2>&1 |
- case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
sed -n \
- "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
- ;;
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
*)
- sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
- esac;
-}
+ esac |
+ sort
+)
echo
cat <<\_ASBOX
echo
for ac_var in $ac_subst_vars
do
- eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ echo "$ac_var='\''$ac_val'\''"
done | sort
echo
if test -n "$ac_subst_files"; then
cat <<\_ASBOX
-## ------------- ##
-## Output files. ##
-## ------------- ##
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
_ASBOX
echo
for ac_var in $ac_subst_files
do
- eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ echo "$ac_var='\''$ac_val'\''"
done | sort
echo
fi
## ----------- ##
_ASBOX
echo
- sed "/^$/d" confdefs.h | sort
+ cat confdefs.h
echo
fi
test "$ac_signal" != 0 &&
echo "$as_me: caught signal $ac_signal"
echo "$as_me: exit $exit_status"
} >&5
- rm -f core *.core &&
- rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status
- ' 0
+' 0
for ac_signal in 1 2 13 15; do
trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
done
ac_signal=0
# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo >confdefs.h
+rm -f -r conftest* confdefs.h
# Predefined preprocessor variables.
# Let the site file select an alternate cache file if it wants to.
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
+if test -n "$CONFIG_SITE"; then
+ set x "$CONFIG_SITE"
+elif test "x$prefix" != xNONE; then
+ set x "$prefix/share/config.site" "$prefix/etc/config.site"
+else
+ set x "$ac_default_prefix/share/config.site" \
+ "$ac_default_prefix/etc/config.site"
fi
-for ac_site_file in $CONFIG_SITE; do
+shift
+for ac_site_file
+do
if test -r "$ac_site_file"; then
{ echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
echo "$as_me: loading site script $ac_site_file" >&6;}
{ echo "$as_me:$LINENO: loading cache $cache_file" >&5
echo "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
- [\\/]* | ?:[\\/]* ) . $cache_file;;
- *) . ./$cache_file;;
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
esac
fi
else
# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
-for ac_var in `(set) 2>&1 |
- sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+for ac_var in $ac_precious_vars; do
eval ac_old_set=\$ac_cv_env_${ac_var}_set
eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val="\$ac_cv_env_${ac_var}_value"
- eval ac_new_val="\$ac_env_${ac_var}_value"
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
case $ac_old_set,$ac_new_set in
set,)
{ echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
# Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
- ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
*) ac_arg=$ac_var=$ac_new_val ;;
esac
case " $ac_configure_args " in
{ (exit 1); exit 1; }; }
fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
VERSION=`cat VERSION`
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
fi
if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_CC="gcc"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+ { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
- CC=$ac_ct_CC
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
else
CC="$ac_cv_prog_CC"
fi
if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
- CC=$ac_ct_CC
-else
- CC="$ac_cv_prog_CC"
-fi
+ fi
fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
fi
done
done
+IFS=$as_save_IFS
if test $ac_prog_rejected = yes; then
# We found a bogon in the path, so make sure we never use it.
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
fi
if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
- for ac_prog in cl
+ for ac_prog in cl.exe
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
test -n "$CC" && break
done
fi
if test -z "$CC"; then
ac_ct_CC=$CC
- for ac_prog in cl
+ for ac_prog in cl.exe
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_CC="$ac_prog"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+ { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
test -n "$ac_ct_CC" && break
done
- CC=$ac_ct_CC
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
fi
fi
{ (exit 1); exit 1; }; }
# Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
- "checking for C compiler version" >&5
+echo "$as_me:$LINENO: checking for C compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
- (eval $ac_compiler --version </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compiler --version >&5") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
- (eval $ac_compiler -v </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compiler -v >&5") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
- (eval $ac_compiler -V </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compiler -V >&5") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
- (eval $ac_link_default) 2>&5
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort. b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions. Remove them first so a
+# subsequent execution test works.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link_default") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
- # Find the output, starting from the most likely. This scheme is
-# not robust to junk in `.', hence go to wildcards (a.*) only as a last
-# resort.
-
-# Be careful to initialize this variable, since it used to be cached.
-# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
-ac_cv_exeext=
-# b.out is created by i960 compilers.
-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
do
test -f "$ac_file" || continue
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
- ;;
- conftest.$ac_ext )
- # This is the source file.
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
;;
[ab].out )
# We found the default executable, but exeext='' is most
# certainly right.
break;;
*.* )
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- # FIXME: I believe we export ac_cv_exeext for Libtool,
- # but it would be cool to find out if it's true. Does anybody
- # maintain Libtool? --akim.
- export ac_cv_exeext
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
break;;
* )
break;;
esac
done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
else
+ ac_file=''
+fi
+
+{ echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6; }
+if test -z "$ac_file"; then
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
ac_exeext=$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6
-# Check the compiler produces executables we can run. If not, either
+# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
# If not cross compiling, check that we can run a simple program.
if test "$cross_compiling" != yes; then
if { ac_try='./$ac_file'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
fi
fi
fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
rm -f a.out a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
-# Check the compiler produces executables we can run. If not, either
+# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6
-
-echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
+{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6; }
+
+{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
for ac_file in conftest.exe conftest conftest.*; do
test -f "$ac_file" || continue
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
*.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- export ac_cv_exeext
break;;
* ) break;;
esac
fi
rm -f conftest$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6; }
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
-echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
if test "${ac_cv_objext+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
}
_ACEOF
rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
- for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
*) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
break;;
esac
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6; }
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
if test "${ac_cv_c_compiler_gnu+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (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); }; } &&
- { 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
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
ac_compiler_gnu=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_compiler_gnu=no
+ ac_compiler_gnu=no
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
fi
-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
GCC=`test $ac_compiler_gnu = yes && echo yes`
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
if test "${ac_cv_prog_cc_g+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ CFLAGS=""
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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); }; }; then
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
ac_cv_prog_cc_g=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_prog_cc_g=no
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
if test "$ac_test_CFLAGS" = set; then
CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
CFLAGS=
fi
fi
-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
+{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_cv_prog_cc_stdc=no
+ ac_cv_prog_cc_c89=no
ac_save_CC=$CC
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
function prototypes and stuff, but not '\xHH' hex character constants.
These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std1 is added to get
+ as 'x'. The following induces an error, until -std is added to get
proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std1. */
+ that's true only with -std. */
int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
return 0;
}
_ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX -qlanglvl=ansi
-# Ultrix and OSF/1 -std1
-# HP-UX 10.20 and later -Ae
-# HP-UX older versions -Aa -D_HPUX_SOURCE
-# SVR4 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (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); }; } &&
- { 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_cv_prog_cc_stdc=$ac_arg
-break
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_c89=$ac_arg
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest.err conftest.$ac_objext
+
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
done
-rm -f conftest.$ac_ext conftest.$ac_objext
+rm -f conftest.$ac_ext
CC=$ac_save_CC
fi
-
-case "x$ac_cv_prog_cc_stdc" in
- x|xno)
- echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6; } ;;
+ xno)
+ { echo "$as_me:$LINENO: result: unsupported" >&5
+echo "${ECHO_T}unsupported" >&6; } ;;
*)
- echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
- CC="$CC $ac_cv_prog_cc_stdc" ;;
+ CC="$CC $ac_cv_prog_cc_c89"
+ { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
esac
-# Some people use a C++ compiler to compile C. Since we use `exit',
-# in C++ we need to declare it. In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-cat >conftest.$ac_ext <<_ACEOF
-#ifndef __cplusplus
- choke me
-#endif
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 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); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (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); }; } &&
- { 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
- for ac_declaration in \
- '' \
- 'extern "C" void std::exit (int) throw (); using std::exit;' \
- 'extern "C" void std::exit (int); using std::exit;' \
- 'extern "C" void exit (int) throw ();' \
- 'extern "C" void exit (int);' \
- 'void exit (int);'
-do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_declaration
-#include <stdlib.h>
-int
-main ()
-{
-exit (42);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 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); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (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); }; } &&
- { 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
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-continue
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_declaration
-int
-main ()
-{
-exit (42);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 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); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (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); }; } &&
- { 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
- break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
- echo '#ifdef __cplusplus' >>confdefs.h
- echo $ac_declaration >>confdefs.h
- echo '#endif' >>confdefs.h
-fi
-
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_aux_dir=
-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
- if test -f $ac_dir/install-sh; then
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+ if test -f "$ac_dir/install-sh"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
break
- elif test -f $ac_dir/install.sh; then
+ elif test -f "$ac_dir/install.sh"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install.sh -c"
break
- elif test -f $ac_dir/shtool; then
+ elif test -f "$ac_dir/shtool"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/shtool install -c"
break
fi
done
if test -z "$ac_aux_dir"; then
- { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
-echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
{ (exit 1); exit 1; }; }
fi
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
if test -z "$INSTALL"; then
if test "${ac_cv_path_install+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
if test $ac_prog = install &&
grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
;;
esac
done
+IFS=$as_save_IFS
fi
if test "${ac_cv_path_install+set}" = set; then
INSTALL=$ac_cv_path_install
else
- # As a last resort, use the slow shell script. We don't cache a
- # path for INSTALL within a source directory, because that will
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
# break other packages using the cache if that directory is
- # removed, or if the path is relative.
+ # removed, or if the value is a relative name.
INSTALL=$ac_install_sh
fi
fi
-echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6
+{ echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6; }
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_STRIP+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
fi
fi
STRIP=$ac_cv_prog_STRIP
if test -n "$STRIP"; then
- echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6
+ { echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
fi
if test -z "$ac_cv_prog_STRIP"; then
ac_ct_STRIP=$STRIP
# Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_STRIP="strip"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
fi
fi
ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
if test -n "$ac_ct_STRIP"; then
- echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6
+ { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
- STRIP=$ac_ct_STRIP
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
else
STRIP="$ac_cv_prog_STRIP"
fi
-# Check whether --enable-lvs-syncd or --disable-lvs-syncd was given.
+# Check whether --enable-lvs-syncd was given.
if test "${enable_lvs_syncd+set}" = set; then
- enableval="$enable_lvs_syncd"
+ enableval=$enable_lvs_syncd;
+fi
-fi;
-# Check whether --enable-lvs or --disable-lvs was given.
+# Check whether --enable-lvs was given.
if test "${enable_lvs+set}" = set; then
- enableval="$enable_lvs"
+ enableval=$enable_lvs;
+fi
-fi;
-# Check whether --enable-vrrp or --disable-vrrp was given.
+# Check whether --enable-vrrp was given.
if test "${enable_vrrp+set}" = set; then
- enableval="$enable_vrrp"
+ enableval=$enable_vrrp;
+fi
-fi;
-# Check whether --with-kernel-dir or --without-kernel-dir was given.
+# Check whether --with-kernel-dir was given.
if test "${with_kernel_dir+set}" = set; then
- withval="$with_kernel_dir"
- kernelinc="$withval/include" kernelpath="$withval"
+ withval=$with_kernel_dir; kernelinc="$withval/include" kernelpath="$withval"
else
kernelinc="/usr/src/linux/include" kernelpath="/usr/src/linux"
-fi;
-# Check whether --enable-debug or --disable-debug was given.
+fi
+
+# Check whether --enable-debug was given.
if test "${enable_debug+set}" = set; then
- enableval="$enable_debug"
+ enableval=$enable_debug;
+fi
-fi;
-# Check whether --enable-profile or --disable-profile was given.
+# Check whether --enable-profile was given.
if test "${enable_profile+set}" = set; then
- enableval="$enable_profile"
+ enableval=$enable_profile;
+fi
-fi;
ac_ext=c
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
#endif
Syntax error
_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
:
else
echo "$as_me: failed program was:" >&5
# Broken: fails on valid input.
continue
fi
+
rm -f conftest.err conftest.$ac_ext
- # OK, works on sane cases. Now check whether non-existent headers
+ # OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
# Broken: success on invalid input.
continue
else
ac_preproc_ok=:
break
fi
+
rm -f conftest.err conftest.$ac_ext
done
else
ac_cv_prog_CPP=$CPP
fi
-echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6
+{ echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6; }
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
#endif
Syntax error
_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
:
else
echo "$as_me: failed program was:" >&5
# Broken: fails on valid input.
continue
fi
+
rm -f conftest.err conftest.$ac_ext
- # OK, works on sane cases. Now check whether non-existent headers
+ # OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
# Broken: success on invalid input.
continue
else
ac_preproc_ok=:
break
fi
+
rm -f conftest.err conftest.$ac_ext
done
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6
-if test "${ac_cv_prog_egrep+set}" = set; then
+{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Extract the first word of "grep ggrep" to use in msg output
+if test -z "$GREP"; then
+set dummy grep ggrep; ac_prog_name=$2
+if test "${ac_cv_path_GREP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_path_GREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+ # Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ ac_count=`expr $ac_count + 1`
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+ $ac_path_GREP_found && break 3
+ done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+GREP="$ac_cv_path_GREP"
+if test -z "$GREP"; then
+ { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ # Extract the first word of "egrep" to use in msg output
+if test -z "$EGREP"; then
+set dummy egrep; ac_prog_name=$2
+if test "${ac_cv_path_EGREP+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if echo a | (grep -E '(a|b)') >/dev/null 2>&1
- then ac_cv_prog_egrep='grep -E'
- else ac_cv_prog_egrep='egrep'
+ ac_path_EGREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+ # Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ ac_count=`expr $ac_count + 1`
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+ $ac_path_EGREP_found && break 3
+ done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+EGREP="$ac_cv_path_EGREP"
+if test -z "$EGREP"; then
+ { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+else
+ ac_cv_path_EGREP=$EGREP
fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
-echo "${ECHO_T}$ac_cv_prog_egrep" >&6
- EGREP=$ac_cv_prog_egrep
-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+ fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
if test "${ac_cv_header_stdc+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (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); }; } &&
- { 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
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
ac_cv_header_stdc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_header_stdc=no
+ ac_cv_header_stdc=no
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <ctype.h>
+#include <stdlib.h>
#if ((' ' & 0x0FF) == 0x020)
# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i))
|| toupper (i) != TOUPPER (i))
- exit(2);
- exit (0);
+ return 2;
+ return 0;
}
_ACEOF
rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
( exit $ac_status )
ac_cv_header_stdc=no
fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
+
+
fi
fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
if test $ac_cv_header_stdc = yes; then
cat >>confdefs.h <<\_ACEOF
fi
-echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5
-echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6; }
if test "${ac_cv_header_sys_wait_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
#include <sys/types.h>
#include <sys/wait.h>
#ifndef WEXITSTATUS
-# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
#endif
#ifndef WIFEXITED
# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (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); }; } &&
- { 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
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
ac_cv_header_sys_wait_h=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_header_sys_wait_h=no
+ ac_cv_header_sys_wait_h=no
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; }
if test $ac_cv_header_sys_wait_h = yes; then
cat >>confdefs.h <<\_ACEOF
inttypes.h stdint.h unistd.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-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 "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (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); }; } &&
- { 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
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
eval "$as_ac_Header=yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-eval "$as_ac_Header=no"
+ eval "$as_ac_Header=no"
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
for ac_header in fcntl.h syslog.h unistd.h sys/ioctl.h sys/time.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
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+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
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&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
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (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); }; } &&
- { 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
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_header_compiler=no
+ ac_header_compiler=no
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
+
+rm -f core conftest.err 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
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_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
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&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
+{ 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:$ac_c_preproc_warn_flag in
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists. ##
-## ------------------------------------------ ##
-_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 "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+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
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
for ac_header in openssl/ssl.h openssl/md5.h openssl/err.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
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+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
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&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
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (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); }; } &&
- { 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
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_header_compiler=no
+ ac_header_compiler=no
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
+
+rm -f core conftest.err 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
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_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
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&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
+{ 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:$ac_c_preproc_warn_flag in
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists. ##
-## ------------------------------------------ ##
-_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 "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+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
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
-echo "$as_me:$LINENO: checking for MD5_Init in -lcrypto" >&5
-echo $ECHO_N "checking for MD5_Init in -lcrypto... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for MD5_Init in -lcrypto" >&5
+echo $ECHO_N "checking for MD5_Init in -lcrypto... $ECHO_C" >&6; }
if test "${ac_cv_lib_crypto_MD5_Init+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any gcc2 internal prototype to avoid an error. */
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
char MD5_Init ();
int
main ()
{
-MD5_Init ();
+return MD5_Init ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 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); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (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); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
ac_cv_lib_crypto_MD5_Init=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_lib_crypto_MD5_Init=no
+ ac_cv_lib_crypto_MD5_Init=no
fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_MD5_Init" >&5
-echo "${ECHO_T}$ac_cv_lib_crypto_MD5_Init" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_MD5_Init" >&5
+echo "${ECHO_T}$ac_cv_lib_crypto_MD5_Init" >&6; }
if test $ac_cv_lib_crypto_MD5_Init = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBCRYPTO 1
fi
-echo "$as_me:$LINENO: checking for SSL_CTX_new in -lssl" >&5
-echo $ECHO_N "checking for SSL_CTX_new in -lssl... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for SSL_CTX_new in -lssl" >&5
+echo $ECHO_N "checking for SSL_CTX_new in -lssl... $ECHO_C" >&6; }
if test "${ac_cv_lib_ssl_SSL_CTX_new+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any gcc2 internal prototype to avoid an error. */
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
char SSL_CTX_new ();
int
main ()
{
-SSL_CTX_new ();
+return SSL_CTX_new ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 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); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (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); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
ac_cv_lib_ssl_SSL_CTX_new=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_lib_ssl_SSL_CTX_new=no
+ ac_cv_lib_ssl_SSL_CTX_new=no
fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_SSL_CTX_new" >&5
-echo "${ECHO_T}$ac_cv_lib_ssl_SSL_CTX_new" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_SSL_CTX_new" >&5
+echo "${ECHO_T}$ac_cv_lib_ssl_SSL_CTX_new" >&6; }
if test $ac_cv_lib_ssl_SSL_CTX_new = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBSSL 1
fi
-echo "$as_me:$LINENO: checking for poptGetContext in -lpopt" >&5
-echo $ECHO_N "checking for poptGetContext in -lpopt... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for poptGetContext in -lpopt" >&5
+echo $ECHO_N "checking for poptGetContext in -lpopt... $ECHO_C" >&6; }
if test "${ac_cv_lib_popt_poptGetContext+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any gcc2 internal prototype to avoid an error. */
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
char poptGetContext ();
int
main ()
{
-poptGetContext ();
+return poptGetContext ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 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); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (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); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
ac_cv_lib_popt_poptGetContext=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_lib_popt_poptGetContext=no
+ ac_cv_lib_popt_poptGetContext=no
fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_popt_poptGetContext" >&5
-echo "${ECHO_T}$ac_cv_lib_popt_poptGetContext" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_popt_poptGetContext" >&5
+echo "${ECHO_T}$ac_cv_lib_popt_poptGetContext" >&6; }
if test $ac_cv_lib_popt_poptGetContext = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBPOPT 1
CPPFLAGS="$CPPFLAGS -I$kernelinc"
-echo "$as_me:$LINENO: checking for kernel version" >&5
-echo $ECHO_N "checking for kernel version... $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
LINUX_MAJOR="0"
_ACEOF
rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
LINUX_PATCH="0"
fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* 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
+ { 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
fi
as_ac_File=`echo "ac_cv_file_$kernelpath/net/core/link_watch.c" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $kernelpath/net/core/link_watch.c" >&5
-echo $ECHO_N "checking for $kernelpath/net/core/link_watch.c... $ECHO_C" >&6
-if eval "test \"\${$as_ac_File+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $kernelpath/net/core/link_watch.c" >&5
+echo $ECHO_N "checking for $kernelpath/net/core/link_watch.c... $ECHO_C" >&6; }
+if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
test "$cross_compiling" = yes &&
eval "$as_ac_File=no"
fi
fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6
+ac_res=`eval echo '${'$as_ac_File'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_File'}'` = yes; then
LINKWATCH_SUPPORT="_WITH_LINKWATCH_"
IPVS_SUPPORT="_WITHOUT_LVS_"
if test "$enable_lvs" != "no"; then
if test "${ac_cv_header_net_ip_vs_h+set}" = set; then
- echo "$as_me:$LINENO: checking for net/ip_vs.h" >&5
-echo $ECHO_N "checking for net/ip_vs.h... $ECHO_C" >&6
+ { echo "$as_me:$LINENO: checking for net/ip_vs.h" >&5
+echo $ECHO_N "checking for net/ip_vs.h... $ECHO_C" >&6; }
if test "${ac_cv_header_net_ip_vs_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
-echo "$as_me:$LINENO: result: $ac_cv_header_net_ip_vs_h" >&5
-echo "${ECHO_T}$ac_cv_header_net_ip_vs_h" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_net_ip_vs_h" >&5
+echo "${ECHO_T}$ac_cv_header_net_ip_vs_h" >&6; }
else
# Is the header compilable?
-echo "$as_me:$LINENO: checking net/ip_vs.h usability" >&5
-echo $ECHO_N "checking net/ip_vs.h usability... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking net/ip_vs.h usability" >&5
+echo $ECHO_N "checking net/ip_vs.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
#include <net/ip_vs.h>
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (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); }; } &&
- { 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
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_header_compiler=no
+ ac_header_compiler=no
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
+
+rm -f core conftest.err 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 net/ip_vs.h presence" >&5
-echo $ECHO_N "checking net/ip_vs.h presence... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking net/ip_vs.h presence" >&5
+echo $ECHO_N "checking net/ip_vs.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
/* end confdefs.h. */
#include <net/ip_vs.h>
_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&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
+{ 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:$ac_c_preproc_warn_flag in
echo "$as_me: WARNING: net/ip_vs.h: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: net/ip_vs.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: net/ip_vs.h: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists. ##
-## ------------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
+
;;
esac
-echo "$as_me:$LINENO: checking for net/ip_vs.h" >&5
-echo $ECHO_N "checking for net/ip_vs.h... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for net/ip_vs.h" >&5
+echo $ECHO_N "checking for net/ip_vs.h... $ECHO_C" >&6; }
if test "${ac_cv_header_net_ip_vs_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_header_net_ip_vs_h=$ac_header_preproc
fi
-echo "$as_me:$LINENO: result: $ac_cv_header_net_ip_vs_h" >&5
-echo "${ECHO_T}$ac_cv_header_net_ip_vs_h" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_net_ip_vs_h" >&5
+echo "${ECHO_T}$ac_cv_header_net_ip_vs_h" >&6; }
fi
if test $ac_cv_header_net_ip_vs_h = yes; then
else
IPVS_SUPPORT="_WITHOUT_LVS_"
- IPVS_MAJOR="0"
- IPVS_MINOR="0"
- IPVS_PATCH="0"
{ echo "$as_me:$LINENO: WARNING: keepalived will be built without LVS support." >&5
echo "$as_me: WARNING: keepalived will be built without LVS support." >&2;}
fi
+if test "$IPVS_SUPPORT" = "_WITHOUT_LVS_" -a "$enable_vrrp" = "no"; then
+ { { echo "$as_me:$LINENO: error: keepalived MUST be compiled at least with LVS or VRRP framework" >&5
+echo "$as_me: error: keepalived MUST be compiled at least with LVS or VRRP framework" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+IPVS_SYNCD="_WITHOUT_IPVS_SYNCD_"
if test "$IPVS_SUPPORT" = "_WITH_LVS_"; then
- echo "$as_me:$LINENO: checking for IPVS version" >&5
-echo $ECHO_N "checking for IPVS version... $ECHO_C" >&6
- if test "$cross_compiling" = yes; 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 "_KRNL_2_4_"; then
+ IPVS_SYNCD="_HAVE_IPVS_SYNCD_"
+ else
+ IPVS_SYNCD="_WITHOUT_IPVS_SYNCD_"
+ fi
- IPVS_MAJOR="0"
- IPVS_MINOR="0"
- IPVS_PATCH="0"
-
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
- #include <stdlib.h>
- #include <stdio.h>
- #include <net/ip_vs.h>
- int main (void) {
- FILE *fp = fopen ("ipvsinfo", "w");
- if (!fp) return 1;
- fprintf (fp, "%d\n%d\n%d\n", NVERSION(IP_VS_VERSION_CODE));
- fclose (fp);
- 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
-
- IPVS_MAJOR=`head -n 1 ipvsinfo | tail -n 1`
- IPVS_MINOR=`head -n 2 ipvsinfo | tail -n 1`
- IPVS_PATCH=`head -n 3 ipvsinfo | tail -n 1`
-
-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 )
-
- IPVS_MAJOR="0"
- IPVS_MINOR="0"
- IPVS_PATCH="0"
-
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
- rm -f ipvsinfo
- echo "$as_me:$LINENO: result: $IPVS_MAJOR.$IPVS_MINOR.$IPVS_PATCH" >&5
-echo "${ECHO_T}$IPVS_MAJOR.$IPVS_MINOR.$IPVS_PATCH" >&6
- if test "$IPVS_MAJOR" = "0" -a "$IPVS_MINOR" = "0" -a "$IPVS_PATCH" = "0"; then
- { echo "$as_me:$LINENO: WARNING: Cannot determine IPVS version." >&5
-echo "$as_me: WARNING: Cannot determine IPVS version." >&2;}
- fi
-fi
-
-if test "$IPVS_SUPPORT" = "_WITHOUT_LVS_" -a "$enable_vrrp" = "no"; then
- { { echo "$as_me:$LINENO: error: keepalived MUST be compiled at least with LVS or VRRP framework" >&5
-echo "$as_me: error: keepalived MUST be compiled at least with LVS or VRRP framework" >&2;}
- { (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_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
+ { 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
+ { 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
-echo $ECHO_N "checking for kernel netlink support... $ECHO_C" >&6
- if test "$cross_compiling" = yes; then
-
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
- #include <asm/types.h>
- #include <sys/socket.h>
- #include <linux/netlink.h>
- int main (void) {
- int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
- if (fd < 0)
- exit(1);
- close(fd);
- exit(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
-
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
- VRRP_SUPPORT="_WITH_VRRP_"
-
-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 )
-
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
+ VRRP_SUPPORT="_WITH_VRRP_"
fi
if test "${enable_debug}" = "yes"; then
-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
+{ 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
echo $ECHO_N "(cached) $ECHO_C" >&6
else
#ifndef __cplusplus
/* Ultrix mips cc rejects this. */
typedef int charset[2];
- const charset x;
+ const charset cs;
/* SunOS 4.1.1 cc rejects this. */
- char const *const *ccp;
- char **p;
+ char const *const *pcpcc;
+ char **ppc;
/* NEC SVR4.0.2 mips cc rejects this. */
struct point {int x, y;};
static struct point const zero = {0,0};
an arm of an if-expression whose if-part is not a constant
expression */
const char *g = "string";
- ccp = &g + (g ? g-g : 0);
+ pcpcc = &g + (g ? g-g : 0);
/* HPUX 7.0 cc rejects these. */
- ++ccp;
- p = (char**) ccp;
- ccp = (char const *const *) p;
+ ++pcpcc;
+ ppc = (char**) pcpcc;
+ pcpcc = (char const *const *) ppc;
{ /* SCO 3.2v4 cc rejects this. */
char *t;
char const *s = 0 ? (char *) 0 : (char const *) 0;
*t++ = 0;
+ if (s) return 0;
}
{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
int x[] = {25, 17};
}
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
const int foo = 10;
+ if (!foo) return 0;
}
+ return !cs[0] && !zero.x;
#endif
;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (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); }; } &&
- { 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
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
ac_cv_c_const=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_c_const=no
+ ac_cv_c_const=no
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
-echo "${ECHO_T}$ac_cv_c_const" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+echo "${ECHO_T}$ac_cv_c_const" >&6; }
if test $ac_cv_c_const = no; then
cat >>confdefs.h <<\_ACEOF
fi
-echo "$as_me:$LINENO: checking for pid_t" >&5
-echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for pid_t" >&5
+echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; }
if test "${ac_cv_type_pid_t+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
+typedef pid_t ac__type_new_;
int
main ()
{
-if ((pid_t *) 0)
+if ((ac__type_new_ *) 0)
return 0;
-if (sizeof (pid_t))
+if (sizeof (ac__type_new_))
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (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); }; } &&
- { 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
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
ac_cv_type_pid_t=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_type_pid_t=no
+ ac_cv_type_pid_t=no
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
-echo "${ECHO_T}$ac_cv_type_pid_t" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
+echo "${ECHO_T}$ac_cv_type_pid_t" >&6; }
if test $ac_cv_type_pid_t = yes; then
:
else
fi
-echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
-echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
+echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; }
if test "${ac_cv_header_time+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (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); }; } &&
- { 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
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
ac_cv_header_time=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_header_time=no
+ ac_cv_header_time=no
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
-echo "${ECHO_T}$ac_cv_header_time" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
+echo "${ECHO_T}$ac_cv_header_time" >&6; }
if test $ac_cv_header_time = yes; then
cat >>confdefs.h <<\_ACEOF
if test $ac_cv_c_compiler_gnu = yes; then
- echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5
-echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
+ { echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5
+echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6; }
if test "${ac_cv_prog_gcc_traditional+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
fi
fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5
-echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5
+echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6; }
if test $ac_cv_prog_gcc_traditional = yes; then
CC="$CC -traditional"
fi
fi
-echo "$as_me:$LINENO: checking for working memcmp" >&5
-echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6
+{ 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
{
/* Some versions of memcmp are not 8-bit clean. */
- char c0 = 0x40, c1 = 0x80, c2 = 0x81;
+ char c0 = '\100', c1 = '\200', c2 = '\201';
if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
- exit (1);
+ return 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.
strcpy (a, "--------01111111");
strcpy (b, "--------10000000");
if (memcmp (a, b, 16) >= 0)
- exit (1);
+ return 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
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
( exit $ac_status )
ac_cv_func_memcmp_working=no
fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* 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 && case $LIBOBJS in
- "memcmp.$ac_objext" | \
- *" memcmp.$ac_objext" | \
- "memcmp.$ac_objext "* | \
+{ 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 && case " $LIBOBJS " in
*" memcmp.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;;
+ *) LIBOBJS="$LIBOBJS memcmp.$ac_objext"
+ ;;
esac
-echo "$as_me:$LINENO: checking return type of signal handlers" >&5
-echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
+{ 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
echo $ECHO_N "(cached) $ECHO_C" >&6
else
/* end confdefs.h. */
#include <sys/types.h>
#include <signal.h>
-#ifdef signal
-# undef signal
-#endif
-#ifdef __cplusplus
-extern "C" void (*signal (int, void (*)(int)))(int);
-#else
-void (*signal ()) ();
-#endif
int
main ()
{
-int i;
+return *(signal (0, 0)) (0) == 1;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 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); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (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); }; } &&
- { 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_cv_type_signal=void
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_signal=int
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_type_signal=int
+ ac_cv_type_signal=void
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
-echo "${ECHO_T}$ac_cv_type_signal" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
+echo "${ECHO_T}$ac_cv_type_signal" >&6; }
cat >>confdefs.h <<_ACEOF
#define RETSIGTYPE $ac_cv_type_signal
for ac_func in gettimeofday select socket strerror strtol uname
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
#undef $ac_func
-/* Override any gcc2 internal prototype to avoid an error. */
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
-{
#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
char $ac_func ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
#endif
int
main ()
{
-return f != $ac_func;
+return $ac_func ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 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); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (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); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
eval "$as_ac_var=yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-eval "$as_ac_var=no"
+ eval "$as_ac_var=no"
fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_var'}'` = yes; then
cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
OUTPUT_TARGET="$OUTPUT_TARGET keepalived/libipfwc/Makefile"
fi
fi
- ac_config_files="$ac_config_files $OUTPUT_TARGET"
+ac_config_files="$ac_config_files $OUTPUT_TARGET"
+
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
+# So, we kill variables containing newlines.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
-{
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ *) $as_unset $ac_var ;;
+ esac ;;
+ esac
+ done
+
(set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote
# substitution turns \\\\ into \\, and sed turns \\ into \).
sed -n \
"s/'/'\\\\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;;
+ ;; #(
*)
# `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
- esac;
-} |
+ esac |
+ sort
+) |
sed '
+ /^ac_cv_env_/b end
t clear
- : clear
+ :clear
s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
t end
- /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- : end' >>confcache
-if diff $cache_file confcache >/dev/null 2>&1; then :; else
- if test -w $cache_file; then
- test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ test "x$cache_file" != "x/dev/null" &&
+ { echo "$as_me:$LINENO: updating cache $cache_file" >&5
+echo "$as_me: updating cache $cache_file" >&6;}
cat confcache >$cache_file
else
- echo "not updating unwritable cache $cache_file"
+ { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+echo "$as_me: not updating unwritable cache $cache_file" >&6;}
fi
fi
rm -f confcache
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
-s/:*\$(srcdir):*/:/;
-s/:*\${srcdir}:*/:/;
-s/:*@srcdir@:*/:/;
-s/^\([^=]*=[ ]*\):*/\1/;
-s/:*$//;
-s/^[^=]*=[ ]*$//;
-}'
-fi
-
# Transform confdefs.h into DEFS.
# Protect against shell expansion while executing Makefile rules.
# Protect against Makefile macro expansion.
#
# If the first sed substitution is executed (which looks for macros that
-# take arguments), then we branch to the quote section. Otherwise,
+# take arguments), then branch to the quote section. Otherwise,
# look for a macro that doesn't take arguments.
-cat >confdef2opt.sed <<\_ACEOF
+ac_script='
t clear
-: clear
-s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g
+:clear
+s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
t quote
-s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g
+s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
t quote
-d
-: quote
-s,[ `~#$^&*(){}\\|;'"<>?],\\&,g
-s,\[,\\&,g
-s,\],\\&,g
-s,\$,$$,g
-p
-_ACEOF
-# We use echo to avoid assuming a particular line-breaking character.
-# The extra dot is to prevent the shell from consuming trailing
-# line-breaks from the sub-command output. A line-break within
-# single-quotes doesn't work because, if this script is created in a
-# platform that uses two characters for line-breaks (e.g., DOS), tr
-# would break.
-ac_LF_and_DOT=`echo; echo .`
-DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
-rm -f confdef2opt.sed
+b any
+:quote
+s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
+s/\[/\\&/g
+s/\]/\\&/g
+s/\$/$$/g
+H
+:any
+${
+ g
+ s/^\n//
+ s/\n/ /g
+ p
+}
+'
+DEFS=`sed -n "$ac_script" confdefs.h`
ac_libobjs=
ac_ltlibobjs=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
- ac_i=`echo "$ac_i" |
- sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
- # 2. Add them.
- ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
- ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs
## M4sh Initialization. ##
## --------------------- ##
-# Be Bourne compatible
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
fi
-DUALCASE=1; export DUALCASE # for MKS sh
# Support unset when possible.
if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
fi
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+fi
+
# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
PS1='$ '
PS2='> '
PS4='+ '
if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
eval $as_var=C; export $as_var
else
- $as_unset $as_var
+ ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
fi
done
# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
# Name of the executable.
-as_me=`$as_basename "$0" ||
+as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)$' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
+# CDPATH.
+$as_unset CDPATH
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" || {
- # Find who we are. Look in the path if we contain no path at all
- # relative or not.
- case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
- ;;
- esac
- # We did not find ourselves, most probably we were run as `sh COMMAND'
- # in which case we are not to be found in the path.
- if test "x$as_myself" = x; then
- as_myself=$0
- fi
- if test ! -f "$as_myself"; then
- { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
- { (exit 1); exit 1; }; }
- fi
- case $CONFIG_SHELL in
- '')
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for as_base in sh bash ksh sh5; do
- case $as_dir in
- /*)
- if ("$as_dir/$as_base" -c '
as_lineno_1=$LINENO
as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
- CONFIG_SHELL=$as_dir/$as_base
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
- fi;;
- esac
- done
-done
-;;
- esac
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
# Create $as_me.lineno as a copy of $as_myself, but with $LINENO
# uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line before each line; the second 'sed' does the real
- # work. The second script uses 'N' to pair each line-number line
- # with the numbered line, and appends trailing '-' during
- # substitution so that $LINENO is not a special case at line end.
+ # line-number line after each line using $LINENO; the second 'sed'
+ # does the real work. The second script uses 'N' to pair each
+ # line-number line with the line containing $LINENO, and appends
+ # trailing '-' during substitution so that $LINENO is not a special
+ # case at line end.
# (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
- sed '=' <$as_myself |
+ # scripts with optimization help from Paolo Bonzini. Blame Lee
+ # E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
N
- s,$,-,
- : loop
- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
t loop
- s,-$,,
- s,^['$as_cr_digits']*\n,,
+ s/-\n.*//
' >$as_me.lineno &&
- chmod +x $as_me.lineno ||
- { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+ chmod +x "$as_me.lineno" ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
{ (exit 1); exit 1; }; }
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensible to this).
- . ./$as_me.lineno
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
esac
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir
+fi
echo >conf$$.file
if ln -s conf$$.file conf$$ 2>/dev/null; then
- # We could just check for DJGPP; but this test a) works b) is more generic
- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
- if test -f conf$$.exe; then
- # Don't use ln at all; we don't have any links
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -p'
- else
- as_ln_s='ln -s'
- fi
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -p'
fi
-rm -f conf$$ conf$$.exe conf$$.file
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
if mkdir -p . 2>/dev/null; then
as_mkdir_p=:
as_mkdir_p=false
fi
-as_executable_p="test -f"
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
exec 6>&1
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# Save the log message, to keep $[0] and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling. Logging --version etc. is OK.
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
-
+# values after options handling.
+ac_log="
This file was extended by $as_me, which was
-generated by GNU Autoconf 2.59. Invocation command line was
+generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
CONFIG_COMMANDS = $CONFIG_COMMANDS
$ $0 $@
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
# Files that config.status was made for.
-if test -n "$ac_config_files"; then
- echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
-fi
+config_files="$ac_config_files"
-if test -n "$ac_config_headers"; then
- echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_links"; then
- echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_commands"; then
- echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
-fi
+_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
-
ac_cs_usage="\
\`$as_me' instantiates files from templates according to the
current configuration.
Usage: $0 [OPTIONS] [FILE]...
-h, --help print this help, then exit
- -V, --version print version number, then exit
+ -V, --version print version number and configuration settings, then exit
-q, --quiet do not print progress messages
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
$config_files
Report bugs to <bug-autoconf@gnu.org>."
-_ACEOF
+_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
config.status
-configured by $0, generated by GNU Autoconf 2.59,
- with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+configured by $0, generated by GNU Autoconf 2.61,
+ with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
-Copyright (C) 2003 Free Software Foundation, Inc.
+Copyright (C) 2006 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
-srcdir=$srcdir
-INSTALL="$INSTALL"
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
do
case $1 in
--*=*)
- ac_option=`expr "x$1" : 'x\([^=]*\)='`
- ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
ac_shift=:
;;
- -*)
+ *)
ac_option=$1
ac_optarg=$2
ac_shift=shift
;;
- *) # This is not an option, so the user has probably given explicit
- # arguments.
- ac_option=$1
- ac_need_defaults=false;;
esac
case $ac_option in
# Handling of the options.
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
ac_cs_recheck=: ;;
- --version | --vers* | -V )
- echo "$ac_cs_version"; exit 0 ;;
- --he | --h)
- # Conflict between --help and --header
- { { echo "$as_me:$LINENO: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2;}
- { (exit 1); exit 1; }; };;
- --help | --hel | -h )
- echo "$ac_cs_usage"; exit 0 ;;
- --debug | --d* | -d )
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ echo "$ac_cs_version"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
CONFIG_FILES="$CONFIG_FILES $ac_optarg"
ac_need_defaults=false;;
- --header | --heade | --head | --hea )
- $ac_shift
- CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
- ac_need_defaults=false;;
+ --he | --h | --help | --hel | -h )
+ echo "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;;
# This is an error.
- -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2;}
+ -*) { echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
{ (exit 1); exit 1; }; } ;;
- *) ac_config_targets="$ac_config_targets $1" ;;
+ *) ac_config_targets="$ac_config_targets $1"
+ ac_need_defaults=false ;;
esac
shift
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
if \$ac_cs_recheck; then
- echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
- exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+ CONFIG_SHELL=$SHELL
+ export CONFIG_SHELL
+ exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
fi
_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ echo "$ac_log"
+} >&5
-
-
-
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
+
+# Handling of arguments.
for ac_config_target in $ac_config_targets
do
- case "$ac_config_target" in
- # Handling of arguments.
- "$OUTPUT_TARGET" ) CONFIG_FILES="$CONFIG_FILES $OUTPUT_TARGET" ;;
+ case $ac_config_target in
+ "$OUTPUT_TARGET") CONFIG_FILES="$CONFIG_FILES $OUTPUT_TARGET" ;;
+
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
{ (exit 1); exit 1; }; };;
esac
done
+
# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used. Set only those that are not.
# We use the long form for the default assignment because of an extremely
fi
# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason to put it here, and in addition,
+# simply because there is no reason against having it here, and in addition,
# creating and moving files from /tmp can sometimes cause problems.
-# Create a temporary directory, and hook for its removal unless debugging.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
$debug ||
{
- trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ tmp=
+ trap 'exit_status=$?
+ { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
trap '{ (exit 1); exit 1; }' 1 2 13 15
}
-
# Create a (secure) tmp directory for tmp files.
{
- tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
test -n "$tmp" && test -d "$tmp"
} ||
{
- tmp=./confstat$$-$RANDOM
- (umask 077 && mkdir $tmp)
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
} ||
{
echo "$me: cannot create a temporary directory in ." >&2
{ (exit 1); exit 1; }
}
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-
#
-# CONFIG_FILES section.
+# Set up the sed scripts for CONFIG_FILES section.
#
# No need to generate the scripts if there are no CONFIG_FILES.
# This happens for instance when ./config.status config.h
-if test -n "\$CONFIG_FILES"; then
- # Protect against being on the right side of a sed subst in config.status.
- sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
- s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
-s,@SHELL@,$SHELL,;t t
-s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
-s,@exec_prefix@,$exec_prefix,;t t
-s,@prefix@,$prefix,;t t
-s,@program_transform_name@,$program_transform_name,;t t
-s,@bindir@,$bindir,;t t
-s,@sbindir@,$sbindir,;t t
-s,@libexecdir@,$libexecdir,;t t
-s,@datadir@,$datadir,;t t
-s,@sysconfdir@,$sysconfdir,;t t
-s,@sharedstatedir@,$sharedstatedir,;t t
-s,@localstatedir@,$localstatedir,;t t
-s,@libdir@,$libdir,;t t
-s,@includedir@,$includedir,;t t
-s,@oldincludedir@,$oldincludedir,;t t
-s,@infodir@,$infodir,;t t
-s,@mandir@,$mandir,;t t
-s,@build_alias@,$build_alias,;t t
-s,@host_alias@,$host_alias,;t t
-s,@target_alias@,$target_alias,;t t
-s,@DEFS@,$DEFS,;t t
-s,@ECHO_C@,$ECHO_C,;t t
-s,@ECHO_N@,$ECHO_N,;t t
-s,@ECHO_T@,$ECHO_T,;t t
-s,@LIBS@,$LIBS,;t t
-s,@CC@,$CC,;t t
-s,@CFLAGS@,$CFLAGS,;t t
-s,@LDFLAGS@,$LDFLAGS,;t t
-s,@CPPFLAGS@,$CPPFLAGS,;t t
-s,@ac_ct_CC@,$ac_ct_CC,;t t
-s,@EXEEXT@,$EXEEXT,;t t
-s,@OBJEXT@,$OBJEXT,;t t
-s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
-s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
-s,@INSTALL_DATA@,$INSTALL_DATA,;t t
-s,@STRIP@,$STRIP,;t t
-s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
-s,@CPP@,$CPP,;t t
-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,@VERSION@,$VERSION,;t t
-s,@VERSION_DATE@,$VERSION_DATE,;t t
-s,@IPVS_SUPPORT@,$IPVS_SUPPORT,;t t
-s,@VRRP_SUPPORT@,$VRRP_SUPPORT,;t t
-s,@LIBOBJS@,$LIBOBJS,;t t
-s,@LTLIBOBJS@,$LTLIBOBJS,;t t
-CEOF
+if test -n "$CONFIG_FILES"; then
_ACEOF
- cat >>$CONFIG_STATUS <<\_ACEOF
- # Split the substitutions into bite-sized pieces for seds with
- # small command number limits, like on Digital OSF/1 and HP-UX.
- ac_max_sed_lines=48
- ac_sed_frag=1 # Number of current file.
- ac_beg=1 # First line for current file.
- ac_end=$ac_max_sed_lines # Line after last line for current file.
- ac_more_lines=:
- ac_sed_cmds=
- while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
- else
- sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
- fi
- if test ! -s $tmp/subs.frag; then
- ac_more_lines=false
- else
- # The purpose of the label and of the branching condition is to
- # speed up the sed processing (if there are no `@' at all, there
- # is no need to browse any of the substitutions).
- # These are the two extra sed commands mentioned above.
- (echo ':t
- /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
- fi
- ac_sed_frag=`expr $ac_sed_frag + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_lines`
- fi
- done
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ cat >conf$$subs.sed <<_ACEOF
+SHELL!$SHELL$ac_delim
+PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
+PACKAGE_NAME!$PACKAGE_NAME$ac_delim
+PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
+PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
+PACKAGE_STRING!$PACKAGE_STRING$ac_delim
+PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
+exec_prefix!$exec_prefix$ac_delim
+prefix!$prefix$ac_delim
+program_transform_name!$program_transform_name$ac_delim
+bindir!$bindir$ac_delim
+sbindir!$sbindir$ac_delim
+libexecdir!$libexecdir$ac_delim
+datarootdir!$datarootdir$ac_delim
+datadir!$datadir$ac_delim
+sysconfdir!$sysconfdir$ac_delim
+sharedstatedir!$sharedstatedir$ac_delim
+localstatedir!$localstatedir$ac_delim
+includedir!$includedir$ac_delim
+oldincludedir!$oldincludedir$ac_delim
+docdir!$docdir$ac_delim
+infodir!$infodir$ac_delim
+htmldir!$htmldir$ac_delim
+dvidir!$dvidir$ac_delim
+pdfdir!$pdfdir$ac_delim
+psdir!$psdir$ac_delim
+libdir!$libdir$ac_delim
+localedir!$localedir$ac_delim
+mandir!$mandir$ac_delim
+DEFS!$DEFS$ac_delim
+ECHO_C!$ECHO_C$ac_delim
+ECHO_N!$ECHO_N$ac_delim
+ECHO_T!$ECHO_T$ac_delim
+LIBS!$LIBS$ac_delim
+build_alias!$build_alias$ac_delim
+host_alias!$host_alias$ac_delim
+target_alias!$target_alias$ac_delim
+CC!$CC$ac_delim
+CFLAGS!$CFLAGS$ac_delim
+LDFLAGS!$LDFLAGS$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+ac_ct_CC!$ac_ct_CC$ac_delim
+EXEEXT!$EXEEXT$ac_delim
+OBJEXT!$OBJEXT$ac_delim
+INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
+INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
+INSTALL_DATA!$INSTALL_DATA$ac_delim
+STRIP!$STRIP$ac_delim
+CPP!$CPP$ac_delim
+GREP!$GREP$ac_delim
+EGREP!$EGREP$ac_delim
+LINKWATCH_SUPPORT!$LINKWATCH_SUPPORT$ac_delim
+KERN!$KERN$ac_delim
+IPVS_SYNCD!$IPVS_SYNCD$ac_delim
+DFLAGS!$DFLAGS$ac_delim
+VERSION!$VERSION$ac_delim
+VERSION_DATE!$VERSION_DATE$ac_delim
+IPVS_SUPPORT!$IPVS_SUPPORT$ac_delim
+VRRP_SUPPORT!$VRRP_SUPPORT$ac_delim
+LIBOBJS!$LIBOBJS$ac_delim
+LTLIBOBJS!$LTLIBOBJS$ac_delim
+_ACEOF
+
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 61; then
+ break
+ elif $ac_last_try; then
+ { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
-fi # test -n "$CONFIG_FILES"
+done
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+ ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+ ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+:end
+s/|#_!!_#|//g
+CEOF$ac_eof
+_ACEOF
+
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[ ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case $ac_file in
- - | *:- | *:-:* ) # input from stdin
- cat >$tmp/stdin
- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- * ) ac_file_in=$ac_file.in ;;
+fi # test -n "$CONFIG_FILES"
+
+
+for ac_tag in :F $CONFIG_FILES
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+ { (exit 1); exit 1; }; };;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+ ac_file_inputs="$ac_file_inputs $ac_f"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input="Generated from "`IFS=:
+ echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ fi
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$tmp/stdin";;
+ esac
+ ;;
esac
- # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
- ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+ ac_dir=`$as_dirname -- "$ac_file" ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p "$ac_dir"
- else
- as_dir="$ac_dir"
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ { as_dir="$ac_dir"
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
{ (exit 1); exit 1; }; }; }
-
ac_builddir=.
-if test "$ac_dir" != .; then
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
case $srcdir in
- .) # No --srcdir option. We are building in place.
+ .) # We are building in place.
ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
case $INSTALL in
[\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
esac
+_ACEOF
- if test x"$ac_file" != x-; then
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
- rm -f "$ac_file"
- fi
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- if test x"$ac_file" = x-; then
- configure_input=
- else
- configure_input="$ac_file. "
- fi
- configure_input=$configure_input"Generated from `echo $ac_file_in |
- sed 's,.*/,,'` by configure."
-
- # First look for the input files in the build tree, otherwise in the
- # src tree.
- ac_file_inputs=`IFS=:
- for f in $ac_file_in; do
- case $f in
- -) echo $tmp/stdin ;;
- [\\/$]*)
- # Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- echo "$f";;
- *) # Relative
- if test -f "$f"; then
- # Build tree
- echo "$f"
- elif test -f "$srcdir/$f"; then
- # Source tree
- echo "$srcdir/$f"
- else
- # /dev/null tree
- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- fi;;
- esac
- done` || { (exit 1); exit 1; }
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+case `sed -n '/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+' $ac_file_inputs` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
cat >>$CONFIG_STATUS <<_ACEOF
sed "$ac_vpsub
$extrasub
cat >>$CONFIG_STATUS <<\_ACEOF
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s,@configure_input@,$configure_input,;t t
-s,@srcdir@,$ac_srcdir,;t t
-s,@abs_srcdir@,$ac_abs_srcdir,;t t
-s,@top_srcdir@,$ac_top_srcdir,;t t
-s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
-s,@builddir@,$ac_builddir,;t t
-s,@abs_builddir@,$ac_abs_builddir,;t t
-s,@top_builddir@,$ac_top_builddir,;t t
-s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
-s,@INSTALL@,$ac_INSTALL,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
- rm -f $tmp/stdin
- if test x"$ac_file" != x-; then
- mv $tmp/out $ac_file
- else
- cat $tmp/out
- rm -f $tmp/out
- fi
+s&@configure_input@&$configure_input&;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+$ac_datarootdir_hack
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+ { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&5
+echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&2;}
+
+ rm -f "$tmp/stdin"
+ case $ac_file in
+ -) cat "$tmp/out"; rm -f "$tmp/out";;
+ *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
+ esac
+ ;;
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+
+ esac
+
+done # for ac_tag
+
{ (exit 0); exit 0; }
_ACEOF
# Configuration template file for keepalived.
# autoconf will generate & check deps for proper compilation
#
-# Copyright (C) 2001-2004 Alexandre Cassen, <acassen@linux-vs.org>
+# Copyright (C) 2001-2009 Alexandre Cassen, <acassen@linux-vs.org>
dnl ----[ Process this file with autoconf to produce a configure script ]----
AC_INIT(keepalived/core/main.c)
[IPVS_SUPPORT="_WITH_LVS_"],
[
IPVS_SUPPORT="_WITHOUT_LVS_"
- IPVS_MAJOR="0"
- IPVS_MINOR="0"
- IPVS_PATCH="0"
AC_MSG_WARN([keepalived will be built without LVS support.])
])
fi
-if test "$IPVS_SUPPORT" = "_WITH_LVS_"; then
- AC_MSG_CHECKING([for IPVS version])
- AC_TRY_RUN([
- #include <stdlib.h>
- #include <stdio.h>
- #include <net/ip_vs.h>
- int main (void) {
- FILE *fp = fopen ("ipvsinfo", "w");
- if (!fp) return 1;
- fprintf (fp, "%d\n%d\n%d\n", NVERSION(IP_VS_VERSION_CODE));
- fclose (fp);
- return 0;
- }
- ], [
- IPVS_MAJOR=`head -n 1 ipvsinfo | tail -n 1`
- IPVS_MINOR=`head -n 2 ipvsinfo | tail -n 1`
- IPVS_PATCH=`head -n 3 ipvsinfo | tail -n 1`
- ], [
- IPVS_MAJOR="0"
- IPVS_MINOR="0"
- IPVS_PATCH="0"
- ], [
- IPVS_MAJOR="0"
- IPVS_MINOR="0"
- IPVS_PATCH="0"
- ])
- rm -f ipvsinfo
- AC_MSG_RESULT([$IPVS_MAJOR.$IPVS_MINOR.$IPVS_PATCH])
- if test "$IPVS_MAJOR" = "0" -a "$IPVS_MINOR" = "0" -a "$IPVS_PATCH" = "0"; then
- AC_MSG_WARN([Cannot determine IPVS version.])
- fi
-fi
-
if test "$IPVS_SUPPORT" = "_WITHOUT_LVS_" -a "$enable_vrrp" = "no"; then
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
+ elif test "_KRNL_2_4_"; then
IPVS_SYNCD="_HAVE_IPVS_SYNCD_"
else
IPVS_SYNCD="_WITHOUT_IPVS_SYNCD_"
dnl ----[ Checks for kernel netlink support ]----
VRRP_SUPPORT="_WITHOUT_VRRP_"
if test "$enable_vrrp" != "no"; then
- AC_MSG_CHECKING([for kernel netlink support])
- AC_TRY_RUN([
- #include <asm/types.h>
- #include <sys/socket.h>
- #include <linux/netlink.h>
- int main (void) {
- int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
- if (fd < 0)
- exit(1);
- close(fd);
- exit(0);
- }], [
- AC_MSG_RESULT(yes)
- VRRP_SUPPORT="_WITH_VRRP_"
- ], [
- AC_MSG_RESULT(no)
- ], [
- AC_MSG_RESULT(no)
- ])
+ VRRP_SUPPORT="_WITH_VRRP_"
fi
if test "${enable_debug}" = "yes"; then
static_routes { # block identification
src <IP ADDRESS> [to] <IP ADDRESS>/<MASK> via|gw <IP ADDRESS> dev <STRING> scope <SCOPE> table <TABLE-ID> # to is optional
src <IP ADDRESS> [to] <IP ADDRESS>/<MASK> via|gw <IP ADDRESS> dev <STRING> scope <SCOPE> table <TABLE-ID> # to is optional
+ src <IP ADDRESS> [to] <IP ADDRESS>/<MASK> via|gw <IP ADDRESS> or <IP ADDRESS> dev <STRING> scope <SCOPE> table <TABLE-ID> # will use multipath route
+ blackhole <IP ADDRESS>[/<MASK>]
...
}
virtual_routes { # VRRP virtual routes
src <IP ADDRESS> [to] <IP ADDRESS>/<MASK> via|gw <IP ADDRESS> dev <STRING> scope <SCOPE> table <TABLE-ID> metric <METRIC> # to is optional
src <IP ADDRESS> [to] <IP ADDRESS>/<MASK> via|gw <IP ADDRESS> dev <STRING> scope <SCOPE> table <TABLE-ID> metric <METRIC> # to is optional
+ src <IP ADDRESS> [to] <IP ADDRESS>/<MASK> via|gw <IP ADDRESS> or <IP ADDRESS> dev <STRING> scope <SCOPE> table <TABLE-ID> # will use multipath route
...
+ blackhole <IP ADDRESS>[/<MASK>]
}
nopreempt # Override VRRP RFC preemption default
preempt_delay # Seconds after startup until
virtualhost <STRING> # VirtualHost string to use for
# HTTP_GET or SSL_GET
+ # Assume silently all RSs down and healthchecks
+ # failed on start. This helps preventing false
+ # positive actions on startup. Alpha mode is
+ # disabled by default.
+ alpha
+
+ # On daemon shutdown, consider quorum and RS
+ # down notifiers for execution, where appropriate.
+ # Omega mode is disabled by default.
+ omega
+
+ # Minimum total weight of all live servers in
+ # the pool necessary to operate VS with no
+ # quality regression. Defaults to 1.
+ quorum <INT>
+
+ # Tolerate this much weight units compared to the
+ # nominal quorum, when considering quorum gain
+ # or loss. A flap dampener. Defaults to 0.
+ hysteresis <INT>
+
+ # Script to launch when quorum is gained.
+ quorum_up <STRING>|<QUOTED-STRING>
+
+ # Script to launch when quorum is lost.
+ quorum_down <STRING>|<QUOTED-STRING>
+
sorry_server <IP ADDRESS> <PORT> # RS to add to LVS topology when all
# realserver are down
# eg virtualhost www.firewall.loc\r
virtualhost <STRING> \r
\r
+ # Assume silently all RSs down and healthchecks\r
+ # failed on start. This helps preventing false\r
+ # positive actions on startup. Alpha mode is\r
+ # disabled by default.\r
+ alpha\r
+\r
+ # On daemon shutdown, consider quorum and RS\r
+ # down notifiers for execution, where appropriate.\r
+ # Omega mode is disabled by default.\r
+ omega\r
+\r
+ # Minimum total weight of all live servers in\r
+ # the pool necessary to operate VS with no\r
+ # quality regression. Defaults to 1.\r
+ quorum <INT>\r
+\r
+ # Tolerate this much weight units compared to the\r
+ # nominal quorum, when considering quorum gain\r
+ # or loss. A flap dampener. Defaults to 0.\r
+ hysteresis <INT>\r
+\r
+ # Script to launch when quorum is gained.\r
+ quorum_up <STRING>|<QUOTED-STRING>\r
+\r
+ # Script to launch when quorum is lost.\r
+ quorum_down <STRING>|<QUOTED-STRING>\r
+\r
+\r
# setup realserver(s)\r
\r
# RS to add when all realservers are down\r
--- /dev/null
+! Sample configuration for quorum/hysteresis setup.
+! The server pool below consists of 10 servers. After
+! start, the quorum will not be reached until 9 (7+2)
+! live servers are present in the pool (all servers are
+! equally weighted, and quorum is the sum of weights).
+! Once this happens, a custom script will be executed,
+! which supposedly invokes some actions to start
+! announcing IP address of the virtual server to the
+! world. After that the quorum will not break until
+! the pool has 5 (7-2) or more live servers. Pool size
+! change from 7 to 6 and back will not trigger a quorum
+! flap this way. Once there are less than 5 servers,
+! the quorum is considered lost and corresponding
+! script is executed, supposedly propagating the
+! failure, so necessary actions can be taken.
+!
+! Due to the alpha mode, all real servers are considered
+! down on server start, so the quorum is initially lost.
+! Due to the omega mode, quorum_down notifier is executed
+! on keepalived shutdown as well (see keepalived.conf
+! manpage for details).
+
+virtual_server 10.0.1.1 80 {
+ delay_loop 6
+ lb_algo wrr
+ lb_kind NAT
+ persistence_timeout 900
+ protocol TCP
+ alpha
+ omega
+ quorum 7
+ hysteresis 2
+ quorum_up /usr/local/sbin/quorum-up.sh
+ quorum_down /usr/local/sbin/quorum-down.sh
+
+ real_server 10.0.0.1 8080 {
+ weight 1
+ TCP_CHECK {
+ connect_port 80
+ connect_timeout 3
+ }
+ }
+ real_server 10.0.0.2 8080 {
+ weight 1
+ TCP_CHECK {
+ connect_port 80
+ connect_timeout 3
+ }
+ }
+ real_server 10.0.0.3 8080 {
+ weight 1
+ TCP_CHECK {
+ connect_port 80
+ connect_timeout 3
+ }
+ }
+ real_server 10.0.0.4 8080 {
+ weight 1
+ TCP_CHECK {
+ connect_port 80
+ connect_timeout 3
+ }
+ }
+ real_server 10.0.0.5 8080 {
+ weight 1
+ TCP_CHECK {
+ connect_port 80
+ connect_timeout 3
+ }
+ }
+ real_server 10.0.0.6 8080 {
+ weight 1
+ TCP_CHECK {
+ connect_port 80
+ connect_timeout 3
+ }
+ }
+ real_server 10.0.0.7 8080 {
+ weight 1
+ TCP_CHECK {
+ connect_port 80
+ connect_timeout 3
+ }
+ }
+ real_server 10.0.0.8 8080 {
+ weight 1
+ TCP_CHECK {
+ connect_port 80
+ connect_timeout 3
+ }
+ }
+ real_server 10.0.0.9 8080 {
+ weight 1
+ TCP_CHECK {
+ connect_port 80
+ connect_timeout 3
+ }
+ }
+ real_server 10.0.0.10 8080 {
+ weight 1
+ TCP_CHECK {
+ connect_port 80
+ connect_timeout 3
+ }
+ }
+}
192.168.110.0/24 via 192.168.200.254 dev eth1
192.168.111.0/24 dev eth2
192.168.112.0/24 via 192.168.100.254
+ 192.168.113.0/24 via 192.168.100.252 or 192.168.100.253
+ blackhole 192.168.113.1/32
}
}
# Makefile.in
#
-# Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
+# Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
EXEC = genhash
BIN = ../bin
OBJS = main.o sock.o layer4.o http.o ssl.o
LIB_OBJS = ../lib/timer.o ../lib/scheduler.o ../lib/memory.o ../lib/list.o \
- ../lib/utils.o ../lib/html.o ../lib/signals.o
+ ../lib/utils.o ../lib/html.o ../lib/signals.o ../lib/logger.o
all: $(BIN)/$(EXEC)
$(STRIP) $(BIN)/$(EXEC)
*
* Part: HTTP asynchronous engine.
*
- * Version: $Id: http.c,v 1.0.0 2002/11/20 21:34:18 acassen Exp $
+ * Version: $Id: http.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <errno.h>
if (req->verbose) {
printf("\n");
printf(HTML_MD5);
- dump_buffer(digest, 16);
+ dump_buffer((char *) digest, 16);
printf(HTML_MD5_FINAL);
}
*
* Part: http.c include file.
*
- * Version: $Id: http.h,v 1.0.0 2002/11/20 21:34:18 acassen Exp $
+ * Version: $Id: http.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _HTTP_H
*
* Part: Layer4 asynchronous primitives.
*
- * Version: $Id: layer4.c,v 1.0.0 2002/11/20 21:34:18 acassen Exp $
+ * Version: $Id: layer4.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "layer4.h"
int (*func) (struct _thread *))
{
int status;
- int slen;
+ socklen_t slen;
int ret = 0;
TIMEVAL timer_min;
*
* Part: layer4.c include file.
*
- * Version: $Id: layer4.h,v 1.0.0 2002/11/20 21:34:18 acassen Exp $
+ * Version: $Id: layer4.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _LAYER4_H
*
* Part: Main entry point.
*
- * Version: $Id: main.c,v 1.0.0 2002/11/20 21:34:18 acassen Exp $
+ * Version: $Id: main.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <signal.h>
/* Terminate handler */
void
-sigend(int sig)
+sigend(void *v, int sig)
{
/* register the terminate thread */
thread_add_terminate_event(master);
signal_init(void)
{
signal_handler_init();
- signal_set(SIGHUP, sigend);
- signal_set(SIGINT, sigend);
- signal_set(SIGTERM, sigend);
+ signal_set(SIGHUP, sigend, NULL);
+ signal_set(SIGINT, sigend, NULL);
+ signal_set(SIGTERM, sigend, NULL);
signal_ignore(SIGPIPE);
}
* Processing the master thread queues,
* return and execute one ready thread.
* Run until error, used for debuging only.
+ * Note that not calling launch_scheduler() does
+ * not activate SIGCHLD handling, however, this
+ * is no issue here.
*/
while (thread_fetch(master, &thread_obj))
thread_call(&thread_obj);
*
* Part: main.c include file.
*
- * Version: $Id: main.h,v 1.0.0 2002/11/20 21:34:18 acassen Exp $
+ * Version: $Id: main.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _MAIN_H
*
* Part: Socket pool utility functions.
*
- * Version: $Id: sock.c,v 1.0.0 2002/11/20 21:34:18 acassen Exp $
+ * Version: $Id: sock.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <string.h>
*
* Part: sock.c include file.
*
- * Version: $Id: sock.h,v 1.0.0 2002/11/20 21:34:18 acassen Exp $
+ * Version: $Id: sock.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _SOCK_H
*
* Part: SSL engine. 'Semi' asyncrhonous stream handling.
*
- * Version: $Id: ssl.c,v 1.0.0 2002/11/20 21:34:18 acassen Exp $
+ * Version: $Id: ssl.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <openssl/err.h>
*
* Part: ssl.c include file.
*
- * Version: $Id: ssl.h,v 1.0.0 2002/11/20 21:34:18 acassen Exp $
+ * Version: $Id: ssl.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _SSL_H
#
# Keepalived OpenSource project.
#
-# Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>
+# Copyright (C) 2001-2009 Alexandre Cassen, <acassen@linux-vs.org>
EXEC = keepalived
BIN = ../bin
#
# Keepalived OpenSource project.
#
-# Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
+# Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
KERNEL = @KERN@
CC = @CC@
*
* Part: Checkers registration.
*
- * Version: $Id: check_api.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: check_api.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <dirent.h>
#include "parser.h"
#include "memory.h"
#include "utils.h"
+#include "logger.h"
#include "global_data.h"
#include "check_misc.h"
#include "check_smtp.h"
dump_checker(void *data_obj)
{
checker *checker_obj = data_obj;
- syslog(LOG_INFO, " %s:%d", inet_ntop2(CHECKER_RIP(checker_obj))
+ log_message(LOG_INFO, " %s:%d", inet_ntop2(CHECKER_RIP(checker_obj))
, ntohs(CHECKER_RPORT(checker_obj)));
(*checker_obj->dump_func) (checker_obj);
}
/* queue the checker */
list_add(checkers_queue, check_obj);
+
+ /* In Alpha mode also mark the check as failed. */
+ if (vs->alpha) {
+ list fc = rs->failed_checkers;
+ checker_id_t *id = (checker_id_t *) MALLOC(sizeof(checker_id_t));
+ *id = check_obj->id;
+ list_add (fc, id);
+ }
}
/* dump the checkers_queue */
dump_checkers_queue(void)
{
if (!LIST_ISEMPTY(checkers_queue)) {
- syslog(LOG_INFO, "------< Health checkers >------");
+ log_message(LOG_INFO, "------< Health checkers >------");
dump_list(checkers_queue);
}
}
for (e = LIST_HEAD(checkers_queue); e; ELEMENT_NEXT(e)) {
checker_obj = ELEMENT_DATA(e);
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"Activating healtchecker for service [%s:%d]",
inet_ntop2(CHECKER_RIP(checker_obj)),
ntohs(CHECKER_RPORT(checker_obj)));
/* Display netlink operation */
if (debug & 32)
- syslog(LOG_INFO, "Netlink reflector reports IP %s %s",
+ log_message(LOG_INFO, "Netlink reflector reports IP %s %s",
inet_ntop2(address), (enable) ? "added" : "removed");
/* Processing Healthcheckers queue */
checker_obj = ELEMENT_DATA(e);
if (CHECKER_VIP(checker_obj) == address && CHECKER_HA_SUSPEND(checker_obj)) {
if (!CHECKER_ENABLED(checker_obj) && enable)
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"Activating healtchecker for service [%s:%d]",
inet_ntop2(CHECKER_RIP(checker_obj)),
ntohs(CHECKER_RPORT(checker_obj)));
if (CHECKER_ENABLED(checker_obj) && !enable)
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"Suspending healtchecker for service [%s:%d]",
inet_ntop2(CHECKER_RIP(checker_obj)),
ntohs(CHECKER_RPORT(checker_obj)));
*
* Part: Healthcheckrs child process handling.
*
- * Version: $Id: check_daemon.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: check_daemon.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "check_daemon.h"
#include "pidfile.h"
#include "daemon.h"
#include "signals.h"
+#include "logger.h"
#include "list.h"
#include "main.h"
#include "memory.h"
#include "vrrp_netlink.h"
#include "vrrp_if.h"
+extern char *checkers_pidfile;
+
/* Daemon stop sequence */
static void
stop_check(void)
{
/* Destroy master thread */
+ signal_handler_destroy();
thread_destroy_master(master);
free_checkers_queue();
free_ssl();
ipvs_stop();
/* Stop daemon */
- pidfile_rm(CHECKERS_PID_FILE);
+ pidfile_rm(checkers_pidfile);
/* Clean data */
free_global_data(data);
}
/* Post initializations */
- syslog(LOG_INFO, "Configuration is using : %lu Bytes", mem_allocated);
+ log_message(LOG_INFO, "Configuration is using : %lu Bytes", mem_allocated);
/* SSL load static data & initialize common ctx context */
if (!init_ssl_ctx()) {
/* Reload handler */
void
-sighup_check(int sig)
+sighup_check(void *v, int sig)
{
- syslog(LOG_INFO, "Reloading Healthchecker child processi(%d) on signal",
+ log_message(LOG_INFO, "Reloading Healthchecker child processi(%d) on signal",
checkers_child);
thread_add_event(master, reload_check_thread, NULL, 0);
}
/* Terminate handler */
void
-sigend_check(int sig)
+sigend_check(void *v, int sig)
{
- syslog(LOG_INFO, "Terminating Healthchecker child process on signal");
+ log_message(LOG_INFO, "Terminating Healthchecker child process on signal");
if (master)
thread_add_terminate_event(master);
}
check_signal_init(void)
{
signal_handler_init();
- signal_set(SIGHUP, sighup_check);
- signal_set(SIGINT, sigend_check);
- signal_set(SIGTERM, sigend_check);
+ signal_set(SIGHUP, sighup_check, NULL);
+ signal_set(SIGINT, sigend_check, NULL);
+ signal_set(SIGTERM, sigend_check, NULL);
signal_ignore(SIGPIPE);
- signal_noignore_sigchld();
}
/* CHECK Child respawning thread */
}
/* We catch a SIGCHLD, handle it */
- syslog(LOG_INFO, "Healthcheck child process(%d) died: Respawning", pid);
+ log_message(LOG_INFO, "Healthcheck child process(%d) died: Respawning", pid);
start_check_child();
return 0;
}
/* Dont start if pid is already running */
if (checkers_running()) {
- syslog(LOG_INFO, "Healthcheck child process already running");
+ log_message(LOG_INFO, "Healthcheck child process already running");
return -1;
}
pid = fork();
if (pid < 0) {
- syslog(LOG_INFO, "Healthcheck child process: fork error(%s)"
+ log_message(LOG_INFO, "Healthcheck child process: fork error(%s)"
, strerror(errno));
return -1;
} else if (pid) {
checkers_child = pid;
- syslog(LOG_INFO, "Starting Healthcheck child process, pid=%d"
+ log_message(LOG_INFO, "Starting Healthcheck child process, pid=%d"
, pid);
/* Start respawning thread */
(log_facility==LOG_DAEMON) ? LOG_LOCAL2 : log_facility);
/* Child process part, write pidfile */
- if (!pidfile_write(CHECKERS_PID_FILE, getpid())) {
- syslog(LOG_INFO, "Healthcheck child process: cannot write pidfile");
+ if (!pidfile_write(checkers_pidfile, getpid())) {
+ log_message(LOG_INFO, "Healthcheck child process: cannot write pidfile");
exit(0);
}
/* Create the new master thread */
+ signal_handler_destroy();
thread_destroy_master(master);
master = thread_make_master();
*
* Part: Healthcheckers dynamic data structure definition.
*
- * Version: $Id: check_data.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: check_data.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "check_data.h"
#include "check_api.h"
+#include "logger.h"
#include "memory.h"
#include "utils.h"
+#include "ipwrapper.h"
/* global vars */
check_conf_data *check_data = NULL;
SSL_DATA *ssl = check_data->ssl;
if (ssl->password)
- syslog(LOG_INFO, " Password : %s", ssl->password);
+ log_message(LOG_INFO, " Password : %s", ssl->password);
if (ssl->cafile)
- syslog(LOG_INFO, " CA-file : %s", ssl->cafile);
+ log_message(LOG_INFO, " CA-file : %s", ssl->cafile);
if (ssl->certfile)
- syslog(LOG_INFO, " Certificate file : %s", ssl->certfile);
+ log_message(LOG_INFO, " Certificate file : %s", ssl->certfile);
if (ssl->keyfile)
- syslog(LOG_INFO, " Key file : %s", ssl->keyfile);
+ log_message(LOG_INFO, " Key file : %s", ssl->keyfile);
if (!ssl->password && !ssl->cafile && !ssl->certfile && !ssl->keyfile)
- syslog(LOG_INFO, " Using autogen SSL context");
+ log_message(LOG_INFO, " Using autogen SSL context");
}
/* Virtual server group facility functions */
{
virtual_server_group *vsg = data;
- syslog(LOG_INFO, " Virtual Server Group = %s", vsg->gname);
+ log_message(LOG_INFO, " Virtual Server Group = %s", vsg->gname);
dump_list(vsg->addr_ip);
dump_list(vsg->range);
dump_list(vsg->vfwmark);
virtual_server_group_entry *vsg_entry = data;
if (vsg_entry->vfwmark)
- syslog(LOG_INFO, " FWMARK = %d", vsg_entry->vfwmark);
+ log_message(LOG_INFO, " FWMARK = %d", vsg_entry->vfwmark);
else if (vsg_entry->range)
- syslog(LOG_INFO, " VIP Range = %s-%d, VPORT = %d"
+ log_message(LOG_INFO, " VIP Range = %s-%d, VPORT = %d"
, inet_ntop2(SVR_IP(vsg_entry))
, vsg_entry->range
, ntohs(SVR_PORT(vsg_entry)));
else
- syslog(LOG_INFO, " VIP = %s, VPORT = %d"
+ log_message(LOG_INFO, " VIP = %s, VPORT = %d"
, inet_ntop2(SVR_IP(vsg_entry))
, ntohs(SVR_PORT(vsg_entry)));
}
FREE_PTR(vs->virtualhost);
FREE_PTR(vs->s_svr);
free_list(vs->rs);
+ FREE_PTR(vs->quorum_up);
+ FREE_PTR(vs->quorum_down);
FREE(vs);
}
static void
virtual_server *vs = data;
if (vs->vsgname)
- syslog(LOG_INFO, " VS GROUP = %s", vs->vsgname);
+ log_message(LOG_INFO, " VS GROUP = %s", vs->vsgname);
else if (vs->vfwmark)
- syslog(LOG_INFO, " VS FWMARK = %d", vs->vfwmark);
+ log_message(LOG_INFO, " VS FWMARK = %d", vs->vfwmark);
else
- syslog(LOG_INFO, " VIP = %s, VPORT = %d", inet_ntop2(SVR_IP(vs))
+ log_message(LOG_INFO, " VIP = %s, VPORT = %d", inet_ntop2(SVR_IP(vs))
, ntohs(SVR_PORT(vs)));
if (vs->virtualhost)
- syslog(LOG_INFO, " VirtualHost = %s", vs->virtualhost);
- syslog(LOG_INFO, " delay_loop = %lu, lb_algo = %s",
+ log_message(LOG_INFO, " VirtualHost = %s", vs->virtualhost);
+ log_message(LOG_INFO, " delay_loop = %lu, lb_algo = %s",
(vs->delay_loop >= TIMER_MAX_SEC) ? vs->delay_loop/TIMER_HZ :
vs->delay_loop,
vs->sched);
if (atoi(vs->timeout_persistence) > 0)
- syslog(LOG_INFO, " persistence timeout = %s",
+ log_message(LOG_INFO, " persistence timeout = %s",
vs->timeout_persistence);
if (vs->granularity_persistence)
- syslog(LOG_INFO, " persistence granularity = %s",
+ log_message(LOG_INFO, " persistence granularity = %s",
inet_ntop2(vs->granularity_persistence));
- syslog(LOG_INFO, " protocol = %s",
+ log_message(LOG_INFO, " protocol = %s",
(vs->service_type == IPPROTO_TCP) ? "TCP" : "UDP");
+ log_message(LOG_INFO, " alpha is %s, omega is %s",
+ vs->alpha ? "ON" : "OFF", vs->omega ? "ON" : "OFF");
+ log_message(LOG_INFO, " quorum = %lu, hysteresis = %lu", vs->quorum, vs->hysteresis);
+ if (vs->quorum_up)
+ log_message(LOG_INFO, " -> Notify script UP = %s",
+ vs->quorum_up);
+ if (vs->quorum_down)
+ log_message(LOG_INFO, " -> Notify script DOWN = %s",
+ vs->quorum_down);
if (vs->ha_suspend)
- syslog(LOG_INFO, " Using HA suspend");
+ log_message(LOG_INFO, " Using HA suspend");
switch (vs->loadbalancing_kind) {
#ifdef _WITH_LVS_
#ifdef _KRNL_2_2_
case 0:
- syslog(LOG_INFO, " lb_kind = NAT");
+ log_message(LOG_INFO, " lb_kind = NAT");
if (vs->nat_mask)
- syslog(LOG_INFO, " nat mask = %s", inet_ntop2(vs->nat_mask));
+ log_message(LOG_INFO, " nat mask = %s", inet_ntop2(vs->nat_mask));
break;
case IP_MASQ_F_VS_DROUTE:
- syslog(LOG_INFO, " lb_kind = DR");
+ log_message(LOG_INFO, " lb_kind = DR");
break;
case IP_MASQ_F_VS_TUNNEL:
- syslog(LOG_INFO, " lb_kind = TUN");
+ log_message(LOG_INFO, " lb_kind = TUN");
break;
#else
case IP_VS_CONN_F_MASQ:
- syslog(LOG_INFO, " lb_kind = NAT");
+ log_message(LOG_INFO, " lb_kind = NAT");
break;
case IP_VS_CONN_F_DROUTE:
- syslog(LOG_INFO, " lb_kind = DR");
+ log_message(LOG_INFO, " lb_kind = DR");
break;
case IP_VS_CONN_F_TUNNEL:
- syslog(LOG_INFO, " lb_kind = TUN");
+ log_message(LOG_INFO, " lb_kind = TUN");
break;
#endif
#endif
}
if (vs->s_svr) {
- syslog(LOG_INFO, " sorry server = %s:%d",
+ log_message(LOG_INFO, " sorry server = %s:%d",
inet_ntop2(SVR_IP(vs->s_svr))
, ntohs(SVR_PORT(vs->s_svr)));
}
new->delay_loop = KEEPALIVED_DEFAULT_DELAY;
strncpy(new->timeout_persistence, "0", 1);
new->virtualhost = NULL;
+ new->alpha = 0;
+ new->omega = 0;
+ new->quorum_up = NULL;
+ new->quorum_down = NULL;
+ new->quorum = 1;
+ new->hysteresis = 0;
+ new->quorum_state = DOWN;
list_add(check_data->vs, new);
}
dump_rs(void *data)
{
real_server *rs = data;
- syslog(LOG_INFO, " RIP = %s, RPORT = %d, WEIGHT = %d",
+ log_message(LOG_INFO, " RIP = %s, RPORT = %d, WEIGHT = %d",
inet_ntop2(SVR_IP(rs))
, ntohs(SVR_PORT(rs))
, rs->weight);
if (rs->inhibit)
- syslog(LOG_INFO, " -> Inhibit service on failure");
+ log_message(LOG_INFO, " -> Inhibit service on failure");
if (rs->notify_up)
- syslog(LOG_INFO, " -> Notify script UP = %s",
+ log_message(LOG_INFO, " -> Notify script UP = %s",
rs->notify_up);
if (rs->notify_down)
- syslog(LOG_INFO, " -> Notify script DOWN = %s",
+ log_message(LOG_INFO, " -> Notify script DOWN = %s",
rs->notify_down);
}
dump_check_data(check_conf_data *check_data_obj)
{
if (check_data_obj->ssl) {
- syslog(LOG_INFO, "------< SSL definitions >------");
+ log_message(LOG_INFO, "------< SSL definitions >------");
dump_ssl();
}
if (!LIST_ISEMPTY(check_data_obj->vs)) {
- syslog(LOG_INFO, "------< LVS Topology >------");
- syslog(LOG_INFO, " System is compiled with LVS v%d.%d.%d",
+ log_message(LOG_INFO, "------< LVS Topology >------");
+ log_message(LOG_INFO, " System is compiled with LVS v%d.%d.%d",
NVERSION(IP_VS_VERSION_CODE));
if (!LIST_ISEMPTY(check_data_obj->vs_group))
dump_list(check_data_obj->vs_group);
*
* Part: WEB CHECK. Common HTTP/SSL checker primitives.
*
- * Version: $Id: check_http.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: check_http.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <openssl/err.h>
#include "check_http.h"
#include "check_ssl.h"
#include "check_api.h"
+#include "logger.h"
#include "memory.h"
#include "parser.h"
#include "utils.h"
dump_url(void *data)
{
url *url_obj = data;
- syslog(LOG_INFO, " Checked url = %s", url_obj->path);
+ log_message(LOG_INFO, " Checked url = %s", url_obj->path);
if (url_obj->digest)
- syslog(LOG_INFO, " digest = %s",
+ log_message(LOG_INFO, " digest = %s",
url_obj->digest);
if (url_obj->status_code)
- syslog(LOG_INFO, " HTTP Status Code = %d",
+ log_message(LOG_INFO, " HTTP Status Code = %d",
url_obj->status_code);
}
http_get_checker *http_get_chk = CHECKER_DATA(data);
if (http_get_chk->proto == PROTO_HTTP)
- syslog(LOG_INFO, " Keepalive method = HTTP_GET");
+ log_message(LOG_INFO, " Keepalive method = HTTP_GET");
else
- syslog(LOG_INFO, " Keepalive method = SSL_GET");
+ log_message(LOG_INFO, " Keepalive method = SSL_GET");
if (http_get_chk->connection_port)
- syslog(LOG_INFO, " Connection port = %d",
+ log_message(LOG_INFO, " Connection port = %d",
ntohs(http_get_chk->connection_port));
if (http_get_chk->bindto)
- syslog(LOG_INFO, " Bind to = %s",
+ log_message(LOG_INFO, " Bind to = %s",
inet_ntop2(http_get_chk->bindto));
- syslog(LOG_INFO, " Connection timeout = %lu",
+ log_message(LOG_INFO, " Connection timeout = %lu",
http_get_chk->connection_to/TIMER_HZ);
- syslog(LOG_INFO, " Nb get retry = %d", http_get_chk->nb_get_retry);
- syslog(LOG_INFO, " Delay before retry = %lu",
+ log_message(LOG_INFO, " Nb get retry = %d", http_get_chk->nb_get_retry);
+ log_message(LOG_INFO, " Delay before retry = %lu",
http_get_chk->delay_before_retry/TIMER_HZ);
dump_list(http_get_chk->url);
}
*/
if (http_arg_obj->retry_it > http_get_check->nb_get_retry-1) {
if (svr_checker_up(checker_obj->id, checker_obj->rs)) {
- syslog(LOG_INFO, "Check on service [%s:%d] failed after %d retry."
+ log_message(LOG_INFO, "Check on service [%s:%d] failed after %d retry."
, inet_ntop2(CHECKER_RIP(checker_obj))
, ntohs(addr_port), http_arg_obj->retry_it);
smtp_alert(checker_obj->rs, NULL, NULL,
checker *checker_obj = THREAD_ARG(thread_obj);
uint16_t addr_port = get_service_port(checker_obj);
- syslog(LOG_INFO, "Timeout %s server [%s:%d].",
+ log_message(LOG_INFO, "Timeout %s server [%s:%d].",
debug_msg
, inet_ntop2(CHECKER_RIP(checker_obj))
, ntohs(addr_port));
REQ *req = HTTP_REQ(http_arg_obj);
uint16_t addr_port = get_service_port(checker_obj);
int r, di = 0;
- unsigned char *digest_tmp;
+ char *digest_tmp;
url *fetched_url = fetch_next_url(http_get_check);
/* First check if remote webserver returned data */
if (req->status_code != fetched_url->status_code) {
/* check if server is currently alive */
if (svr_checker_up(checker_obj->id, checker_obj->rs)) {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"HTTP status code error to [%s:%d] url(%s)"
", status_code [%d].",
inet_ntop2(CHECKER_RIP(checker_obj)),
return epilog(thread_obj, 2, 0, 1);
} else {
if (!svr_checker_up(checker_obj->id, checker_obj->rs))
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"HTTP status code success to [%s:%d] url(%d).",
inet_ntop2(CHECKER_RIP(checker_obj))
, ntohs(addr_port)
if (r) {
/* check if server is currently alive */
if (svr_checker_up(checker_obj->id, checker_obj->rs)) {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"MD5 digest error to [%s:%d] url[%s]"
", MD5SUM [%s].",
inet_ntop2(CHECKER_RIP(checker_obj)),
return epilog(thread_obj, 2, 0, 1);
} else {
if (!svr_checker_up(checker_obj->id, checker_obj->rs))
- syslog(LOG_INFO, "MD5 digest success to [%s:%d] url(%d).",
+ log_message(LOG_INFO, "MD5 digest success to [%s:%d] url(%d).",
inet_ntop2(CHECKER_RIP(checker_obj))
, ntohs(addr_port)
, http_arg_obj->url_it + 1);
/* Test if data are ready */
if (r == -1 && (errno == EAGAIN || errno == EINTR)) {
- syslog(LOG_INFO, "Read error with server [%s:%d]: %s",
+ log_message(LOG_INFO, "Read error with server [%s:%d]: %s",
inet_ntop2(CHECKER_RIP(checker_obj))
, ntohs(addr_port)
, strerror(errno));
if (r == -1) {
/* We have encourred a real read error */
if (svr_checker_up(checker_obj->id, checker_obj->rs)) {
- syslog(LOG_INFO, "Read error with server [%s:%d]: %s",
+ log_message(LOG_INFO, "Read error with server [%s:%d]: %s",
inet_ntop2(CHECKER_RIP(checker_obj))
, ntohs(addr_port)
, strerror(errno));
FREE(str_request);
if (!ret) {
- syslog(LOG_INFO, "Cannot send get request to [%s:%d].",
+ log_message(LOG_INFO, "Cannot send get request to [%s:%d].",
inet_ntop2(CHECKER_RIP(checker_obj))
, ntohs(addr_port));
case connect_error:
/* check if server is currently alive */
if (svr_checker_up(checker_obj->id, checker_obj->rs)) {
- syslog(LOG_INFO, "Error connecting server [%s:%d].",
+ log_message(LOG_INFO, "Error connecting server [%s:%d].",
inet_ntop2(CHECKER_RIP(checker_obj))
, ntohs(addr_port));
smtp_alert(checker_obj->rs, NULL, NULL,
#endif
if ((http_get_check->proto == PROTO_SSL) &&
(svr_checker_up(checker_obj->id, checker_obj->rs))) {
- syslog(LOG_INFO, "SSL handshake/communication error"
+ log_message(LOG_INFO, "SSL handshake/communication error"
" connecting to server"
" (openssl errno: %d) [%s:%d]."
, SSL_get_error (http_arg_obj->req->ssl, ret)
* check if server is currently alive.
*/
if (!svr_checker_up(checker_obj->id, checker_obj->rs)) {
- syslog(LOG_INFO, "Remote Web server [%s:%d] succeed on service.",
+ log_message(LOG_INFO, "Remote Web server [%s:%d] succeed on service.",
inet_ntop2(CHECKER_RIP(checker_obj))
, ntohs(addr_port));
smtp_alert(checker_obj->rs, NULL, NULL, "UP",
* Part: MISC CHECK. Perform a system call to run an extra
* system prog or script.
*
- * Version: $Id: check_misc.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: check_misc.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "check_misc.h"
#include "check_api.h"
#include "memory.h"
#include "ipwrapper.h"
+#include "logger.h"
#include "smtp.h"
#include "utils.h"
#include "parser.h"
#include "notify.h"
#include "daemon.h"
+#include "signals.h"
int misc_check_thread(thread *);
int misc_check_child_thread(thread *);
dump_misc_check(void *data)
{
misc_checker *misc_chk = CHECKER_DATA(data);
- syslog(LOG_INFO, " Keepalive method = MISC_CHECK");
- syslog(LOG_INFO, " script = %s", misc_chk->path);
- syslog(LOG_INFO, " timeout = %lu", misc_chk->timeout/TIMER_HZ);
- syslog(LOG_INFO, " dynamic = %s", misc_chk->dynamic ? "YES" : "NO");
+ log_message(LOG_INFO, " Keepalive method = MISC_CHECK");
+ log_message(LOG_INFO, " script = %s", misc_chk->path);
+ log_message(LOG_INFO, " timeout = %lu", misc_chk->timeout/TIMER_HZ);
+ log_message(LOG_INFO, " dynamic = %s", misc_chk->dynamic ? "YES" : "NO");
}
void
/* In case of fork is error. */
if (pid < 0) {
- syslog(LOG_INFO, "Failed fork process");
+ log_message(LOG_INFO, "Failed fork process");
return -1;
}
}
/* Child part */
+ signal_handler_destroy();
closeall(0);
open("/dev/null", O_RDWR);
dup(0);
dup(0);
- /* Also need to reset the signal state */
- {
- sigset_t empty_set;
- sigemptyset(&empty_set);
- sigprocmask(SIG_SETMASK, &empty_set, NULL);
-
- signal(SIGHUP, SIG_DFL);
- signal(SIGINT, SIG_DFL);
- signal(SIGTERM, SIG_DFL);
- signal(SIGKILL, SIG_DFL);
- }
-
status = system_call(misc_chk->path);
if (status < 0 || !WIFEXITED(status))
/* The child hasn't responded. Kill it off. */
if (svr_checker_up(checker_obj->id, checker_obj->rs)) {
- syslog(LOG_INFO, "Misc check to [%s] for [%s] timed out",
+ log_message(LOG_INFO, "Misc check to [%s] for [%s] timed out",
inet_ntop2(CHECKER_RIP(checker_obj)),
misc_chk->path);
smtp_alert(checker_obj->rs, NULL, NULL,
/* everything is good */
if (!svr_checker_up(checker_obj->id, checker_obj->rs)) {
- syslog(LOG_INFO, "Misc check to [%s] for [%s] success.",
+ log_message(LOG_INFO, "Misc check to [%s] for [%s] success.",
inet_ntop2(CHECKER_RIP(checker_obj)),
misc_chk->path);
smtp_alert(checker_obj->rs, NULL, NULL,
}
} else {
if (svr_checker_up(checker_obj->id, checker_obj->rs)) {
- syslog(LOG_INFO, "Misc check to [%s] for [%s] failed.",
+ log_message(LOG_INFO, "Misc check to [%s] for [%s] failed.",
inet_ntop2(CHECKER_RIP(checker_obj)),
misc_chk->path);
smtp_alert(checker_obj->rs, NULL, NULL,
return 0;
}
- syslog(LOG_WARNING, "Process [%d] didn't respond to SIGTERM", pid);
+ log_message(LOG_WARNING, "Process [%d] didn't respond to SIGTERM", pid);
waitpid(pid, NULL, 0);
return 0;
* data structure representation the conf file representing
* the loadbalanced server pool.
*
- * Version: $Id: check_parser.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: check_parser.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "check_parser.h"
#include "check_api.h"
#include "global_data.h"
#include "global_parser.h"
+#include "logger.h"
#include "parser.h"
#include "memory.h"
#include "utils.h"
vs->loadbalancing_kind = IP_VS_CONN_F_TUNNEL;
#endif
else
- syslog(LOG_INFO, "PARSER : unknown [%s] routing method.", str);
+ log_message(LOG_INFO, "PARSER : unknown [%s] routing method.", str);
}
static void
natmask_handler(vector strvec)
real_server *rs = LIST_TAIL_DATA(vs->rs);
rs->notify_down = set_value(strvec);
}
+static void
+alpha_handler(vector strvec)
+{
+ virtual_server *vs = LIST_TAIL_DATA(check_data->vs);
+ vs->alpha = 1;
+}
+static void
+omega_handler(vector strvec)
+{
+ virtual_server *vs = LIST_TAIL_DATA(check_data->vs);
+ vs->omega = 1;
+}
+static void
+quorum_up_handler(vector strvec)
+{
+ virtual_server *vs = LIST_TAIL_DATA(check_data->vs);
+ vs->quorum_up = set_value(strvec);
+}
+static void
+quorum_down_handler(vector strvec)
+{
+ virtual_server *vs = LIST_TAIL_DATA(check_data->vs);
+ vs->quorum_down = set_value(strvec);
+}
+static void
+quorum_handler(vector strvec)
+{
+ virtual_server *vs = LIST_TAIL_DATA(check_data->vs);
+ long tmp = atol (VECTOR_SLOT(strvec, 1));
+ if (tmp < 1) {
+ log_message(LOG_ERR, "Condition not met: Quorum >= 1");
+ log_message(LOG_ERR, "Ignoring requested value %s, using 1 instead",
+ (char *) VECTOR_SLOT(strvec, 1));
+ tmp = 1;
+ }
+ vs->quorum = tmp;
+}
+static void
+hysteresis_handler(vector strvec)
+{
+ virtual_server *vs = LIST_TAIL_DATA(check_data->vs);
+ long tmp = atol (VECTOR_SLOT(strvec, 1));
+ if (tmp < 0 || tmp >= vs->quorum) {
+ log_message(LOG_ERR, "Condition not met: 0 <= Hysteresis <= Quorum - 1");
+ log_message(LOG_ERR, "Ignoring requested value %s, using 0 instead",
+ (char *) VECTOR_SLOT(strvec, 1));
+ log_message(LOG_ERR, "Hint: try defining hysteresis after quorum");
+ tmp = 0;
+ }
+ vs->hysteresis = tmp;
+}
vector
check_init_keywords(void)
install_keyword("ha_suspend", &hasuspend_handler);
install_keyword("virtualhost", &virtualhost_handler);
+ /* Pool regression detection and handling. */
+ install_keyword("alpha", &alpha_handler);
+ install_keyword("omega", &omega_handler);
+ install_keyword("quorum_up", &quorum_up_handler);
+ install_keyword("quorum_down", &quorum_down_handler);
+ install_keyword("quorum", &quorum_handler);
+ install_keyword("hysteresis", &hysteresis_handler);
+
/* Real server mapping */
install_keyword("sorry_server", &ssvr_handler);
install_keyword("real_server", &rs_handler);
*
* Part: SMTP CHECK. Check an SMTP-server.
*
- * Version: $Id: check_smtp.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: check_smtp.c,v 1.1.16 2009/02/14 03:25:07 acassen Exp $
*
* Authors: Jeremy Rumpf, <jrumpf@heavyload.net>
* Alexandre Cassen, <acassen@linux-vs.org>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <ctype.h>
#include "check_smtp.h"
#include "check_api.h"
+#include "logger.h"
#include "memory.h"
#include "ipwrapper.h"
#include "utils.h"
smtp_dump_host(void *data)
{
smtp_host *smtp_hst = data;
- syslog(LOG_INFO, " Checked ip = %s", inet_ntop2(smtp_hst->ip));
- syslog(LOG_INFO, " port = %d", ntohs(smtp_hst->port));
+ log_message(LOG_INFO, " Checked ip = %s", inet_ntop2(smtp_hst->ip));
+ log_message(LOG_INFO, " port = %d", ntohs(smtp_hst->port));
if (smtp_hst->bindto)
- syslog(LOG_INFO, " bindto = %s", inet_ntop2(smtp_hst->bindto));
+ log_message(LOG_INFO, " bindto = %s", inet_ntop2(smtp_hst->bindto));
}
/*
dump_smtp_check(void *data)
{
smtp_checker *smtp_chk = CHECKER_DATA(data);
- syslog(LOG_INFO, " Keepalive method = SMTP_CHECK");
- syslog(LOG_INFO, " helo = %s", smtp_chk->helo_name);
- syslog(LOG_INFO, " timeout = %ld", smtp_chk->timeout/TIMER_HZ);
- syslog(LOG_INFO, " retry = %d", smtp_chk->retry);
- syslog(LOG_INFO, " delay before retry = %ld", smtp_chk->db_retry/TIMER_HZ);
+ log_message(LOG_INFO, " Keepalive method = SMTP_CHECK");
+ log_message(LOG_INFO, " helo = %s", smtp_chk->helo_name);
+ log_message(LOG_INFO, " timeout = %ld", smtp_chk->timeout/TIMER_HZ);
+ log_message(LOG_INFO, " retry = %d", smtp_chk->retry);
+ log_message(LOG_INFO, " delay before retry = %ld", smtp_chk->db_retry/TIMER_HZ);
dump_list(smtp_chk->host);
}
va_end(varg_list);
error_buff[512 - 1] = '\0';
- syslog(LOG_INFO, error_buff);
+ log_message(LOG_INFO, error_buff);
} else {
- syslog(LOG_INFO, "SMTP_CHECK Unknown error");
+ log_message(LOG_INFO, "SMTP_CHECK Unknown error");
}
}
/* wrap the buffer, if full, by clearing it */
if (SMTP_BUFF_MAX - smtp_chk->buff_ctr <= 0) {
- syslog(LOG_INFO, "SMTP_CHECK Buffer overflow reading from server [%s:%d]. "
+ log_message(LOG_INFO, "SMTP_CHECK Buffer overflow reading from server [%s:%d]. "
"Increase SMTP_BUFF_MAX in smtp_check.h",
inet_ntop2(smtp_hst->ip), ntohs(smtp_hst->port));
smtp_clear_buff(thread_obj);
*/
if ((smtp_chk->host_ptr = list_element(smtp_chk->host, smtp_chk->host_ctr)) == NULL) {
if (!svr_checker_up(chk->id, chk->rs)) {
- syslog(LOG_INFO, "Remote SMTP server [%s:%d] succeed on service.",
+ log_message(LOG_INFO, "Remote SMTP server [%s:%d] succeed on service.",
inet_ntop2(CHECKER_RIP(chk)), ntohs(CHECKER_RPORT(chk)));
smtp_alert(chk->rs, NULL, NULL, "UP",
* url, compute a MD5 over this result and match it to the
* expected value.
*
- * Version: $Id: check_ssl.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: check_ssl.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <openssl/err.h>
#include "check_ssl.h"
#include "check_api.h"
+#include "logger.h"
#include "memory.h"
#include "parser.h"
#include "smtp.h"
if (!
(SSL_CTX_use_certificate_chain_file
(ssl->ctx, check_data->ssl->keyfile))) {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"SSL error : Cant load certificate file...");
return 0;
}
if (!
(SSL_CTX_use_PrivateKey_file
(ssl->ctx, check_data->ssl->keyfile, SSL_FILETYPE_PEM))) {
- syslog(LOG_INFO, "SSL error : Cant load key file...");
+ log_message(LOG_INFO, "SSL error : Cant load key file...");
return 0;
}
if (!
(SSL_CTX_load_verify_locations
(ssl->ctx, check_data->ssl->cafile, 0))) {
- syslog(LOG_INFO, "SSL error : Cant load CA file...");
+ log_message(LOG_INFO, "SSL error : Cant load CA file...");
return 0;
}
SSL_DATA *ssl = check_data->ssl;
if (!build_ssl_ctx()) {
- syslog(LOG_INFO, "Error Initialize SSL, ctx Instance");
- syslog(LOG_INFO, " SSL keyfile:%s", ssl->keyfile);
- syslog(LOG_INFO, " SSL password:%s", ssl->password);
- syslog(LOG_INFO, " SSL cafile:%s", ssl->cafile);
- syslog(LOG_INFO, "Terminate...\n");
+ log_message(LOG_INFO, "Error Initialize SSL, ctx Instance");
+ log_message(LOG_INFO, " SSL keyfile:%s", ssl->keyfile);
+ log_message(LOG_INFO, " SSL password:%s", ssl->password);
+ log_message(LOG_INFO, " SSL cafile:%s", ssl->cafile);
+ log_message(LOG_INFO, "Terminate...\n");
clear_ssl(ssl);
return 0;
}
switch (err) {
case SSL_ERROR_ZERO_RETURN:
- syslog(LOG_INFO, " SSL error: (zero return)");
+ log_message(LOG_INFO, " SSL error: (zero return)");
break;
case SSL_ERROR_WANT_READ:
- syslog(LOG_INFO, " SSL error: (read error)");
+ log_message(LOG_INFO, " SSL error: (read error)");
break;
case SSL_ERROR_WANT_WRITE:
- syslog(LOG_INFO, " SSL error: (write error)");
+ log_message(LOG_INFO, " SSL error: (write error)");
break;
case SSL_ERROR_WANT_CONNECT:
- syslog(LOG_INFO, " SSL error: (connect error)");
+ log_message(LOG_INFO, " SSL error: (connect error)");
break;
case SSL_ERROR_WANT_X509_LOOKUP:
- syslog(LOG_INFO, " SSL error: (X509 lookup error)");
+ log_message(LOG_INFO, " SSL error: (X509 lookup error)");
break;
case SSL_ERROR_SYSCALL:
- syslog(LOG_INFO, " SSL error: (syscall error)");
+ log_message(LOG_INFO, " SSL error: (syscall error)");
break;
case SSL_ERROR_SSL:{
ssl_strerr = (char *) MALLOC(500);
extended_error = ERR_get_error();
ERR_error_string(extended_error, ssl_strerr);
- syslog(LOG_INFO, " SSL error: (%s)", ssl_strerr);
+ log_message(LOG_INFO, " SSL error: (%s)", ssl_strerr);
FREE(ssl_strerr);
break;
}
*
* Part: TCP checker.
*
- * Version: $Id: check_tcp.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: check_tcp.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "check_tcp.h"
#include "memory.h"
#include "ipwrapper.h"
#include "layer4.h"
+#include "logger.h"
#include "smtp.h"
#include "utils.h"
#include "parser.h"
{
tcp_checker *tcp_chk = CHECKER_DATA(data);
- syslog(LOG_INFO, " Keepalive method = TCP_CHECK");
+ log_message(LOG_INFO, " Keepalive method = TCP_CHECK");
if (tcp_chk->connection_port)
- syslog(LOG_INFO, " Connection port = %d",
+ log_message(LOG_INFO, " Connection port = %d",
ntohs(tcp_chk->connection_port));
if (tcp_chk->bindto)
- syslog(LOG_INFO, " Bind to = %s", inet_ntop2(tcp_chk->bindto));
- syslog(LOG_INFO, " Connection timeout = %d", tcp_chk->connection_to/TIMER_HZ);
+ log_message(LOG_INFO, " Bind to = %s", inet_ntop2(tcp_chk->bindto));
+ log_message(LOG_INFO, " Connection timeout = %d", tcp_chk->connection_to/TIMER_HZ);
}
void
close(thread_obj->u.fd);
if (!svr_checker_up(checker_obj->id, checker_obj->rs)) {
- syslog(LOG_INFO, "TCP connection to [%s:%d] success.",
+ log_message(LOG_INFO, "TCP connection to [%s:%d] success.",
inet_ntop2(CHECKER_RIP(checker_obj))
, ntohs(addr_port));
smtp_alert(checker_obj->rs, NULL, NULL,
} else {
if (svr_checker_up(checker_obj->id, checker_obj->rs)) {
- syslog(LOG_INFO, "TCP connection to [%s:%d] failed !!!",
+ log_message(LOG_INFO, "TCP connection to [%s:%d] failed !!!",
inet_ntop2(CHECKER_RIP(checker_obj))
, ntohs(addr_port));
smtp_alert(checker_obj->rs, NULL, NULL,
* library to add/remove server MASQ rules to the kernel
* firewall framework.
*
- * Version: $Id: ipfwwrapper.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: ipfwwrapper.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "ipfwwrapper.h"
* Part: IPVS Kernel wrapper. Use setsockopt call to add/remove
* server to/from the loadbalanced server pool.
*
- * Version: $Id: ipvswrapper.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: ipvswrapper.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "ipvswrapper.h"
#include "list.h"
#include "utils.h"
#include "memory.h"
+#include "logger.h"
/* local helpers functions */
static int parse_timeout(char *, unsigned *);
int
ipvs_syncd_cmd(int cmd, char *ifname, int state, int syncid)
{
- syslog(LOG_INFO, "IPVS : Sync daemon not supported on kernel v2.2");
+ log_message(LOG_INFO, "IPVS : Sync daemon not supported on kernel v2.2");
return IPVS_ERROR;
}
ctl.u.vs_user.protocol = vs->service_type;
if (!parse_timeout(vs->timeout_persistence, &ctl.u.vs_user.timeout))
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"IPVS : Virtual service [%s:%d] illegal timeout.",
inet_ntop2(SVR_IP(vs))
, ntohs(SVR_PORT(vs)));
sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
if (sockfd == -1) {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"IPVS : Can not initialize SOCK_RAW descriptor.");
return IPVS_ERROR;
}
sizeof (ctl));
if (errno == ESRCH) {
- syslog(LOG_INFO, "IPVS : Virtual service [%s:%d] not defined.",
+ log_message(LOG_INFO, "IPVS : Virtual service [%s:%d] not defined.",
inet_ntop2(SVR_IP(vs))
, ntohs(SVR_PORT(vs)));
close(sockfd);
return IPVS_ERROR;
} else if (errno == EEXIST) {
if (rs)
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"IPVS : Destination already exists [%s:%d].",
inet_ntop2(SVR_IP(rs))
, ntohs(SVR_PORT(rs)));
} else if (errno == ENOENT) {
if (rs)
- syslog(LOG_INFO, "IPVS : No such destination [%s:%d].",
+ log_message(LOG_INFO, "IPVS : No such destination [%s:%d].",
inet_ntop2(SVR_IP(rs))
, ntohs(SVR_PORT(rs)));
}
int
ipvs_start(void)
{
+ log_message(LOG_DEBUG, "Initializing ipvs 2.4");
/* Init IPVS kernel channel */
if (ipvs_init()) {
/* try to insmod the ip_vs module if ipvs_init failed */
if (modprobe_ipvs() || ipvs_init()) {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"IPVS : Can't initialize ipvs: %s",
ipvs_strerror(errno));
return IPVS_ERROR;
ipvs_talk(int cmd)
{
if (ipvs_command(cmd, urule))
- syslog(LOG_INFO, "IPVS : %s", ipvs_strerror(errno));
+ log_message(LOG_INFO, "IPVS : %s", ipvs_strerror(errno));
return IPVS_SUCCESS;
}
return ipvs_talk(cmd);
#else
- syslog(LOG_INFO, "IPVS : Sync daemon not supported");
+ log_message(LOG_INFO, "IPVS : Sync daemon not supported");
return IPVS_ERROR;
#endif
}
urule->protocol = vs->service_type;
if (!parse_timeout(vs->timeout_persistence, &urule->timeout))
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"IPVS : Virtual service [%s:%d] illegal timeout.",
inet_ntop2(SVR_IP(vs)), ntohs(SVR_PORT(vs)));
int
ipvs_start(void)
{
+ log_message(LOG_DEBUG, "Initializing ipvs 2.6");
/* Initialize IPVS module */
if (ipvs_init()) {
if (modprobe_ipvs() || ipvs_init()) {
- syslog(LOG_INFO, "IPVS: Can't initialize ipvs: %s",
+ log_message(LOG_INFO, "IPVS: Can't initialize ipvs: %s",
ipvs_strerror(errno));
return IPVS_ERROR;
}
}
if (result)
- syslog(LOG_INFO, "IPVS: %s", ipvs_strerror(errno));
+ log_message(LOG_INFO, "IPVS: %s", ipvs_strerror(errno));
}
int
srule->protocol = vs->service_type;
if (!parse_timeout(vs->timeout_persistence, &srule->timeout))
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"IPVS : Virtual service [%s:%d] illegal timeout.",
inet_ntop2(SVR_IP(vs)), ntohs(SVR_PORT(vs)));
*
* Part: Manipulation functions for IPVS & IPFW wrappers.
*
- * Version: $Id: ipwrapper.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: ipwrapper.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "ipwrapper.h"
#include "ipvswrapper.h"
+#include "logger.h"
#include "memory.h"
#include "utils.h"
#include "notify.h"
+#include "main.h"
+
+/* Returns the sum of all RS weight in a virtual server. */
+long unsigned
+weigh_live_realservers(virtual_server * vs)
+{
+ element e;
+ real_server *svr;
+ long unsigned count = 0;
+
+ for (e = LIST_HEAD(vs->rs); e; ELEMENT_NEXT(e)) {
+ svr = ELEMENT_DATA(e);
+ if (ISALIVE(svr))
+ count += svr->weight;
+ }
+ return count;
+}
/* Remove a realserver IPVS rule */
static int
{
element e;
real_server *rs;
+ char rsip[16], vsip[16];
for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
rs = ELEMENT_DATA(e);
, rs))
return 0;
UNSET_ALIVE(rs);
+ if (!vs->omega)
+ continue;
+
+ /* In Omega mode we call VS and RS down notifiers
+ * all the way down the exit, as necessary.
+ */
+ if (rs->notify_down) {
+ log_message(LOG_INFO, "Executing [%s] for service [%s:%d]"
+ " in VS [%s:%d]"
+ , rs->notify_down
+ , inet_ntoa2(SVR_IP(rs), rsip)
+ , ntohs(SVR_PORT(rs))
+ , (vs->vsgname) ? vs->vsgname : inet_ntoa2(SVR_IP(vs), vsip)
+ , ntohs(SVR_PORT(vs)));
+ notify_exec(rs->notify_down);
+ }
+
+ /* Sooner or later VS will lose the quorum (if any). However,
+ * we don't push in a sorry server then, hence the regression
+ * is intended.
+ */
+ if (vs->quorum_state == UP && vs->quorum_down
+ && weigh_live_realservers(vs) < vs->quorum - vs->hysteresis) {
+ vs->quorum_state = DOWN;
+ log_message(LOG_INFO, "Executing [%s] for VS [%s:%d]"
+ , vs->quorum_down
+ , (vs->vsgname) ? vs->vsgname : inet_ntoa2(SVR_IP(vs), vsip)
+ , ntohs(SVR_PORT(vs)));
+ notify_exec(vs->quorum_down);
+ }
}
#ifdef _KRNL_2_2_
/* if we have a /32 mask, we create one nat rules per
return 0;
} else if (!clear_service_rs(vs_group, vs, vs->rs))
return 0;
+ /* The above will handle Omega case for VS as well. */
}
if (!ipvs_cmd(LVS_CMD_DEL, vs_group, vs, NULL))
/* Set a realserver IPVS rules */
static int
-init_service_rs(virtual_server * vs, list l)
+init_service_rs(virtual_server * vs)
{
element e;
real_server *rs;
- for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
+ for (e = LIST_HEAD(vs->rs); e; ELEMENT_NEXT(e)) {
rs = ELEMENT_DATA(e);
+ /* In alpha mode, be pessimistic (or realistic?) and don't
+ * add real servers into the VS pool. They will get there
+ * later upon healthchecks recovery (if ever).
+ */
+ if (vs->alpha) {
+ UNSET_ALIVE(rs);
+ continue;
+ }
if (!ISALIVE(rs)) {
if (!ipvs_cmd(LVS_CMD_ADD_DEST, check_data->vs_group, vs, rs))
return 0;
/* Processing real server queue */
if (!LIST_ISEMPTY(vs->rs))
- if (!init_service_rs(vs, vs->rs))
+ if (!init_service_rs(vs))
return 0;
return 1;
}
return 1;
}
-/* Check if all rs for a specific vs are down */
-int
-all_realservers_down(virtual_server * vs)
-{
- element e;
- real_server *svr;
-
- for (e = LIST_HEAD(vs->rs); e; ELEMENT_NEXT(e)) {
- svr = ELEMENT_DATA(e);
- if (ISALIVE(svr))
- return 0;
- }
- return 1;
-}
-
/* manipulate add/remove rs according to alive state */
void
perform_svr_state(int alive, virtual_server * vs, real_server * rs)
{
char rsip[16], vsip[16];
+/*
+ * | ISALIVE(rs) | alive | context
+ * | 0 | 0 | first check failed under alpha mode, unreachable here
+ * | 0 | 1 | RS went up, add it to the pool
+ * | 1 | 0 | RS went down, remove it from the pool
+ * | 1 | 1 | first check succeeded w/o alpha mode, unreachable here
+ */
if (!ISALIVE(rs) && alive) {
*/
if (vs->s_svr) {
if (ISALIVE(vs->s_svr)) {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"Removing sorry server [%s:%d] from VS [%s:%d]",
inet_ntoa2(SVR_IP(vs->s_svr), rsip)
, ntohs(SVR_PORT(vs->s_svr))
}
}
- syslog(LOG_INFO, "%s service [%s:%d] to VS [%s:%d]",
+ log_message(LOG_INFO, "%s service [%s:%d] to VS [%s:%d]",
(rs->inhibit) ? "Enabling" : "Adding"
, inet_ntoa2(SVR_IP(rs), rsip)
, ntohs(SVR_PORT(rs))
ipvs_cmd(LVS_CMD_ADD_DEST, check_data->vs_group, vs, rs);
rs->alive = alive;
if (rs->notify_up) {
- syslog(LOG_INFO, "Executing [%s] for service [%s:%d]"
+ log_message(LOG_INFO, "Executing [%s] for service [%s:%d]"
" in VS [%s:%d]"
, rs->notify_up
, inet_ntoa2(SVR_IP(rs), rsip)
, ntohs(SVR_PORT(vs)));
notify_exec(rs->notify_up);
}
+ /* If we have just gained quorum, it's time to consider notify_up. */
+ if (vs->quorum_state == DOWN
+ && weigh_live_realservers(vs) >= vs->quorum + vs->hysteresis) {
+ vs->quorum_state = UP;
+ log_message(LOG_INFO, "Gained quorum %lu+%lu=%lu <= %u for VS [%s:%d]"
+ , vs->quorum
+ , vs->hysteresis
+ , vs->quorum + vs->hysteresis
+ , weigh_live_realservers(vs)
+ , (vs->vsgname) ? vs->vsgname : inet_ntoa2(SVR_IP(vs), vsip)
+ , ntohs(SVR_PORT(vs)));
+ if (vs->quorum_up) {
+ log_message(LOG_INFO, "Executing [%s] for VS [%s:%d]"
+ , vs->quorum_up
+ , (vs->vsgname) ? vs->vsgname : inet_ntoa2(SVR_IP(vs), vsip)
+ , ntohs(SVR_PORT(vs)));
+ notify_exec(vs->quorum_up);
+ }
+ }
#ifdef _KRNL_2_2_
if (vs->nat_mask == HOST_NETMASK)
ipfw_cmd(IP_FW_CMD_ADD, vs, rs);
#endif
+ return;
+ }
- } else {
+ if (ISALIVE(rs) && !alive) {
- syslog(LOG_INFO, "%s service [%s:%d] from VS [%s:%d]",
+ log_message(LOG_INFO, "%s service [%s:%d] from VS [%s:%d]",
(rs->inhibit) ? "Disabling" : "Removing"
, inet_ntoa2(SVR_IP(rs), rsip)
, ntohs(SVR_PORT(rs))
ipvs_cmd(LVS_CMD_DEL_DEST, check_data->vs_group, vs, rs);
rs->alive = alive;
if (rs->notify_down) {
- syslog(LOG_INFO, "Executing [%s] for service [%s:%d]"
+ log_message(LOG_INFO, "Executing [%s] for service [%s:%d]"
" in VS [%s:%d]"
, rs->notify_down
, inet_ntoa2(SVR_IP(rs), rsip)
ipfw_cmd(IP_FW_CMD_DEL, vs, rs);
#endif
- /* if all the realserver pool is down, we add sorry server */
- if (vs->s_svr && all_realservers_down(vs)) {
- syslog(LOG_INFO,
- "Adding sorry server [%s:%d] to VS [%s:%d]",
- inet_ntoa2(SVR_IP(vs->s_svr), rsip)
- , ntohs(SVR_PORT(vs->s_svr))
- , (vs->vsgname) ? vs->vsgname : inet_ntoa2(SVR_IP(vs), vsip)
- , ntohs(SVR_PORT(vs)));
-
- /* the sorry server is now up in the pool, we flag it alive */
- ipvs_cmd(LVS_CMD_ADD_DEST, check_data->vs_group, vs, vs->s_svr);
- vs->s_svr->alive = 1;
-#ifdef _KRNL_2_2_
- ipfw_cmd(IP_FW_CMD_ADD, vs, vs->s_svr);
-#endif
+ /* If we have just lost quorum for the VS, we need to consider
+ * VS notify_down and sorry_server cases
+ */
+ if (vs->quorum_state == UP
+ && weigh_live_realservers(vs) < vs->quorum - vs->hysteresis) {
+ vs->quorum_state = DOWN;
+ log_message(LOG_INFO, "Lost quorum %lu-%lu=%lu > %u for VS [%s:%d]"
+ , vs->quorum
+ , vs->hysteresis
+ , vs->quorum - vs->hysteresis
+ , weigh_live_realservers(vs)
+ , (vs->vsgname) ? vs->vsgname : inet_ntoa2(SVR_IP(vs), vsip)
+ , ntohs(SVR_PORT(vs)));
+ if (vs->quorum_down) {
+ log_message(LOG_INFO, "Executing [%s] for VS [%s:%d]"
+ , vs->quorum_down
+ , (vs->vsgname) ? vs->vsgname : inet_ntoa2(SVR_IP(vs), vsip)
+ , ntohs(SVR_PORT(vs)));
+ notify_exec(vs->quorum_down);
+ }
+ if (vs->s_svr) {
+ log_message(LOG_INFO,
+ "Adding sorry server [%s:%d] to VS [%s:%d]",
+ inet_ntoa2(SVR_IP(vs->s_svr), rsip)
+ , ntohs(SVR_PORT(vs->s_svr))
+ , (vs->vsgname) ? vs->vsgname : inet_ntoa2(SVR_IP(vs), vsip)
+ , ntohs(SVR_PORT(vs)));
+
+ /* the sorry server is now up in the pool, we flag it alive */
+ ipvs_cmd(LVS_CMD_ADD_DEST, check_data->vs_group, vs, vs->s_svr);
+ vs->s_svr->alive = 1;
+
+ #ifdef _KRNL_2_2_
+ ipfw_cmd(IP_FW_CMD_ADD, vs, vs->s_svr);
+ #endif
+ }
}
}
}
char rsip[16], vsip[16];
if (weight != rs->weight) {
- syslog(LOG_INFO, "Changing weight from %d to %d for %s service [%s:%d]"
+ log_message(LOG_INFO, "Changing weight from %d to %d for %s service [%s:%d]"
" of VS [%s:%d]"
, rs->weight
, weight
list l = rs->failed_checkers;
checker_id_t *id;
- /* Handle alive state */
- for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
- id = ELEMENT_DATA(e);
- if (*id == cid) {
- if (alive) {
+ /* Handle alive state. Depopulate failed_checkers and call
+ * perform_svr_state() independently, letting the latter sort
+ * things out itself.
+ */
+ if (alive) {
+ /* Remove the succeeded check from failed_checkers list. */
+ for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
+ id = ELEMENT_DATA(e);
+ if (*id == cid) {
free_list_element(l, e);
- if (LIST_SIZE(l) == 0)
- perform_svr_state(alive, vs, rs);
- }
- return;
+ /* If we don't break, the next iteration will trigger
+ * a SIGSEGV.
+ */
+ break;
+ }
}
+ if (LIST_SIZE(l) == 0)
+ perform_svr_state(alive, vs, rs);
}
-
/* Handle not alive state */
- if (!alive) {
+ else {
id = (checker_id_t *) MALLOC(sizeof(checker_id_t));
*id = cid;
list_add(l, id);
for (e = LIST_HEAD(old); e; ELEMENT_NEXT(e)) {
vsge = ELEMENT_DATA(e);
if (!vsge_exist(vsge, new)) {
- syslog(LOG_INFO, "VS [%s:%d:%d:%d] in group %s"
+ log_message(LOG_INFO, "VS [%s:%d:%d:%d] in group %s"
" no longer exist\n"
, inet_ntop2(vsge->addr_ip)
, ntohs(vsge->addr_port)
rs = ELEMENT_DATA(e);
if (!rs_exist(rs, new)) {
/* Reset inhibit flag to delete inhibit entries */
- syslog(LOG_INFO, "service [%s:%d] no longer exist"
+ log_message(LOG_INFO, "service [%s:%d] no longer exist"
, inet_ntoa2(SVR_IP(rs), rsip)
, ntohs(SVR_PORT(rs)));
- syslog(LOG_INFO, "Removing service [%s:%d] from VS [%s:%d]"
+ log_message(LOG_INFO, "Removing service [%s:%d] from VS [%s:%d]"
, inet_ntoa2(SVR_IP(rs), rsip)
, ntohs(SVR_PORT(rs))
, inet_ntoa2(SVR_IP(old_vs), vsip)
*/
if (!vs_exist(vs)) {
if (vs->vsgname)
- syslog(LOG_INFO, "Removing Virtual Server Group [%s]"
+ log_message(LOG_INFO, "Removing Virtual Server Group [%s]"
, vs->vsgname);
else
- syslog(LOG_INFO, "Removing Virtual Server [%s:%d]"
+ log_message(LOG_INFO, "Removing Virtual Server [%s:%d]"
, inet_ntop2(vs->addr_ip)
, ntohs(vs->addr_port));
#
# Keepalived OpenSource project.
#
-# Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
+# Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
CC = @CC@
INCLUDES = -I../include -I../../lib
*
* Part: Main program structure.
*
- * Version: $Id: main.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: main.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <syslog.h>
#include "daemon.h"
+#include "logger.h"
#include "utils.h"
/* Daemonization function coming from zebra source code */
/* In case of fork is error. */
pid = fork();
if (pid < 0) {
- syslog(LOG_INFO, "xdaemon: fork error");
+ log_message(LOG_INFO, "xdaemon: fork error");
return -1;
}
/* Become session leader and get pid. */
pid = setsid();
if (pid < -1) {
- syslog(LOG_INFO, "xdaemon: setsid error");
+ log_message(LOG_INFO, "xdaemon: setsid error");
return -1;
}
*
* Part: Dynamic data structure definition.
*
- * Version: $Id: global_data.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: global_data.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <syslog.h>
#include "global_data.h"
#include "memory.h"
#include "list.h"
+#include "logger.h"
#include "utils.h"
/* global vars */
dump_email(void *data_obj)
{
char *addr = data_obj;
- syslog(LOG_INFO, " Email notification = %s", addr);
+ log_message(LOG_INFO, " Email notification = %s", addr);
}
void
if (data->router_id ||
data->smtp_server || data->smtp_connection_to || data->email_from) {
- syslog(LOG_INFO, "------< Global definitions >------");
+ log_message(LOG_INFO, "------< Global definitions >------");
}
if (data->router_id)
- syslog(LOG_INFO, " Router ID = %s", data->router_id);
+ log_message(LOG_INFO, " Router ID = %s", data->router_id);
if (data->plugin_dir)
- syslog(LOG_INFO, " Plugin dir = %s", data->plugin_dir);
+ log_message(LOG_INFO, " Plugin dir = %s", data->plugin_dir);
if (data->smtp_server)
- syslog(LOG_INFO, " Smtp server = %s",
+ log_message(LOG_INFO, " Smtp server = %s",
inet_ntop2(data->smtp_server));
if (data->smtp_connection_to)
- syslog(LOG_INFO, " Smtp server connection timeout = %lu",
+ log_message(LOG_INFO, " Smtp server connection timeout = %lu",
data->smtp_connection_to / TIMER_HZ);
if (data->email_from) {
- syslog(LOG_INFO, " Email notification from = %s",
+ log_message(LOG_INFO, " Email notification from = %s",
data->email_from);
dump_list(data->email);
}
* data structure representation the conf file representing
* the loadbalanced server pool.
*
- * Version: $Id: global_parser.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: global_parser.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "global_parser.h"
* Part: Layer4 checkers handling. Register worker threads &
* upper layer checkers.
*
- * Version: $Id: layer4.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: layer4.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "layer4.h"
int (*func) (struct _thread *))
{
int status;
- int slen;
+ socklen_t slen;
int ret = 0;
TIMEVAL timer_min;
*
* Part: Main program structure.
*
- * Version: $Id: main.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: main.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "main.h"
#include "config.h"
#include "signals.h"
+#include "pidfile.h"
+#include "logger.h"
/* global var */
char *conf_file = NULL; /* Configuration file */
pid_t checkers_child = -1; /* Healthcheckers child process ID */
int daemon_mode = 0; /* VRRP/CHECK subsystem selection */
int linkwatch = 0; /* Use linkwatch kernel netlink reflection */
+char *main_pidfile = KEEPALIVED_PID_FILE; /* overrule default pidfile */
+char *checkers_pidfile = CHECKERS_PID_FILE; /* overrule default pidfile */
+char *vrrp_pidfile = VRRP_PID_FILE; /* overrule default pidfile */
/* Log facility table */
static struct {
static void
stop_keepalived(void)
{
- syslog(LOG_INFO, "Stopping " VERSION_STRING);
+ log_message(LOG_INFO, "Stopping " VERSION_STRING);
/* Just cleanup memory & exit */
+ signal_handler_destroy();
thread_destroy_master(master);
if (daemon_mode == 3 || !daemon_mode)
- pidfile_rm(KEEPALIVED_PID_FILE);
+ pidfile_rm(main_pidfile);
else
- pidfile_rm((daemon_mode & 1) ? KEEPALIVED_VRRP_PID_FILE :
- KEEPALIVED_CHECKERS_PID_FILE);
+ pidfile_rm((daemon_mode & 1) ? vrrp_pidfile :
+ checkers_pidfile);
#ifdef _DEBUG_
keepalived_free_final("Parent process");
/* SIGHUP handler */
void
-sighup(int sig)
+sighup(void *v, int sig)
{
/* Set the reloading flag */
SET_RELOAD;
/* Terminate handler */
void
-sigend(int sig)
+sigend(void *v, int sig)
{
int status;
/* register the terminate thread */
- syslog(LOG_INFO, "Terminating on signal");
+ log_message(LOG_INFO, "Terminating on signal");
thread_add_terminate_event(master);
if (vrrp_child > 0) {
signal_init(void)
{
signal_handler_init();
- signal_set(SIGHUP, sighup);
- signal_set(SIGINT, sigend);
- signal_set(SIGTERM, sigend);
+ signal_set(SIGHUP, sighup, NULL);
+ signal_set(SIGINT, sigend, NULL);
+ signal_set(SIGTERM, sigend, NULL);
signal_ignore(SIGPIPE);
- signal_noignore_sigchld();
}
/* Usage function */
" %s --log-detail -D Detailed log messages.\n"
" %s --log-facility -S 0-7 Set syslog facility to LOG_LOCAL[0-7]. (default=LOG_DAEMON)\n"
" %s --help -h Display this short inlined help screen.\n"
- " %s --version -v Display the version number\n",
+ " %s --version -v Display the version number\n"
+ " %s --pid -p pidfile\n"
+ " %s --checkers_pid -c checkers pidfile\n"
+ " %s --vrrp_pid -r vrrp pidfile\n",
prog, prog, prog, prog, prog, prog, prog, prog,
- prog, prog, prog, prog);
+ prog, prog, prog, prog, prog, prog, prog);
}
/* Command line parser */
{"use-file", 'f', POPT_ARG_STRING, &option_arg, 'f'},
{"vrrp", 'P', POPT_ARG_NONE, NULL, 'P'},
{"check", 'C', POPT_ARG_NONE, NULL, 'C'},
+ {"pid", 'p', POPT_ARG_STRING, &option_arg, 'p'},
+ {"checkers_pid", 'c', POPT_ARG_STRING, &option_arg, 'c'},
+ {"vrrp_pid", 'r', POPT_ARG_STRING, &option_arg, 'r'},
{NULL, 0, 0, NULL, 0}
};
case 'C':
daemon_mode |= 2;
break;
+ case 'p':
+ main_pidfile = option_arg;
+ break;
+ case 'c':
+ checkers_pidfile = option_arg;
+ break;
+ case 'r':
+ vrrp_pidfile = option_arg;
+ break;
}
/* the others */
+ /* fixme: why is this duplicated? */
while ((c = poptGetNextOpt(context)) >= 0) {
switch (c) {
case 'l':
case 'C':
daemon_mode |= 2;
break;
+ case 'p':
+ main_pidfile = option_arg;
+ break;
+ case 'c':
+ checkers_pidfile = option_arg;
+ break;
+ case 'r':
+ vrrp_pidfile = option_arg;
+ break;
}
}
parse_cmdline(argc, argv);
openlog(PROG, LOG_PID | (debug & 1) ? LOG_CONS : 0, log_facility);
- syslog(LOG_INFO, "Starting " VERSION_STRING);
+ log_message(LOG_INFO, "Starting " VERSION_STRING);
/* Check if keepalived is already running */
if (keepalived_running(daemon_mode)) {
- syslog(LOG_INFO, "daemon is already running");
+ log_message(LOG_INFO, "daemon is already running");
goto end;
}
/* write the pidfile */
if (daemon_mode == 3 || !daemon_mode) {
- if (!pidfile_write(KEEPALIVED_PID_FILE, getpid()))
+ if (!pidfile_write(main_pidfile, getpid()))
goto end;
} else {
- if (!pidfile_write((daemon_mode & 1) ? KEEPALIVED_VRRP_PID_FILE :
- KEEPALIVED_CHECKERS_PID_FILE, getpid()))
+ if (!pidfile_write((daemon_mode & 1) ? vrrp_pidfile :
+ checkers_pidfile, getpid()))
goto end;
}
*
* Part: pidfile utility.
*
- * Version: $Id: pidfile.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: pidfile.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
+#include "logger.h"
#include "pidfile.h"
+extern char *main_pidfile;
+extern char *checkers_pidfile;
+extern char *vrrp_pidfile;
/* Create the runnnig daemon pidfile */
int
FILE *pidfile = fopen(pid_file, "w");
if (!pidfile) {
- syslog(LOG_INFO, "pidfile_write : Can not open %s pidfile",
+ log_message(LOG_INFO, "pidfile_write : Can not open %s pidfile",
pid_file);
return 0;
}
/* If no process is attached to pidfile, remove it */
if (kill(pid, 0)) {
- syslog(LOG_INFO, "Remove a zombie pid file %s", pid_file);
+ log_message(LOG_INFO, "Remove a zombie pid file %s", pid_file);
pidfile_rm(pid_file);
return 0;
}
int
keepalived_running(int mode)
{
- if (process_running(KEEPALIVED_PID_FILE))
+ if (process_running(main_pidfile))
return 1;
else if (mode & 1 || mode & 2)
- return process_running((mode & 1) ? KEEPALIVED_VRRP_PID_FILE :
- KEEPALIVED_CHECKERS_PID_FILE);
+ return process_running((mode & 1) ? vrrp_pidfile :
+ checkers_pidfile);
- if (process_running(KEEPALIVED_VRRP_PID_FILE) ||
- process_running(KEEPALIVED_CHECKERS_PID_FILE))
+ if (process_running(vrrp_pidfile) ||
+ process_running(checkers_pidfile))
return 1;
return 0;
}
int
vrrp_running(void)
{
- return process_running(VRRP_PID_FILE);
+ return process_running(vrrp_pidfile);
}
/* Return VRRP child process state */
int
checkers_running(void)
{
- return process_running(CHECKERS_PID_FILE);
+ return process_running(checkers_pidfile);
}
* 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.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: smtp.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <time.h>
#include "scheduler.h"
#include "memory.h"
#include "list.h"
+#include "logger.h"
#include "utils.h"
/* SMTP FSM definition */
{
smtp_thread_arg *smtp_arg = THREAD_ARG(thread_obj);
- syslog(LOG_INFO, "SMTP connection ERROR to [%s:%d].",
+ log_message(LOG_INFO, "SMTP connection ERROR to [%s:%d].",
inet_ntop2(data->smtp_server), SMTP_PORT);
free_smtp_all(smtp_arg);
return 0;
{
smtp_thread_arg *smtp_arg = THREAD_ARG(thread_obj);
- syslog(LOG_INFO, "Timeout connecting SMTP server [%s:%d].",
+ log_message(LOG_INFO, "Timeout connecting SMTP server [%s:%d].",
inet_ntop2(data->smtp_server), SMTP_PORT);
free_smtp_all(smtp_arg);
return 0;
{
smtp_thread_arg *smtp_arg = THREAD_ARG(thread_obj);
- syslog(LOG_INFO, "Remote SMTP server [%s:%d] connected.",
+ log_message(LOG_INFO, "Remote SMTP server [%s:%d] connected.",
inet_ntop2(data->smtp_server), SMTP_PORT);
smtp_arg->stage = connect_success;
smtp_arg = THREAD_ARG(thread_obj);
if (thread_obj->type == THREAD_READ_TIMEOUT) {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"Timeout reading data to remote SMTP server [%s:%d].",
inet_ntop2(data->smtp_server), SMTP_PORT);
SMTP_FSM_READ(QUIT, thread_obj, 0);
if (rcv_buffer_size == -1) {
if (errno == EAGAIN)
goto end;
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"Error reading data from remote SMTP server [%s:%d].",
inet_ntop2(data->smtp_server), SMTP_PORT);
SMTP_FSM_READ(QUIT, thread_obj, 0);
/* received data overflow buffer size ? */
if (smtp_arg->buflen >= SMTP_BUFFER_MAX) {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"Received buffer from remote SMTP server [%s:%d]"
" overflow our get read buffer length.",
inet_ntop2(data->smtp_server), SMTP_PORT);
thread_add_write(thread_obj->master, smtp_send_thread, smtp_arg,
smtp_arg->fd, data->smtp_connection_to);
} else {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"Can not read data from remote SMTP server [%s:%d].",
inet_ntop2(data->smtp_server), SMTP_PORT);
SMTP_FSM_READ(QUIT, thread_obj, 0);
smtp_thread_arg *smtp_arg = THREAD_ARG(thread_obj);
if (thread_obj->type == THREAD_WRITE_TIMEOUT) {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"Timeout sending data to remote SMTP server [%s:%d].",
inet_ntop2(data->smtp_server), SMTP_PORT);
SMTP_FSM_READ(QUIT, thread_obj, 0);
thread_add_read(thread_obj->master, smtp_read_thread, smtp_arg,
thread_obj->u.fd, data->smtp_connection_to);
} else {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"Can not send data to remote SMTP server [%s:%d].",
inet_ntop2(data->smtp_server), SMTP_PORT);
SMTP_FSM_READ(QUIT, thread_obj, 0);
if (status == 220) {
smtp_arg->stage++;
} else {
- syslog(LOG_INFO, "Error connecting SMTP server[%s:%d]."
+ log_message(LOG_INFO, "Error connecting SMTP server[%s:%d]."
" SMTP status code = %d", inet_ntop2(data->smtp_server),
SMTP_PORT, status);
smtp_arg->stage = ERROR;
if (status == 250) {
smtp_arg->stage++;
} else {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"Error processing HELO cmd on SMTP server [%s:%d]."
" SMTP status code = %d", inet_ntop2(data->smtp_server),
SMTP_PORT, status);
if (status == 250) {
smtp_arg->stage++;
} else {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"Error processing MAIL cmd on SMTP server [%s:%d]."
" SMTP status code = %d", inet_ntop2(data->smtp_server),
SMTP_PORT, status);
if (!fetched_email)
smtp_arg->stage++;
} else {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"Error processing RCPT cmd on SMTP server [%s:%d]."
" SMTP status code = %d", inet_ntop2(data->smtp_server),
SMTP_PORT, status);
if (status == 354) {
smtp_arg->stage++;
} else {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"Error processing DATA cmd on SMTP server [%s:%d]."
" SMTP status code = %d", inet_ntop2(data->smtp_server),
SMTP_PORT, status);
smtp_thread_arg *smtp_arg = THREAD_ARG(thread_obj);
if (status == 250) {
- syslog(LOG_INFO, "SMTP alert successfully sent.");
+ log_message(LOG_INFO, "SMTP alert successfully sent.");
smtp_arg->stage++;
} else {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"Error processing DOT cmd on SMTP server [%s:%d]."
" SMTP status code = %d", inet_ntop2(data->smtp_server),
SMTP_PORT, status);
--- /dev/null
+#! /bin/sh
+
+### BEGIN INIT INFO
+# Provides: keepalived
+# Required-Start: $remote_fs $syslog
+# Required-Stop : $remote_fs $syslog
+# Default-Start : 3 5
+# Default-Stop : 0 1 2 6
+# Description : Start keepalived to allow XY and provide YZ
+# continued on second line by '#<TAB>'
+### END INIT INFO
+
+
+DAEMON="Keepalived daemon"
+DAEMON_BIN="/usr/local/sbin/keepalived"
+DAEMON_CONF="/etc/keepalived/keepalived.conf"
+DAEMON_PIDFILE="/var/run/keepalived.pid"
+DAEMON_OPT="-d"
+#DAEMON_USER="root"
+SUPPORTS_HUP="yes"
+# "yes" if exist next values in freshclam.conf
+# PidFile /var/run/keepalived.pid
+# DatabaseOwner root
+
+pid_par=${DAEMON_PIDFILE:+"-p $DAEMON_PIDFILE"}
+usr_par=${DAEMON_USER:+"-u $DAEMON_USER"}
+
+test -x $DAEMON_BIN || exit 5
+
+# Shell functions sourced from /etc/rc.status:
+# rc_check check and set local and overall rc status
+# rc_status check and set local and overall rc status
+# rc_status -v ditto but be verbose in local rc status
+# rc_status -v -r ditto and clear the local rc status
+# rc_failed set local and overall rc status to failed
+# rc_failed <num> set local and overall rc status to <num><num>
+# rc_reset clear local rc status (overall remains)
+# rc_exit exit appropriate to overall rc status
+. /etc/rc.status
+
+# First reset status of this service
+rc_reset
+
+# Return values acc. to LSB for all commands but status:
+# 0 - success
+# 1 - generic or unspecified error
+# 2 - invalid or excess argument(s)
+# 3 - unimplemented feature (e.g. "reload")
+# 4 - insufficient privilege
+# 5 - program is not installed
+# 6 - program is not configured
+# 7 - program is not running
+#
+# Note that starting an already running service, stopping
+# or restarting a not-running service as well as the restart
+# with force-reload (in case signalling is not supported) are
+# considered a success.
+
+# remove empty pid files to avoid disturbing warnings by checkproc/killproc
+# (these can occur if dhcpd does not start correctly)
+test -e $DAEMON_PIDFILE && ! test -s $DAEMON_PIDFILE && rm $DAEMON_PIDFILE
+
+case "$1" in
+ start)
+ echo -n "Starting $DAEMON "
+ if test ! -f ${DAEMON_CONF}; then
+ echo -n >&2 "Configuration file, ${DAEMON_CONF} does not exist. "
+ rc_status -s
+ exit 6
+ fi
+ checkproc $pid_par ${DAEMON_BIN}
+ case $? in
+ 0) echo -n "- Warning: daemon already running. " ;;
+ 1) echo -n "- Warning: ${DAEMON_PIDFILE} exists. " ;;
+ esac
+# echo "startproc $usr_par $pid_par ${DAEMON_BIN} ${DAEMON_OPT}"
+ startproc $usr_par $pid_par ${DAEMON_BIN} ${DAEMON_OPT}
+ rc_status -v
+ ;;
+ stop)
+ echo -n "Shutting down $DAEMON "
+ checkproc $pid_par ${DAEMON_BIN} || \
+ echo -n " Warning: daemon not running. "
+ killproc $pid_par -t 10 ${DAEMON_BIN}
+ rc_status -v
+ ;;
+ try-restart|condrestart)
+ if test "$1" = "condrestart"; then
+ echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
+ fi
+ $0 status
+ if test $? = 0; then
+ $0 restart
+ else
+ rc_reset
+ fi
+ rc_status
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ rc_status
+ ;;
+ force-reload|reload)
+ if test "$SUPPORTS_HUP" = "yes"; then
+ echo -n "Reload service $DAEMON "
+ checkproc $pid_par ${DAEMON_BIN} && \
+ touch ${DAEMON_PIDFILE} || \
+ echo -n >&2 " Warning: daemon not running. "
+ killproc $pid_par -HUP ${DAEMON_BIN}
+ rc_status -v
+ else
+ $0 stop && sleep 3 && $0 start
+ rc_status
+ fi
+ ;;
+ status)
+ echo -n "Checking for $DAEMON "
+ checkproc $pid_par ${DAEMON_BIN}
+ rc_status -v
+ ;;
+ probe)
+ test ${DAEMON_CONF} -nt ${DAEMON_PIDFILE} && echo reload
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
+ exit 1
+ ;;
+esac
+rc_exit
+
*
* Part: Checkers arguments structures definitions.
*
- * Version: $Id: check_api.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: check_api.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _CHECK_API_H
*
* Part: check_daemon.c include file.
*
- * Version: $Id: check_daemon.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: check_daemon.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _CHECK_DAEMON_H
*
* Part: Healthcheckers dynamic data structure definition.
*
- * Version: $Id: check_data.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: check_data.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _CHECK_DATA_H
/* local includes */
#include "list.h"
#include "vector.h"
+#include "timer.h"
/* Typedefs */
typedef unsigned int checker_id_t;
/* Daemon dynamic data structure definition */
-#define MAX_TIMEOUT_LENGTH 5
-#define KEEPALIVED_DEFAULT_DELAY 60
+#define MAX_TIMEOUT_LENGTH 5
+#define KEEPALIVED_DEFAULT_DELAY (60 * TIMER_HZ)
/* SSL specific data */
typedef struct _ssl_data SSL_DATA;
real_server *s_svr;
list rs;
int alive;
+ unsigned alpha; /* Alpha mode enabled. */
+ unsigned omega; /* Omega mode enabled. */
+ char * quorum_up; /* A hook to call when the VS gains quorum. */
+ char * quorum_down; /* A hook to call when the VS loses quorum. */
+ long unsigned quorum; /* Minimum live RSs to consider VS up. */
+ long unsigned hysteresis; /* up/down events "lag" WRT quorum. */
+ unsigned quorum_state; /* Reflects result of the last transition done. */
} virtual_server;
/* Configuration data root */
*
* Part: check_http.c include file.
*
- * Version: $Id: check_http.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: check_http.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _CHECK_HTTP_H
*
* Part: check_misc.c include file.
*
- * Version: $Id: check_misc.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: check_misc.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _CHECK_MISC_H
*
* Part: check_parser.c include file.
*
- * Version: $Id: check_parser.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: check_parser.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _CHECK_PARSER_H
*
* Part: check_smtp.c include file.
*
- * Version: $Id: check_smtp.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: check_smtp.h,v 1.1.16 2009/02/14 03:25:07 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
* Jeremy Rumpf, <jrumpf@heavyload.net>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _CHECK_SMTP_H
*
* Part: check_http.c include file.
*
- * Version: $Id: check_http.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: check_http.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _CHECK_SSL_H
*
* Part: check_tcp.c include file.
*
- * Version: $Id: check_tcp.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: check_tcp.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _CHECK_TCP_H
*
* Part: Configuration include file.
*
- * Version: $Id: config.h.in,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: config.h.in,v 1.1.16 2009/02/14 03:25:07 acassen Exp $
*
* Author: Jacob Rief, <jacob.rief@tiscover.com>
*
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _CONFIG_H
*
* Part: Daemon process handling.
*
- * Version: $Id: daemon.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: daemon.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _DAEMON_H
*
* Part: Dynamic data structure definition.
*
- * Version: $Id: global_data.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: global_data.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _GLOBAL_DATA_H
*
* Part: vrrp_parser.c include file.
*
- * Version: $Id: global_parser.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: global_parser.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _GLOBAL_PARSER_H
*
* Part: ipfwwrapper.c include file.
*
- * Version: $Id: ipfwwrapper.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: ipfwwrapper.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _IPFWWRAPPER_H
*
* Part: ipvswrapper.c include file.
*
- * Version: $Id: ipvswrapper.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: ipvswrapper.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _IPVSWRAPPER_H
*
* Part: ipwrapper.c include file.
*
- * Version: $Id: ipwrapper.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: ipwrapper.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _IPWRAPPER_H
*
* Part: layer4.c include file.
*
- * Version: $Id: layer4.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: layer4.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _LAYER4_H
*
* Part: Main program include file.
*
- * Version: $Id: main.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: main.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _MAIN_H
*
* Part: pidfile.c include file.
*
- * Version: $Id: pidfile.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: pidfile.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _PIDFILE_H
*
* Part: smtp.c include file.
*
- * Version: $Id: smtp.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: smtp.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _SMTP_H
*
* Part: vrrp.c program include file.
*
- * Version: $Id: vrrp.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_H
#define VRRP_STATE_FAULT 3 /* internal */
#define VRRP_STATE_GOTO_MASTER 4 /* internal */
#define VRRP_STATE_LEAVE_MASTER 5 /* internal */
-#define VRRP_STATE_GOTO_FAULT 98 /* internal */
#define VRRP_DISPATCHER 99 /* internal */
#define VRRP_MCAST_RETRY 10 /* internal */
#define VRRP_MAX_FSM_STATE 4 /* internal */
#define VRRP_PKT_SADDR(V) (((V)->mcast_saddr) ? (V)->mcast_saddr : IF_ADDR((V)->ifp))
-#define VRRP_ISUP(V) ((IF_ISUP((V)->ifp) || (V)->dont_track_primary) & \
- ((!LIST_ISEMPTY((V)->track_ifp)) ? TRACK_ISUP((V)->track_ifp) : 1))
+#define VRRP_IF_ISUP(V) ((IF_ISUP((V)->ifp) || (V)->dont_track_primary) & \
+ ((!LIST_ISEMPTY((V)->track_ifp)) ? TRACK_ISUP((V)->track_ifp) : 1))
+
+#define VRRP_SCRIPT_ISUP(V) ((!LIST_ISEMPTY((V)->track_script)) ? SCRIPT_ISUP((V)->track_script) : 1)
+
+#define VRRP_ISUP(V) (VRRP_IF_ISUP(V) && VRRP_SCRIPT_ISUP(V))
/* prototypes */
extern int open_vrrp_send_socket(const int proto, const int idx);
extern int vrrp_complete_init(void);
extern void shutdown_vrrp_instances(void);
extern void clear_diff_vrrp(void);
+extern void clear_diff_script(void);
extern void vrrp_restore_interface(vrrp_rt * vrrp, int advF);
#endif
*
* Part: vrrp_arp.c include file.
*
- * Version: $Id: vrrp_arp.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_arp.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_ARP_H
*
* Part: vrrp_daemon.c include file.
*
- * Version: $Id: vrrp_daemon.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_daemon.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_DAEMON_H
*
* Part: Dynamic data structure definition.
*
- * Version: $Id: vrrp_data.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_data.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_DATA_H
*
* Part: vrrp_if.c include file.
*
- * Version: $Id: vrrp_if.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_if.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_IF_H
/* global includes */
#include <net/if.h>
+/* needed to get correct values for SIOC* */
+#include <linux/sockios.h>
+
/* local includes */
#include "scheduler.h"
#include "list.h"
/* types definition */
#ifndef SIOCETHTOOL
+/* should not happen, otherwise we have a broken toolchain */
+#warning "SIOCETHTOOL not defined. Defaulting to 0x8946, which is probably wrong !"
#define SIOCETHTOOL 0x8946
#endif
#ifndef SIOCGMIIPHY
+/* should not happen, otherwise we have a broken toolchain */
+#warning "SIOCGMIIPHY not defined. Defaulting to SIOCDEVPRIVATE, which is probably wrong !"
#define SIOCGMIIPHY (SIOCDEVPRIVATE) /* Get the PHY in use. */
-#define SIOCGMIIREG (SIOCDEVPRIVATE+1) /* Read a PHY register. */
-#define SIOCSMIIREG (SIOCDEVPRIVATE+2) /* Write a PHY register. */
-#define SIOCGPARAMS (SIOCDEVPRIVATE+3) /* Read operational parameters. */
-#define SIOCSPARAMS (SIOCDEVPRIVATE+4) /* Set operational parameters. */
+#define SIOCGMIIREG (SIOCGMIIPHY+1) /* Read a PHY register. */
+#endif
+
+/* ethtool.h cannot be included because old versions use kernel-only types
+ * which cannot be included from user-land. We don't need much anyway.
+ */
+#ifndef ETHTOOL_GLINK
+#define ETHTOOL_GLINK 0x0000000a
+/* for passing single values */
+struct ethtool_value {
+ uint32_t cmd;
+ uint32_t data;
+};
#endif
#define LINK_UP 1
#define LINK_DOWN 0
*
* Part: vrrp_index.c include file.
*
- * Version: $Id: vrrp_index.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_index.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_INDEX_H
*
* Part: vrrp_ipaddress.c include file.
*
- * Version: $Id: vrrp_ipaddress.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_ipaddress.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_IPADDR_H
*
* Part: vrrp_iproute.c include file.
*
- * Version: $Id: vrrp_iproute.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_iproute.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_IPROUTE_H
uint32_t dst; /* RTA_DST */
uint8_t dmask;
uint32_t gw; /* RTA_GATEWAY */
+ uint32_t gw2; /* Will use RTA_MULTIPATH */
uint32_t src; /* RTA_PREFSRC */
uint32_t metric; /* RTA_PRIORITY */
int index; /* RTA_OIF */
+ int blackhole;
int scope;
int table;
int set;
*
* Part: vrrp_ipsecah.c include file.
*
- * Version: $Id: vrrp_ipsecah.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_ipsecah.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_IPSEC_AH_H
*
* Part: vrrp_netlink.c include file.
*
- * Version: $Id: vrrp_netlink.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_netlink.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_NETLINK_H
extern int addattr32(struct nlmsghdr *n, int maxlen, int type, uint32_t data_obj);
extern int addattr_l(struct nlmsghdr *n, int maxlen, int type, void *data_obj,
int alen);
+extern int rta_addattr_l(struct rtattr *rta, int maxlen, int type,
+ const void *data, int alen);
extern char *netlink_scope_n2a(int scope);
extern int netlink_scope_a2n(char *scope);
extern int netlink_socket(struct nl_handle *nl, unsigned long groups);
*
* Part: vrrp_notify.c include file.
*
- * Version: $Id: vrrp_notify.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_notify.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_NOTIFY_H
*
* Part: vrrp_parser.c include file.
*
- * Version: $Id: vrrp_parser.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_parser.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_PARSER_H
*
* Part: vrrp_scheduler.c include file.
*
- * Version: $Id: vrrp_scheduler.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_scheduler.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_SCHEDULER_H
*
* Part: vrrp_sync.c include file.
*
- * Version: $Id: vrrp_sync.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_sync.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_SYNC_H
*
* Part: vrrp_track.c include file.
*
- * Version: $Id: vrrp_track.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_track.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VRRP_TRACK_H
/* Macro definition */
#define TRACK_ISUP(L) (vrrp_tracked_up((L)))
+#define SCRIPT_ISUP(L) (vrrp_script_up((L)))
/* VRRP script tracking defaults */
#define VRRP_SCRIPT_DI 1 /* external script track interval (in sec) */
-#define VRRP_SCRIPT_DW 2 /* external script default weight */
+#define VRRP_SCRIPT_DW 0 /* external script default weight */
/* VRRP script tracking results */
#define VRRP_SCRIPT_STATUS_DISABLED 0
#define VRRP_SCRIPT_STATUS_INIT 1
#define VRRP_SCRIPT_STATUS_NONE 2
#define VRRP_SCRIPT_STATUS_GOOD 3
+#define VRRP_SCRIPT_STATUS_INIT_GOOD 4
/* external script we call to track local processes */
typedef struct _vrrp_script {
extern int vrrp_tracked_up(list l);
extern void vrrp_log_tracked_down(list l);
extern int vrrp_tracked_weight(list l);
+extern int vrrp_script_up(list l);
extern int vrrp_script_weight(list l);
+extern vrrp_script* find_script_by_name(char *name);
#endif
--- /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
#
# Keepalived OpenSource project.
#
-# Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
+# Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
CC = @CC@
INCLUDES = -I../include -I../../lib
* master fails, a backup server takes over.
* The original implementation has been made by jerome etienne.
*
- * Version: $Id: vrrp.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
/* local include */
#include "vrrp_index.h"
#include "memory.h"
#include "list.h"
+#include "logger.h"
#include "main.h"
#include "utils.h"
#include "notify.h"
vrrp_handle_ipaddress(vrrp_rt * vrrp, int cmd, int type)
{
if (debug & 32)
- syslog(LOG_INFO, "VRRP_Instance(%s) %s protocol %s", vrrp->iname,
+ log_message(LOG_INFO, "VRRP_Instance(%s) %s protocol %s", vrrp->iname,
(cmd == IPADDRESS_ADD) ? "setting" : "removing",
(type == VRRP_VIP_TYPE) ? "VIPs." : "E-VIPs.");
netlink_iplist_ipv4((type == VRRP_VIP_TYPE) ? vrrp->vip : vrrp->evip
vrrp_handle_iproutes(vrrp_rt * vrrp, int cmd)
{
if (debug & 32)
- syslog(LOG_INFO, "VRRP_Instance(%s) %s protocol Virtual Routes",
+ log_message(LOG_INFO, "VRRP_Instance(%s) %s protocol Virtual Routes",
vrrp->iname,
(cmd == IPROUTE_ADD) ? "setting" : "removing");
netlink_rtlist_ipv4(vrrp->vroutes, cmd);
/* first verify that the SPI value is equal to src IP */
if (ah->spi != ip->saddr) {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"IPSEC AH : invalid IPSEC SPI value. %d and expect %d",
ip->saddr, ah->spi);
return 1;
if (ntohl(ah->seq_number) >= vrrp->ipsecah_counter->seq_number || vrrp->sync) {
vrrp->ipsecah_counter->seq_number = ntohl(ah->seq_number);
} else {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"VRRP_Instance(%s) IPSEC-AH : sequence number %d"
" already proceeded. Packet dropped. Local(%d)", vrrp->iname
, ntohl(ah->seq_number), vrrp->ipsecah_counter->seq_number);
memset(ah->auth_data, 0, sizeof (ah->auth_data));
/* Compute the ICV */
- hmac_md5(buffer,
+ hmac_md5((unsigned char *) buffer,
vrrp_iphdr_len(vrrp) + vrrp_ipsecah_len() + vrrp_hd_len(vrrp)
, vrrp->auth_data, sizeof (vrrp->auth_data)
, digest);
if (memcmp(backup_auth_data, digest, HMAC_MD5_TRUNC) != 0) {
- syslog(LOG_INFO, "VRRP_Instance(%s) IPSEC-AH : invalid"
+ log_message(LOG_INFO, "VRRP_Instance(%s) IPSEC-AH : invalid"
" IPSEC HMAC-MD5 value. Due to fields mutation"
" or bad password !", vrrp->iname);
return 1;
/* MUST verify that the IP TTL is 255 */
if (ip->ttl != VRRP_IP_TTL) {
- syslog(LOG_INFO, "invalid ttl. %d and expect %d", ip->ttl,
+ log_message(LOG_INFO, "invalid ttl. %d and expect %d", ip->ttl,
VRRP_IP_TTL);
return VRRP_PACKET_KO;
}
/* MUST verify the VRRP version */
if ((hd->vers_type >> 4) != VRRP_VERSION) {
- syslog(LOG_INFO, "invalid version. %d and expect %d",
+ log_message(LOG_INFO, "invalid version. %d and expect %d",
(hd->vers_type >> 4), VRRP_VERSION);
return VRRP_PACKET_KO;
}
* equal to the VRRP header
*/
if ((ntohs(ip->tot_len) - ihl) <= sizeof (vrrp_pkt)) {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"ip payload too short. %d and expect at least %d",
ntohs(ip->tot_len) - ihl, sizeof (vrrp_pkt));
return VRRP_PACKET_KO;
/* MUST verify the VRRP checksum */
if (in_csum((u_short *) hd,
sizeof(vrrp_pkt) + VRRP_AUTH_LEN + hd->naddr * sizeof(uint32_t), 0)) {
- syslog(LOG_INFO, "Invalid vrrp checksum");
+ log_message(LOG_INFO, "Invalid vrrp checksum");
return VRRP_PACKET_KO;
}
* check the authentication type
*/
if (vrrp->auth_type != hd->auth_type) {
- syslog(LOG_INFO, "receive a %d auth, expecting %d!",
+ log_message(LOG_INFO, "receive a %d auth, expecting %d!",
vrrp->auth_type, hd->auth_type);
return VRRP_PACKET_KO;
}
char *pw = (char *) ip + ntohs(ip->tot_len)
- sizeof (vrrp->auth_data);
if (memcmp(pw, vrrp->auth_data, sizeof(vrrp->auth_data)) != 0) {
- syslog(LOG_INFO, "receive an invalid passwd!");
+ log_message(LOG_INFO, "receive an invalid passwd!");
return VRRP_PACKET_KO;
}
}
/* MUST verify that the VRID is valid on the receiving interface */
if (vrrp->vrid != hd->vrid) {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"received VRID mismatch. Received %d, Expected %d",
hd->vrid, vrrp->vrid);
return VRRP_PACKET_DROP;
* VRID are valid
*/
if (hd->naddr != LIST_SIZE(vrrp->vip)) {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"receive an invalid ip number count associated with VRID!");
return VRRP_PACKET_KO;
}
for (e = LIST_HEAD(vrrp->vip); e; ELEMENT_NEXT(e)) {
ipaddress = ELEMENT_DATA(e);
if (!vrrp_in_chk_vips(vrrp, ipaddress->addr, vips)) {
- syslog(LOG_INFO, "ip address associated with VRID"
+ log_message(LOG_INFO, "ip address associated with VRID"
" not present in received packet : %d",
ipaddress->addr);
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"one or more VIP associated with"
" VRID mismatch actual MASTER advert");
return VRRP_PACKET_KO;
}
}
} else if (hd->naddr > 0) {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"receive an invalid ip number count associated with VRID!");
return VRRP_PACKET_KO;
}
* the locally configured for this virtual router
*/
if (vrrp->adver_int / TIMER_HZ != hd->adver_int) {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"advertissement interval mismatch mine=%d rcved=%d",
vrrp->adver_int, hd->adver_int);
/* to prevent concurent VRID running => multiple master in 1 VRID */
ip->tos = 0;
ip->tot_len = ip->ihl * 4 + vrrp_hd_len(vrrp);
ip->tot_len = htons(ip->tot_len);
- ip->id = ++vrrp->ip_id;
+ ip->id = htons(++vrrp->ip_id);
+ /* kernel will fill in ID if left to 0, so we overflow to 1 */
+ if (vrrp->ip_id == 65535)
+ vrrp->ip_id = 1;
ip->frag_off = 0;
ip->ttl = VRRP_IP_TTL;
-- rfc2402.3.3.3.1.1.1 & rfc2401.5
*/
digest = (unsigned char *) MALLOC(16 * sizeof (unsigned char *));
- hmac_md5(buffer, buflen, vrrp->auth_data, sizeof (vrrp->auth_data)
+ hmac_md5((unsigned char *) buffer, buflen, vrrp->auth_data, sizeof (vrrp->auth_data)
, digest);
memcpy(ah->auth_data, digest, HMAC_MD5_TRUNC);
ret = vrrp_in_chk(vrrp, buf);
if (ret == VRRP_PACKET_DROP) {
- syslog(LOG_INFO, "Sync instance needed on %s !!!",
+ log_message(LOG_INFO, "Sync instance needed on %s !!!",
IF_NAME(vrrp->ifp));
}
if (ret == VRRP_PACKET_KO)
- syslog(LOG_INFO, "bogus VRRP packet received on %s !!!",
+ log_message(LOG_INFO, "bogus VRRP packet received on %s !!!",
IF_NAME(vrrp->ifp));
return ret;
}
for (e = LIST_HEAD(vrrp->vip); e; ELEMENT_NEXT(e)) {
ipaddress = ELEMENT_DATA(e);
if (0 == j && debug & 32)
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"VRRP_Instance(%s) Sending gratuitous ARPs "
"on %s for %s",
vrrp->iname,
for (e = LIST_HEAD(vrrp->evip); e; ELEMENT_NEXT(e)) {
ipaddress = ELEMENT_DATA(e);
if (0 == j && debug & 32)
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"VRRP_Instance(%s) Sending gratuitous ARPs "
"on %s for %s",
vrrp->iname,
vrrp_send_adv(vrrp, vrrp->effective_priority);
vrrp->state = VRRP_STATE_MAST;
- syslog(LOG_INFO, "VRRP_Instance(%s) Transition to MASTER STATE",
+ log_message(LOG_INFO, "VRRP_Instance(%s) Transition to MASTER STATE",
vrrp->iname);
}
}
/* set the new vrrp state */
- switch (vrrp->wantstate) {
- case VRRP_STATE_BACK:
- syslog(LOG_INFO, "VRRP_Instance(%s) Entering BACKUP STATE",
- vrrp->iname);
- vrrp_restore_interface(vrrp, 0);
- vrrp->state = vrrp->wantstate;
- notify_instance_exec(vrrp, VRRP_STATE_BACK);
- break;
- case VRRP_STATE_GOTO_FAULT:
- syslog(LOG_INFO, "VRRP_Instance(%s) Entering FAULT STATE",
- vrrp->iname);
- vrrp_restore_interface(vrrp, 0);
- vrrp->state = VRRP_STATE_FAULT;
- notify_instance_exec(vrrp, VRRP_STATE_FAULT);
- break;
- }
+ log_message(LOG_INFO, "VRRP_Instance(%s) Entering BACKUP STATE",
+ vrrp->iname);
+ vrrp_restore_interface(vrrp, 0);
+ vrrp->state = vrrp->wantstate;
+ notify_instance_exec(vrrp, VRRP_STATE_BACK);
/* Set the down timer */
vrrp->ms_down_timer = 3 * vrrp->adver_int + VRRP_TIMER_SKEW(vrrp);
ret = vrrp_check_packet(vrrp, buf, buflen);
if (ret == VRRP_PACKET_KO || ret == VRRP_PACKET_NULL) {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"VRRP_Instance(%s) ignoring received advertisment...",
vrrp->iname);
vrrp->ms_down_timer =
vrrp->ms_down_timer =
3 * vrrp->adver_int + VRRP_TIMER_SKEW(vrrp);
} else if (hd->priority < vrrp->effective_priority) {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"VRRP_Instance(%s) forcing a new MASTER election",
vrrp->iname);
vrrp->wantstate = VRRP_STATE_GOTO_MASTER;
int ret = 0;
if (!VRRP_VIP_ISSET(vrrp)) {
- syslog(LOG_INFO, "VRRP_Instance(%s) Entering MASTER STATE",
+ log_message(LOG_INFO, "VRRP_Instance(%s) Entering MASTER STATE",
vrrp->iname);
vrrp_state_become_master(vrrp);
ret = 1;
ipsec_ah *ah;
/* return on link failure */
- if (vrrp->wantstate == VRRP_STATE_GOTO_FAULT) {
+ if (vrrp->wantstate == VRRP_STATE_FAULT) {
vrrp->ms_down_timer =
3 * vrrp->adver_int + VRRP_TIMER_SKEW(vrrp);
vrrp->state = VRRP_STATE_FAULT;
if (ret == VRRP_PACKET_KO ||
ret == VRRP_PACKET_NULL || ret == VRRP_PACKET_DROP) {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"VRRP_Instance(%s) Dropping received VRRP packet...",
vrrp->iname);
return 0;
} else if (hd->priority < vrrp->effective_priority) {
/* We receive a lower prio adv we just refresh remote ARP cache */
- syslog(LOG_INFO, "VRRP_Instance(%s) Received lower prio advert"
+ log_message(LOG_INFO, "VRRP_Instance(%s) Received lower prio advert"
", forcing new election", vrrp->iname);
if (iph->protocol == IPPROTO_IPSEC_AH) {
ah = (ipsec_ah *) (buf + sizeof(struct iphdr));
- syslog(LOG_INFO, "VRRP_Instance(%s) IPSEC-AH : Syncing seq_num"
+ log_message(LOG_INFO, "VRRP_Instance(%s) IPSEC-AH : Syncing seq_num"
" - Increment seq"
, vrrp->iname);
vrrp->ipsecah_counter->seq_number = ntohl(ah->seq_number) + 1;
} else if (hd->priority > vrrp->effective_priority ||
(hd->priority == vrrp->effective_priority &&
ntohl(iph->saddr) > VRRP_PKT_SADDR(vrrp))) {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"VRRP_Instance(%s) Received higher prio advert",
vrrp->iname);
if (iph->protocol == IPPROTO_IPSEC_AH) {
ah = (ipsec_ah *) (buf + sizeof(struct iphdr));
- syslog(LOG_INFO, "VRRP_Instance(%s) IPSEC-AH : Syncing seq_num"
+ log_message(LOG_INFO, "VRRP_Instance(%s) IPSEC-AH : Syncing seq_num"
" - Decrement seq"
, vrrp->iname);
vrrp->ipsecah_counter->seq_number = ntohl(ah->seq_number) - 1;
if (ret == VRRP_PACKET_KO ||
ret == VRRP_PACKET_NULL || ret == VRRP_PACKET_DROP) {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"VRRP_Instance(%s) Dropping received VRRP packet...",
vrrp->iname);
return 0;
chk_min_cfg(vrrp_rt * vrrp)
{
if (vrrp->vrid == 0) {
- syslog(LOG_INFO, "VRRP_Instance(%s) the virtual id must be set!",
+ log_message(LOG_INFO, "VRRP_Instance(%s) the virtual id must be set!",
vrrp->iname);
return 0;
}
if (!vrrp->ifp) {
- syslog(LOG_INFO, "VRRP_Instance(%s) Unknown interface !",
+ log_message(LOG_INFO, "VRRP_Instance(%s) Unknown interface !",
vrrp->iname);
return 0;
}
fd = socket(AF_INET, SOCK_RAW, proto);
if (fd < 0) {
int err = errno;
- syslog(LOG_INFO, "cant open raw socket. errno=%d",
+ log_message(LOG_INFO, "cant open raw socket. errno=%d",
err);
return -1;
}
fd = socket(AF_INET, SOCK_RAW, proto);
if (fd < 0) {
int err = errno;
- syslog(LOG_INFO, "cant open raw socket. errno=%d",
+ log_message(LOG_INFO, "cant open raw socket. errno=%d",
err);
return -1;
}
clear_diff_routes(old_vrrp->vroutes, vrrp->vroutes);
}
+/* Keep the state from before reload */
+static void
+reset_vrrp_state(vrrp_rt * old_vrrp)
+{
+ /* Keep VRRP state, ipsec AH seq_number */
+ vrrp_rt *vrrp = vrrp_exist(old_vrrp);
+ vrrp->state = old_vrrp->state;
+ vrrp->init_state = old_vrrp->state;
+ vrrp->wantstate = old_vrrp->state;
+ memcpy(vrrp->ipsecah_counter, old_vrrp->ipsecah_counter, sizeof(seq_counter));
+
+#ifdef _HAVE_IPVS_SYNCD_
+ if (old_vrrp->lvs_syncd_if)
+ ipvs_syncd_cmd(IPVS_STOPDAEMON, NULL,
+ (old_vrrp->state == VRRP_STATE_MAST) ? IPVS_MASTER:
+ IPVS_BACKUP,
+ old_vrrp->vrid);
+ if (vrrp->lvs_syncd_if)
+ ipvs_syncd_cmd(IPVS_STARTDAEMON, NULL,
+ (vrrp->state == VRRP_STATE_MAST) ? IPVS_MASTER:
+ IPVS_BACKUP,
+ vrrp->vrid);
+#endif
+
+ /* Remember if we had vips up and add new ones if needed */
+ vrrp->vipset = old_vrrp->vipset;
+ if (vrrp->vipset) {
+ if (!LIST_ISEMPTY(vrrp->vip))
+ vrrp_handle_ipaddress(vrrp, IPADDRESS_ADD, VRRP_VIP_TYPE);
+ if (!LIST_ISEMPTY(vrrp->evip))
+ vrrp_handle_ipaddress(vrrp, IPADDRESS_ADD, VRRP_EVIP_TYPE);
+ if (!LIST_ISEMPTY(vrrp->vroutes))
+ vrrp_handle_iproutes(vrrp, IPROUTE_ADD);
+ }
+}
+
/* Diff when reloading configuration */
void
clear_diff_vrrp(void)
/* virtual routes diff */
clear_diff_vrrp_vroutes(vrrp);
+
+ /* reset the state */
+ reset_vrrp_state(vrrp);
+ }
+ }
+}
+
+/* Set script status to a sensible value on reload */
+void
+clear_diff_script(void)
+{
+ element e;
+ list l = old_vrrp_data->vrrp_script;
+ vrrp_script *vscript, *nvscript;
+
+ if (LIST_ISEMPTY(l))
+ return;
+
+ for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
+ vscript = ELEMENT_DATA(e);
+ if (vscript->result == VRRP_SCRIPT_STATUS_GOOD) {
+ nvscript = find_script_by_name(vscript->sname);
+ if (nvscript) {
+ log_message(LOG_INFO, "VRRP_Script(%s) considered successful on reload",
+ nvscript->sname);
+ nvscript->result = VRRP_SCRIPT_STATUS_INIT_GOOD;
+ break;
+ }
}
}
}
*
* Part: ARP primitives.
*
- * Version: $Id: vrrp_arp.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_arp.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
/* local includes */
#include "vrrp_arp.h"
+#include "logger.h"
#include "memory.h"
#include "utils.h"
garp_fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_RARP));
if (garp_fd > 0)
- syslog(LOG_INFO, "Registering gratutious ARP shared channel");
+ log_message(LOG_INFO, "Registering gratutious ARP shared channel");
else
- syslog(LOG_INFO, "Error while registering gratutious ARP shared channel");
+ log_message(LOG_INFO, "Error while registering gratutious ARP shared channel");
}
void gratuitous_arp_close(void)
{
len = sendto(garp_fd, garp_buffer, sizeof(m_arphdr) + ETHER_HDR_LEN
, 0, (struct sockaddr *)&sll, sizeof(sll));
if (len < 0)
- syslog(LOG_INFO, "Error sending gratutious ARP on %s for %s"
+ log_message(LOG_INFO, "Error sending gratutious ARP on %s for %s"
, IF_NAME(ipaddress->ifp), inet_ntop2(ipaddress->addr));
return len;
}
{
struct ether_header *eth = (struct ether_header *) garp_buffer;
m_arphdr *arph = (m_arphdr *) (garp_buffer + ETHER_HDR_LEN);
- char *hwaddr = IF_HWADDR(ipaddress->ifp);
+ char *hwaddr = (char *) IF_HWADDR(ipaddress->ifp);
int len;
/* Ethernet header */
arph->ar_op = htons(ARPOP_REQUEST);
memcpy(arph->__ar_sha, hwaddr, ETH_ALEN);
memcpy(arph->__ar_sip, &ipaddress->addr, sizeof (ipaddress->addr));
+ memset(arph->__ar_tha, 0xFF, ETH_ALEN);
memcpy(arph->__ar_tip, &ipaddress->addr, sizeof (ipaddress->addr));
/* Send the ARP message */
*
* Part: VRRP child process handling.
*
- * Version: $Id: vrrp_daemon.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_daemon.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "vrrp_daemon.h"
#include "global_data.h"
#include "pidfile.h"
#include "daemon.h"
+#include "logger.h"
#include "signals.h"
#ifdef _WITH_LVS_
#include "ipvswrapper.h"
#include "memory.h"
#include "parser.h"
+extern char *vrrp_pidfile;
+
/* Daemon stop sequence */
static void
stop_vrrp(void)
{
/* Destroy master thread */
+ signal_handler_destroy();
thread_destroy_master(master);
/* Clear static entries */
gratuitous_arp_close();
/* Stop daemon */
- pidfile_rm(VRRP_PID_FILE);
+ pidfile_rm(vrrp_pidfile);
/* Clean data */
free_global_data(data);
clear_diff_saddresses();
clear_diff_sroutes();
clear_diff_vrrp();
+ clear_diff_script();
}
/* Complete VRRP initialization */
}
/* Post initializations */
- syslog(LOG_INFO, "Configuration is using : %lu Bytes", mem_allocated);
+ log_message(LOG_INFO, "Configuration is using : %lu Bytes", mem_allocated);
/* Set static entries */
netlink_iplist_ipv4(vrrp_data->static_addresses, IPADDRESS_ADD);
/* Reload handler */
void
-sighup_vrrp(int sig)
+sighup_vrrp(void *v, int sig)
{
- syslog(LOG_INFO, "Reloading VRRP child process(%d) on signal",
+ log_message(LOG_INFO, "Reloading VRRP child process(%d) on signal",
vrrp_child);
thread_add_event(master, reload_vrrp_thread, NULL, 0);
}
/* Terminate handler */
void
-sigend_vrrp(int sig)
+sigend_vrrp(void *v, int sig)
{
- syslog(LOG_INFO, "Terminating VRRP child process on signal");
+ log_message(LOG_INFO, "Terminating VRRP child process on signal");
if (master)
thread_add_terminate_event(master);
}
vrrp_signal_init(void)
{
signal_handler_init();
- signal_set(SIGHUP, sighup_vrrp);
- signal_set(SIGINT, sigend_vrrp);
- signal_set(SIGTERM, sigend_vrrp);
+ signal_set(SIGHUP, sighup_vrrp, NULL);
+ signal_set(SIGINT, sigend_vrrp, NULL);
+ signal_set(SIGTERM, sigend_vrrp, NULL);
signal_ignore(SIGPIPE);
- signal_noignore_sigchld();
}
/* VRRP Child respawning thread */
}
/* We catch a SIGCHLD, handle it */
- syslog(LOG_INFO, "VRRP child process(%d) died: Respawning", pid);
+ log_message(LOG_INFO, "VRRP child process(%d) died: Respawning", pid);
start_vrrp_child();
return 0;
}
/* Dont start if pid is already running */
if (vrrp_running()) {
- syslog(LOG_INFO, "VRRP child process already running");
+ log_message(LOG_INFO, "VRRP child process already running");
return -1;
}
pid = fork();
if (pid < 0) {
- syslog(LOG_INFO, "VRRP child process: fork error(%s)"
+ log_message(LOG_INFO, "VRRP child process: fork error(%s)"
, strerror(errno));
return -1;
} else if (pid) {
vrrp_child = pid;
- syslog(LOG_INFO, "Starting VRRP child process, pid=%d"
+ log_message(LOG_INFO, "Starting VRRP child process, pid=%d"
, pid);
/* Start respawning thread */
(log_facility==LOG_DAEMON) ? LOG_LOCAL1 : log_facility);
/* Child process part, write pidfile */
- if (!pidfile_write(VRRP_PID_FILE, getpid())) {
+ if (!pidfile_write(vrrp_pidfile, getpid())) {
/* Fatal error */
- syslog(LOG_INFO, "VRRP child process: cannot write pidfile");
+ log_message(LOG_INFO, "VRRP child process: cannot write pidfile");
exit(0);
}
/* Create the new master thread */
+ signal_handler_destroy();
thread_destroy_master(master);
master = thread_make_master();
*
* Part: Dynamic data structure definition.
*
- * Version: $Id: vrrp_data.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_data.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "vrrp_data.h"
#include "vrrp.h"
#include "memory.h"
#include "utils.h"
+#include "logger.h"
/* global vars */
vrrp_conf_data *vrrp_data = NULL;
int i;
char *str;
- syslog(LOG_INFO, " VRRP Sync Group = %s, %s", vgroup->gname,
+ log_message(LOG_INFO, " VRRP Sync Group = %s, %s", vgroup->gname,
(vgroup->state == VRRP_STATE_MAST) ? "MASTER" : "BACKUP");
for (i = 0; i < VECTOR_SIZE(vgroup->iname); i++) {
str = VECTOR_SLOT(vgroup->iname, i);
- syslog(LOG_INFO, " monitor = %s", str);
+ log_message(LOG_INFO, " monitor = %s", str);
}
if (vgroup->script_backup)
- syslog(LOG_INFO, " Backup state transition script = %s",
+ log_message(LOG_INFO, " Backup state transition script = %s",
vgroup->script_backup);
if (vgroup->script_master)
- syslog(LOG_INFO, " Master state transition script = %s",
+ log_message(LOG_INFO, " Master state transition script = %s",
vgroup->script_master);
if (vgroup->script_fault)
- syslog(LOG_INFO, " Fault state transition script = %s",
+ log_message(LOG_INFO, " Fault state transition script = %s",
vgroup->script_fault);
if (vgroup->script)
- syslog(LOG_INFO, " Generic state transition script = '%s'",
+ log_message(LOG_INFO, " Generic state transition script = '%s'",
vgroup->script);
if (vgroup->smtp_alert)
- syslog(LOG_INFO, " Using smtp notification");
+ log_message(LOG_INFO, " Using smtp notification");
}
static void
vrrp_script *vscript = data;
char *str;
- syslog(LOG_INFO, " VRRP Script = %s", vscript->sname);
- syslog(LOG_INFO, " Command = %s", vscript->script);
- syslog(LOG_INFO, " Interval = %d sec", vscript->interval / TIMER_HZ);
- syslog(LOG_INFO, " Weight = %d", vscript->weight);
+ log_message(LOG_INFO, " VRRP Script = %s", vscript->sname);
+ log_message(LOG_INFO, " Command = %s", vscript->script);
+ log_message(LOG_INFO, " Interval = %d sec", vscript->interval / TIMER_HZ);
+ log_message(LOG_INFO, " Weight = %d", vscript->weight);
switch (vscript->result) {
case VRRP_SCRIPT_STATUS_INIT:
str = "BAD"; break;
case VRRP_SCRIPT_STATUS_GOOD:
str = "GOOD"; break;
+ case VRRP_SCRIPT_STATUS_INIT_GOOD:
+ str = "INIT/GOOD"; break;
case VRRP_SCRIPT_STATUS_DISABLED:
default:
str = "DISABLED"; break;
}
- syslog(LOG_INFO, " Status = %s", str);
+ log_message(LOG_INFO, " Status = %s", str);
}
/* Socket pool functions */
dump_sock(void *sock_data_obj)
{
sock *sock_obj = sock_data_obj;
- syslog(LOG_INFO, "VRRP sockpool: [ifindex(%d), proto(%d), fd(%d,%d)]",
+ log_message(LOG_INFO, "VRRP sockpool: [ifindex(%d), proto(%d), fd(%d,%d)]",
sock_obj->ifindex
, sock_obj->proto
, sock_obj->fd_in
{
vrrp_rt *vrrp = data;
- syslog(LOG_INFO, " VRRP Instance = %s", vrrp->iname);
+ log_message(LOG_INFO, " VRRP Instance = %s", vrrp->iname);
if (vrrp->init_state == VRRP_STATE_BACK)
- syslog(LOG_INFO, " Want State = BACKUP");
+ log_message(LOG_INFO, " Want State = BACKUP");
else
- syslog(LOG_INFO, " Want State = MASTER");
- syslog(LOG_INFO, " Runing on device = %s", IF_NAME(vrrp->ifp));
+ log_message(LOG_INFO, " Want State = MASTER");
+ log_message(LOG_INFO, " Runing on device = %s", IF_NAME(vrrp->ifp));
if (vrrp->dont_track_primary)
- syslog(LOG_INFO, " VRRP interface tracking disabled");
+ log_message(LOG_INFO, " VRRP interface tracking disabled");
if (vrrp->mcast_saddr)
- syslog(LOG_INFO, " Using mcast src_ip = %s",
+ log_message(LOG_INFO, " Using mcast src_ip = %s",
inet_ntop2(vrrp->mcast_saddr));
if (vrrp->lvs_syncd_if)
- syslog(LOG_INFO, " Runing LVS sync daemon on interface = %s",
+ log_message(LOG_INFO, " Runing LVS sync daemon on interface = %s",
vrrp->lvs_syncd_if);
if (vrrp->garp_delay)
- syslog(LOG_INFO, " Gratuitous ARP delay = %d",
+ log_message(LOG_INFO, " Gratuitous ARP delay = %d",
vrrp->garp_delay/TIMER_HZ);
- syslog(LOG_INFO, " Virtual Router ID = %d", vrrp->vrid);
- syslog(LOG_INFO, " Priority = %d", vrrp->base_priority);
- syslog(LOG_INFO, " Advert interval = %dsec",
+ log_message(LOG_INFO, " Virtual Router ID = %d", vrrp->vrid);
+ log_message(LOG_INFO, " Priority = %d", vrrp->base_priority);
+ log_message(LOG_INFO, " Advert interval = %dsec",
vrrp->adver_int / TIMER_HZ);
if (vrrp->nopreempt)
- syslog(LOG_INFO, " Preempt disabled");
+ log_message(LOG_INFO, " Preempt disabled");
if (vrrp->preempt_delay)
- syslog(LOG_INFO, " Preempt delay = %ld secs",
+ log_message(LOG_INFO, " Preempt delay = %ld secs",
vrrp->preempt_delay / TIMER_HZ);
if (vrrp->auth_type) {
- syslog(LOG_INFO, " Authentication type = %s",
+ log_message(LOG_INFO, " Authentication type = %s",
(vrrp->auth_type ==
VRRP_AUTH_AH) ? "IPSEC_AH" : "SIMPLE_PASSWORD");
- syslog(LOG_INFO, " Password = %s", vrrp->auth_data);
+ log_message(LOG_INFO, " Password = %s", vrrp->auth_data);
}
if (!LIST_ISEMPTY(vrrp->track_ifp)) {
- syslog(LOG_INFO, " Tracked interfaces = %d", LIST_SIZE(vrrp->track_ifp));
+ log_message(LOG_INFO, " Tracked interfaces = %d", LIST_SIZE(vrrp->track_ifp));
dump_list(vrrp->track_ifp);
}
if (!LIST_ISEMPTY(vrrp->track_script)) {
- syslog(LOG_INFO, " Tracked scripts = %d",
+ log_message(LOG_INFO, " Tracked scripts = %d",
LIST_SIZE(vrrp->track_script));
dump_list(vrrp->track_script);
}
if (!LIST_ISEMPTY(vrrp->vip)) {
- syslog(LOG_INFO, " Virtual IP = %d", LIST_SIZE(vrrp->vip));
+ log_message(LOG_INFO, " Virtual IP = %d", LIST_SIZE(vrrp->vip));
dump_list(vrrp->vip);
}
if (!LIST_ISEMPTY(vrrp->evip)) {
- syslog(LOG_INFO, " Virtual IP Excluded = %d", LIST_SIZE(vrrp->evip));
+ log_message(LOG_INFO, " Virtual IP Excluded = %d", LIST_SIZE(vrrp->evip));
dump_list(vrrp->evip);
}
if (!LIST_ISEMPTY(vrrp->vroutes)) {
- syslog(LOG_INFO, " Virtual Routes = %d", LIST_SIZE(vrrp->vroutes));
+ log_message(LOG_INFO, " Virtual Routes = %d", LIST_SIZE(vrrp->vroutes));
dump_list(vrrp->vroutes);
}
if (vrrp->script_backup)
- syslog(LOG_INFO, " Backup state transition script = %s",
+ log_message(LOG_INFO, " Backup state transition script = %s",
vrrp->script_backup);
if (vrrp->script_master)
- syslog(LOG_INFO, " Master state transition script = %s",
+ log_message(LOG_INFO, " Master state transition script = %s",
vrrp->script_master);
if (vrrp->script_fault)
- syslog(LOG_INFO, " Fault state transition script = %s",
+ log_message(LOG_INFO, " Fault state transition script = %s",
vrrp->script_fault);
if (vrrp->script_stop)
- syslog(LOG_INFO, " Stop state transition script = %s",
+ log_message(LOG_INFO, " Stop state transition script = %s",
vrrp->script_stop);
if (vrrp->script)
- syslog(LOG_INFO, " Generic state transition script = '%s'",
+ log_message(LOG_INFO, " Generic state transition script = '%s'",
vrrp->script);
if (vrrp->smtp_alert)
- syslog(LOG_INFO, " Using smtp notification");
+ log_message(LOG_INFO, " Using smtp notification");
}
void
alloc_vrrp_vip(vector strvec)
{
vrrp_rt *vrrp = LIST_TAIL_DATA(vrrp_data->vrrp);
+ if (vrrp->ifp == NULL) {
+ log_message(LOG_ERR, "Configuration error: VRRP definition must belong to an interface");
+ }
if (LIST_ISEMPTY(vrrp->vip))
vrrp->vip = alloc_list(free_ipaddress, dump_ipaddress);
new = (vrrp_conf_data *) MALLOC(sizeof (vrrp_conf_data));
new->vrrp = alloc_list(free_vrrp, dump_vrrp);
- new->vrrp_index = alloc_mlist(NULL, NULL, 255);
+ new->vrrp_index = alloc_mlist(NULL, NULL, 255+1);
new->vrrp_index_fd = alloc_mlist(NULL, NULL, 1024+1);
new->vrrp_sync_group = alloc_list(free_vgroup, dump_vgroup);
new->vrrp_script = alloc_list(free_vscript, dump_vscript);
{
free_list(vrrp_data_obj->static_addresses);
free_list(vrrp_data_obj->static_routes);
- free_mlist(vrrp_data_obj->vrrp_index, 255);
+ free_mlist(vrrp_data_obj->vrrp_index, 255+1);
free_mlist(vrrp_data_obj->vrrp_index_fd, 1024+1);
free_list(vrrp_data_obj->vrrp);
free_list(vrrp_data_obj->vrrp_sync_group);
dump_vrrp_data(vrrp_conf_data * vrrp_data_obj)
{
if (!LIST_ISEMPTY(vrrp_data_obj->static_addresses)) {
- syslog(LOG_INFO, "------< Static Addresses >------");
+ log_message(LOG_INFO, "------< Static Addresses >------");
dump_list(vrrp_data_obj->static_addresses);
}
if (!LIST_ISEMPTY(vrrp_data_obj->static_routes)) {
- syslog(LOG_INFO, "------< Static Routes >------");
+ log_message(LOG_INFO, "------< Static Routes >------");
dump_list(vrrp_data_obj->static_routes);
}
if (!LIST_ISEMPTY(vrrp_data_obj->vrrp)) {
- syslog(LOG_INFO, "------< VRRP Topology >------");
+ log_message(LOG_INFO, "------< VRRP Topology >------");
dump_list(vrrp_data_obj->vrrp);
}
if (!LIST_ISEMPTY(vrrp_data_obj->vrrp_sync_group)) {
- syslog(LOG_INFO, "------< VRRP Sync groups >------");
+ log_message(LOG_INFO, "------< VRRP Sync groups >------");
dump_list(vrrp_data_obj->vrrp_sync_group);
}
if (!LIST_ISEMPTY(vrrp_data_obj->vrrp_script)) {
- syslog(LOG_INFO, "------< VRRP Scripts >------");
+ log_message(LOG_INFO, "------< VRRP Scripts >------");
dump_list(vrrp_data_obj->vrrp_script);
}
}
*
* Part: Interfaces manipulation.
*
- * Version: $Id: vrrp_if.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_if.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
/* global include */
#include "vrrp_netlink.h"
#include "memory.h"
#include "utils.h"
+#include "logger.h"
/* Global vars */
static list if_queue;
interface *ifp;
element e;
- if (LIST_ISEMPTY(if_queue))
+ if (LIST_ISEMPTY(if_queue)) {
+ log_message(LOG_ERR, "Interface queue is empty");
return NULL;
+ }
for (e = LIST_HEAD(if_queue); e; ELEMENT_NEXT(e)) {
ifp = ELEMENT_DATA(e);
if (!strcmp(ifp->ifname, ifname))
return ifp;
}
+ log_message(LOG_ERR, "No such interface, %s", ifname);
return NULL;
}
data[1] = location;
if (ioctl(fd, SIOCGMIIREG, &ifr) < 0) {
- syslog(LOG_ERR, "SIOCGMIIREG on %s failed: %s", ifr.ifr_name,
+ log_message(LOG_ERR, "SIOCGMIIREG on %s failed: %s", ifr.ifr_name,
strerror(errno));
return -1;
}
// if_mii_dump(mii_regs, phy_id);
if (mii_regs[0] == 0xffff) {
- syslog(LOG_ERR, "No MII transceiver present for %s !!!",
+ log_message(LOG_ERR, "No MII transceiver present for %s !!!",
ifr.ifr_name);
return -1;
}
{
interface *ifp = if_data_obj;
- syslog(LOG_INFO, "------< NIC >------");
- syslog(LOG_INFO, " Name = %s", ifp->ifname);
- syslog(LOG_INFO, " index = %d", ifp->ifindex);
- syslog(LOG_INFO, " address = %s", inet_ntop2(ifp->address));
+ log_message(LOG_INFO, "------< NIC >------");
+ log_message(LOG_INFO, " Name = %s", ifp->ifname);
+ log_message(LOG_INFO, " index = %d", ifp->ifindex);
+ log_message(LOG_INFO, " address = %s", inet_ntop2(ifp->address));
/* FIXME: Harcoded for ethernet */
if (ifp->hw_type == ARPHRD_ETHER)
- syslog(LOG_INFO, " MAC = %.2x:%.2x:%.2x:%.2x:%.2x:%.2x",
+ log_message(LOG_INFO, " MAC = %.2x:%.2x:%.2x:%.2x:%.2x:%.2x",
ifp->hw_addr[0], ifp->hw_addr[1], ifp->hw_addr[2]
, ifp->hw_addr[3], ifp->hw_addr[4], ifp->hw_addr[5]);
if (ifp->flags & IFF_UP)
- syslog(LOG_INFO, " is UP");
+ log_message(LOG_INFO, " is UP");
if (ifp->flags & IFF_RUNNING)
- syslog(LOG_INFO, " is RUNNING");
+ log_message(LOG_INFO, " is RUNNING");
if (!(ifp->flags & IFF_UP) && !(ifp->flags & IFF_RUNNING))
- syslog(LOG_INFO, " is DOWN");
+ log_message(LOG_INFO, " is DOWN");
- syslog(LOG_INFO, " MTU = %d", ifp->mtu);
+ log_message(LOG_INFO, " MTU = %d", ifp->mtu);
switch (ifp->hw_type) {
case ARPHRD_LOOPBACK:
- syslog(LOG_INFO, " HW Type = LOOPBACK");
+ log_message(LOG_INFO, " HW Type = LOOPBACK");
break;
case ARPHRD_ETHER:
- syslog(LOG_INFO, " HW Type = ETHERNET");
+ log_message(LOG_INFO, " HW Type = ETHERNET");
break;
default:
- syslog(LOG_INFO, " HW Type = UNKNOWN");
+ log_message(LOG_INFO, " HW Type = UNKNOWN");
break;
}
/* MII channel supported ? */
if (IF_MII_SUPPORTED(ifp))
- syslog(LOG_INFO, " NIC support MII regs");
+ log_message(LOG_INFO, " NIC support MII regs");
else if (IF_ETHTOOL_SUPPORTED(ifp))
- syslog(LOG_INFO, " NIC support EHTTOOL GLINK interface");
+ log_message(LOG_INFO, " NIC support EHTTOOL GLINK interface");
else
- syslog(LOG_INFO, " Enabling NIC ioctl refresh polling");
+ log_message(LOG_INFO, " Enabling NIC ioctl refresh polling");
}
static void
// dump_list(if_queue);
netlink_interface_lookup();
#ifdef _WITH_LINKWATCH_
- syslog(LOG_INFO, "Using LinkWatch kernel netlink reflector...");
+ log_message(LOG_INFO, "Using LinkWatch kernel netlink reflector...");
#else
- syslog(LOG_INFO, "Using MII-BMSR NIC polling thread...");
- init_if_linkbeat();
+ log_message(LOG_INFO, "Using MII-BMSR NIC polling thread...");
+ init_if_linkbeat();
#endif
}
ret = setsockopt(sd, IPPROTO_IP, IP_ADD_MEMBERSHIP,
(char *) &req_add, sizeof (struct ip_mreqn));
if (ret < 0) {
- syslog(LOG_INFO, "cant do IP_ADD_MEMBERSHIP errno=%s (%d)",
+ log_message(LOG_INFO, "cant do IP_ADD_MEMBERSHIP errno=%s (%d)",
strerror(errno), errno);
close(sd);
return -1;
ret = setsockopt(sd, IPPROTO_IP, IP_DROP_MEMBERSHIP,
(char *) &req_add, sizeof (struct ip_mreqn));
if (ret < 0) {
- syslog(LOG_INFO, "cant do IP_DROP_MEMBERSHIP errno=%s (%d)",
+ log_message(LOG_INFO, "cant do IP_DROP_MEMBERSHIP errno=%s (%d)",
strerror(errno), errno);
return;
}
, strlen(IF_NAME(ifp)) + 1);
if (ret < 0) {
int err = errno;
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"cant bind to device %s. errno=%d. (try to run it as root)",
IF_NAME(ifp), err);
close(sd);
ret = setsockopt(sd, IPPROTO_IP, IP_HDRINCL, &on, sizeof(on));
if (ret < 0) {
int err = errno;
- syslog(LOG_INFO, "cant set HDRINCL IP option. errno=%d.", err);
+ log_message(LOG_INFO, "cant set HDRINCL IP option. errno=%d.", err);
close(sd);
return -1;
}
ret = setsockopt(sd, IPPROTO_IP, IP_MULTICAST_LOOP, &loop, sizeof(loop));
if (ret < 0) {
int err = errno;
- syslog(LOG_INFO, "cant set MULTICAST_LOOP IP option. errno=%d.", err);
+ log_message(LOG_INFO, "cant set MULTICAST_LOOP IP option. errno=%d.", err);
close(sd);
return -1;
}
*
* Part: VRRP instance index table.
*
- * Version: $Id: vrrp_index.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_index.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
/* local include */
*
* Part: NETLINK IPv4 address manipulation.
*
- * Version: $Id: vrrp_ipaddress.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_ipaddress.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
/* local include */
#include "vrrp_ipaddress.h"
#include "vrrp_netlink.h"
#include "vrrp_data.h"
+#include "logger.h"
#include "memory.h"
#include "utils.h"
dump_ipaddress(void *if_data_obj)
{
ip_address *ip_addr = if_data_obj;
- syslog(LOG_INFO, " %s/%d brd %s dev %s scope %s%s%s"
+ log_message(LOG_INFO, " %s/%d brd %s dev %s scope %s%s%s"
, inet_ntop2(ip_addr->addr)
, ip_addr->mask
, inet_ntop2(ip_addr->broadcast)
if (!strcmp(str, "dev")) {
new->ifp = if_get_by_ifname(VECTOR_SLOT(strvec, ++i));
if (!new->ifp) {
- syslog(LOG_INFO, "VRRP is trying to assign VIP to unknown %s"
+ log_message(LOG_INFO, "VRRP is trying to assign VIP to unknown %s"
" interface !!! go out and fixe your conf !!!",
(char *)VECTOR_SLOT(strvec, i));
FREE(new);
/* All addresses removed */
if (LIST_ISEMPTY(n)) {
- syslog(LOG_INFO, "Removing a VIP|E-VIP block");
+ log_message(LOG_INFO, "Removing a VIP|E-VIP block");
netlink_iplist_ipv4(l, IPADDRESS_DEL);
return;
}
for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
ipaddress = ELEMENT_DATA(e);
if (!address_exist(n, ipaddress) && ipaddress->set) {
- syslog(LOG_INFO, "ip address %s/%d dev %s, no longer exist"
+ log_message(LOG_INFO, "ip address %s/%d dev %s, no longer exist"
, inet_ntop2(ipaddress->addr)
, ipaddress->mask
, IF_NAME(if_get_by_ifindex(ipaddress->ifindex)));
*
* Part: NETLINK IPv4 routes manipulation.
*
- * Version: $Id: vrrp_iproute.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_iproute.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
/* local include */
#include "vrrp_netlink.h"
#include "vrrp_if.h"
#include "vrrp_data.h"
+#include "logger.h"
#include "memory.h"
#include "utils.h"
char buf[1024];
} req;
+ char buf[1024];
+ struct rtattr *rta = (void*)buf;
+ struct rtnexthop *rtnh;
+
memset(&req, 0, sizeof (req));
req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct rtmsg));
req.r.rtm_scope = iproute->scope;
req.r.rtm_type = RTN_UNICAST;
}
+ if (iproute->blackhole)
+ req.r.rtm_type = RTN_BLACKHOLE;
/* Set routing entry */
req.r.rtm_dst_len = iproute->dmask;
addattr_l(&req.n, sizeof(req), RTA_DST, &iproute->dst, 4);
- addattr_l(&req.n, sizeof(req), RTA_GATEWAY, &iproute->gw, 4);
- if (iproute->index)
+ if ((!iproute->blackhole) && (!iproute->gw2))
+ addattr_l(&req.n, sizeof(req), RTA_GATEWAY, &iproute->gw, 4);
+ if (iproute->gw2) {
+ rta->rta_type = RTA_MULTIPATH;
+ rta->rta_len = RTA_LENGTH(0);
+ rtnh = RTA_DATA(rta);
+#define MULTIPATH_ADD_GW(x) \
+ memset(rtnh, 0, sizeof(*rtnh)); \
+ rtnh->rtnh_len = sizeof(*rtnh); \
+ if (iproute->index) rtnh->rtnh_ifindex = iproute->index; \
+ rta->rta_len += rtnh->rtnh_len; \
+ rta_addattr_l(rta, 1024, RTA_GATEWAY, x, 4); \
+ rtnh->rtnh_len += sizeof(struct rtattr) + 4; \
+ rtnh = RTNH_NEXT(rtnh);
+ MULTIPATH_ADD_GW(&iproute->gw);
+ MULTIPATH_ADD_GW(&iproute->gw2);
+ addattr_l(&req.n, sizeof(req), RTA_MULTIPATH, RTA_DATA(rta), RTA_PAYLOAD(rta));
+ }
+ if ((iproute->index) && (!iproute->gw2))
addattr32(&req.n, sizeof(req), RTA_OIF, iproute->index);
if (iproute->src)
addattr_l(&req.n, sizeof(req), RTA_PREFSRC, &iproute->src, 4);
char *log_msg = MALLOC(150);
char *tmp = MALLOC(30);
+ if (route->blackhole) {
+ strncat(log_msg, "blackhole ", 30);
+ }
if (route->dst) {
snprintf(tmp, 30, "%s/%d", inet_ntop2(route->dst), route->dmask);
strncat(log_msg, tmp, 30);
snprintf(tmp, 30, " gw %s", inet_ntop2(route->gw));
strncat(log_msg, tmp, 30);
}
+ if (route->gw2) {
+ snprintf(tmp, 30, " or gw %s", inet_ntop2(route->gw2));
+ strncat(log_msg, tmp, 30);
+ }
if (route->src) {
snprintf(tmp, 30, " src %s", inet_ntop2(route->src));
strncat(log_msg, tmp, 30);
strncat(log_msg, tmp, 30);
}
- syslog(LOG_INFO, " %s", log_msg);
+ log_message(LOG_INFO, " %s", log_msg);
FREE(tmp);
FREE(log_msg);
str = VECTOR_SLOT(strvec, i);
/* cmd parsing */
- if (!strcmp(str, "via") || !strcmp(str, "gw")) {
+ if (!strcmp(str, "blackhole")) {
+ new->blackhole = 1;
+ inet_ston(VECTOR_SLOT(strvec, ++i), &new->dst);
+ } else if (!strcmp(str, "via") || !strcmp(str, "gw")) {
inet_ston(VECTOR_SLOT(strvec, ++i), &new->gw);
+ } else if (!strcmp(str, "or")) {
+ inet_ston(VECTOR_SLOT(strvec, ++i), &new->gw2);
} else if (!strcmp(str, "src")) {
inet_ston(VECTOR_SLOT(strvec, ++i), &new->src);
} else if (!strcmp(str, "dev") || !strcmp(str, "oif")) {
ifp = if_get_by_ifname(VECTOR_SLOT(strvec, ++i));
if (!ifp) {
- syslog(LOG_INFO, "VRRP is trying to assign VROUTE to unknown "
+ log_message(LOG_INFO, "VRRP is trying to assign VROUTE to unknown "
"%s interface !!! go out and fixe your conf !!!",
(char *)VECTOR_SLOT(strvec, i));
FREE(new);
/* All Static routes removed */
if (LIST_ISEMPTY(n)) {
- syslog(LOG_INFO, "Removing a VirtualRoute block");
+ log_message(LOG_INFO, "Removing a VirtualRoute block");
netlink_rtlist_ipv4(l, IPROUTE_DEL);
return;
}
for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
iproute = ELEMENT_DATA(e);
if (!route_exist(n, iproute) && iproute->set) {
- syslog(LOG_INFO, "ip route %s/%d ... , no longer exist"
+ log_message(LOG_INFO, "ip route %s/%d ... , no longer exist"
, inet_ntop2(iproute->dst), iproute->dmask);
netlink_route_ipv4(iproute, IPROUTE_DEL);
}
* authentication data encryption using HMAC MD5 according to
* RFCs 2085 & 2104.
*
- * Version: $Id: vrrp_ipsecah.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_ipsecah.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "vrrp_ipsecah.h"
*
* Part: NETLINK kernel command channel.
*
- * Version: $Id: vrrp_netlink.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_netlink.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
/* global include */
#include "check_api.h"
#include "vrrp_netlink.h"
#include "vrrp_if.h"
+#include "logger.h"
#include "memory.h"
#include "scheduler.h"
#include "utils.h"
int
netlink_socket(struct nl_handle *nl, unsigned long groups)
{
- int addr_len;
+ socklen_t addr_len;
int ret;
memset(nl, 0, sizeof (nl));
nl->fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
if (nl->fd < 0) {
- syslog(LOG_INFO, "Netlink: Cannot open netlink socket : (%s)",
+ log_message(LOG_INFO, "Netlink: Cannot open netlink socket : (%s)",
strerror(errno));
return -1;
}
ret = fcntl(nl->fd, F_SETFL, O_NONBLOCK);
if (ret < 0) {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"Netlink: Cannot set netlink socket flags : (%s)",
strerror(errno));
close(nl->fd);
ret = bind(nl->fd, (struct sockaddr *) &nl->snl, sizeof (nl->snl));
if (ret < 0) {
- syslog(LOG_INFO, "Netlink: Cannot bind netlink socket : (%s)",
+ log_message(LOG_INFO, "Netlink: Cannot bind netlink socket : (%s)",
strerror(errno));
close(nl->fd);
return -1;
addr_len = sizeof (nl->snl);
ret = getsockname(nl->fd, (struct sockaddr *) &nl->snl, &addr_len);
if (ret < 0 || addr_len != sizeof (nl->snl)) {
- syslog(LOG_INFO, "Netlink: Cannot getsockname : (%s)",
+ log_message(LOG_INFO, "Netlink: Cannot getsockname : (%s)",
strerror(errno));
close(nl->fd);
return -1;
}
if (nl->snl.nl_family != AF_NETLINK) {
- syslog(LOG_INFO, "Netlink: Wrong address family %d",
+ log_message(LOG_INFO, "Netlink: Wrong address family %d",
nl->snl.nl_family);
close(nl->fd);
return -1;
netlink_set_block(struct nl_handle *nl, int *flags)
{
if ((*flags = fcntl(nl->fd, F_GETFL, 0)) < 0) {
- syslog(LOG_INFO, "Netlink: Cannot F_GETFL socket : (%s)",
+ log_message(LOG_INFO, "Netlink: Cannot F_GETFL socket : (%s)",
strerror(errno));
return -1;
}
*flags &= ~O_NONBLOCK;
if (fcntl(nl->fd, F_SETFL, *flags) < 0) {
- syslog(LOG_INFO, "Netlink: Cannot F_SETFL socket : (%s)",
+ log_message(LOG_INFO, "Netlink: Cannot F_SETFL socket : (%s)",
strerror(errno));
return -1;
}
{
*flags |= O_NONBLOCK;
if (fcntl(nl->fd, F_SETFL, *flags) < 0) {
- syslog(LOG_INFO, "Netlink: Cannot F_SETFL socket : (%s)",
+ log_message(LOG_INFO, "Netlink: Cannot F_SETFL socket : (%s)",
strerror(errno));
return -1;
}
return 0;
}
+int rta_addattr_l(struct rtattr *rta, int maxlen, int type,
+ const void *data, int alen)
+{
+ struct rtattr *subrta;
+ int len = RTA_LENGTH(alen);
+
+ if (RTA_ALIGN(rta->rta_len) + RTA_ALIGN(len) > maxlen) {
+ return -1;
+ }
+ subrta = (struct rtattr*)(((char*)rta) + RTA_ALIGN(rta->rta_len));
+ subrta->rta_type = type;
+ subrta->rta_len = len;
+ memcpy(RTA_DATA(subrta), data, alen);
+ rta->rta_len = NLMSG_ALIGN(rta->rta_len) + RTA_ALIGN(len);
+ return 0;
+}
+
static void
parse_rtattr(struct rtattr **tb, int max, struct rtattr *rta, int len)
{
continue;
if (errno == EWOULDBLOCK || errno == EAGAIN)
break;
- syslog(LOG_INFO, "Netlink: Received message overrun");
+ log_message(LOG_INFO, "Netlink: Received message overrun");
continue;
}
if (status == 0) {
- syslog(LOG_INFO, "Netlink: EOF");
+ log_message(LOG_INFO, "Netlink: EOF");
return -1;
}
if (msg.msg_namelen != sizeof snl) {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"Netlink: Sender address length error: length %d",
msg.msg_namelen);
return -1;
}
if (h->nlmsg_len < NLMSG_LENGTH(sizeof (struct nlmsgerr))) {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"Netlink: error: message truncated");
return -1;
}
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"Netlink: error: %s, type=(%u), seq=%u, pid=%d",
strerror(-err->error),
err->msg.nlmsg_type,
/* Skip unsolicited messages from cmd channel */
if (nl != &nl_cmd && h->nlmsg_pid == nl_cmd.snl.nl_pid) {
- syslog(LOG_INFO, "Netlink: skipping nl_cmd msg...");
+ log_message(LOG_INFO, "Netlink: skipping nl_cmd msg...");
continue;
}
error = (*filter) (&snl, h);
if (error < 0) {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"Netlink: filter function error");
ret = error;
}
/* After error care. */
if (msg.msg_flags & MSG_TRUNC) {
- syslog(LOG_INFO, "Netlink: error: message truncated");
+ log_message(LOG_INFO, "Netlink: error: message truncated");
continue;
}
if (status) {
- syslog(LOG_INFO, "Netlink: error: data remnant size %d",
+ log_message(LOG_INFO, "Netlink: error: data remnant size %d",
status);
return -1;
}
static int
netlink_talk_filter(struct sockaddr_nl *snl, struct nlmsghdr *h)
{
- syslog(LOG_INFO, "Netlink: ignoring message type 0x%04x",
+ log_message(LOG_INFO, "Netlink: ignoring message type 0x%04x",
h->nlmsg_type);
return 0;
}
/* Send message to netlink interface. */
status = sendmsg(nl->fd, &msg, 0);
if (status < 0) {
- syslog(LOG_INFO, "Netlink: sendmsg() error: %s",
+ log_message(LOG_INFO, "Netlink: sendmsg() error: %s",
strerror(errno));
return -1;
}
/* Set blocking flag */
ret = netlink_set_block(nl, &flags);
if (ret < 0)
- syslog(LOG_INFO, "Netlink: Warning, couldn't set "
+ log_message(LOG_INFO, "Netlink: Warning, couldn't set "
"blocking flag to netlink socket...");
status = netlink_parse_info(netlink_talk_filter, nl);
status = sendto(nl->fd, (void *) &req, sizeof (req)
, 0, (struct sockaddr *) &snl, sizeof (snl));
if (status < 0) {
- syslog(LOG_INFO, "Netlink: sendto() failed: %s",
+ log_message(LOG_INFO, "Netlink: sendto() failed: %s",
strerror(errno));
return -1;
}
int hw_addr_len = RTA_PAYLOAD(tb[IFLA_ADDRESS]);
if (hw_addr_len > IF_HWADDR_MAX)
- syslog(LOG_ERR, "MAC address for %s is too large: %d",
+ log_message(LOG_ERR, "MAC address for %s is too large: %d",
name, hw_addr_len);
else {
ifp->hw_addr_len = hw_addr_len;
/* Set blocking flag */
ret = netlink_set_block(&nlh, &flags);
if (ret < 0)
- syslog(LOG_INFO, "Netlink: 1Warning, couldn't set "
+ log_message(LOG_INFO, "Netlink: 1Warning, couldn't set "
"blocking flag to netlink socket...");
/* Interface lookup */
/* Set blocking flag */
ret = netlink_set_block(&nlh, &flags);
if (ret < 0)
- syslog(LOG_INFO, "Netlink: 2Warning, couldn't set "
+ log_message(LOG_INFO, "Netlink: 2Warning, couldn't set "
"blocking flag to netlink socket...");
/* Address lookup */
return netlink_if_address_filter(snl, h);
break;
default:
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"Kernel is reflecting an unknown netlink nlmsg_type: %d",
h->nlmsg_type);
break;
netlink_socket(&nl_kernel, groups);
if (nl_kernel.fd > 0) {
- syslog(LOG_INFO, "Registering Kernel netlink reflector");
+ log_message(LOG_INFO, "Registering Kernel netlink reflector");
thread_add_read(master, kernel_netlink, NULL, nl_kernel.fd,
NETLINK_TIMER);
} else
- syslog(LOG_INFO, "Error while registering Kernel netlink reflector channel");
+ log_message(LOG_INFO, "Error while registering Kernel netlink reflector channel");
/* Prepare netlink command channel. */
netlink_socket(&nl_cmd, 0);
if (nl_cmd.fd > 0)
- syslog(LOG_INFO, "Registering Kernel netlink command channel");
+ log_message(LOG_INFO, "Registering Kernel netlink command channel");
else
- syslog(LOG_INFO, "Error while registering Kernel netlink cmd channel");
+ log_message(LOG_INFO, "Error while registering Kernel netlink cmd channel");
}
void
*
* Part: VRRP state transition notification scripts handling.
*
- * Version: $Id: vrrp_notify.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_notify.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
/* system include */
#include "vrrp_notify.h"
#include "memory.h"
#include "notify.h"
+#include "logger.h"
static char *
get_iscript(vrrp_rt * vrrp, int state)
static int
script_open_litteral(char *script)
{
+ log_message(LOG_DEBUG, "Opening script file %s",script);
FILE *fOut = fopen(script, "r");;
if (!fOut) {
- syslog(LOG_INFO, "Can't open %s (errno %d %s)", script,
+ log_message(LOG_INFO, "Can't open %s (errno %d %s)", script,
errno, strerror(errno));
return 0;
}
* data structure representation the conf file representing
* the loadbalanced server pool.
*
- * Version: $Id: vrrp_parser.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_parser.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "vrrp_parser.h"
#include "vrrp.h"
#include "global_data.h"
#include "global_parser.h"
+#include "logger.h"
#include "parser.h"
#include "memory.h"
vrrp->vrid = atoi(VECTOR_SLOT(strvec, 1));
if (VRRP_IS_BAD_VID(vrrp->vrid)) {
- syslog(LOG_INFO, "VRRP Error : VRID not valid !\n");
- syslog(LOG_INFO,
+ log_message(LOG_INFO, "VRRP Error : VRID not valid !\n");
+ log_message(LOG_INFO,
" must be between 1 & 255. reconfigure !\n");
} else
alloc_vrrp_bucket(vrrp);
vrrp->effective_priority = vrrp->base_priority = atoi(VECTOR_SLOT(strvec, 1));
if (VRRP_IS_BAD_PRIORITY(vrrp->base_priority)) {
- syslog(LOG_INFO, "VRRP Error : Priority not valid !\n");
- syslog(LOG_INFO,
+ log_message(LOG_INFO, "VRRP Error : Priority not valid !\n");
+ log_message(LOG_INFO,
" must be between 1 & 255. reconfigure !\n");
- syslog(LOG_INFO, " Using default value : 100\n");
+ log_message(LOG_INFO, " Using default value : 100\n");
vrrp->effective_priority = vrrp->base_priority = 100;
}
}
vrrp->adver_int = atoi(VECTOR_SLOT(strvec, 1));
if (VRRP_IS_BAD_ADVERT_INT(vrrp->adver_int)) {
- syslog(LOG_INFO, "VRRP Error : Advert interval not valid !\n");
- syslog(LOG_INFO,
+ log_message(LOG_INFO, "VRRP Error : Advert interval not valid !\n");
+ log_message(LOG_INFO,
" must be between less than 1sec.\n");
- syslog(LOG_INFO, " Using default value : 1sec\n");
+ log_message(LOG_INFO, " Using default value : 1sec\n");
vrrp->adver_int = 1;
}
vrrp->adver_int *= TIMER_HZ;
vrrp->debug = atoi(VECTOR_SLOT(strvec, 1));
if (VRRP_IS_BAD_DEBUG_INT(vrrp->debug)) {
- syslog(LOG_INFO, "VRRP Error : Debug interval not valid !\n");
- syslog(LOG_INFO, " must be between 0-4\n");
+ log_message(LOG_INFO, "VRRP Error : Debug interval not valid !\n");
+ log_message(LOG_INFO, " must be between 0-4\n");
vrrp->debug = 0;
}
}
vrrp->preempt_delay = atoi(VECTOR_SLOT(strvec, 1));
if (VRRP_IS_BAD_PREEMPT_DELAY(vrrp->preempt_delay)) {
- syslog(LOG_INFO, "VRRP Error : Preempt_delay not valid !\n");
- syslog(LOG_INFO, " must be between 0-%d\n",
+ log_message(LOG_INFO, "VRRP Error : Preempt_delay not valid !\n");
+ log_message(LOG_INFO, " must be between 0-%d\n",
TIMER_MAX_SEC);
vrrp->preempt_delay = 0;
}
if (VECTOR_SIZE(vec)) {
nbvip++;
if (nbvip > VRRP_MAX_VIP) {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"VRRP_Instance(%s) "
"trunc to the first %d VIPs.",
vrrp->iname, VRRP_MAX_VIP);
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
" => Declare others VIPs into"
" the excluded vip block");
} else
*
* Part: Sheduling framework for vrrp code.
*
- * Version: $Id: vrrp_scheduler.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_scheduler.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "vrrp_scheduler.h"
#include "memory.h"
#include "notify.h"
#include "list.h"
+#include "logger.h"
#include "main.h"
#include "smtp.h"
+#include "signals.h"
/* VRRP FSM (Finite State Machine) design.
*
static void vrrp_log_int_down(vrrp_rt *vrrp)
{
if (!IF_ISUP(vrrp->ifp))
- syslog(LOG_INFO, "Kernel is reporting: interface %s DOWN",
+ log_message(LOG_INFO, "Kernel is reporting: interface %s DOWN",
IF_NAME(vrrp->ifp));
if (!LIST_ISEMPTY(vrrp->track_ifp))
vrrp_log_tracked_down(vrrp->track_ifp);
static void vrrp_log_int_up(vrrp_rt *vrrp)
{
if (IF_ISUP(vrrp->ifp))
- syslog(LOG_INFO, "Kernel is reporting: interface %s UP",
+ log_message(LOG_INFO, "Kernel is reporting: interface %s UP",
IF_NAME(vrrp->ifp));
if (!LIST_ISEMPTY(vrrp->track_ifp))
- syslog(LOG_INFO, "Kernel is reporting: tracked interface are UP");
+ log_message(LOG_INFO, "Kernel is reporting: tracked interface are UP");
}
/*
}
if (warning > 0) {
- syslog(LOG_INFO, "VRRP_Instance(%s) : ignoring "
+ log_message(LOG_INFO, "VRRP_Instance(%s) : ignoring "
"track weights due to SYNC group",
vrrp->iname);
}
vrrp->lvs_syncd_if, IPVS_BACKUP,
vrrp->vrid);
#endif
- syslog(LOG_INFO, "VRRP_Instance(%s) Entering BACKUP STATE",
+ log_message(LOG_INFO, "VRRP_Instance(%s) Entering BACKUP STATE",
vrrp->iname);
/* Set BACKUP state */
vscript->result = VRRP_SCRIPT_STATUS_NONE;
thread_add_timer(master, vrrp_script_thread,
vscript, vscript->interval);
+ } else if (vscript->result == VRRP_SCRIPT_STATUS_INIT_GOOD) {
+ vscript->result = VRRP_SCRIPT_STATUS_GOOD;
+ thread_add_timer(master, vrrp_script_thread,
+ vscript, vscript->interval);
}
}
}
* with the remote IPSEC AH VRRP instance counter.
*/
if (iph->protocol == IPPROTO_IPSEC_AH) {
- syslog(LOG_INFO, "VRRP_Instance(%s) IPSEC-AH : seq_num sync",
+ log_message(LOG_INFO, "VRRP_Instance(%s) IPSEC-AH : seq_num sync",
vrrp->iname);
ah = (ipsec_ah *) (buffer + sizeof (struct iphdr));
vrrp->ipsecah_counter->seq_number = ntohl(ah->seq_number) + 1;
{
if (!VRRP_ISUP(vrrp)) {
vrrp_log_int_down(vrrp);
- vrrp->wantstate = VRRP_STATE_GOTO_FAULT;
+ vrrp->wantstate = VRRP_STATE_FAULT;
vrrp_state_leave_master(vrrp);
} else if (vrrp_state_master_rx(vrrp, buffer, len)) {
vrrp_state_leave_master(vrrp);
* Transition to BACKUP state for AH
* seq number synchronization.
*/
- syslog(LOG_INFO, "VRRP_Instance(%s) in FAULT state jump to AH sync",
+ log_message(LOG_INFO, "VRRP_Instance(%s) in FAULT state jump to AH sync",
vrrp->iname);
vrrp->wantstate = VRRP_STATE_BACK;
vrrp_state_leave_master(vrrp);
if (vrrp_state_fault_rx(vrrp, buffer, len)) {
if (vrrp->sync) {
if (vrrp_sync_leave_fault(vrrp)) {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"VRRP_Instance(%s) prio is higher than received advert",
vrrp->iname);
vrrp_become_master(vrrp, buffer, len);
}
} else {
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"VRRP_Instance(%s) prio is higher than received advert",
vrrp->iname);
vrrp_become_master(vrrp, buffer, len);
} else {
if (vrrp->sync) {
if (vrrp_sync_leave_fault(vrrp)) {
- syslog(LOG_INFO, "VRRP_Instance(%s) Entering BACKUP STATE",
+ log_message(LOG_INFO, "VRRP_Instance(%s) Entering BACKUP STATE",
vrrp->iname);
vrrp->state = VRRP_STATE_BACK;
vrrp_smtp_notifier(vrrp);
notify_instance_exec(vrrp, VRRP_STATE_BACK);
}
} else {
- syslog(LOG_INFO, "VRRP_Instance(%s) Entering BACKUP STATE",
+ log_message(LOG_INFO, "VRRP_Instance(%s) Entering BACKUP STATE",
vrrp->iname);
vrrp->state = VRRP_STATE_BACK;
vrrp_smtp_notifier(vrrp);
{
if (!VRRP_ISUP(vrrp)) {
vrrp_log_int_down(vrrp);
- syslog(LOG_INFO, "VRRP_Instance(%s) Now in FAULT state",
+ log_message(LOG_INFO, "VRRP_Instance(%s) Now in FAULT state",
vrrp->iname);
vrrp->state = VRRP_STATE_FAULT;
vrrp->ms_down_timer = 3 * vrrp->adver_int + VRRP_TIMER_SKEW(vrrp);
vrrp_master(vrrp_rt * vrrp)
{
/* Check if interface we are running on is UP */
- if (vrrp->wantstate != VRRP_STATE_GOTO_FAULT) {
+ if (vrrp->wantstate != VRRP_STATE_FAULT) {
if (!VRRP_ISUP(vrrp)) {
vrrp_log_int_down(vrrp);
- vrrp->wantstate = VRRP_STATE_GOTO_FAULT;
+ vrrp->wantstate = VRRP_STATE_FAULT;
}
}
/* Then perform the state transition */
- if (vrrp->wantstate == VRRP_STATE_GOTO_FAULT ||
+ if (vrrp->wantstate == VRRP_STATE_FAULT ||
vrrp->wantstate == VRRP_STATE_BACK ||
vrrp->ipsecah_counter->cycle) {
vrrp->ms_down_timer =
vrrp_state_leave_master(vrrp);
if (vrrp->state == VRRP_STATE_BACK)
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"VRRP_Instance(%s) Now in BACKUP state",
vrrp->iname);
if (vrrp->state == VRRP_STATE_FAULT)
- syslog(LOG_INFO, "VRRP_Instance(%s) Now in FAULT state",
+ log_message(LOG_INFO, "VRRP_Instance(%s) Now in FAULT state",
vrrp->iname);
} else if (vrrp->state == VRRP_STATE_MAST) {
/*
/* In case of fork is error. */
if (pid < 0) {
- syslog(LOG_INFO, "Failed fork process");
+ log_message(LOG_INFO, "Failed fork process");
return -1;
}
}
/* Child part */
+ signal_handler_destroy();
closeall(0);
open("/dev/null", O_RDWR);
dup(0);
dup(0);
- /* Also need to reset the signal state */
- {
- sigset_t empty_set;
- sigemptyset(&empty_set);
- sigprocmask(SIG_SETMASK, &empty_set, NULL);
-
- signal(SIGHUP, SIG_DFL);
- signal(SIGINT, SIG_DFL);
- signal(SIGTERM, SIG_DFL);
- signal(SIGKILL, SIG_DFL);
- }
-
status = system_call(vscript->script);
if (status < 0 || !WIFEXITED(status))
int status;
status = WEXITSTATUS(wait_status);
if (status == 0 && vscript->result != VRRP_SCRIPT_STATUS_GOOD) {
- syslog(LOG_INFO, "VRRP_Script(%s) succeeded", vscript->sname);
+ log_message(LOG_INFO, "VRRP_Script(%s) succeeded", vscript->sname);
}
if (status != 0 && vscript->result != VRRP_SCRIPT_STATUS_NONE) {
- syslog(LOG_INFO, "VRRP_Script(%s) failed", vscript->sname);
+ log_message(LOG_INFO, "VRRP_Script(%s) failed", vscript->sname);
}
vscript->result = (status == 0) ? VRRP_SCRIPT_STATUS_GOOD :
VRRP_SCRIPT_STATUS_NONE;
return 0;
}
- syslog(LOG_WARNING, "Process [%d] didn't respond to SIGTERM", pid);
+ log_message(LOG_WARNING, "Process [%d] didn't respond to SIGTERM", pid);
waitpid(pid, NULL, 0);
return 0;
*
* Part: VRRP synchronization framework.
*
- * Version: $Id: vrrp_sync.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_sync.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "vrrp_sync.h"
#include "vrrp_if.h"
#include "vrrp_notify.h"
#include "vrrp_data.h"
+#include "logger.h"
#include "smtp.h"
/* Compute the new instance sands */
if (vrrp->state == VRRP_STATE_MAST ||
vrrp->state == VRRP_STATE_GOTO_MASTER ||
- vrrp->state == VRRP_STATE_GOTO_FAULT ||
+ vrrp->state == VRRP_STATE_FAULT ||
vrrp->wantstate == VRRP_STATE_GOTO_MASTER) {
vrrp->sands.tv_sec = time_now.tv_sec + vrrp->adver_int / TIMER_HZ;
vrrp->sands.tv_usec = time_now.tv_usec;
}
if (is_up == LIST_SIZE(vgroup->index_list)) {
- syslog(LOG_INFO, "Kernel is reporting: Group(%s) UP"
+ log_message(LOG_INFO, "Kernel is reporting: Group(%s) UP"
, GROUP_NAME(vgroup));
return 1;
}
vrrp_sgroup *vgroup = vrrp->sync;
if (vrrp_sync_group_up(vgroup)) {
- syslog(LOG_INFO, "VRRP_Group(%s) Leaving FAULT state",
+ log_message(LOG_INFO, "VRRP_Group(%s) Leaving FAULT state",
GROUP_NAME(vgroup));
return 1;
}
if (GROUP_STATE(vgroup) == VRRP_STATE_FAULT)
return;
- syslog(LOG_INFO, "VRRP_Group(%s) Transition to MASTER state",
+ log_message(LOG_INFO, "VRRP_Group(%s) Transition to MASTER state",
GROUP_NAME(vgroup));
/* Perform sync index */
if (isync != vrrp) {
/* Force a new protocol master election */
isync->wantstate = VRRP_STATE_GOTO_MASTER;
- syslog(LOG_INFO,
+ log_message(LOG_INFO,
"VRRP_Instance(%s) forcing a new MASTER election",
isync->iname);
vrrp_send_adv(isync, isync->effective_priority);
if (GROUP_STATE(vgroup) == VRRP_STATE_BACK)
return;
- syslog(LOG_INFO, "VRRP_Group(%s) Syncing instances to BACKUP state",
+ log_message(LOG_INFO, "VRRP_Group(%s) Syncing instances to BACKUP state",
GROUP_NAME(vgroup));
/* Perform sync index */
if (GROUP_STATE(vgroup) == VRRP_STATE_MAST)
return;
- syslog(LOG_INFO, "VRRP_Group(%s) Syncing instances to MASTER state",
+ log_message(LOG_INFO, "VRRP_Group(%s) Syncing instances to MASTER state",
GROUP_NAME(vgroup));
/* Perform sync index */
if (GROUP_STATE(vgroup) == VRRP_STATE_FAULT)
return;
- syslog(LOG_INFO, "VRRP_Group(%s) Syncing instances to FAULT state",
+ log_message(LOG_INFO, "VRRP_Group(%s) Syncing instances to FAULT state",
GROUP_NAME(vgroup));
/* Perform sync index */
*/
if (isync != vrrp && isync->state != VRRP_STATE_FAULT) {
if (isync->state == VRRP_STATE_MAST)
- isync->wantstate = VRRP_STATE_GOTO_FAULT;
+ isync->wantstate = VRRP_STATE_FAULT;
if (isync->state == VRRP_STATE_BACK)
isync->state = VRRP_STATE_FAULT;
}
*
* Part: Interface tracking framework.
*
- * Version: $Id: vrrp_track.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vrrp_track.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
/* local include */
#include "vrrp_track.h"
#include "vrrp_if.h"
#include "vrrp_data.h"
+#include "logger.h"
#include "memory.h"
/* Track interface dump */
dump_track(void *track_data_obj)
{
tracked_if *tip = track_data_obj;
- syslog(LOG_INFO, " %s weight %d", IF_NAME(tip->ifp), tip->weight);
+ log_message(LOG_INFO, " %s weight %d", IF_NAME(tip->ifp), tip->weight);
}
void
alloc_track(list track_list, vector strvec)
/* Ignoring if no interface found */
if (!ifp) {
- syslog(LOG_INFO, " %s no match, ignoring...", tracked);
+ log_message(LOG_INFO, " %s no match, ignoring...", tracked);
return;
}
!strcmp(VECTOR_SLOT(strvec, 1), "weight")) {
weight = atoi(VECTOR_SLOT(strvec, 2));
if (weight < -254 || weight > 254) {
- syslog(LOG_INFO, " %s: weight must be between "
+ log_message(LOG_INFO, " %s: weight must be between "
"[-254..254] inclusive. Ignoring...", tracked);
weight = 0;
}
list_add(track_list, tip);
}
-static vrrp_script *
+vrrp_script *
find_script_by_name(char *name)
{
element e;
dump_track_script(void *track_data_obj)
{
tracked_sc *tsc = track_data_obj;
- syslog(LOG_INFO, " %s weight %d", tsc->scr->sname, tsc->weight);
+ log_message(LOG_INFO, " %s weight %d", tsc->scr->sname, tsc->weight);
}
void
alloc_track_script(list track_list, vector strvec)
/* Ignoring if no interface found */
if (!vsc) {
- syslog(LOG_INFO, " %s no match, ignoring...", tracked);
+ log_message(LOG_INFO, " %s no match, ignoring...", tracked);
return;
}
weight = atoi(VECTOR_SLOT(strvec, 2));
if (weight < -254 || weight > 254) {
weight = vsc->weight;
- syslog(LOG_INFO, " %s: weight must be between [-254..254]"
+ log_message(LOG_INFO, " %s: weight must be between [-254..254]"
" inclusive, ignoring...",
tracked);
}
tsc = (tracked_sc *) MALLOC(sizeof (tracked_sc));
tsc->scr = vsc;
tsc->weight = weight;
- if (weight != 0)
- vsc->inuse++;
+ vsc->inuse++;
list_add(track_list, tsc);
}
for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
tip = ELEMENT_DATA(e);
if (!IF_ISUP(tip->ifp))
- syslog(LOG_INFO, "Kernel is reporting: interface %s DOWN",
+ log_message(LOG_INFO, "Kernel is reporting: interface %s DOWN",
IF_NAME(tip->ifp));
}
}
return weight;
}
+/* Test if all tracked scripts are either OK or weight-tracked */
+int
+vrrp_script_up(list l)
+{
+ element e;
+ tracked_sc *tsc;
+
+ for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
+ tsc = ELEMENT_DATA(e);
+ if (!tsc->weight && tsc->scr->result == VRRP_SCRIPT_STATUS_NONE)
+ return 0;
+ }
+
+ return 1;
+}
+
/* Returns total weights of all tracked scripts :
* - a positive weight adds to the global weight when the result is OK
* - a negative weight subtracts from the global weight when the result is bad
#
# Keepalived OpenSource project.
#
-# Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
+# Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
CC = @CC@
INCLUDES = -I.
COMPILE = $(CC) $(CFLAGS) $(DEFS)
OBJS = memory.o utils.o notify.o timer.o scheduler.o \
- vector.o list.o html.o parser.o signals.o
+ vector.o list.o html.o parser.o signals.o logger.o
HEADERS = $(OBJS:.o=.h)
.c.o:
html.o: html.c html.h memory.h
parser.o: parser.c parser.h memory.h
signals.o: signals.c signals.h
+logger.o: logger.c logger.h
*
* Part: HTML stream parser utility functions.
*
- * Version: $Id: html.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: html.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <string.h>
*
* Part: parser.c include file.
*
- * Version: $Id: html.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: html.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _HTML_H
*
* Part: List structure manipulation.
*
- * Version: $Id: list.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: list.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "list.h"
*
* Part: list.c include file.
*
- * Version: $Id: list.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: list.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _LIST_H
--- /dev/null
+/*
+ * Soft: Keepalived is a failover program for the LVS project
+ * <www.linuxvirtualserver.org>. It monitor & manipulate
+ * a loadbalanced server pool using multi-layer checks.
+ *
+ * Part: logging facility.
+ *
+ * Version: $Id: vector.c,v 1.1.16 2009/02/14 03:25:07 acassen Exp $
+ *
+ * Author: Alexandre Cassen, <acassen@linux-vs.org>
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
+ */
+
+#include <syslog.h>
+#include <stdio.h>
+#include <stdarg.h>
+
+/* Boolean flag - send messages to console as well as syslog */
+static int log_console = 0;
+
+void
+enable_console_log(void) {
+ log_console = 1;
+}
+
+void
+log_message(const int facility, const char *format, ...)
+{
+ va_list args;
+
+ va_start(args,format);
+
+ if (log_console) {
+ vfprintf(stderr, format, args);
+ fprintf(stderr,"\n");
+ }
+
+ vsyslog(facility, format, args);
+}
--- /dev/null
+/*
+ * Soft: Keepalived is a failover program for the LVS project
+ * <www.linuxvirtualserver.org>. It monitor & manipulate
+ * a loadbalanced server pool using multi-layer checks.
+ *
+ * Part: logging facility.
+ *
+ * Version: $Id: vector.c,v 1.1.16 2009/02/14 03:25:07 acassen Exp $
+ *
+ * Author: Alexandre Cassen, <acassen@linux-vs.org>
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
+ */
+
+#ifndef _LOGGER_H
+#define _LOGGER_H
+
+void enable_console_log(void);
+void log_message(int priority, char* format, ...);
+
+#endif
* Part: Memory management framework. This framework is used to
* find any memory leak.
*
- * Version: $Id: memory.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: memory.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "memory.h"
*
* Part: memory.c include file.
*
- * Version: $Id: memory.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: memory.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _MEMORY_H
*
* Part: Forked system call to launch an extra script.
*
- * Version: $Id: notify.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: notify.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <unistd.h>
#include <syslog.h>
#include <fcntl.h>
#include "notify.h"
+#include "signals.h"
+#include "logger.h"
/* perform a system call */
int
if (retval == 127) {
/* couldn't exec command */
- syslog(LOG_ALERT, "Couldn't exec command: %s", cmdline);
+ log_message(LOG_ALERT, "Couldn't exec command: %s", cmdline);
} else if (retval == -1) {
/* other error */
- syslog(LOG_ALERT, "Error exec-ing command: %s", cmdline);
+ log_message(LOG_ALERT, "Error exec-ing command: %s", cmdline);
}
return retval;
/* In case of fork is error. */
if (pid < 0) {
- syslog(LOG_INFO, "Failed fork process");
+ log_message(LOG_INFO, "Failed fork process");
return -1;
}
if (pid)
return 0;
+ signal_handler_destroy();
closeall(0);
open("/dev/null", O_RDWR);
*
* Part: notify.c include file.
*
- * Version: $Id: notify.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: notify.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _NOTIFY_H
* data structure representation the conf file representing
* the loadbalanced server pool.
*
- * Version: $Id: parser.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: parser.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <glob.h>
#include <errno.h>
#include "parser.h"
#include "memory.h"
+#include "logger.h"
/* global vars */
vector keywords;
int i;
for(i = 0; i < globbuf.gl_pathc; i++){
- syslog(LOG_INFO, "Opening file '%s'.\n",globbuf.gl_pathv[i]);
+ log_message(LOG_INFO, "Opening file '%s'.\n",globbuf.gl_pathv[i]);
stream = fopen(globbuf.gl_pathv[i], "r");
if (!stream) {
- syslog(LOG_INFO, "Configuration file '%s' open problem (%s)...\n"
+ log_message(LOG_INFO, "Configuration file '%s' open problem (%s)...\n"
, globbuf.gl_pathv[i], strerror(errno));
return;
}
*
* Part: cfreader.c include file.
*
- * Version: $Id: parser.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: parser.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#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.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: scheduler.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <signal.h>
#include <sys/wait.h>
#include <sys/select.h>
+#include <unistd.h>
#include "scheduler.h"
#include "memory.h"
#include "utils.h"
#include "signals.h"
+#include "logger.h"
/* global vars */
thread_master *master = NULL;
t = thread_obj;
thread_obj = t->next;
+ if (t->type == THREAD_READY_FD ||
+ t->type == THREAD_READ ||
+ t->type == THREAD_WRITE ||
+ t->type == THREAD_READ_TIMEOUT ||
+ t->type == THREAD_WRITE_TIMEOUT)
+ close (t->u.fd);
+
thread_list_delete(&thread_list_obj, t);
t->type = THREAD_UNUSED;
thread_add_unuse(m, t);
assert(m != NULL);
if (FD_ISSET(fd, &m->readfd)) {
- syslog(LOG_WARNING, "There is already read fd [%d]", fd);
+ log_message(LOG_WARNING, "There is already read fd [%d]", fd);
return NULL;
}
assert(m != NULL);
if (FD_ISSET(fd, &m->writefd)) {
- syslog(LOG_WARNING, "There is already write fd [%d]", fd);
+ log_message(LOG_WARNING, "There is already write fd [%d]", fd);
return NULL;
}
thread_list_delete(&thread_obj->master->event, thread_obj);
break;
case THREAD_READY:
+ case THREAD_READY_FD:
thread_list_delete(&thread_obj->master->ready, thread_obj);
break;
default:
if (!TIMER_ISNULL(timer_min)) {
timer_min = timer_sub(timer_min, time_now);
- if (timer_min.tv_sec < 0 || TIMER_ISNULL(timer_min)) {
- timer_min.tv_sec = 0;
- timer_min.tv_usec = 10;
+ if (timer_min.tv_sec < 0) {
+ timer_wait->tv_sec = timer_wait->tv_usec = 0;
+ } else {
+ timer_wait->tv_sec = timer_min.tv_sec;
+ timer_wait->tv_usec = timer_min.tv_usec;
}
- timer_wait->tv_sec = timer_min.tv_sec;
- timer_wait->tv_usec = timer_min.tv_usec;
- } else
- timer_wait = NULL;
+ return;
+ }
+
+ if (TIMER_ISNULL(*timer_wait))
+ timer_wait->tv_sec = 1;
}
/* Fetch next ready thread. */
fd_set writefd;
fd_set exceptfd;
TIMEVAL timer_wait;
- int status;
- sigset_t sigset, dummy_sigset, block_sigset, pending;
+ int signal_fd;
assert(m != NULL);
- /*
- * Set up the signal mask for select, by removing
- * SIGCHLD from the set of blocked signals.
- */
- sigemptyset(&dummy_sigset);
- sigprocmask(SIG_BLOCK, &dummy_sigset, &sigset);
- sigdelset(&sigset, SIGCHLD);
-
- sigemptyset(&block_sigset);
- sigaddset(&block_sigset, SIGCHLD);
-
/* Timer initialization */
memset(&timer_wait, 0, sizeof (TIMEVAL));
writefd = m->writefd;
exceptfd = m->exceptfd;
- /*
- * Linux doesn't have a pselect syscall. Need to manually
- * check if we have a signal waiting for us, else we lose the SIGCHLD
- * when the pselect emulation changes the procmask.
- * Theres still a small race between the procmask change and the select
- * call, but it'll be picked up in the next iteration.
- * Note that we don't use pselect here for portability between glibc
- * versions. Until/unless linux gets a pselect syscall, this is
- * equivalent to what glibc does, anyway.
- */
+ signal_fd = signal_rfd();
+ FD_SET(signal_fd, &readfd);
- sigpending(&pending);
- if (sigismember(&pending, SIGCHLD)) {
- /* Clear the pending signal */
- int sig;
- sigwait(&block_sigset, &sig);
-
- ret = -1;
- errno = EINTR;
- } else {
- /* Emulate pselect */
- sigset_t saveset;
- sigprocmask(SIG_SETMASK, &sigset, &saveset);
- ret = select(FD_SETSIZE, &readfd, &writefd, &exceptfd,
- (TIMER_ISNULL(timer_wait)) ? NULL : &timer_wait);
- sigprocmask(SIG_SETMASK, &saveset, NULL);
- }
+ ret = select(FD_SETSIZE, &readfd, &writefd, &exceptfd,
+ (TIMER_ISNULL(timer_wait)) ? NULL : &timer_wait);
/* we have to save errno here because the next syscalls will set it */
old_errno = errno;
- /*
- * When we receive a signal, we only add it to the signal_mask. This
- * is so that we can run our handler functions in a safe place and
- * not in, for example, the middle of a list modification.
- */
- if (signal_pending())
+ /* handle signals synchronously, including child reaping */
+ if (FD_ISSET(signal_fd, &readfd))
signal_run_callback();
/* Update current time */
set_time_now();
if (ret < 0) {
- if (old_errno != EINTR) {
- /* Real error. */
- DBG("select error: %s", strerror(old_errno));
- assert(0);
- } else {
- /*
- * This is O(n^2), but there will only be a few entries on
- * this list.
- */
- pid_t pid;
- while ((pid = waitpid(-1, &status, WNOHANG))) {
- if (pid == -1) {
- if (errno == ECHILD)
- goto retry;
- DBG("waitpid error: %s", strerror(errno));
- assert(0);
- } else {
- thread_obj = m->child.head;
- while (thread_obj) {
- struct _thread *t;
- t = thread_obj;
- thread_obj = t->next;
- if (pid == t->u.c.pid) {
- thread_list_delete(&m->child, t);
- thread_list_add(&m->ready, t);
- t->u.c.status = status;
- t->type = THREAD_READY;
- break;
- }
- }
- }
- }
- }
- goto retry;
+ if (old_errno == EINTR)
+ goto retry;
+ /* Real error. */
+ DBG("select error: %s", strerror(old_errno));
+ assert(0);
}
/* Timeout children */
FD_CLR(t->u.fd, &m->readfd);
thread_list_delete(&m->read, t);
thread_list_add(&m->ready, t);
- t->type = THREAD_READY;
+ t->type = THREAD_READY_FD;
} else {
if (timer_cmp(time_now, t->sands) >= 0) {
FD_CLR(t->u.fd, &m->readfd);
FD_CLR(t->u.fd, &m->writefd);
thread_list_delete(&m->write, t);
thread_list_add(&m->ready, t);
- t->type = THREAD_READY;
+ t->type = THREAD_READY_FD;
} else {
if (timer_cmp(time_now, t->sands) >= 0) {
FD_CLR(t->u.fd, &m->writefd);
return fetch;
}
+/* Synchronous signal handler to reap child processes */
+void
+thread_child_handler(void * v, int sig) {
+ thread_master * m = v;
+ /*
+ * This is O(n^2), but there will only be a few entries on
+ * this list.
+ */
+ thread *thread_obj;
+ pid_t pid;
+ int status = 77;
+ while ((pid = waitpid(-1, &status, WNOHANG))) {
+ if (pid == -1) {
+ if (errno == ECHILD)
+ return;
+ DBG("waitpid error: %s", strerror(errno));
+ assert(0);
+ } else {
+ thread_obj = m->child.head;
+ while (thread_obj) {
+ struct _thread *t;
+ t = thread_obj;
+ thread_obj = t->next;
+ if (pid == t->u.c.pid) {
+ thread_list_delete(&m->child, t);
+ thread_list_add(&m->ready, t);
+ t->u.c.status = status;
+ t->type = THREAD_READY;
+ break;
+ }
+ }
+ }
+ }
+}
+
+
/* Make unique thread id for non pthread version of thread manager. */
unsigned long int
thread_get_id(void)
{
thread thread_obj;
+ signal_set(SIGCHLD, thread_child_handler, master);
+
/*
* Processing the master thread queues,
* return and execute one ready thread.
*
* Part: scheduler.c include file.
*
- * Version: $Id: scheduler.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: scheduler.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _SCHEDULER_H
#define THREAD_READ_TIMEOUT 8
#define THREAD_CHILD_TIMEOUT 9
#define THREAD_TERMINATE 10
+#define THREAD_READY_FD 11
/* MICRO SEC def */
#define BOOTSTRAP_DELAY TIMER_HZ
extern void thread_cancel(thread * thread_obj);
extern void thread_cancel_event(thread_master * m, void *arg);
extern thread *thread_fetch(thread_master * m, thread * fetch);
+extern void thread_child_handler(void * v, int sig);
extern void thread_call(thread * thread_obj);
extern void launch_scheduler(void);
*
* Part: Signals framework.
*
- * Version: $Id: signals.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: signals.c,v 1.1.16 2009/02/14 03:25:07 acassen Exp $
*
* Author: Kevin Lindsay, <kevinl@netnation.com>
* Alexandre Cassen, <acassen@linux-vs.org>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <signal.h>
#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <errno.h>
+#include <assert.h>
#include "signals.h"
+#include "utils.h"
/* Local Vars */
-static int signal_mask;
-void (*signal_SIGHUP_handler) (int sig);
-void (*signal_SIGINT_handler) (int sig);
-void (*signal_SIGTERM_handler) (int sig);
-void (*signal_SIGCHLD_handler) (int sig);
+void (*signal_SIGHUP_handler) (void *, int sig);
+void *signal_SIGHUP_v;
+void (*signal_SIGINT_handler) (void *, int sig);
+void *signal_SIGINT_v;
+void (*signal_SIGTERM_handler) (void *, int sig);
+void *signal_SIGTERM_v;
+void (*signal_SIGCHLD_handler) (void *, int sig);
+void *signal_SIGCHLD_v;
+
+static int signal_pipe[2] = { -1, -1 };
/* Local signal test */
int
signal_pending(void)
{
- return (signal_mask) ? 1 : 0;
+ fd_set readset;
+ int rc;
+ struct timeval timeout = { 0, 0 };
+
+ FD_ZERO(&readset);
+ FD_SET(signal_pipe[0], &readset);
+
+ rc = select(signal_pipe[0] + 1, &readset, NULL, NULL, &timeout);
+
+ return rc>0?1:0;
}
/* Signal flag */
void
signal_handler(int sig)
{
- switch(sig) {
- case SIGHUP:
- signal_mask |= SIGNAL_SIGHUP;
- break;
- case SIGINT:
- signal_mask |= SIGNAL_SIGINT;
- break;
- case SIGTERM:
- signal_mask |= SIGNAL_SIGTERM;
- break;
- case SIGCHLD:
- signal_mask |= SIGNAL_SIGCHLD;
- break;
+ if (write(signal_pipe[1], &sig, sizeof(int)) != sizeof(int)) {
+ DBG("signal_pipe write error %s", strerror(errno));
+ assert(0);
}
-}
+}
/* Signal wrapper */
void *
-signal_set(int signo, void (*func) (int))
+signal_set(int signo, void (*func) (void *, int), void *v)
{
int ret;
struct sigaction sig;
switch(signo) {
case SIGHUP:
signal_SIGHUP_handler = func;
+ signal_SIGHUP_v = v;
break;
case SIGINT:
signal_SIGINT_handler = func;
+ signal_SIGINT_v = v;
break;
case SIGTERM:
signal_SIGTERM_handler = func;
+ signal_SIGTERM_v = v;
break;
case SIGCHLD:
signal_SIGCHLD_handler = func;
+ signal_SIGCHLD_v = v;
break;
}
void *
signal_ignore(int signo)
{
- return signal_set(signo, SIG_IGN);
-}
-
-/*
- * SIGCHLD handler. Reap all zombie child.
- * WNOHANG prevent against parent process get
- * stuck waiting child termination.
- */
-void
-dummy_handler(int sig)
-{
- /* Dummy */
-}
-
-void
-signal_noignore_sigchld(void)
-{
- struct sigaction sa;
- sigset_t mask;
-
- /* Need to remove the NOCHLD flag */
- sigemptyset(&mask);
- sa.sa_handler = dummy_handler;
- sa.sa_mask = mask;
- sa.sa_flags = 0;
-
- sigaction(SIGCHLD, &sa, NULL);
-
- /* Block SIGCHLD so that we only receive it
- * when required (ie when its unblocked in the
- * select loop)
- */
- sigaddset(&mask, SIGCHLD);
- sigprocmask(SIG_BLOCK, &mask, NULL);
+ return signal_set(signo, NULL, NULL);
}
/* Handlers intialization */
void
signal_handler_init(void)
{
- signal_mask = 0;
+ int n = pipe(signal_pipe);
+ assert(!n);
+
+ fcntl(signal_pipe[0], F_SETFL, O_NONBLOCK | fcntl(signal_pipe[0], F_GETFL));
+ fcntl(signal_pipe[1], F_SETFL, O_NONBLOCK | fcntl(signal_pipe[1], F_GETFL));
+
signal_SIGHUP_handler = NULL;
signal_SIGINT_handler = NULL;
signal_SIGTERM_handler = NULL;
signal_SIGCHLD_handler = NULL;
}
-/* Handlers callback according to global signal mask */
void
-signal_run_callback(void)
-{
- if (SIGNAL_SIGHUP & signal_mask) {
- signal_mask &= ~SIGNAL_SIGHUP;
- if (signal_SIGHUP_handler)
- signal_SIGHUP_handler(SIGHUP);
- }
+signal_handler_destroy(void) {
+ struct sigaction sig;
- if (SIGNAL_SIGINT & signal_mask) {
- signal_mask &= ~SIGNAL_SIGINT;
- if (signal_SIGINT_handler)
- signal_SIGINT_handler(SIGINT);
- }
+ sig.sa_handler = SIG_DFL;
+ sigemptyset(&sig.sa_mask);
+ sig.sa_flags = 0;
- if (SIGNAL_SIGTERM & signal_mask) {
- signal_mask &= ~SIGNAL_SIGTERM;
- if (signal_SIGTERM_handler)
- signal_SIGTERM_handler(SIGTERM);
- }
+ /* First ensure that no more signals happen, then close pipe */
+ sigaction(SIGHUP, &sig, NULL);
+ sigaction(SIGINT, &sig, NULL);
+ sigaction(SIGTERM, &sig, NULL);
+ sigaction(SIGCHLD, &sig, NULL);
+
+ close(signal_pipe[1]);
+ close(signal_pipe[0]);
+ signal_pipe[1] = -1;
+ signal_pipe[0] = -1;
+}
+
+int
+signal_rfd(void) {
+ return(signal_pipe[0]);
+}
- if (SIGNAL_SIGCHLD & signal_mask) {
- signal_mask &= ~SIGNAL_SIGCHLD;
- if (signal_SIGCHLD_handler)
- signal_SIGCHLD_handler(SIGCHLD);
+/* Handlers callback */
+void
+signal_run_callback(void)
+{
+ int sig;
+
+ while(read(signal_pipe[0], &sig, sizeof(int)) == sizeof(int)) {
+ switch(sig) {
+ case SIGHUP:
+ if (signal_SIGHUP_handler)
+ signal_SIGHUP_handler(signal_SIGHUP_v, SIGHUP);
+ break;
+ case SIGINT:
+ if (signal_SIGINT_handler)
+ signal_SIGINT_handler(signal_SIGINT_v, SIGINT);
+ break;
+ case SIGTERM:
+ if (signal_SIGTERM_handler)
+ signal_SIGTERM_handler(signal_SIGTERM_v, SIGTERM);
+ break;
+ case SIGCHLD:
+ if (signal_SIGCHLD_handler)
+ signal_SIGCHLD_handler(signal_SIGCHLD_v, SIGCHLD);
+ break;
+ default:
+ break;
+ }
}
}
+
*
* Part: signals.c include file.
*
- * Version: $Id: signals.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: signals.h,v 1.1.16 2009/02/14 03:25:07 acassen Exp $
*
* Author: Kevin Lindsay, <kevinl@netnation.com>
* Alexandre Cassen, <acassen@linux-vs.org>
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _SIGNALS_H
#define _SIGNALS_H
-/* signals definition */
-#define SIGNAL_SIGHUP 0x02
-#define SIGNAL_SIGINT 0x04
-#define SIGNAL_SIGTERM 0x08
-#define SIGNAL_SIGCHLD 0x10
-
/* Prototypes */
extern int signal_pending(void);
-extern void *signal_set(int signo, void (*func) (int));
+extern void *signal_set(int signo, void (*func) (void *, int), void *);
extern void *signal_ignore(int signo);
-extern void signal_noignore_sigchld(void);
extern void signal_handler_init(void);
+extern void signal_handler_destroy(void);
extern void signal_run_callback(void);
+extern int signal_rfd(void);
+
#endif
*
* Part: Timer manipulations.
*
- * Version: $Id: timer.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: timer.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include <stdio.h>
return ret;
}
+/* This function is a wrapper for gettimeofday(). It uses local storage to
+ * guarantee that the returned time will always be monotonic. If the time goes
+ * backwards, it returns the same as previous one and readjust its internal
+ * drift. If the time goes forward further than TIME_MAX_FORWARD_US
+ * microseconds since last call, it will bound it to that value. It is designed
+ * to be used as a drop-in replacement of gettimeofday(&now, NULL). It will
+ * normally return 0, unless <now> is NULL, in which case it will return -1 and
+ * set errno to EFAULT.
+ */
+int monotonic_gettimeofday(struct timeval *now)
+{
+ static struct timeval mono_date;
+ static struct timeval drift; /* warning: signed seconds! */
+ struct timeval sys_date, adjusted, deadline;
+
+ if (!now) {
+ errno = EFAULT;
+ return -1;
+ }
+
+ gettimeofday(&sys_date, NULL);
+
+ /* on first call, we set mono_date to system date */
+ if (mono_date.tv_sec == 0) {
+ mono_date = sys_date;
+ drift.tv_sec = drift.tv_usec = 0;
+ *now = mono_date;
+ return 0;
+ }
+
+ /* compute new adjusted time by adding the drift offset */
+ adjusted.tv_sec = sys_date.tv_sec + drift.tv_sec;
+ adjusted.tv_usec = sys_date.tv_usec + drift.tv_usec;
+ if (adjusted.tv_usec >= 1000000) {
+ adjusted.tv_usec -= 1000000;
+ adjusted.tv_sec++;
+ }
+
+ /* check for jumps in the past, and bound to last date */
+ if (adjusted.tv_sec < mono_date.tv_sec ||
+ (adjusted.tv_sec == mono_date.tv_sec &&
+ adjusted.tv_usec < mono_date.tv_usec))
+ goto fixup;
+
+ /* check for jumps too far in the future, and bound them to
+ * TIME_MAX_FORWARD_US microseconds.
+ */
+ deadline.tv_sec = mono_date.tv_sec + TIME_MAX_FORWARD_US / 1000000;
+ deadline.tv_usec = mono_date.tv_usec + TIME_MAX_FORWARD_US % 1000000;
+ if (deadline.tv_usec >= 1000000) {
+ deadline.tv_usec -= 1000000;
+ deadline.tv_sec++;
+ }
+
+ if (adjusted.tv_sec > deadline.tv_sec ||
+ (adjusted.tv_sec == deadline.tv_sec &&
+ adjusted.tv_usec >= deadline.tv_usec)) {
+ mono_date = deadline;
+ goto fixup;
+ }
+
+ /* adjusted date is correct */
+ mono_date = adjusted;
+ *now = mono_date;
+ return 0;
+
+ fixup:
+ /* Now we have to recompute the drift between sys_date and
+ * mono_date. Since it can be negative and we don't want to
+ * play with negative carries in all computations, we take
+ * care of always having the microseconds positive.
+ */
+ drift.tv_sec = mono_date.tv_sec - sys_date.tv_sec;
+ drift.tv_usec = mono_date.tv_usec - sys_date.tv_usec;
+ if (drift.tv_usec < 0) {
+ drift.tv_usec += 1000000;
+ drift.tv_sec--;
+ }
+ *now = mono_date;
+ return 0;
+}
+
/* current time */
TIMEVAL
timer_now(void)
/* init timer */
TIMER_RESET(curr_time);
- gettimeofday(&curr_time, NULL);
+ monotonic_gettimeofday(&curr_time);
errno = old_errno;
return curr_time;
/* init timer */
TIMER_RESET(time_now);
- gettimeofday(&time_now, NULL);
+ monotonic_gettimeofday(&time_now);
errno = old_errno;
return time_now;
*
* Part: timer.c include file.
*
- * Version: $Id: timer.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: timer.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _TIMER_H
extern TIMEVAL time_now;
/* macro utilities */
+#define TIME_MAX_FORWARD_US 2000000
#define TIMER_HZ 1000000
#define TIMER_MAX_SEC 1000
#define TIMER_SEC(T) ((T).tv_sec)
*
* Part: General program utils.
*
- * Version: $Id: utils.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: utils.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "utils.h"
*
* Part: utils.h include file.
*
- * Version: $Id: utils.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: utils.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _UTILS_H
*
* Part: Vector structure manipulation.
*
- * Version: $Id: vector.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vector.c,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#include "vector.h"
*
* Part: vector.c include file.
*
- * Version: $Id: vector.h,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
+ * Version: $Id: vector.h,v 1.1.16 2009/02/14 03:25:07 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-2007 Alexandre Cassen, <acassen@freebox.fr>
+ * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
*/
#ifndef _VECTOR_H