MINOR: checks: Support custom functions to eval a tcp-check expect rules

It is now possible to set a custom function to evaluate a tcp-check expect
rule. It is an internal and not documentd option because the right pointer of
function must be set and it is not possible to express it in the
configuration. It will be used to convert some protocol healthchecks to
tcp-checks.

Custom functions must have the following signature:

  enum tcpcheck_eval_ret (*custom)(struct check *, struct tcpcheck_rule *, int);
diff --git a/include/types/checks.h b/include/types/checks.h
index 2205633..30f7d75 100644
--- a/include/types/checks.h
+++ b/include/types/checks.h
@@ -253,11 +253,12 @@
 };
 
 enum tcpcheck_expect_type {
-	TCPCHK_EXPECT_UNDEF = 0, /* Match is not used. */
-	TCPCHK_EXPECT_STRING, /* Matches a string. */
-	TCPCHK_EXPECT_REGEX, /* Matches a regular pattern. */
+	TCPCHK_EXPECT_UNDEF = 0,    /* Match is not used. */
+	TCPCHK_EXPECT_STRING,       /* Matches a string. */
+	TCPCHK_EXPECT_REGEX,        /* Matches a regular pattern. */
 	TCPCHK_EXPECT_REGEX_BINARY, /* Matches a regular pattern on a hex-encoded text. */
-	TCPCHK_EXPECT_BINARY, /* Matches a binary sequence. */
+	TCPCHK_EXPECT_BINARY,       /* Matches a binary sequence. */
+	TCPCHK_EXPECT_CUSTOM,       /* Execute a custom function. */
 };
 
 struct tcpcheck_expect {
@@ -265,6 +266,9 @@
 	union {
 		char *string;           /* Matching a literal string / binary anywhere in the response. */
 		struct my_regex *regex; /* Matching a regex pattern. */
+
+		/* custom function to eval epxect rule */
+		enum tcpcheck_eval_ret (*custom)(struct check *, struct tcpcheck_rule *, int);
 	};
 	struct tcpcheck_rule *head;     /* first expect of a chain. */
 	int length;                     /* Size in bytes of the pattern referenced by string / binary. */