MEDIUM: checks: Support expression to set the port
Since we have a session attached to tcp-check healthchecks, It is possible use
sample expression and variables. In addition, it is possible to add tcp-check
set-var rules to define custom variables. So, now, a sample expression can be
used to define the port to use to establish a connection for a tcp-check connect
rule. For instance:
tcp-check set-var(check.port) int(8888)
tcp-check connect port var(check.port)
diff --git a/include/types/checks.h b/include/types/checks.h
index 29d0ebd..49e4ed6 100644
--- a/include/types/checks.h
+++ b/include/types/checks.h
@@ -225,6 +225,7 @@
int alpn_len; /* ALPN string length */
uint16_t options; /* options when setting up a new connection */
uint16_t port; /* port to connect to */
+ struct sample_expr *port_expr; /* sample expr to determine the port, may be NULL */
struct sockaddr_storage addr; /* the address to the connect */
};