* keepalived-1.1.2 released.
* Dominik Vogt, <dominik.vogt@gmx.de> and I extended checker
framework to support multiple checkers per realserver.
Each checker own a uniq id, each realserver own a list
of checkers id. Realserver is considered down if one of the
checkers fails.
* Dominik Vogt, <dominik.vogt@gmx.de> extended list library to
support free_list_element.
* Dominik Vogt, <dominik.vogt@gmx.de> and I extended ipwrapper
to support multiple checkers test. Created a checker state
updater helper function to perform realserver state according
to checker state.
* Dominik Vogt, <dominik.vogt@gmx.de> extended all checkers
code to support multiple checker design (to not perform
server state according a single checkers test).
* Tobias Klausmann, <klausman@schwarzvogel.de> and I extended
layer4 framework to support socket binding to a specific
ip address before calling connect(). Extended the TCP, HTTP
and SSL checker to support binding selection, creating
a new checker keyword named "bindto".
look at doc/keepalived.conf.SYNOPSIS for more informations.
* VRRP : Extended the ethtool code to be selected only if
ETHTOOL_GLINK is available. This is useful for s/390 zSeries
users :) since zSerie 2.4 kernel doesn't support ethtool
extension.
* VRRP : Gatis Peisenieks, <gatis@mt.lv> fixed IPSEC-AH
code to exclude ip header id filed while computing AH digest.
Fixed AH sequence number to be set in network byte order.
* VRRP : Fixed a bug in the static_ipaddress block that caused
a noisy crashing startup.
* VRRP : Kjetil Torgrim Homme, <kjetilho@ifi.uio.no> and I
fixed a daemon crash while reloading configuration due to a
vrrp_buffer not freed.
* VRRP : Review the watchdog calling location. watchdog listener
is reinitialized during a daemon reload.
* VRRP : Diego Rivera, <lrivera@racsa.co.cr> extended notify
framework to support simple notify script call. Created a new
keyword "notify", for both vrrp_instance and vrrp_sync_group.
If configured, this notify script is called after FSM state
transition notify scripts.
look at doc/keepalived.conf.SYNOPSIS for more informations.
* Review the checker watchdog calling location like VRRP.
* Fixed code selection to exclude VRRP dependencies if code is
configured without VRRP framework.
* Extended memory lib free function to reset memory location to
NULL.
* Diego Rivera, <lrivera@racsa.co.cr> extended global parser
to support default handlers for lvs_id, smtp_server,
smtp_connection_timeout and email_from. default values are :
o lvs_id : box local name
o smtp_server : localhost
o email_from : uid@box_local_name
o smtp_connection_timeout : 30s
+2003-09-07 Alexandre Cassen <acassen@linux-vs.org>
+ * keepalived-1.1.2 released.
+ * Dominik Vogt, <dominik.vogt@gmx.de> and I extended checker
+ framework to support multiple checkers per realserver.
+ Each checker own a uniq id, each realserver own a list
+ of checkers id. Realserver is considered down if one of the
+ checkers fails.
+ * Dominik Vogt, <dominik.vogt@gmx.de> extended list library to
+ support free_list_element.
+ * Dominik Vogt, <dominik.vogt@gmx.de> and I extended ipwrapper
+ to support multiple checkers test. Created a checker state
+ updater helper function to perform realserver state according
+ to checker state.
+ * Dominik Vogt, <dominik.vogt@gmx.de> extended all checkers
+ code to support multiple checker design (to not perform
+ server state according a single checkers test).
+ * Tobias Klausmann, <klausman@schwarzvogel.de> and I extended
+ layer4 framework to support socket binding to a specific
+ ip address before calling connect(). Extended the TCP, HTTP
+ and SSL checker to support binding selection, creating
+ a new checker keyword named "bindto".
+ look at doc/keepalived.conf.SYNOPSIS for more informations.
+ * VRRP : Extended the ethtool code to be selected only if
+ ETHTOOL_GLINK is available. This is useful for s/390 zSeries
+ users :) since zSerie 2.4 kernel doesn't support ethtool
+ extension.
+ * VRRP : Gatis Peisenieks, <gatis@mt.lv> fixed IPSEC-AH
+ code to exclude ip header id filed while computing AH digest.
+ Fixed AH sequence number to be set in network byte order.
+ * VRRP : Fixed a bug in the static_ipaddress block that caused
+ a noisy crashing startup.
+ * VRRP : Kjetil Torgrim Homme, <kjetilho@ifi.uio.no> and I
+ fixed a daemon crash while reloading configuration due to a
+ vrrp_buffer not freed.
+ * VRRP : Review the watchdog calling location. watchdog listener
+ is reinitialized during a daemon reload.
+ * VRRP : Diego Rivera, <lrivera@racsa.co.cr> extended notify
+ framework to support simple notify script call. Created a new
+ keyword "notify", for both vrrp_instance and vrrp_sync_group.
+ If configured, this notify script is called after FSM state
+ transition notify scripts.
+ look at doc/keepalived.conf.SYNOPSIS for more informations.
+ * Review the checker watchdog calling location like VRRP.
+ * Fixed code selection to exclude VRRP dependencies if code is
+ configured without VRRP framework.
+ * Extended memory lib free function to reset memory location to
+ NULL.
+ * Diego Rivera, <lrivera@racsa.co.cr> extended global parser
+ to support default handlers for lvs_id, smtp_server,
+ smtp_connection_timeout and email_from. default values are :
+ o lvs_id : box local name
+ o smtp_server : localhost
+ o email_from : uid@box_local_name
+ o smtp_connection_timeout : 30s
+
2003-07-24 Alexandre Cassen <acassen@linux-vs.org>
* keepalived-1.1.1 released.
* VRRP : Fixed an issue while reloading configuration. Fixed
notify_master <STRING>|<QUOTED-STRING> # Script to run during MASTER transit
notify_backup <STRING>|<QUOTED-STRING> # Script to run during BACKUP transit
notify_fault <STRING>|<QUOTED-STRING> # Script to run during FAULT transit
+ notify <STRING>|<QUOTED-STRING> # Script to run during ANY state transit (1)
smtp_alert # Send email notif during state transit
}
+(1) The "notify" script is called AFTER the corresponding notify_* script has
+ been called, and is given exactly 3 arguments (the whole string is interpreted
+ as a litteral filename so don't add parameters!):
+
+ $1 = A string indicating whether it's a "GROUP" or an "INSTANCE"
+ $2 = The name of said group or instance
+ $3 = The state it's transitioning to ("MASTER", "BACKUP" or "FAULT")
+
+ $1 and $3 are ALWAYS sent in uppercase, and the possible strings sent are the
+ same ones listed above ("GROUP"/"INSTANCE", "MASTER"/"BACKUP"/"FAULT").
+
2.2. VRRP instance
The configuration block looks like :
notify_master <STRING>|<QUOTED-STRING> # Same as vrrp_sync_group
notify_backup <STRING>|<QUOTED-STRING> # Same as vrrp_sync_group
notify_fault <STRING>|<QUOTED-STRING> # Same as vrrp_sync_group
+ notify <STRING>|<QUOTED-STRING> # Same as vrrp_sync_group
smtp_alert # Same as vrrp_sync_group
}
}
...
connect_port <PORT> # TCP port to connect
+ bindto <IP ADDRESS> # IP address to bind to
connect_timeout <INTEGER> # Timeout connection
nb_get_retry <INTEGER> # number of get retry
delay_before_retry <INTEGER> # delay before retry
TCP_CHECK { # TCP healthchecker
connect_port <PORT> # TCP port to connect
+ bindto <IP ADDRESS> # IP address to bind to
connect_timeout <INTEGER> # Timeout connection
}
}
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include <errno.h>
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _HTTP_H
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "layer4.h"
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _LAYER4_H
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include <signal.h>
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _MAIN_H
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include <string.h>
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _SOCK_H
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include <openssl/err.h>
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _SSL_H
check_misc.o: check_misc.c ../include/check_misc.h ../include/check_api.h \
../../lib/memory.h ../include/ipwrapper.h ../include/smtp.h \
../../lib/utils.h ../../lib/notify.h ../../lib/parser.h ../include/daemon.h
-ipwrapper.o: ipwrapper.c ../include/ipwrapper.h ../../lib/utils.h \
- ../../lib/notify.h
+ipwrapper.o: ipwrapper.c ../include/ipwrapper.h ../../lib/memory.h \
+ ../../lib/utils.h ../../lib/notify.h
ipvswrapper.o: ipvswrapper.c ../include/ipvswrapper.h ../../lib/utils.h \
../../lib/memory.h
*
* Part: Checkers registration.
*
- * Version: $Id: check_api.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: check_api.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "check_api.h"
extern check_conf_data *check_data;
extern unsigned int debug;
+/* Global vars */
+static checker_id_t ncheckers = 0;
+
/* free checker data */
static void
free_checker(void *data)
chk->vs = vs;
chk->rs = rs;
chk->data = data;
+ chk->id = ncheckers++;
chk->enabled = (vs->vfwmark) ? 1 : 0;
#ifdef _WITHOUT_VRRP_
chk->enabled = 1;
free_checkers_queue(void)
{
free_list(checkers_queue);
+ ncheckers = 0;
}
/* register the checker to the global I/O scheduler */
*
* Part: CI-LINUX checker. Integration to Compaq Cluster Infrastructure.
*
- * Version: $Id: check_ci.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: check_ci.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Aneesh Kumar K.V, <aneesh.kumar@digital.com>
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "check_ci.h"
switch (status) {
case UP:
- if (!ISALIVE(checker->rs)) {
+ if (!svr_checker_up(checker->id, checker->rs)) {
smtp_alert(thread->master, checker->rs, NULL, NULL, "UP",
"=> CI-Linux CHECK succeed on service <=");
- perform_svr_state(UP, checker->vs, checker->rs);
+ update_svr_checker_state(UP, checker->id
+ , checker->vs
+ , checker->rs);
}
break;
case DOWN:
- if (ISALIVE(checker->rs)) {
+ if (svr_checker_up(checker->id, checker->rs)) {
smtp_alert(thread->master, checker->rs, NULL, NULL, "DOWN",
"=> CI-Linux CHECK failed on service <=");
- perform_svr_state(DOWN, checker->vs, checker->rs);
+ update_svr_checker_state(DOWN, checker->id
+ , checker->vs
+ , checker->rs);
}
break;
default:
*
* Part: Healthcheckrs child process handling.
*
- * Version: $Id: check_daemon.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: check_daemon.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "check_daemon.h"
/* Clean data */
free_global_data(data);
free_check_data(check_data);
+#ifdef _WITH_VRRP_
free_interface_queue();
+#endif
#ifdef _DEBUG_
keepalived_free_final("Healthcheck child process");
{
/* Initialize sub-system */
init_checkers_queue();
+#ifdef _WITH_VRRP_
init_interface_queue();
kernel_netlink_init();
+#endif
/* Parse configuration file */
data = alloc_global_data();
dump_check_data(check_data);
}
+ /* Register healthcheckers software watchdog */
+ check_wdog_sd = wdog_init(WDOG_CHECK);
+
/* Register checkers thread */
register_checkers_thread();
}
free_checkers_queue();
free_ssl();
+ /* free watchdog sd */
+ wdog_close(check_wdog_sd, WDOG_CHECK);
+
/* Save previous conf data */
old_check_data = check_data;
check_data = NULL;
sigend_check(int sig)
{
syslog(LOG_INFO, "Terminating Healthchecker child process on signal");
- thread_add_terminate_event(master);
+ if (master)
+ thread_add_terminate_event(master);
}
/* VRRP Child signal handling */
/* Start Healthcheck daemon */
start_check();
- /* Register healthcheckers software watchdog */
- check_wdog_sd = wdog_init(WDOG_CHECK);
-
/* Launch the scheduling I/O multiplexer */
launch_scheduler();
*
* Part: Healthcheckers dynamic data structure definition.
*
- * Version: $Id: check_data.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: check_data.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "check_data.h"
real_server *rs = data;
FREE_PTR(rs->notify_up);
FREE_PTR(rs->notify_down);
+ free_list(rs->failed_checkers);
FREE(rs);
}
static void
rs->notify_down);
}
+static void
+free_failed_checkers(void *data)
+{
+ FREE(data);
+}
+
void
alloc_rs(char *ip, char *port)
{
inet_ston(ip, &new->addr_ip);
new->addr_port = htons(atoi(port));
new->weight = 1;
+ new->failed_checkers = alloc_list(free_failed_checkers, NULL);
if (LIST_ISEMPTY(vs->rs))
vs->rs = alloc_list(free_rs, dump_rs);
*
* Part: WEB CHECK. Common HTTP/SSL checker primitives.
*
- * Version: $Id: check_http.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: check_http.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include <openssl/err.h>
if (http_get_chk->connection_port)
syslog(LOG_INFO, " Connection port = %d",
ntohs(http_get_chk->connection_port));
+ if (http_get_chk->bindto)
+ syslog(LOG_INFO, " Bind to = %s",
+ inet_ntop2(http_get_chk->bindto));
syslog(LOG_INFO, " Connection timeout = %d",
http_get_chk->connection_to);
syslog(LOG_INFO, " Nb get retry = %d", http_get_chk->nb_get_retry);
}
void
+bindto_handler(vector strvec)
+{
+ http_get_checker *http_get_chk = CHECKER_GET();
+ inet_ston(VECTOR_SLOT(strvec, 1), &http_get_chk->bindto);
+}
+
+void
connect_to_handler(vector strvec)
{
http_get_checker *http_get_chk = CHECKER_GET();
install_keyword("HTTP_GET", &http_get_handler);
install_sublevel();
install_keyword("connect_port", &connect_p_handler);
+ install_keyword("bindto", &bindto_handler);
install_keyword("connect_timeout", &connect_to_handler);
install_keyword("nb_get_retry", &nb_get_retry_handler);
install_keyword("delay_before_retry", &delay_before_retry_handler);
install_keyword("SSL_GET", &http_get_handler);
install_sublevel();
install_keyword("connect_port", &connect_p_handler);
+ install_keyword("bindto", &bindto_handler);
install_keyword("connect_timeout", &connect_to_handler);
install_keyword("nb_get_retry", &nb_get_retry_handler);
install_keyword("delay_before_retry", &delay_before_retry_handler);
* servers.
*/
if (http_arg->retry_it > http_get_check->nb_get_retry-1) {
- if (ISALIVE(checker->rs)) {
+ if (svr_checker_up(checker->id, checker->rs)) {
syslog(LOG_INFO, "Check on service [%s:%d] failed after %d retry."
, inet_ntop2(CHECKER_RIP(checker))
, ntohs(addr_port), http_arg->retry_it);
"DOWN",
"=> CHECK failed on service"
" : MD5 digest mismatch <=");
- perform_svr_state(DOWN, checker->vs, checker->rs);
+ update_svr_checker_state(DOWN, checker->id
+ , checker->vs
+ , checker->rs);
}
/* Reset it counters */
, ntohs(addr_port));
/* check if server is currently alive */
- if (ISALIVE(checker->rs)) {
+ if (svr_checker_up(checker->id, checker->rs)) {
smtp_alert(thread->master, checker->rs, NULL, NULL,
"DOWN", smtp_msg);
- perform_svr_state(DOWN, checker->vs, checker->rs);
+ update_svr_checker_state(DOWN, checker->id
+ , checker->vs
+ , checker->rs);
}
return epilog(thread, 1, 0, 0);
if (fetched_url->status_code) {
if (req->status_code != fetched_url->status_code) {
/* check if server is currently alive */
- if (ISALIVE(checker->rs)) {
+ if (svr_checker_up(checker->id, checker->rs)) {
syslog(LOG_INFO,
"HTTP status code error to [%s:%d] url(%s)"
", status_code [%d].",
"DOWN",
"=> CHECK failed on service"
" : HTTP status code mismatch <=");
- perform_svr_state(DOWN, checker->vs, checker->rs);
+ update_svr_checker_state(DOWN, checker->id
+ , checker->vs
+ , checker->rs);
} else {
DBG("HTTP Status_code to [%s:%d] url(%d) = [%d].",
inet_ntop2(CHECKER_RIP(checker))
}
return epilog(thread, 2, 0, 1);
} else {
- if (!ISALIVE(checker->rs))
+ if (!svr_checker_up(checker->id, checker->rs))
syslog(LOG_INFO,
"HTTP status code success to [%s:%d] url(%d).",
inet_ntop2(CHECKER_RIP(checker))
if (r) {
/* check if server is currently alive */
- if (ISALIVE(checker->rs)) {
+ if (svr_checker_up(checker->id, checker->rs)) {
syslog(LOG_INFO,
"MD5 digest error to [%s:%d] url[%s]"
", MD5SUM [%s].",
FREE(digest_tmp);
return epilog(thread, 2, 0, 1);
} else {
- if (!ISALIVE(checker->rs))
+ if (!svr_checker_up(checker->id, checker->rs))
syslog(LOG_INFO, "MD5 digest success to [%s:%d] url(%d).",
inet_ntop2(CHECKER_RIP(checker))
, ntohs(addr_port)
if (r == -1) {
/* We have encourred a real read error */
- if (ISALIVE(checker->rs)) {
+ if (svr_checker_up(checker->id, checker->rs)) {
syslog(LOG_INFO, "Read error with server [%s:%d]: %s",
inet_ntop2(CHECKER_RIP(checker))
, ntohs(addr_port)
"DOWN",
"=> HTTP CHECK failed on service"
" : cannot receive data <=");
- perform_svr_state(DOWN, checker->vs,
- checker->rs);
+ update_svr_checker_state(DOWN, checker->id
+ , checker->vs
+ , checker->rs);
}
return epilog(thread, 1, 0, 0);
}
, ntohs(addr_port));
/* check if server is currently alive */
- if (ISALIVE(checker->rs)) {
+ if (svr_checker_up(checker->id, checker->rs)) {
smtp_alert(thread->master, checker->rs, NULL, NULL,
"DOWN",
"=> CHECK failed on service"
" : cannot send data <=");
- perform_svr_state(DOWN, checker->vs, checker->rs);
+ update_svr_checker_state(DOWN, checker->id
+ , checker->vs
+ , checker->rs);
}
return epilog(thread, 1, 0, 0);
}
switch (status) {
case connect_error:
/* check if server is currently alive */
- if (ISALIVE(checker->rs)) {
+ if (svr_checker_up(checker->id, checker->rs)) {
syslog(LOG_INFO, "Error connecting server [%s:%d].",
inet_ntop2(CHECKER_RIP(checker))
, ntohs(addr_port));
"DOWN",
"=> CHECK failed on service"
" : connection error <=");
- perform_svr_state(DOWN, checker->vs, checker->rs);
+ update_svr_checker_state(DOWN, checker->id
+ , checker->vs
+ , checker->rs);
}
return epilog(thread, 1, 0, 0);
break;
* Check completed.
* check if server is currently alive.
*/
- if (!ISALIVE(checker->rs)) {
+ if (!svr_checker_up(checker->id, checker->rs)) {
syslog(LOG_INFO, "Remote Web server [%s:%d] succeed on service.",
inet_ntop2(CHECKER_RIP(checker))
, ntohs(addr_port));
smtp_alert(thread->master, checker->rs, NULL, NULL, "UP",
"=> CHECK succeed on service <=");
- perform_svr_state(UP, checker->vs, checker->rs);
+ update_svr_checker_state(UP, checker->id
+ , checker->vs
+ , checker->rs);
}
http_arg->req = NULL;
return epilog(thread, 1, 0, 0) + 1;
return 0;
}
- status = tcp_connect(fd, CHECKER_RIP(checker), addr_port);
+ status = tcp_bind_connect(fd, CHECKER_RIP(checker), addr_port
+ , http_get_check->bindto);
/* handle tcp connection status & register check worker thread */
tcp_connection_state(fd, status, thread, http_check_thread,
* Part: MISC CHECK. Perform a system call to run an extra
* system prog or script.
*
- * Version: $Id: check_misc.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: check_misc.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Eric Jarman, <ehj38230@cmsu2.cmsu.edu>
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "check_misc.h"
pid = THREAD_CHILD_PID(thread);
/* The child hasn't responded. Kill it off. */
- if (ISALIVE(checker->rs)) {
+ if (svr_checker_up(checker->id, checker->rs)) {
syslog(LOG_INFO, "Misc check to [%s] for [%s] timed out",
inet_ntop2(CHECKER_RIP(checker)),
misc_chk->path);
smtp_alert(thread->master, checker->rs, NULL, NULL,
"DOWN",
"=> MISC CHECK script timeout on service <=");
- perform_svr_state(DOWN, checker->vs, checker->rs);
+ update_svr_checker_state(DOWN, checker->id
+ , checker->vs
+ , checker->rs);
}
kill(pid, SIGTERM);
status = WEXITSTATUS(wait_status);
if (status == 0) {
/* everything is good */
- if (!ISALIVE(checker->rs)) {
+ if (!svr_checker_up(checker->id, checker->rs)) {
syslog(LOG_INFO, "Misc check to [%s] for [%s] success.",
inet_ntop2(CHECKER_RIP(checker)),
misc_chk->path);
smtp_alert(thread->master, checker->rs, NULL, NULL,
"UP",
"=> MISC CHECK succeed on service <=");
- perform_svr_state(UP, checker->vs, checker->rs);
+ update_svr_checker_state(UP, checker->id
+ , checker->vs
+ , checker->rs);
}
} else {
- if (ISALIVE(checker->rs)) {
+ if (svr_checker_up(checker->id, checker->rs)) {
syslog(LOG_INFO, "Misc check to [%s] for [%s] failed.",
inet_ntop2(CHECKER_RIP(checker)),
misc_chk->path);
smtp_alert(thread->master, checker->rs, NULL, NULL,
"DOWN",
"=> MISC CHECK failed on service <=");
- perform_svr_state(DOWN, checker->vs, checker->rs);
+ update_svr_checker_state(DOWN, checker->id
+ , checker->vs
+ , checker->rs);
}
}
}
* data structure representation the conf file representing
* the loadbalanced server pool.
*
- * Version: $Id: check_parser.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: check_parser.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "check_parser.h"
* url, compute a MD5 over this result and match it to the
* expected value.
*
- * Version: $Id: check_ssl.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: check_ssl.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include <openssl/err.h>
if (r && !req->extracted) {
/* check if server is currently alive */
- if (ISALIVE(checker->rs)) {
+ if (svr_checker_up(checker->id, checker->rs)) {
smtp_alert(thread->master, checker->rs, NULL, NULL,
"DOWN",
"=> SSL CHECK failed on service"
" : cannot receive data <=\n\n");
- perform_svr_state(DOWN, checker->vs,
- checker->rs);
+ update_svr_checker_state(DOWN, checker->id
+ , checker->vs
+ , checker->rs);
}
return epilog(thread, 1, 0, 0);
}
*
* Part: TCP checker.
*
- * Version: $Id: check_tcp.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: check_tcp.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "check_tcp.h"
if (tcp_chk->connection_port)
syslog(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);
}
}
void
+bind_handler(vector strvec)
+{
+ tcp_checker *tcp_chk = CHECKER_GET();
+ inet_ston(VECTOR_SLOT(strvec, 1), &tcp_chk->bindto);
+}
+
+void
connect_timeout_handler(vector strvec)
{
tcp_checker *tcp_chk = CHECKER_GET();
install_keyword("TCP_CHECK", &tcp_check_handler);
install_sublevel();
install_keyword("connect_port", &connect_port_handler);
+ install_keyword("bindto", &bind_handler);
install_keyword("connect_timeout", &connect_timeout_handler);
install_sublevel_end();
}
if (status == connect_success) {
close(thread->u.fd);
- if (!ISALIVE(checker->rs)) {
+ if (!svr_checker_up(checker->id, checker->rs)) {
syslog(LOG_INFO, "TCP connection to [%s:%d] success.",
inet_ntop2(CHECKER_RIP(checker))
, ntohs(addr_port));
smtp_alert(thread->master, checker->rs, NULL, NULL,
"UP",
"=> TCP CHECK succeed on service <=");
- perform_svr_state(UP, checker->vs, checker->rs);
+ update_svr_checker_state(UP, checker->id
+ , checker->vs
+ , checker->rs);
}
} else {
- if (ISALIVE(checker->rs)) {
+ if (svr_checker_up(checker->id, checker->rs)) {
syslog(LOG_INFO, "TCP connection to [%s:%d] failed !!!",
inet_ntop2(CHECKER_RIP(checker))
, ntohs(addr_port));
smtp_alert(thread->master, checker->rs, NULL, NULL,
"DOWN",
"=> TCP CHECK failed on service <=");
- perform_svr_state(DOWN, checker->vs, checker->rs);
+ update_svr_checker_state(DOWN, checker->id
+ , checker->vs
+ , checker->rs);
}
}
int
tcp_connect_thread(thread * thread)
{
- checker *checker;
- tcp_checker *tcp_check;
+ checker *checker = THREAD_ARG(thread);
+ tcp_checker *tcp_check = CHECKER_ARG(checker);
int fd;
uint16_t addr_port;
int status;
- checker = THREAD_ARG(thread);
- tcp_check = CHECKER_ARG(checker);
-
/*
* Register a new checker thread & return
* if checker is disabled
addr_port = CHECKER_RPORT(checker);
if (tcp_check->connection_port)
addr_port = tcp_check->connection_port;
- status = tcp_connect(fd, CHECKER_RIP(checker), addr_port);
+ status = tcp_bind_connect(fd, CHECKER_RIP(checker), addr_port
+ , tcp_check->bindto);
/* handle tcp connection status & register check worker thread */
tcp_connection_state(fd, status, thread, tcp_check_thread,
* library to add/remove server MASQ rules to the kernel
* firewall framework.
*
- * Version: $Id: ipfwwrapper.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: ipfwwrapper.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "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.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: ipvswrapper.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "ipvswrapper.h"
*
* Part: Manipulation functions for IPVS & IPFW wrappers.
*
- * Version: $id: ipwrapper.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $id: ipwrapper.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "ipwrapper.h"
#include "ipvswrapper.h"
+#include "memory.h"
#include "utils.h"
#include "notify.h"
}
}
+/* Test if realserver is marked UP for a specific checker */
+int
+svr_checker_up(checker_id_t cid, real_server *rs)
+{
+ element e;
+ list l = rs->failed_checkers;
+ checker_id_t *id;
+
+ /*
+ * We assume there is not too much checker per
+ * real server, so we consider this lookup as
+ * o(1).
+ */
+ for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
+ id = ELEMENT_DATA(e);
+ if (*id == cid)
+ return 0;
+ }
+
+ return 1;
+}
+
+/* Update checker's state */
+void
+update_svr_checker_state(int alive, checker_id_t cid, virtual_server *vs, real_server *rs)
+{
+ element e;
+ 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) {
+ free_list_element(l, e);
+ if (LIST_SIZE(l) == 0)
+ perform_svr_state(alive, vs, rs);
+ }
+ return;
+ }
+ }
+
+ /* Handle not alive state */
+ if (!alive) {
+ id = (checker_id_t *) MALLOC(sizeof(checker_id_t));
+ *id = cid;
+ list_add(l, id);
+ if (LIST_SIZE(l) == 1)
+ perform_svr_state(alive, vs, rs);
+ }
+}
+
/* Check if a vsg entry is in new data */
static int
vsge_exist(virtual_server_group_entry *vsg_entry, list l)
*
* Part: Main program structure.
*
- * Version: $Id: main.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: main.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include <syslog.h>
*
* Part: Dynamic data structure definition.
*
- * Version: $Id: global_data.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: global_data.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include <syslog.h>
+#include <unistd.h>
+#include <pwd.h>
#include "global_data.h"
#include "memory.h"
#include "list.h"
/* External vars */
extern conf_data *data;
+/* Default settings */
+static void
+set_default_lvs_id(conf_data* conf_data)
+{
+ char *new_id = NULL;
+ int len = 0;
+
+ new_id = get_local_name();
+ if (!new_id || !new_id[0]) return;
+
+ len = strlen(new_id);
+ conf_data->lvs_id = MALLOC(len + 1);
+ if (!conf_data->lvs_id) return;
+
+ memcpy(conf_data->lvs_id, new_id, len);
+}
+
+static void
+set_default_email_from(conf_data* conf_data)
+{
+ struct passwd *pwd = NULL;
+ char* hostname = NULL;
+ int len = 0;
+
+ hostname = get_local_name();
+ if (!hostname || !hostname[0]) return;
+
+ pwd = getpwuid(getuid());
+ if (!pwd) return;
+
+ len = strlen(hostname) + strlen(pwd->pw_name) + 2;
+ conf_data->email_from = MALLOC(len);
+ if (!conf_data->email_from) return;
+
+ snprintf(conf_data->email_from, len, "%s@%s", pwd->pw_name, hostname);
+}
+
+static void
+set_default_smtp_server(conf_data* conf_data)
+{
+ conf_data->smtp_server = htonl(DEFAULT_SMTP_SERVER);
+}
+
+static void
+set_default_smtp_connection_timeout(conf_data* conf_data)
+{
+ conf_data->smtp_connection_to = DEFAULT_SMTP_CONNECTION_TIMEOUT;
+}
+
+static void
+set_default_values(conf_data* conf_data)
+{
+ /* No global data so don't default */
+ if (!conf_data) return;
+ set_default_lvs_id(conf_data);
+ set_default_smtp_server(conf_data);
+ set_default_smtp_connection_timeout(conf_data);
+ set_default_email_from(conf_data);
+}
+
/* email facility functions */
static void
free_email(void *data)
new = (conf_data *) MALLOC(sizeof (conf_data));
new->email = alloc_list(free_email, dump_email);
+ set_default_values(new);
return new;
}
* data structure representation the conf file representing
* the loadbalanced server pool.
*
- * Version: $Id: global_parser.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: global_parser.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "global_parser.h"
static void
lvsid_handler(vector strvec)
{
+ FREE_PTR(data->lvs_id);
data->lvs_id = set_value(strvec);
}
static void
emailfrom_handler(vector strvec)
{
+ FREE_PTR(data->email_from);
data->email_from = set_value(strvec);
}
static void
* Part: Layer4 checkers handling. Register worker threads &
* upper layer checkers.
*
- * Version: $Id: layer4.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: layer4.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "layer4.h"
#include "utils.h"
enum connect_result
-tcp_connect(int fd, uint32_t addr_ip, uint16_t addr_port)
+tcp_bind_connect(int fd, uint32_t addr_ip, uint16_t addr_port, uint32_t bind_ip)
{
struct linger li = { 0 };
int long_inet;
- struct sockaddr_in adr_serv;
+ struct sockaddr_in sin;
int ret;
int val;
setsockopt(fd, SOL_SOCKET, SO_LINGER, (char *) &li,
sizeof (struct linger));
- long_inet = sizeof (struct sockaddr_in);
- memset(&adr_serv, 0, long_inet);
- adr_serv.sin_family = AF_INET;
- adr_serv.sin_port = addr_port;
- adr_serv.sin_addr.s_addr = addr_ip;
-
/* Make socket non-block. */
val = fcntl(fd, F_GETFL, 0);
fcntl(fd, F_SETFL, val | O_NONBLOCK);
- /* Call connect function. */
- ret = connect(fd, (struct sockaddr *) &adr_serv, long_inet);
+ /* Bind socket */
+ long_inet = sizeof (struct sockaddr_in);
+ memset(&sin, 0, long_inet);
+
+ if (bind_ip) {
+ sin.sin_family = AF_INET;
+ sin.sin_addr.s_addr = bind_ip;
+ if (bind(fd, (struct sockaddr *) &sin, sizeof(sin)) != 0)
+ return connect_error;
+ }
+
+ /* Set remote IP and connect */
+ memset(&sin, 0, long_inet);
+ sin.sin_family = AF_INET;
+ sin.sin_port = addr_port;
+ sin.sin_addr.s_addr = addr_ip;
+
+ ret = connect(fd, (struct sockaddr *) &sin, long_inet);
/* Immediate success */
if (ret == 0) {
}
enum connect_result
+tcp_connect(int fd, uint32_t addr_ip, uint16_t addr_port)
+{
+ return tcp_bind_connect(fd, addr_ip, addr_port, 0);
+}
+
+enum connect_result
tcp_socket_state(int fd, thread * thread, uint32_t addr_ip, uint16_t addr_port,
int (*func) (struct _thread *))
{
*
* Part: Main program structure.
*
- * Version: $Id: main.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: main.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "main.h"
*
* Part: pidfile utility.
*
- * Version: $Id: pidfile.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: pidfile.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "pidfile.h"
* using the smtp protocol according to the RFC 821. A non blocking
* timeouted connection is used to handle smtp protocol.
*
- * Version: $Id: smtp.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: smtp.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "smtp.h"
*
* Part: Checkers arguments structures definitions.
*
- * Version: $Id: check_api.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: check_api.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _CHECK_API_H
virtual_server *vs; /* pointer to the checker thread virtualserver */
real_server *rs; /* pointer to the checker thread realserver */
void *data;
+ checker_id_t id; /* Checker identifier */
int enabled; /* Activation flag */
} checker;
*
* Part: check_ci.c include file.
*
- * Version: $Id: check_ci.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: check_ci.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Aneesh Kumar K.V, <aneesh.kumar@digital.com>
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _CI_LINUX_H
*
* Part: check_daemon.c include file.
*
- * Version: $Id: check_daemon.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: check_daemon.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _CHECK_DAEMON_H
*
* Part: Healthcheckers dynamic data structure definition.
*
- * Version: $Id: check_data.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: check_data.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _CHECK_DATA_H
#include "list.h"
#include "vector.h"
+/* Typedefs */
+typedef unsigned int checker_id_t;
+
/* Daemon dynamic data structure definition */
#define MAX_TIMEOUT_LENGTH 5
#define KEEPALIVED_DEFAULT_DELAY 60
char *notify_up; /* Script to launch when RS is added to LVS */
char *notify_down; /* Script to launch when RS is removed from LVS */
int alive;
+ list failed_checkers; /* List of failed checkers */
int set; /* in the IPVS table */
} real_server;
*
* Part: check_http.c include file.
*
- * Version: $Id: check_http.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: check_http.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _HTTP_H
typedef struct _http_get_checker {
int proto;
uint16_t connection_port;
+ uint32_t bindto;
int connection_to;
int nb_get_retry;
int delay_before_retry;
*
* Part: check_misc.c include file.
*
- * Version: $Id: check_misc.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: check_misc.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
* Eric Jarman, <ehj38230@cmsu2.cmsu.edu>
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _MISC_H
*
* Part: check_parser.c include file.
*
- * Version: $Id: check_parser.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: check_parser.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _CHECK_PARSER_H
*
* Part: check_http.c include file.
*
- * Version: $Id: check_http.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: check_http.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _SSL_H
*
* Part: check_tcp.c include file.
*
- * Version: $Id: check_tcp.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: check_tcp.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _TCP_H
/* Checker argument structure */
typedef struct _tcp_checker {
uint16_t connection_port;
+ uint32_t bindto;
int connection_to;
} tcp_checker;
*
* Part: Daemon process handling.
*
- * Version: $Id: daemon.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: daemon.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _DAEMON_H
*
* Part: Dynamic data structure definition.
*
- * Version: $Id: global_data.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: global_data.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _GLOBAL_DATA_H
/* local includes */
#include "list.h"
+/* constants */
+#define DEFAULT_SMTP_SERVER 0x7f000001
+#define DEFAULT_SMTP_CONNECTION_TIMEOUT 30
+
/* email link list */
typedef struct _email {
char *addr;
*
* Part: vrrp_parser.c include file.
*
- * Version: $Id: global_parser.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: global_parser.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _GLOBAL_PARSER_H
*
* Part: ipfwwrapper.c include file.
*
- * Version: $Id: ipfwwrapper.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: ipfwwrapper.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _IPFWWRAPPER_H
*
* Part: ipvswrapper.c include file.
*
- * Version: $Id: ipvswrapper.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: ipvswrapper.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _IPVSWRAPPER_H
*
* Part: ipwrapper.c include file.
*
- * Version: $Id: ipwrapper.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: ipwrapper.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _IPWRAPPER_H
/* prototypes */
extern void perform_svr_state(int alive, virtual_server * vs, real_server * rs);
+extern int svr_checker_up(checker_id_t cid, real_server *rs);
+extern void update_svr_checker_state(int alive, checker_id_t cid
+ , virtual_server *vs
+ , real_server *rs);
extern int init_services(void);
extern int clear_services(void);
extern int clear_diff_services(void);
*
* Part: layer4.c include file.
*
- * Version: $Id: layer4.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: layer4.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _LAYER4_H
/* Prototypes defs */
extern enum connect_result
-tcp_connect(int fd, uint32_t, uint16_t);
+tcp_bind_connect(int, uint32_t, uint16_t, uint32_t);
+
+extern enum connect_result
+tcp_connect(int, uint32_t, uint16_t);
extern enum connect_result
tcp_socket_state(int, thread *, uint32_t, uint16_t,
*
* Part: Main program include file.
*
- * Version: $Id: main.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: main.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _MAIN_H
/* Build version */
#define PROG "Keepalived"
-#define VERSION_CODE 0x010100
-#define DATE_CODE 0x180703
+#define VERSION_CODE 0x010102
+#define DATE_CODE 0x080903
#define KEEPALIVED_VERSION(version) \
(version >> 16) & 0xFF, \
*
* Part: pidfile.c include file.
*
- * Version: $Id: pidfile.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: pidfile.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _PIDFILE_H
*
* Part: smtp.c include file.
*
- * Version: $Id: smtp.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: smtp.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _SMTP_H
*
* Part: vrrp.c program include file.
*
- * Version: $Id: vrrp.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_H
char *script_backup;
char *script_master;
char *script_fault;
+ char *script;
int smtp_alert;
} vrrp_sgroup;
char *script_backup;
char *script_master;
char *script_fault;
+ char *script;
/* rfc2336.6.2 */
uint32_t ms_down_timer;
*
* Part: vrrp_arp.c include file.
*
- * Version: $Id: vrrp_arp.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_arp.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_ARP_H
*
* Part: vrrp_daemon.c include file.
*
- * Version: $Id: vrrp_daemon.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_daemon.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_DAEMON_H
*
* Part: Dynamic data structure definition.
*
- * Version: $Id: vrrp_data.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_data.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_DATA_H
extern void alloc_vrrp_vip(vector strvec);
extern void alloc_vrrp_evip(vector strvec);
extern void alloc_vrrp_vroute(vector strvec);
+extern void alloc_vrrp_buffer(void);
+extern void free_vrrp_buffer(void);
extern vrrp_conf_data *alloc_vrrp_data(void);
extern void free_vrrp_data(vrrp_conf_data * data);
extern void dump_vrrp_data(vrrp_conf_data * data);
*
* Part: vrrp_if.c include file.
*
- * Version: $Id: vrrp_if.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_if.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_IF_H
*
* Part: vrrp_index.c include file.
*
- * Version: $Id: vrrp_index.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_index.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_INDEX_H
*
* Part: vrrp_ipaddress.c include file.
*
- * Version: $Id: vrrp_ipaddress.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_ipaddress.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_IPADDR_H
*
* Part: vrrp_iproute.c include file.
*
- * Version: $Id: vrrp_iproute.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_iproute.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_IPROUTE_H
*
* Part: vrrp_ipsecah.c include file.
*
- * Version: $Id: vrrp_ipsecah.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_ipsecah.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_IPSEC_AH_H
typedef struct { /* rfc2402.3.3.3.1.1.1 */
u_int8_t tos;
- u_int16_t id;
u_int16_t frag_off;
u_int16_t check;
} ICV_mutable_fields; /* We need to zero this fields to compute the ICV */
*
* Part: vrrp_netlink.c include file.
*
- * Version: $Id: vrrp_netlink.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_netlink.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_NETLINK_H
*
* Part: vrrp_notify.c include file.
*
- * Version: $Id: vrrp_notify.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_notify.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_NOTIFY_H
*
* Part: vrrp_parser.c include file.
*
- * Version: $Id: vrrp_parser.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_parser.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_PARSER_H
*
* Part: vrrp_scheduler.c include file.
*
- * Version: $Id: vrrp_scheduler.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_scheduler.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_SCHEDULER_H
*
* Part: vrrp_sync.c include file.
*
- * Version: $Id: vrrp_sync.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_sync.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_SYNC_H
*
* Part: vrrp_track.c include file.
*
- * Version: $Id: vrrp_track.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_track.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VRRP_TRACK_H
* master fails, a backup server takes over.
* The original implementation has been made by jerome etienne.
*
- * Version: $Id: vrrp.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
/* local include */
* sender counter.
*/
vrrp->ipsecah_counter->seq_number++;
- if (ah->seq_number >= vrrp->ipsecah_counter->seq_number || vrrp->sync) {
- vrrp->ipsecah_counter->seq_number = ah->seq_number;
+ 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,
"VRRP_Instance(%s) IPSEC-AH : sequence number %d"
" already proceeded. Packet dropped. Local(%d)", vrrp->iname
- , ah->seq_number, vrrp->ipsecah_counter->seq_number);
+ , ntohl(ah->seq_number), vrrp->ipsecah_counter->seq_number);
return 1;
}
/* zero the ip mutable fields */
ip->tos = 0;
- ip->id = 0;
ip->frag_off = 0;
ip->check = 0;
memcpy(backup_auth_data, ah->auth_data, sizeof (ah->auth_data));
/* backup the ip mutable fields */
ip_mutable_fields->tos = ip->tos;
- ip_mutable_fields->id = ip->id;
ip_mutable_fields->frag_off = ip->frag_off;
ip_mutable_fields->check = ip->check;
/* zero the ip mutable fields */
ip->tos = 0;
- ip->id = 0;
ip->frag_off = 0;
ip->check = 0;
vrrp->ipsecah_counter->seq_number++;
}
- ah->seq_number = vrrp->ipsecah_counter->seq_number;
+ ah->seq_number = htonl(vrrp->ipsecah_counter->seq_number);
/* Compute the ICV & trunc the digest to 96bits
=> No padding needed.
/* Restore the ip mutable fields */
ip->tos = ip_mutable_fields->tos;
- ip->id = ip_mutable_fields->id;
ip->frag_off = ip_mutable_fields->frag_off;
ip->check = ip_mutable_fields->check;
syslog(LOG_INFO, "VRRP_Instance(%s) IPSEC-AH : Syncing seq_num"
" - Increment seq"
, vrrp->iname);
- vrrp->ipsecah_counter->seq_number = ah->seq_number + 1;
+ vrrp->ipsecah_counter->seq_number = ntohl(ah->seq_number) + 1;
vrrp->ipsecah_counter->cycle = 0;
}
vrrp_send_adv(vrrp, vrrp->priority);
syslog(LOG_INFO, "VRRP_Instance(%s) IPSEC-AH : Syncing seq_num"
" - Decrement seq"
, vrrp->iname);
- vrrp->ipsecah_counter->seq_number = ah->seq_number - 1;
+ vrrp->ipsecah_counter->seq_number = ntohl(ah->seq_number) - 1;
vrrp->ipsecah_counter->cycle = 0;
}
vrrp->ms_down_timer =
*
* Part: ARP primitives.
*
- * Version: $Id: vrrp_arp.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_arp.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
/* system includes */
/* Build the dst device */
memset(&sll, 0, sizeof(sll));
sll.sll_family = AF_PACKET;
- strncpy(sll.sll_addr, IF_HWADDR(ipaddress->ifp), sizeof(sll.sll_addr));
+ memcpy(sll.sll_addr, IF_HWADDR(ipaddress->ifp), ETH_ALEN);
sll.sll_halen = ETHERNET_HW_LEN;
sll.sll_ifindex = IF_INDEX(ipaddress->ifp);
*
* Part: VRRP child process handling.
*
- * Version: $Id: vrrp_daemon.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_daemon.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "vrrp_daemon.h"
/* Parse configuration file */
data = alloc_global_data();
vrrp_data = alloc_vrrp_data();
+ alloc_vrrp_buffer();
init_data(conf_file, vrrp_init_keywords);
if (!vrrp_data) {
stop_vrrp();
dump_vrrp_data(vrrp_data);
}
+ /* Register vrrp software watchdog */
+ vrrp_wdog_sd = wdog_init(WDOG_VRRP);
+
/* Init & start the VRRP packet dispatcher */
thread_add_event(master, vrrp_dispatcher_init, NULL,
VRRP_DISPATCHER);
master = thread_make_master();
free_global_data(data);
free_interface_queue();
+ free_vrrp_buffer();
gratuitous_arp_close();
+ /* free watchdog sd */
+ wdog_close(vrrp_wdog_sd, WDOG_VRRP);
+
/* Save previous conf data */
old_vrrp_data = vrrp_data;
vrrp_data = NULL;
sigend_vrrp(int sig)
{
syslog(LOG_INFO, "Terminating VRRP child process on signal");
- thread_add_terminate_event(master);
+ if (master)
+ thread_add_terminate_event(master);
}
/* VRRP Child signal handling */
/* Start VRRP daemon */
start_vrrp();
- /* Register vrrp software watchdog */
- vrrp_wdog_sd = wdog_init(WDOG_VRRP);
-
/* Launch the scheduling I/O multiplexer */
launch_scheduler();
*
* Part: Dynamic data structure definition.
*
- * Version: $Id: vrrp_data.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_data.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "vrrp_data.h"
FREE_PTR(vgroup->script_backup);
FREE_PTR(vgroup->script_master);
FREE_PTR(vgroup->script_fault);
+ FREE_PTR(vgroup->script);
FREE(vgroup);
}
static void
if (vgroup->script_fault)
syslog(LOG_INFO, " Fault state transition script = %s",
vgroup->script_fault);
+ if (vgroup->script)
+ syslog(LOG_INFO, " Generic state transition script = '%s'",
+ vgroup->script);
if (vgroup->smtp_alert)
syslog(LOG_INFO, " Using smtp notification");
}
FREE_PTR(vrrp->script_backup);
FREE_PTR(vrrp->script_master);
FREE_PTR(vrrp->script_fault);
+ FREE_PTR(vrrp->script);
FREE(vrrp->ipsecah_counter);
free_list(vrrp->track_ifp);
free_list(vrrp->vip);
if (vrrp->script_fault)
syslog(LOG_INFO, " Fault state transition script = %s",
vrrp->script_fault);
+ if (vrrp->script)
+ syslog(LOG_INFO, " Generic state transition script = '%s'",
+ vrrp->script);
if (vrrp->smtp_alert)
syslog(LOG_INFO, " Using smtp notification");
}
}
/* data facility functions */
+void
+alloc_vrrp_buffer(void)
+{
+ vrrp_buffer = (char *) MALLOC(VRRP_PACKET_TEMP_LEN);
+}
+
+void
+free_vrrp_buffer(void)
+{
+ FREE(vrrp_buffer);
+}
+
vrrp_conf_data *
alloc_vrrp_data(void)
{
new->vrrp_index = alloc_mlist(NULL, NULL, 255);
new->vrrp_index_fd = alloc_mlist(NULL, NULL, 1024+1);
new->vrrp_sync_group = alloc_list(free_vgroup, dump_vgroup);
- vrrp_buffer = (char *) MALLOC(VRRP_PACKET_TEMP_LEN);
return new;
}
free_list(vrrp_data->vrrp);
free_list(vrrp_data->vrrp_sync_group);
FREE(vrrp_data);
- FREE(vrrp_buffer);
}
void
*
* Part: Interfaces manipulation.
*
- * Version: $Id: vrrp_if.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_if.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
/* global include */
static int
if_ethtool_status(const int fd)
{
-#ifdef _KRNL_2_4_
+#ifdef ETHTOOL_GLINK
struct ethtool_value edata;
int err = 0;
*
* Part: VRRP instance index table.
*
- * Version: $Id: vrrp_index.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_index.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
/* local include */
*
* Part: NETLINK IPv4 address manipulation.
*
- * Version: $Id: vrrp_ipaddress.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_ipaddress.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
/* local include */
int i = 0;
new = (ip_address *) MALLOC(sizeof(ip_address));
- new->ifp = ifp;
- new->ifindex = IF_INDEX(ifp);
+ if (ifp) {
+ new->ifp = ifp;
+ new->ifindex = IF_INDEX(ifp);
+ } else {
+ new->ifp = if_get_by_ifname(DFLT_INT);
+ new->ifindex = IF_INDEX(new->ifp);
+ }
/* FMT parse */
while (i < VECTOR_SIZE(strvec)) {
}
i++;
}
-
- /* If index not set then use default interface index */
- if (!ifp) {
- new->ifp = ifp;
- new->ifindex = IF_INDEX(if_get_by_ifname(DFLT_INT));
- }
-
list_add(ip_list, new);
}
*
* Part: NETLINK IPv4 routes manipulation.
*
- * Version: $Id: vrrp_iproute.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_iproute.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
/* local include */
* authentication data encryption using HMAC MD5 according to
* RFCs 2085 & 2104.
*
- * Version: $Id: vrrp_ipsecah.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_ipsecah.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "vrrp_ipsecah.h"
*
* Part: NETLINK kernel command channel.
*
- * Version: $Id: vrrp_netlink.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_netlink.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
/* global include */
*
* Part: VRRP state transition notification scripts handling.
*
- * Version: $Id: vrrp_notify.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_notify.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
/* system include */
}
static char *
+get_igscript(vrrp_rt * vrrp)
+{
+ return vrrp->script;
+}
+
+static char *
get_gscript(vrrp_sgroup * vgroup, int state)
{
if (!vgroup->notify_exec)
}
static char *
+get_ggscript(vrrp_sgroup * vgroup)
+{
+ return vgroup->script;
+}
+
+static char *
notify_script_name(char *cmdline)
{
char *cp = cmdline;
}
static int
-script_open(char *script)
+script_open_litteral(char *script)
{
- char *script_name = notify_script_name(script);
- FILE *fOut;
-
- fOut = fopen(script_name, "r");;
+ FILE *fOut = fopen(script, "r");;
if (!fOut) {
- syslog(LOG_INFO, "Can't open %s (errno %d %s)", script_name,
+ syslog(LOG_INFO, "Can't open %s (errno %d %s)", script,
errno, strerror(errno));
return 0;
}
- FREE(script_name);
fclose(fOut);
return 1;
}
-int
-notify_instance_exec(vrrp_rt * vrrp, int state)
+static int
+script_open(char *script)
{
- char *script = get_iscript(vrrp, state);
+ return script_open_litteral(notify_script_name(script));
+}
+
+static int
+notify_script_exec(char* script, char *type, int state_num, char* name)
+{
+ /*
+ * Determine the length of the buffer that we'll need to generate the command
+ * to run:
+ *
+ * "script" {GROUP|INSTANCE} "NAME" {MASTER|BACKUP|FAULT}
+ *
+ * Thus, the length of the buffer will be:
+ *
+ * ( strlen(script) + 3 ) + ( strlen(type) + 1 ) + ( strlen(state) + 1 ) + ( strlen(name) + 2 ) + 1
+ *
+ * Which is:
+ * - The length of the script plus two enclosing quotes plus adjacent space
+ * - The length of the type string plus the adjacent space
+ * - The length of the state string plus the adjacent space
+ * - The length of the name of the instance or group, plus two enclosing
+ * quotes (just in case)
+ * - The null-terminator
+ *
+ * Which results in:
+ *
+ * strlen(script) + strlen(type) + strlen(state) + strlen(name) + 8
+ */
- if (!script || !script_open(script))
+ char *state = "{UNKNOWN}";
+ switch (state_num) {
+ case VRRP_STATE_MAST : state = "MASTER" ; break;
+ case VRRP_STATE_BACK : state = "BACKUP" ; break;
+ case VRRP_STATE_FAULT : state = "FAULT" ; break;
+ }
+
+ int size = (strlen(script) + strlen(type) + strlen(state) + strlen(name) + 8);
+ char *command_line = MALLOC(size);
+ if (!command_line)
return 0;
/* Launch the script */
- notify_exec(script);
+ notify_exec(command_line);
+ FREE(command_line);
return 1;
}
int
+notify_instance_exec(vrrp_rt * vrrp, int state)
+{
+ char *script = get_iscript(vrrp, state);
+ char *gscript = get_igscript(vrrp);
+ int ret = 0;
+
+ /* Launch the notify_* script */
+ if (script && script_open(script)) {
+ notify_exec(script);
+ ret = 1;
+ }
+
+ /* Launch the generic notify script */
+ if (gscript && script_open_litteral(gscript)) {
+ notify_script_exec(gscript, "INSTANCE", state, vrrp->iname);
+ ret = 1;
+ }
+
+ return ret;
+}
+
+int
notify_group_exec(vrrp_sgroup * vgroup, int state)
{
char *script = get_gscript(vgroup, state);
+ char *gscript = get_ggscript(vgroup);
+ int ret = 0;
- if (!script || !script_open(script))
- return 0;
+ /* Launch the notify_* script */
+ if (script && script_open(script)) {
+ notify_exec(script);
+ ret = 1;
+ }
- /* Launch the script */
- notify_exec(script);
- return 1;
+ /* Launch the generic notify script */
+ if (gscript && script_open_litteral(gscript)) {
+ notify_script_exec(gscript, "GROUP", state, vgroup->gname);
+ ret = 1;
+ }
+
+ return ret;
}
* data structure representation the conf file representing
* the loadbalanced server pool.
*
- * Version: $Id: vrrp_parser.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_parser.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "vrrp_parser.h"
vgroup->notify_exec = 1;
}
static void
+vrrp_gnotify_handler(vector strvec)
+{
+ vrrp_sgroup *vgroup = LIST_TAIL_DATA(vrrp_data->vrrp_sync_group);
+ vgroup->script = set_value(strvec);
+ vgroup->notify_exec = 1;
+}
+static void
vrrp_gsmtp_handler(vector strvec)
{
vrrp_sgroup *vgroup = LIST_TAIL_DATA(vrrp_data->vrrp_sync_group);
vrrp->notify_exec = 1;
}
static void
+vrrp_notify_handler(vector strvec)
+{
+ vrrp_rt *vrrp = LIST_TAIL_DATA(vrrp_data->vrrp);
+ vrrp->script = set_value(strvec);
+ vrrp->notify_exec = 1;
+}
+static void
vrrp_smtp_handler(vector strvec)
{
vrrp_rt *vrrp = LIST_TAIL_DATA(vrrp_data->vrrp);
install_keyword("notify_backup", &vrrp_gnotify_backup_handler);
install_keyword("notify_master", &vrrp_gnotify_master_handler);
install_keyword("notify_fault", &vrrp_gnotify_fault_handler);
+ install_keyword("notify", &vrrp_gnotify_handler);
install_keyword("smtp_alert", &vrrp_gsmtp_handler);
install_keyword_root("vrrp_instance", &vrrp_handler);
install_keyword("state", &vrrp_state_handler);
install_keyword("notify_backup", &vrrp_notify_backup_handler);
install_keyword("notify_master", &vrrp_notify_master_handler);
install_keyword("notify_fault", &vrrp_notify_fault_handler);
+ install_keyword("notify", &vrrp_notify_handler);
install_keyword("smtp_alert", &vrrp_smtp_handler);
install_keyword("lvs_sync_daemon_interface", &vrrp_lvs_syncd_handler);
install_keyword("garp_master_delay", &vrrp_garp_delay_handler);
*
* Part: Sheduling framework for vrrp code.
*
- * Version: $Id: vrrp_scheduler.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_scheduler.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "vrrp_scheduler.h"
*
* Part: VRRP synchronization framework.
*
- * Version: $Id: vrrp_sync.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_sync.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "vrrp_sync.h"
*
* Part: Interface tracking framework.
*
- * Version: $Id: vrrp_track.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vrrp_track.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
/* local include */
*
* Part: HTML stream parser utility functions.
*
- * Version: $Id: html.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: html.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include <string.h>
*
* Part: parser.c include file.
*
- * Version: $Id: html.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: html.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _HTML_H
*
* Part: List structure manipulation.
*
- * Version: $Id: list.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: list.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "list.h"
FREE(l);
}
+void
+free_list_element(list l, element e)
+{
+ if (!e)
+ return;
+ if (l->head == e)
+ l->head = (e->next == e) ? NULL : e->next;
+ if (l->tail == e)
+ l->tail = (e->prev == e) ? NULL : e->prev;
+ if (e->prev)
+ e->prev->next = e->next;
+ if (e->next)
+ e->next->prev = e->prev;
+ if (l->free)
+ (*l->free) (e->data);
+ l->count--;
+ FREE(e);
+}
/* Multiple list helpers functions */
list
*
* Part: list.c include file.
*
- * Version: $Id: list.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: list.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _LIST_H
/* Prototypes */
extern list alloc_list(void (*free_func) (void *), void (*dump_func) (void *));
extern void free_list(list l);
+extern void free_list_element(list l, element e);
extern void *list_element(list l, int num);
extern void dump_list(list l);
extern void list_add(list l, void *data);
* Part: Memory management framework. This framework is used to
* find any memory leak.
*
- * Version: $Id: memory.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: memory.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "memory.h"
{
mem_allocated -= sizeof (p);
free(p);
+ p = NULL;
}
/* KeepAlived memory management. in debug mode,
*
* Part: memory.c include file.
*
- * Version: $Id: memory.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: memory.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _MEMORY_H
*
* Part: Forked system call to launch an extra script.
*
- * Version: $Id: notify.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: notify.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include <unistd.h>
*
* Part: notify.c include file.
*
- * Version: $Id: notify.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: notify.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _NOTIFY_H
* data structure representation the conf file representing
* the loadbalanced server pool.
*
- * Version: $Id: parser.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: parser.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "parser.h"
*
* Part: cfreader.c include file.
*
- * Version: $Id: parser.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: parser.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _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.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: scheduler.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include <signal.h>
*
* Part: scheduler.c include file.
*
- * Version: $Id: scheduler.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: scheduler.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _SCHEDULER_H
*
* Part: Timer manipulations.
*
- * Version: $Id: timer.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: timer.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include <stdio.h>
*
* Part: timer.c include file.
*
- * Version: $Id: timer.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: timer.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _TIMER_H
*
* Part: General program utils.
*
- * Version: $Id: utils.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: utils.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "utils.h"
*
* Part: utils.h include file.
*
- * Version: $Id: utils.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: utils.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _UTILS_H
*
* Part: Vector structure manipulation.
*
- * Version: $Id: vector.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vector.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include "vector.h"
*
* Part: vector.c include file.
*
- * Version: $Id: vector.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: vector.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _VECTOR_H
*
* Part: Software watchdog framework.
*
- * Version: $Id: watchdog.c,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: watchdog.c,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#include <unistd.h>
*
* Part: watchdog.c include file.
*
- * Version: $Id: watchdog.h,v 1.1.1 2003/07/24 22:36:16 acassen Exp $
+ * Version: $Id: watchdog.h,v 1.1.2 2003/09/08 01:18:41 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
*/
#ifndef _WATCHDOG_H