From: Gaetan Rivet Date: Fri, 14 Feb 2020 10:25:09 +0000 (+0100) Subject: MINOR: checks: Use an enum to describe the tcp-check rule type X-Git-Tag: v2.2-dev7~178 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dd66732ffe2435413364fdb14492d4a4cee75f59;p=thirdparty%2Fhaproxy.git MINOR: checks: Use an enum to describe the tcp-check rule type Replace the generic integer with an enumerated list. This allows light type check and helps debugging (seeing action = 2 in the struct is not helpful). --- diff --git a/include/types/checks.h b/include/types/checks.h index e94824b8af..dbbf96ddd2 100644 --- a/include/types/checks.h +++ b/include/types/checks.h @@ -212,11 +212,11 @@ struct analyze_status { }; /* possible actions for tcpcheck_rule->action */ -enum { - TCPCHK_ACT_SEND = 0, /* send action, regular string format */ - TCPCHK_ACT_EXPECT, /* expect action, either regular or binary string */ - TCPCHK_ACT_CONNECT, /* connect action, to probe a new port */ - TCPCHK_ACT_COMMENT, /* no action, simply a comment used for logs */ +enum tcpcheck_rule_type { + TCPCHK_ACT_SEND = 0, /* send action, regular string format */ + TCPCHK_ACT_EXPECT, /* expect action, either regular or binary string */ + TCPCHK_ACT_CONNECT, /* connect action, to probe a new port */ + TCPCHK_ACT_COMMENT, /* no action, simply a comment used for logs */ }; /* flags used by tcpcheck_rule->conn_opts */ @@ -226,7 +226,7 @@ enum { struct tcpcheck_rule { struct list list; /* list linked to from the proxy */ - int action; /* action: send or expect */ + enum tcpcheck_rule_type action; /* type of the rule. */ char *comment; /* comment to be used in the logs and on the stats socket */ /* match type uses NON-NULL pointer from either string or expect_regex below */ /* sent string is string */