Skip to content

Commit

Permalink
keepalived-1.1.3
Browse files Browse the repository at this point in the history
* keepalived-1.1.3 released.
* Stephan von Krawczynski, <skraw@ithnet.com> extended ip
  address framework to support broadcast address selection.
* Extended the scheduling framework to support plain 'long'
  timer. Visited the layer4 framework to support this new
  scheduling scheme. Reviewed the checkers and VRRP framework
  to support long timer.
* VRRP : Removed the timer micro adjust call. Its use is
  obsolete with the new scheduling 'long' timer support.
* Jacob Rief, <Jacob.Rief@tiscover.com> and I added support
  log level selection for main daemon. A new command line
  argument has been created :
  --log-facility  -S  0-7 Set syslog facility to
                      LOG_LOCAL[0-7]. (default=LOG_DAEMON)
* Extended the HTTP checker to support non blocking read
  while processing stream. NONBLOCK flags is set before
  read operation to catch EAGAIN error.
* VRRP : Diego Rivera, <lrivera@racsa.co.cr> and I fixed a
  notify issue while building notify exec string.
* VRRP : Diego Rivera, <lrivera@racsa.co.cr> and I extended
  FSM to support BACKUP state notifiers and smtp_alert call
  during VRRP initialization.
* Jan Vanhercke, <jan.vanhercke@c-cure.be> and I extended
  scheduling timer computation to support micro-sec second
  overlap. Extended the whole scheduling framework to support
  this scheduling scheme while computing thread timers.
* Fixed scheduling framework to support child thread timers
  while computing global scheduling timer.
  • Loading branch information
Alexandre Cassen committed Sep 28, 2009
1 parent 6b2cf7c commit c2f69b0
Show file tree
Hide file tree
Showing 102 changed files with 481 additions and 409 deletions.
30 changes: 30 additions & 0 deletions ChangeLog
@@ -1,3 +1,33 @@
2003-09-29 Alexandre Cassen <acassen@linux-vs.org>
* keepalived-1.1.3 released.
* Stephan von Krawczynski, <skraw@ithnet.com> extended ip
address framework to support broadcast address selection.
* Extended the scheduling framework to support plain 'long'
timer. Visited the layer4 framework to support this new
scheduling scheme. Reviewed the checkers and VRRP framework
to support long timer.
* VRRP : Removed the timer micro adjust call. Its use is
obsolete with the new scheduling 'long' timer support.
* Jacob Rief, <Jacob.Rief@tiscover.com> and I added support
log level selection for main daemon. A new command line
argument has been created :
--log-facility -S 0-7 Set syslog facility to
LOG_LOCAL[0-7]. (default=LOG_DAEMON)
* Extended the HTTP checker to support non blocking read
while processing stream. NONBLOCK flags is set before
read operation to catch EAGAIN error.
* VRRP : Diego Rivera, <lrivera@racsa.co.cr> and I fixed a
notify issue while building notify exec string.
* VRRP : Diego Rivera, <lrivera@racsa.co.cr> and I extended
FSM to support BACKUP state notifiers and smtp_alert call
during VRRP initialization.
* Jan Vanhercke, <jan.vanhercke@c-cure.be> and I extended
scheduling timer computation to support micro-sec second
overlap. Extended the whole scheduling framework to support
this scheduling scheme while computing thread timers.
* Fixed scheduling framework to support child thread timers
while computing global scheduling timer.

2003-09-07 Alexandre Cassen <acassen@linux-vs.org>
* keepalived-1.1.2 released.
* Dominik Vogt, <dominik.vogt@gmx.de> and I extended checker
Expand Down
3 changes: 2 additions & 1 deletion README
Expand Up @@ -9,7 +9,8 @@ Keepalived implementation is based on an I/O multiplexer to handle a
strong multi-threading framework. All the events process use this I/O
multiplexer.

Keepalived is free software. See the file COPYING for copying conditions.
Keepalived is free software, Copyright (C) Alexandre Cassen.
See the file COPYING for copying conditions.


OPENSSL TOOLKIT LICENCE EXCEPTION
Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
1.1.2
1.1.3
12 changes: 6 additions & 6 deletions doc/keepalived.conf.SYNOPSIS
Expand Up @@ -39,8 +39,8 @@ global_defs { # Block identification
The configuration block looks like :

static_ipaddress { # block identification
<IP ADDRESS>/<MASK> dev <STRING> scope <SCOPE>
<IP ADDRESS>/<MASK> dev <STRING> scope <SCOPE>
<IP ADDRESS>/<MASK> brd <IP ADDRESS> dev <STRING> scope <SCOPE>
<IP ADDRESS>/<MASK> brd <IP ADDRESS> dev <STRING> scope <SCOPE>
...
}

Expand Down Expand Up @@ -127,13 +127,13 @@ vrrp_instance <STRING> { # VRRP instance declaration
auth_pass <STRING> # Password string
}
virtual_ipaddress { # VRRP IP addres block
<IP ADDRESS>/<MASK> dev <STRING> scope <SCOPE>
<IP ADDRESS>/<MASK> dev <STRING> scope <SCOPE>
<IP ADDRESS>/<MASK> brd <IP ADDRESS> dev <STRING> scope <SCOPE>
<IP ADDRESS>/<MASK> brd <IP ADDRESS> dev <STRING> scope <SCOPE>
...
}
virtual_ipaddress_excluded { # VRRP IP excluded from VRRP
<IP ADDRESS>/<MASK> dev <STRING> scope <SCOPE> # packets
<IP ADDRESS>/<MASK> dev <STRING> scope <SCOPE>
<IP ADDRESS>/<MASK> brd <IP ADDRESS> dev <STRING> scope <SCOPE> # packets
<IP ADDRESS>/<MASK> brd <IP ADDRESS> dev <STRING> scope <SCOPE>
...
}
virtual_routes { # VRRP virtual routes
Expand Down
35 changes: 17 additions & 18 deletions genhash/http.c
Expand Up @@ -58,7 +58,8 @@ extern REQ *req;
*/

/* free allocated pieces */
static void free_all(thread * thread)
static void
free_all(thread * thread)
{
SOCK *sock = THREAD_ARG(thread);

Expand Down Expand Up @@ -87,7 +88,7 @@ epilog(thread * thread)

/* Simple finalization function */
int
finalize(thread *thread)
finalize(thread * thread)
{
SOCK *sock = THREAD_ARG(thread);
unsigned char digest[16];
Expand All @@ -99,7 +100,7 @@ finalize(thread *thread)
printf("\n");
printf(HTML_MD5);
print_buffer(16, digest);

printf(HTML_MD5_FINAL);
}
printf("MD5SUM = ");
Expand All @@ -113,20 +114,22 @@ finalize(thread *thread)
}

/* Process incoming stream */
int http_process_stream(SOCK *sock, int r)
int
http_process_stream(SOCK * sock, int r)
{
sock->size += r;
sock->total_size += r;

if (!sock->extracted) {
if (req->verbose)
printf(HTTP_HEADER_HEXA);
if ((sock->extracted =
extract_html(sock->buffer, sock->size))) {
if ((sock->extracted = extract_html(sock->buffer, sock->size))) {
if (req->verbose) {
print_buffer(sock->extracted - sock->buffer, sock->buffer);
print_buffer(sock->extracted - sock->buffer,
sock->buffer);
printf(HTTP_HEADER_ASCII);
for (r = 0; r < sock->extracted - sock->buffer; r++)
for (r = 0; r < sock->extracted - sock->buffer;
r++)
printf("%c", sock->buffer[r]);
printf("\n");
printf(HTML_HEADER_HEXA);
Expand All @@ -136,8 +139,7 @@ int http_process_stream(SOCK *sock, int r)
if (req->verbose)
print_buffer(r, sock->extracted);
memcpy(sock->buffer, sock->extracted, r);
MD5_Update(&sock->context, sock->buffer,
r);
MD5_Update(&sock->context, sock->buffer, r);
r = 0;
}
sock->size = r;
Expand All @@ -152,8 +154,7 @@ int http_process_stream(SOCK *sock, int r)
} else if (sock->size) {
if (req->verbose)
print_buffer(r, sock->buffer);
MD5_Update(&sock->context, sock->buffer,
sock->size);
MD5_Update(&sock->context, sock->buffer, sock->size);
sock->size = 0;
}

Expand Down Expand Up @@ -249,13 +250,11 @@ http_request_thread(thread * thread)
memset(str_request, 0, GET_BUFFER_LENGTH);

snprintf(str_request, GET_BUFFER_LENGTH, REQUEST_TEMPLATE,
req->url,
(req->vhost) ? req->vhost : inet_ntop2(req->addr_ip)
req->url, (req->vhost) ? req->vhost : inet_ntop2(req->addr_ip)
, ntohs(req->addr_port));

/* Send the GET request to remote Web server */
DBG("Sending GET request [%s] on fd:%d\n",
req->url, sock->fd);
DBG("Sending GET request [%s] on fd:%d\n", req->url, sock->fd);
if (req->ssl)
ret =
ssl_send_request(sock->ssl, str_request,
Expand All @@ -269,8 +268,8 @@ http_request_thread(thread * thread)

if (!ret) {
fprintf(stderr, "Cannot send get request to [%s:%d].\n",
inet_ntop2(req->addr_ip)
, ntohs(req->addr_port));
inet_ntop2(req->addr_ip)
, ntohs(req->addr_port));
return epilog(thread);
}

Expand Down
8 changes: 4 additions & 4 deletions genhash/http.h
Expand Up @@ -36,7 +36,7 @@
/* global defs */
#define GET_BUFFER_LENGTH 2048
#define MAX_BUFFER_LENGTH 4096
#define HTTP_CNX_TIMEOUT 5
#define HTTP_CNX_TIMEOUT (5 * TIMER_HZ)
#define PROTO_HTTP 0x01
#define PROTO_SSL 0x02

Expand All @@ -55,9 +55,9 @@
#define HTML_MD5_FINAL DELIM_BEGIN" HTML MD5 final resulting "DELIM_END

/* Define prototypes */
extern int epilog(thread *thread);
extern int finalize(thread *thread);
extern int http_process_stream(SOCK *sock, int r);
extern int epilog(thread * thread);
extern int finalize(thread * thread);
extern int http_process_stream(SOCK * sock, int r);
extern int http_request_thread(thread * thread);

#endif
23 changes: 8 additions & 15 deletions genhash/layer4.c
Expand Up @@ -115,15 +115,8 @@ tcp_socket_state(int fd, thread * thread, uint32_t addr_ip, uint16_t addr_port,
inet_ntop2(addr_ip), ntohs(addr_port));

timer_min = timer_sub_now(thread->sands);

if (TIMER_SEC(timer_min) <= 0)
thread_add_write(thread->master, func,
THREAD_ARG(thread)
, thread->u.fd, 0);
else
thread_add_write(thread->master, func,
THREAD_ARG(thread)
, thread->u.fd, TIMER_SEC(timer_min));
thread_add_write(thread->master, func, THREAD_ARG(thread)
, thread->u.fd, TIMER_LONG(timer_min));
return connect_in_progress;
}

Expand All @@ -133,7 +126,7 @@ tcp_socket_state(int fd, thread * thread, uint32_t addr_ip, uint16_t addr_port,
void
tcp_connection_state(int fd, enum connect_result status, thread * thread,
int (*func) (struct _thread *)
, int timeout)
, long timeout)
{
switch (status) {
case connect_error:
Expand All @@ -145,7 +138,7 @@ tcp_connection_state(int fd, enum connect_result status, thread * thread,
fd, timeout);
break;

/* Checking non-blocking connect, we wait until socket is writable */
/* Checking non-blocking connect, we wait until socket is writable */
case connect_in_progress:
thread_add_write(thread->master, func, THREAD_ARG(thread),
fd, timeout);
Expand All @@ -162,8 +155,9 @@ tcp_check_thread(thread * thread)
SOCK *sock = THREAD_ARG(thread);
int ret = 1;

sock->status = tcp_socket_state(thread->u.fd, thread, req->addr_ip
, req->addr_port, tcp_check_thread);
sock->status =
tcp_socket_state(thread->u.fd, thread, req->addr_ip, req->addr_port,
tcp_check_thread);
switch (sock->status) {
case connect_error:
DBG("Error connecting server [%s:%d].\n",
Expand All @@ -189,8 +183,7 @@ tcp_check_thread(thread * thread)
*/
sock->lock = 0;
thread_add_event(thread->master,
http_request_thread,
sock, 0);
http_request_thread, sock, 0);
} else {
DBG("Connection trouble to: [%s:%d].\n",
inet_ntop2(req->addr_ip),
Expand Down
14 changes: 7 additions & 7 deletions genhash/layer4.h
Expand Up @@ -46,18 +46,18 @@ enum connect_result {

/* Prototypes defs */
extern enum connect_result
tcp_connect(int fd, uint32_t, uint16_t);
tcp_connect(int fd, uint32_t, uint16_t);

extern enum connect_result
tcp_socket_state(int, thread *, uint32_t, uint16_t,
int (*func) (struct _thread *));
tcp_socket_state(int, thread *, uint32_t, uint16_t,
int (*func) (struct _thread *));

extern void
tcp_connection_state(int, enum connect_result
, thread *, int (*func) (struct _thread *)
, int);
tcp_connection_state(int, enum connect_result
, thread *, int (*func) (struct _thread *)
, long);

extern int
tcp_connect_thread(thread *);
tcp_connect_thread(thread *);

#endif
9 changes: 4 additions & 5 deletions genhash/main.c
Expand Up @@ -54,13 +54,13 @@ signal_set(int signo, void (*func) (int))
sig.sa_flags = 0;
#ifdef SA_RESTART
sig.sa_flags |= SA_RESTART;
#endif /* SA_RESTART */
#endif /* SA_RESTART */

ret = sigaction(signo, &sig, &osig);

if (ret < 0)
return (SIG_ERR);
else
else
return (osig.sa_handler);
}

Expand All @@ -74,7 +74,6 @@ signal_init(void)
signal_set(SIGKILL, sigend);
}


/* Usage function */
static void
usage(const char *prog)
Expand Down Expand Up @@ -220,7 +219,7 @@ main(int argc, char **argv)

/* Signal handling initialization */
signal_init();

/* Create the master thread */
master = thread_make_master();

Expand All @@ -238,7 +237,7 @@ main(int argc, char **argv)
/* Finalize output informations */
if (req->verbose)
printf("Global response time for [%s] =%lu\n",
req->url, req->response_time-req->ref_time);
req->url, req->response_time - req->ref_time);

/* exit cleanly */
SSL_CTX_free(req->ctx);
Expand Down
2 changes: 1 addition & 1 deletion genhash/main.h
Expand Up @@ -71,7 +71,7 @@ typedef struct {
} REQ;

/* Global variables */
REQ *req; /* Cmd line arguments */
REQ *req; /* Cmd line arguments */
unsigned int debug;

/* Data buffer length description */
Expand Down
16 changes: 9 additions & 7 deletions genhash/sock.c
Expand Up @@ -36,7 +36,8 @@ extern thread_master *master;
extern SOCK *sock;

/* Close the descriptor */
static void close_sock(SOCK *sock)
static void
close_sock(SOCK * sock)
{
if (sock->ssl) {
SSL_shutdown(sock->ssl);
Expand All @@ -46,7 +47,8 @@ static void close_sock(SOCK *sock)
}

/* Destroy the socket handler */
void free_sock(SOCK *sock)
void
free_sock(SOCK * sock)
{
DBG("Freeing fd:%d\n", sock->fd);

Expand All @@ -55,10 +57,10 @@ void free_sock(SOCK *sock)
}

/* Init socket handler */
void init_sock(void)
void
init_sock(void)
{
sock = (SOCK *)MALLOC(sizeof(SOCK));
memset(sock, 0, sizeof(SOCK));
thread_add_event(master, tcp_connect_thread,
sock, 0);
sock = (SOCK *) MALLOC(sizeof (SOCK));
memset(sock, 0, sizeof (SOCK));
thread_add_event(master, tcp_connect_thread, sock, 0);
}
2 changes: 1 addition & 1 deletion genhash/sock.h
Expand Up @@ -44,7 +44,7 @@ typedef struct {
} SOCK;

/* Prototypes */
extern void free_sock(SOCK *sock);
extern void free_sock(SOCK * sock);
extern void init_sock(void);

#endif
5 changes: 2 additions & 3 deletions genhash/ssl.c
Expand Up @@ -106,8 +106,7 @@ ssl_connect(thread * thread)
SSL_set_bio(sock->ssl, sock->bio, sock->bio);
ret = SSL_connect(sock->ssl);

DBG(" SSL_connect return code = %d on fd:%d\n",
ret, thread->u.fd);
DBG(" SSL_connect return code = %d on fd:%d\n", ret, thread->u.fd);
ssl_printerr(SSL_get_error(sock->ssl, ret));

return (ret > 0) ? 1 : 0;
Expand Down Expand Up @@ -161,7 +160,7 @@ ssl_read_thread(thread * thread)
* and sometime not...
*/

read_stream:
read_stream:

/* read the SSL stream */
memset(sock->buffer, 0, MAX_BUFFER_LENGTH);
Expand Down

0 comments on commit c2f69b0

Please sign in to comment.