]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: checks: retrieve the check-specific defines from server.h to checks.h
authorWilly Tarreau <w@1wt.eu>
Wed, 11 Dec 2013 15:45:07 +0000 (16:45 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 14 Dec 2013 15:02:18 +0000 (16:02 +0100)
After the move of checks from servers to autonomous checks, we need a
massive cleanup and reordering as it's becoming increasingly difficult
to find the definitions of types and enums.

Nothing was changed, blocks were just moved.

include/types/checks.h
include/types/server.h

index 956df3a0c116cce446fb48f9065bcfc03ee2004a..381c990fbd7f6e359d9d4948d5539e10fe28e424 100644 (file)
 #ifndef _TYPES_CHECKS_H
 #define _TYPES_CHECKS_H
 
+#include <sys/time.h>
+
+#include <common/config.h>
+#include <common/mini-clist.h>
+#include <common/regex.h>
+
+#include <types/connection.h>
+#include <types/obj_type.h>
+#include <types/task.h>
+#include <types/server.h>
+
+
+/* bits for s->result used for health-checks */
+#define SRV_CHK_UNKNOWN 0x0000
+#define SRV_CHK_FAILED  0x0001
+#define SRV_CHK_PASSED  0x0002
+#define SRV_CHK_DISABLE 0x0004
+
+/* check flags */
+#define CHK_STATE_RUNNING      0x0001  /* this check is currently running */
+#define CHK_STATE_DISABLED     0x0002  /* this check is currently administratively disabled */
+
 /* check status */
 enum {
        HCHK_STATUS_UNKNOWN      = 0,   /* Unknown */
@@ -95,6 +117,28 @@ enum {
        HANA_OBS_SIZE
 };
 
+struct check {
+       struct connection *conn;                /* connection state for health checks */
+       unsigned short port;                    /* the port to use for the health checks */
+       struct buffer *bi, *bo;                 /* input and output buffers to send/recv check */
+       struct task *task;                      /* the task associated to the health check processing, NULL if disabled */
+       struct timeval start;                   /* last health check start time */
+       long duration;                          /* time in ms took to finish last health check */
+       short status, code;                     /* check result, check code */
+       char desc[HCHK_DESC_LEN];               /* health check descritpion */
+       int use_ssl;                            /* use SSL for health checks */
+       int send_proxy;                         /* send a PROXY protocol header with checks */
+       struct tcpcheck_rule *current_step;     /* current step when using tcpcheck */
+       int inter, fastinter, downinter;        /* checks: time in milliseconds */
+       int result;                             /* health-check result : SRV_CHK_* */
+       int state;                              /* health-check result : CHK_* */
+       int health;                             /* 0 to rise-1 = bad;
+                                                * rise to rise+fall-1 = good */
+       int rise, fall;                         /* time in iterations */
+       int type;                               /* Check type, one of PR_O2_*_CHK */
+       struct server *server;                  /* back-pointer to server */
+};
+
 struct check_status {
        short result;                   /* one of SRV_CHK_* */
        char *info;                     /* human readable short info */
index a3775a7c889351a66c213ba9554d70c9d8aa2a23..7775369d6154f4af8a445e5c94a53a203f0b316f 100644 (file)
 #define SRV_STATUS_FULL     3   /* the/all server(s) are saturated */
 #define SRV_STATUS_QUEUED   4   /* the/all server(s) are saturated but the connection was queued */
 
-/* bits for s->result used for health-checks */
-#define SRV_CHK_UNKNOWN 0x0000   /* initialized to this by default */
-#define SRV_CHK_FAILED  0x0001   /* server check failed, flag has precedence over SRV_CHK_PASSED */
-#define SRV_CHK_PASSED  0x0002   /* server check succeeded unless FAILED is also set */
-#define SRV_CHK_DISABLE 0x0004   /* server returned a "disable" code */
-
-/* check flags */
-#define CHK_STATE_RUNNING      0x0001  /* this check is currently running */
-#define CHK_STATE_DISABLED     0x0002  /* this check is currently administratively disabled */
-
 /* various constants */
 #define SRV_UWGHT_RANGE 256
 #define SRV_UWGHT_MAX   (SRV_UWGHT_RANGE)
@@ -110,29 +100,6 @@ struct tree_occ {
        struct eb32_node node;
 };
 
-struct check {
-       struct connection *conn;                /* connection state for health checks */
-
-       unsigned short port;                    /* the port to use for the health checks */
-       struct buffer *bi, *bo;                 /* input and output buffers to send/recv check */
-       struct task *task;                      /* the task associated to the health check processing, NULL if disabled */
-       struct timeval start;                   /* last health check start time */
-       long duration;                          /* time in ms took to finish last health check */
-       short status, code;                     /* check result, check code */
-       char desc[HCHK_DESC_LEN];               /* health check descritpion */
-       int use_ssl;                            /* use SSL for health checks */
-       int send_proxy;                         /* send a PROXY protocol header with checks */
-       struct tcpcheck_rule *current_step;     /* current step when using tcpcheck */
-       int inter, fastinter, downinter;        /* checks: time in milliseconds */
-       int result;                             /* health-check result : SRV_CHK_* */
-       int state;                              /* health-check result : CHK_* */
-       int health;                             /* 0 to rise-1 = bad;
-                                                * rise to rise+fall-1 = good */
-       int rise, fall;                         /* time in iterations */
-       int type;                               /* Check type, one of PR_O2_*_CHK */
-       struct server *server;                  /* back-pointer to server */
-};
-
 struct server {
        enum obj_type obj_type;                 /* object type == OBJ_TYPE_SERVER */
        struct server *next;