Permalink
Browse files

keepalived-0.5.8

* keepalived-0.5.8 released.
* Added an OpenSSL Licence exception to grant Keepalived compilation
  with OpenSSL Toolkit.
  Thanks to Andres Salomon, <dilinger@voxel.net> for suggesting.
* Added connection port selection for Healthcheckers (TCP_CHECK,
  HTTP|SSL_GET). Can be usefull for Healthcheck in fwmark LVS topology
  for grouping service.
  Thanks to Richard  L. Allbery, <rla@prideindustries.com> for suggesting.
  See samples directory for examples.
* Fixed some IPVS exclusion code when running --disable-lvs.
* Added support to VirtualHost selection when using HTTP|SSL_GET.
  See samples directory for examples.
* Added VirtualHost selection into the genhash utility.
* Fixed some IPVS sync daemon initializations issues.
* Cometics patches in IPVS wrapper framework.
* Added support to quoted string. This can be usefull if you are using
  MISC_CHECK and you want to pass arguments to called script. See samples.
  Thanks to Benoit Gaussen, <ben@trez42.net> for suggesting.
* Prepare work on real_server_group in order to group some realserver
  declaration.
* VRRP : Fixed a password length exception causing an unwanted dropping
  issue.
* VRRP : Enhanced the MASTER state to send gratuitous arp if receiving
  a remote lower prio advert => This fix a remote stalled ARP cache.
  Thanks to Simon Kirby, <sim@netnation.com> for discussing this case.
  • Loading branch information...
1 parent ab59e5d commit 1cfb6e163dc116d55e05f5a263b3a84c78f073eb Alexandre Cassen committed May 21, 2002
Showing with 822 additions and 266 deletions.
  1. +358 −0 :
  2. 0 AUTHORS → AUTHOR
  3. +27 −0 ChangeLog
  4. +12 −0 README
  5. +1 −1 VERSION
  6. +1 −1 check_api.c
  7. +2 −1 check_api.h
  8. +68 −32 check_http.c
  9. +2 −2 check_http.h
  10. +1 −1 check_misc.c
  11. +1 −1 check_misc.h
  12. +1 −1 check_ssl.c
  13. +1 −1 check_ssl.h
  14. +24 −6 check_tcp.c
  15. +2 −1 check_tcp.h
  16. +0 −1 configure
  17. +0 −1 configure.in
  18. +1 −1 daemon.c
  19. +1 −1 daemon.h
  20. +19 −9 data.c
  21. +9 −2 data.h
  22. +11 −2 genhash/main.c
  23. +2 −1 genhash/main.h
  24. +1 −1 ipfwwrapper.c
  25. +1 −1 ipfwwrapper.h
  26. +6 −28 ipvswrapper.c
  27. +5 −3 ipvswrapper.h
  28. +33 −17 ipwrapper.c
  29. +1 −1 ipwrapper.h
  30. +1 −1 layer4.c
  31. +1 −1 layer4.h
  32. +1 −1 list.c
  33. +1 −1 list.h
  34. +1 −1 main.c
  35. +3 −3 main.h
  36. +1 −1 memory.c
  37. +1 −1 memory.h
  38. +46 −14 parser.c
  39. +1 −1 parser.h
  40. +1 −1 pidfile.c
  41. +1 −1 pidfile.h
  42. +4 −3 samples/{keepalived.conf.ssl → keepalived.conf.HTTP_GET.port}
  43. +30 −0 samples/keepalived.conf.fwmark
  44. +0 −90 samples/keepalived.conf.misc_check
  45. +29 −0 samples/keepalived.conf.misc_check_arg
  46. +36 −0 samples/keepalived.conf.real_server_group
  47. +38 −0 samples/keepalived.conf.virtualhost
  48. +1 −1 scheduler.c
  49. +1 −1 scheduler.h
  50. +1 −1 smtp.c
  51. +1 −1 smtp.h
  52. +1 −1 timer.c
  53. +1 −1 timer.h
  54. +1 −1 utils.c
  55. +1 −1 utils.h
  56. +1 −1 vector.c
  57. +1 −1 vector.h
  58. +8 −8 vrrp.c
  59. +1 −1 vrrp.h
  60. +1 −1 vrrp_if.c
  61. +1 −1 vrrp_if.h
  62. +1 −1 vrrp_ipaddress.c
  63. +1 −1 vrrp_ipaddress.h
  64. +1 −1 vrrp_ipsecah.c
  65. +1 −1 vrrp_ipsecah.h
  66. +1 −1 vrrp_netlink.c
  67. +1 −1 vrrp_netlink.h
  68. +7 −1 vrrp_scheduler.c
  69. +1 −1 vrrp_scheduler.h
View
358 :
@@ -0,0 +1,358 @@
+/*
+ * Soft: Keepalived is a failover program for the LVS project
+ * <www.linuxvirtualserver.org>. It monitor & manipulate
+ * a loadbalanced server pool using multi-layer checks.
+ *
+ * Part: Dynamic data structure definition.
+ *
+ * Version: $Id: data.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
+ *
+ * Author: Alexandre Cassen, <acassen@linux-vs.org>
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#include "data.h"
+#include "memory.h"
+#include "utils.h"
+#include "check_api.h"
+#include "vrrp.h"
+
+extern data *conf_data;
+
+/* email facility functions */
+static void free_email(void *data)
+{
+ FREE(data);
+}
+static void dump_email(void *data)
+{
+ char *addr = data;
+ syslog(LOG_INFO, " Email notification = %s", addr);
+}
+void alloc_email(char *addr)
+{
+ int size = strlen(addr);
+ char *new;
+
+ new = (char *)MALLOC(size+1);
+ memcpy(new, addr, size);
+
+ list_add(conf_data->email, new);
+}
+
+/* SSL facility functions */
+SSL_DATA *alloc_ssl(void)
+{
+ SSL_DATA *ssl = (SSL_DATA *)MALLOC(sizeof(SSL_DATA));
+ return ssl;
+}
+static void free_ssl(void)
+{
+ SSL_DATA *ssl = conf_data->ssl;
+
+ if (!ssl) return;
+ FREE_PTR(ssl->password);
+ FREE_PTR(ssl->cafile);
+ FREE_PTR(ssl->certfile);
+ FREE_PTR(ssl->keyfile);
+ FREE(ssl);
+}
+static void dump_ssl(void)
+{
+ SSL_DATA *ssl = conf_data->ssl;
+
+ if (ssl->password)
+ syslog(LOG_INFO, " Password : %s", ssl->password);
+ if (ssl->cafile)
+ syslog(LOG_INFO, " CA-file : %s", ssl->cafile);
+ if (ssl->certfile)
+ syslog(LOG_INFO, " Certificate file : %s", ssl->certfile);
+ if (ssl->keyfile)
+ syslog(LOG_INFO, " Key file : %s", ssl->keyfile);
+ if (!ssl->password && !ssl->cafile && !ssl->certfile && !ssl->keyfile)
+ syslog(LOG_INFO, " Using autogen SSL context");
+}
+
+/* VRRP facility functions */
+static void free_vrrp(void *data)
+{
+ vrrp_rt *vrrp = data;
+
+ FREE(vrrp->iname);
+ FREE_PTR(vrrp->isync);
+ FREE_PTR(vrrp->lvs_syncd_if);
+ FREE_PTR(vrrp->vaddr);
+ FREE(vrrp->ipsecah_counter);
+ FREE(vrrp);
+}
+static void dump_vrrp(void *data)
+{
+ vrrp_rt *vrrp = data;
+ int i;
+
+ syslog(LOG_INFO, " VRRP Instance = %s", vrrp->iname);
+ if (vrrp->isync)
+ syslog(LOG_INFO, " Sync with instance = %s", vrrp->isync);
+ if (vrrp->init_state == VRRP_STATE_BACK)
+ syslog(LOG_INFO, " Want State = BACKUP");
+ else
+ syslog(LOG_INFO, " Want State = MASTER");
+ syslog(LOG_INFO, " Runing on device = %s", IF_NAME(vrrp->ifp));
+ if (vrrp->lvs_syncd_if)
+ syslog(LOG_INFO, " Runing LVS sync daemon on interface = %s"
+ , vrrp->lvs_syncd_if);
+ syslog(LOG_INFO, " Virtual Router ID = %d", vrrp->vrid);
+ syslog(LOG_INFO, " Priority = %d", vrrp->priority);
+ syslog(LOG_INFO, " Advert interval = %dsec", vrrp->adver_int/TIMER_HZ);
+ if (vrrp->preempt)
+ syslog(LOG_INFO, " Preempt Active");
+ if (vrrp->auth_type) {
+ syslog(LOG_INFO, " Authentication type = %s",
+ (vrrp->auth_type == VRRP_AUTH_AH)?"IPSEC_AH":"SIMPLE_PASSWORD" );
+ syslog(LOG_INFO, " Password = %s", vrrp->auth_data);
+ }
+ syslog(LOG_INFO, " VIP count = %d", vrrp->naddr);
+ for (i = 0; i < vrrp->naddr; i++)
+ syslog(LOG_INFO, " VIP%d = %s", i+1, ip_ntoa(vrrp->vaddr[i].addr));
+ if (vrrp->notify_exec)
+ syslog(LOG_INFO, " Using notification script = %s"
+ , vrrp->notify_file);
+ if (vrrp->smtp_alert)
+ syslog(LOG_INFO, " Using smtp notification");
+}
+void alloc_vrrp(char *iname)
+{
+ int size = strlen(iname);
+ seq_counter *counter;
+ vrrp_rt *new;
+
+ /* Allocate new VRRP structure */
+ new = (vrrp_rt *) MALLOC(sizeof(vrrp_rt));
+ counter = (seq_counter *) MALLOC(sizeof(seq_counter));
+
+ /* Build the structure */
+ new->ipsecah_counter = counter;
+
+ /* Set default values */
+ new->wantstate = VRRP_STATE_BACK;
+ new->init_state = VRRP_STATE_BACK;
+ new->adver_int = TIMER_HZ;
+ new->iname = (char *)MALLOC(size+1);
+ memcpy(new->iname, iname, size);
+
+ list_add(conf_data->vrrp, new);
+}
+void alloc_vrrp_vip(char *vip)
+{
+ vrrp_rt *vrrp = LIST_TAIL_DATA(conf_data->vrrp);
+ uint32_t ipaddr = inet_addr(vip);
+
+ vrrp->naddr++;
+ if (vrrp->vaddr)
+ vrrp->vaddr = REALLOC(vrrp->vaddr, vrrp->naddr*sizeof(*vrrp->vaddr));
+ else
+ vrrp->vaddr = (vip_addr *)MALLOC(sizeof(*vrrp->vaddr));
+ vrrp->vaddr[vrrp->naddr-1].addr = ipaddr;
+ vrrp->vaddr[vrrp->naddr-1].set = 0;
+}
+
+/* Virtual server facility functions */
+static void free_vs(void *data)
+{
+ virtual_server *vs = data;
+ FREE_PTR(vs->virtualhost);
+ FREE_PTR(vs->s_svr);
+ if (!LIST_ISEMPTY(vs->rs))
+ free_list(vs->rs);
+ FREE(vs);
+}
+static void dump_vs(void *data)
+{
+ virtual_server *vs = data;
+
+ if (vs->vfwmark)
+ syslog(LOG_INFO, " VS FWMARK = %d", vs->vfwmark);
+ else
+ syslog(LOG_INFO, " VIP = %s, VPORT = %d"
+ , ip_ntoa(SVR_IP(vs))
+ , ntohs(SVR_PORT(vs)));
+ if (vs->virtualhost)
+ syslog(LOG_INFO, " VirtualHost = %s", vs->virtualhost);
+ syslog(LOG_INFO, " delay_loop = %d, lb_algo = %s"
+ , vs->delay_loop
+ , vs->sched);
+ if (atoi(vs->timeout_persistence) > 0)
+ syslog(LOG_INFO, " persistence timeout = %s"
+ , vs->timeout_persistence);
+ if (vs->granularity_persistence)
+ syslog(LOG_INFO, " persistence granularity = %s"
+ , ip_ntoa(vs->granularity_persistence));
+ syslog(LOG_INFO, " protocol = %s"
+ , (vs->service_type == IPPROTO_TCP)?"TCP":"UDP");
+
+ switch (vs->loadbalancing_kind) {
+#ifdef _WITH_LVS_
+#ifdef _KRNL_2_2_
+ case 0:
+ syslog(LOG_INFO, " lb_kind = NAT");
+ syslog(LOG_INFO, " nat mask = %s", ip_ntoa(vs->nat_mask));
+ break;
+ case IP_MASQ_F_VS_DROUTE:
+ syslog(LOG_INFO, " lb_kind = DR");
+ break;
+ case IP_MASQ_F_VS_TUNNEL:
+ syslog(LOG_INFO, " lb_kind = TUN");
+ break;
+#else
+ case IP_VS_CONN_F_MASQ:
+ syslog(LOG_INFO, " lb_kind = NAT");
+ break;
+ case IP_VS_CONN_F_DROUTE:
+ syslog(LOG_INFO, " lb_kind = DR");
+ break;
+ case IP_VS_CONN_F_TUNNEL:
+ syslog(LOG_INFO, " lb_kind = TUN");
+ break;
+#endif
+#endif
+ }
+
+ if (vs->s_svr) {
+ syslog(LOG_INFO, " sorry server = %s:%d"
+ , ip_ntoa(SVR_IP(vs->s_svr))
+ , ntohs(SVR_PORT(vs->s_svr)));
+ }
+ if (!LIST_ISEMPTY(vs->rs))
+ dump_list(vs->rs);
+}
+void alloc_vs(char *ip, char *port)
+{
+ virtual_server *new;
+
+ new = (virtual_server *)MALLOC(sizeof(virtual_server));
+
+ if (!strcmp(ip, "fwmark")) {
+ new->vfwmark = atoi(port);
+ } else {
+ new->addr_ip = inet_addr(ip);
+ new->addr_port = htons(atoi(port));
+ }
+ new->delay_loop = KEEPALIVED_DEFAULT_DELAY;
+ strncpy(new->timeout_persistence, "0", 1);
+ new->virtualhost = NULL;
+
+ list_add(conf_data->vs, new);
+}
+
+/* Sorry server facility functions */
+void alloc_ssvr(char *ip, char *port)
+{
+ virtual_server *vs = LIST_TAIL_DATA(conf_data->vs);
+
+ vs->s_svr = (real_server *)MALLOC(sizeof(real_server));
+ vs->s_svr->weight = 1;
+ vs->s_svr->addr_ip = inet_addr(ip);
+ vs->s_svr->addr_port = htons(atoi(port));
+}
+
+/* Real server facility functions */
+static void free_rs(void *data)
+{
+ real_server *rs = data;
+ FREE(rs);
+}
+static void dump_rs(void *data)
+{
+ real_server *rs = data;
+ syslog(LOG_INFO, " RIP = %s, RPORT = %d, WEIGHT = %d"
+ , ip_ntoa(SVR_IP(rs))
+ , ntohs(SVR_PORT(rs))
+ , rs->weight);
+}
+void alloc_rs(char *ip, char *port)
+{
+ virtual_server *vs = LIST_TAIL_DATA(conf_data->vs);
+ real_server *new;
+
+ new = (real_server *)MALLOC(sizeof(real_server));
+
+ new->addr_ip = inet_addr(ip);
+ new->addr_port = htons(atoi(port));
+ new->alive = 1;
+
+ if (LIST_ISEMPTY(vs->rs))
+ vs->rs = alloc_list(free_rs, dump_rs);
+ list_add(vs->rs, new);
+ vs->last_rs_type = RS;
+}
+
+/* data facility functions */
+data *alloc_data(void)
+{
+ data *new;
+
+ new = (data *)MALLOC(sizeof(data));
+ new->email = alloc_list(free_email, dump_email);
+ new->vrrp = alloc_list(free_vrrp, dump_vrrp);
+ new->vs = alloc_list(free_vs, dump_vs);
+
+ return new;
+}
+void free_data(void)
+{
+ free_ssl();
+ free_list(conf_data->email);
+ free_list(conf_data->vrrp);
+ free_list(conf_data->vs);
+
+ FREE_PTR(conf_data->lvs_id);
+ FREE_PTR(conf_data->email_from);
+ FREE(conf_data);
+}
+void dump_data(void)
+{
+ if (conf_data->lvs_id ||
+ conf_data->smtp_server ||
+ conf_data->smtp_connection_to ||
+ conf_data->email_from) {
+ syslog(LOG_INFO, "------< Global definitions >------");
+ }
+ if (conf_data->lvs_id)
+ syslog(LOG_INFO, " LVS ID = %s", conf_data->lvs_id);
+ if (conf_data->smtp_server)
+ syslog(LOG_INFO, " Smtp server = %s", ip_ntoa(conf_data->smtp_server));
+ if (conf_data->smtp_connection_to)
+ syslog(LOG_INFO, " Smtp server connection timeout = %d"
+ , conf_data->smtp_connection_to);
+ if (conf_data->email_from) {
+ syslog(LOG_INFO, " Email notification from = %s"
+ , conf_data->email_from);
+ dump_list(conf_data->email);
+ }
+ if (conf_data->ssl) {
+ syslog(LOG_INFO, "------< SSL definitions >------");
+ dump_ssl();
+ }
+ if (!LIST_ISEMPTY(conf_data->vrrp)) {
+ syslog(LOG_INFO, "------< VRRP Topology >------");
+ dump_list(conf_data->vrrp);
+ }
+#ifdef _WITH_LVS_
+ if (!LIST_ISEMPTY(conf_data->vs)) {
+ syslog(LOG_INFO, "------< LVS Topology >------");
+ syslog(LOG_INFO, " System is compiled with LVS v%d.%d.%d"
+ , NVERSION(IP_VS_VERSION_CODE));
+ dump_list(conf_data->vs);
+ }
+ dump_checkers_queue();
+#endif
+}
View
File renamed without changes.
View
@@ -1,3 +1,30 @@
+2002-05-21 Alexandre Cassen <acassen@linux-vs.org>
+ * keepalived-0.5.8 released.
+ * Added an OpenSSL Licence exception to grant Keepalived compilation
+ with OpenSSL Toolkit.
+ Thanks to Andres Salomon, <dilinger@voxel.net> for suggesting.
+ * Added connection port selection for Healthcheckers (TCP_CHECK,
+ HTTP|SSL_GET). Can be usefull for Healthcheck in fwmark LVS topology
+ for grouping service.
+ Thanks to Richard L. Allbery, <rla@prideindustries.com> for suggesting.
+ See samples directory for examples.
+ * Fixed some IPVS exclusion code when running --disable-lvs.
+ * Added support to VirtualHost selection when using HTTP|SSL_GET.
+ See samples directory for examples.
+ * Added VirtualHost selection into the genhash utility.
+ * Fixed some IPVS sync daemon initializations issues.
+ * Cometics patches in IPVS wrapper framework.
+ * Added support to quoted string. This can be usefull if you are using
+ MISC_CHECK and you want to pass arguments to called script. See samples.
+ Thanks to Benoit Gaussen, <ben@trez42.net> for suggesting.
+ * Prepare work on real_server_group in order to group some realserver
+ declaration.
+ * VRRP : Fixed a password length exception causing an unwanted dropping
+ issue.
+ * VRRP : Enhanced the MASTER state to send gratuitous arp if receiving
+ a remote lower prio advert => This fix a remote stalled ARP cache.
+ Thanks to Simon Kirby, <sim@netnation.com> for discussing this case.
+
2002-05-02 Alexandre Cassen <acassen@linux-vs.org>
* keepalived-0.5.7 released.
* Review autoconf/automake scripts to be more generic on system and code
Oops, something went wrong.

0 comments on commit 1cfb6e1

Please sign in to comment.