MEDIUM: checks: Implement SPOP check using tcp-check rules
A share tcp-check ruleset is now created to support SPOP checks. This way no
extra memory is used if several backends use a SPOP check.
The following sequence is used :
tcp-check send-binary SPOP_REQ
tcp-check expect custom min-recv 4
The spop request is the result of the function
spoe_prepare_healthcheck_request() and the expect rule relies on a custom
function calling spoe_handle_healthcheck_response().
diff --git a/include/proto/checks.h b/include/proto/checks.h
index ff43238..669c620 100644
--- a/include/proto/checks.h
+++ b/include/proto/checks.h
@@ -81,6 +81,8 @@
const char *file, int line);
int proxy_parse_ldap_check_opt(char **args, int cur_arg, struct proxy *curpx, struct proxy *defpx,
const char *file, int line);
+int proxy_parse_spop_check_opt(char **args, int cur_arg, struct proxy *curpx, struct proxy *defpx,
+ const char *file, int line);
#endif /* _PROTO_CHECKS_H */
diff --git a/include/types/checks.h b/include/types/checks.h
index a5676c1..d3da5f2 100644
--- a/include/types/checks.h
+++ b/include/types/checks.h
@@ -318,6 +318,7 @@
#define TCPCHK_RULES_MYSQL_CHK 0x00000050
#define TCPCHK_RULES_LDAP_CHK 0x00000060
#define TCPCHK_RULES_SSL3_CHK 0x00000070
+#define TCPCHK_RULES_SPOP_CHK 0x00000090
/* A list of tcp-check vars, to be registered before executing a ruleset */
struct tcpcheck_var {
diff --git a/include/types/proxy.h b/include/types/proxy.h
index bf2a798..e13c63c 100644
--- a/include/types/proxy.h
+++ b/include/types/proxy.h
@@ -175,8 +175,7 @@
#define PR_O2_LB_AGENT_CHK 0x80000000 /* use a TCP connection to obtain a metric of server health */
#define PR_O2_TCPCHK_CHK 0x90000000 /* use TCPCHK check for server health */
#define PR_O2_EXT_CHK 0xA0000000 /* use external command for server health */
-#define PR_O2_SPOP_CHK 0xB0000000 /* use SPOP for server health */
-/* unused: 0xC0000000 to 0xF000000, reserved for health checks */
+/* unused: 0xB0000000 to 0xF000000, reserved for health checks */
#define PR_O2_CHK_ANY 0xF0000000 /* Mask to cover any check */
/* end of proxy->options2 */