MEDIUM: checks: Add implicit tcp-check connect rule
After the configuration parsing, when its validity check, an implicit tcp-check
connect rule is added in front of the tcp-check ruleset if the first non-comment
rule is not a connect one. This implicit rule is flagged to use the default
check parameter.
This means now, all tcp-check rulesets begin with a connect and are never
empty. When tcp-check healthchecks are used, all connections are thus handled by
tcpcheck_main() function.
diff --git a/include/types/checks.h b/include/types/checks.h
index 2fc8012..521dca8 100644
--- a/include/types/checks.h
+++ b/include/types/checks.h
@@ -211,10 +211,11 @@
unsigned char lr[HANA_OBS_SIZE]; /* result for l4/l7: 0 = ignore, 1 - error, 2 - OK */
};
-#define TCPCHK_OPT_NONE 0x0000 /* no options specified, default */
-#define TCPCHK_OPT_SEND_PROXY 0x0001 /* send proxy-protocol string */
-#define TCPCHK_OPT_SSL 0x0002 /* SSL connection */
-#define TCPCHK_OPT_LINGER 0x0004 /* Do not RST connection, let it linger */
+#define TCPCHK_OPT_NONE 0x0000 /* no options specified, default */
+#define TCPCHK_OPT_SEND_PROXY 0x0001 /* send proxy-protocol string */
+#define TCPCHK_OPT_SSL 0x0002 /* SSL connection */
+#define TCPCHK_OPT_LINGER 0x0004 /* Do not RST connection, let it linger */
+#define TCPCHK_OPT_DEFAULT_CONNECT 0x0008 /* Do a connect using server params */
struct tcpcheck_connect {
uint16_t port; /* port to connect to */