MINOR: actions: Declare all the embedded actions in the same header file

This patch group the action name in one file. Some action are called
many times and need an action embedded in the action caller. The main
goal is to have only one header file grouping all definitions.
diff --git a/include/types/action.h b/include/types/action.h
index 77ce928..9d8b2f9 100644
--- a/include/types/action.h
+++ b/include/types/action.h
@@ -32,10 +32,70 @@
 	ACT_F_HTTP_RES,    /* http-response */
 };
 
+enum act_name {
+	ACT_ACTION_CONT = 0,
+	ACT_ACTION_STOP,
+
+	/* http request actions. */
+	HTTP_REQ_ACT_UNKNOWN,
+	HTTP_REQ_ACT_ALLOW,
+	HTTP_REQ_ACT_DENY,
+	HTTP_REQ_ACT_TARPIT,
+	HTTP_REQ_ACT_AUTH,
+	HTTP_REQ_ACT_ADD_HDR,
+	HTTP_REQ_ACT_SET_HDR,
+	HTTP_REQ_ACT_DEL_HDR,
+	HTTP_REQ_ACT_REPLACE_HDR,
+	HTTP_REQ_ACT_REPLACE_VAL,
+	HTTP_REQ_ACT_REDIR,
+	HTTP_REQ_ACT_SET_NICE,
+	HTTP_REQ_ACT_SET_LOGL,
+	HTTP_REQ_ACT_SET_TOS,
+	HTTP_REQ_ACT_SET_MARK,
+	HTTP_REQ_ACT_ADD_ACL,
+	HTTP_REQ_ACT_DEL_ACL,
+	HTTP_REQ_ACT_DEL_MAP,
+	HTTP_REQ_ACT_SET_MAP,
+	HTTP_REQ_ACT_SET_SRC,
+	HTTP_REQ_ACT_TRK_SC0,
+	/* SC1, SC2, ... SCn */
+	HTTP_REQ_ACT_TRK_SCMAX = HTTP_REQ_ACT_TRK_SC0 + MAX_SESS_STKCTR - 1,
+
+	/* http response actions */
+	HTTP_RES_ACT_UNKNOWN,
+	HTTP_RES_ACT_ALLOW,
+	HTTP_RES_ACT_DENY,
+	HTTP_RES_ACT_ADD_HDR,
+	HTTP_RES_ACT_REPLACE_HDR,
+	HTTP_RES_ACT_REPLACE_VAL,
+	HTTP_RES_ACT_SET_HDR,
+	HTTP_RES_ACT_DEL_HDR,
+	HTTP_RES_ACT_SET_NICE,
+	HTTP_RES_ACT_SET_LOGL,
+	HTTP_RES_ACT_SET_TOS,
+	HTTP_RES_ACT_SET_MARK,
+	HTTP_RES_ACT_ADD_ACL,
+	HTTP_RES_ACT_DEL_ACL,
+	HTTP_RES_ACT_DEL_MAP,
+	HTTP_RES_ACT_SET_MAP,
+	HTTP_RES_ACT_REDIR,
+
+	/* tcp actions */
+	TCP_ACT_ACCEPT,
+	TCP_ACT_REJECT,
+	TCP_ACT_EXPECT_PX,
+	TCP_ACT_TRK_SC0, /* TCP request tracking : must be contiguous and cover up to MAX_SESS_STKCTR values */
+	TCP_ACT_TRK_SC1,
+	TCP_ACT_TRK_SC2,
+	TCP_ACT_TRK_SCMAX = TCP_ACT_TRK_SC0 + MAX_SESS_STKCTR - 1,
+	TCP_ACT_CLOSE, /* close at the sender's */
+	TCP_ACT_CAPTURE, /* capture a fetched sample */
+};
+
 struct act_rule {
 	struct list list;
 	struct acl_cond *cond;                 /* acl condition to meet */
-	unsigned int action;                   /* HTTP_REQ_* */
+	enum act_name action;                  /* ACT_ACTION_* */
 	enum act_from from;                    /* ACT_F_* */
 	short deny_status;                     /* HTTP status to return to user when denying */
 	int (*action_ptr)(struct act_rule *rule, struct proxy *px,
diff --git a/include/types/proto_http.h b/include/types/proto_http.h
index 62016da..16be842 100644
--- a/include/types/proto_http.h
+++ b/include/types/proto_http.h
@@ -225,58 +225,6 @@
 	HTTP_AUTH_DIGEST,
 } __attribute__((packed));
 
-/* actions for "http-request" */
-enum {
-	HTTP_REQ_ACT_UNKNOWN = 0,
-	HTTP_REQ_ACT_ALLOW,
-	HTTP_REQ_ACT_DENY,
-	HTTP_REQ_ACT_TARPIT,
-	HTTP_REQ_ACT_AUTH,
-	HTTP_REQ_ACT_ADD_HDR,
-	HTTP_REQ_ACT_SET_HDR,
-	HTTP_REQ_ACT_DEL_HDR,
-	HTTP_REQ_ACT_REPLACE_HDR,
-	HTTP_REQ_ACT_REPLACE_VAL,
-	HTTP_REQ_ACT_REDIR,
-	HTTP_REQ_ACT_SET_NICE,
-	HTTP_REQ_ACT_SET_LOGL,
-	HTTP_REQ_ACT_SET_TOS,
-	HTTP_REQ_ACT_SET_MARK,
-	HTTP_REQ_ACT_ADD_ACL,
-	HTTP_REQ_ACT_DEL_ACL,
-	HTTP_REQ_ACT_DEL_MAP,
-	HTTP_REQ_ACT_SET_MAP,
-	HTTP_REQ_ACT_CUSTOM_STOP,
-	HTTP_REQ_ACT_CUSTOM_CONT,
-	HTTP_REQ_ACT_SET_SRC,
-	HTTP_REQ_ACT_TRK_SC0,
-	/* SC1, SC2, ... SCn */
-	HTTP_REQ_ACT_TRK_SCMAX = HTTP_REQ_ACT_TRK_SC0 + MAX_SESS_STKCTR - 1,
-};
-
-/* actions for "http-response" */
-enum {
-	HTTP_RES_ACT_UNKNOWN = 0,
-	HTTP_RES_ACT_ALLOW,
-	HTTP_RES_ACT_DENY,
-	HTTP_RES_ACT_ADD_HDR,
-	HTTP_RES_ACT_REPLACE_HDR,
-	HTTP_RES_ACT_REPLACE_VAL,
-	HTTP_RES_ACT_SET_HDR,
-	HTTP_RES_ACT_DEL_HDR,
-	HTTP_RES_ACT_SET_NICE,
-	HTTP_RES_ACT_SET_LOGL,
-	HTTP_RES_ACT_SET_TOS,
-	HTTP_RES_ACT_SET_MARK,
-	HTTP_RES_ACT_ADD_ACL,
-	HTTP_RES_ACT_DEL_ACL,
-	HTTP_RES_ACT_DEL_MAP,
-	HTTP_RES_ACT_SET_MAP,
-	HTTP_RES_ACT_REDIR,
-	HTTP_RES_ACT_CUSTOM_STOP,  /* used for module keywords */
-	HTTP_RES_ACT_CUSTOM_CONT,  /* used for module keywords */
-};
-
 /* final results for http-request rules */
 enum rule_result {
 	HTTP_RULE_RES_CONT = 0,  /* nothing special, continue rules evaluation */
diff --git a/include/types/proto_tcp.h b/include/types/proto_tcp.h
index 4ab0985..df969a1 100644
--- a/include/types/proto_tcp.h
+++ b/include/types/proto_tcp.h
@@ -29,21 +29,6 @@
 #include <types/acl.h>
 #include <types/stream.h>
 
-/* Layer4 accept/reject rules */
-enum {
-	TCP_ACT_ACCEPT = 1,
-	TCP_ACT_REJECT = 2,
-	TCP_ACT_EXPECT_PX = 3,
-	TCP_ACT_TRK_SC0 = 4, /* TCP request tracking : must be contiguous and cover up to MAX_SESS_STKCTR values */
-	TCP_ACT_TRK_SC1 = 5,
-	TCP_ACT_TRK_SC2 = 6,
-	TCP_ACT_TRK_SCMAX = TCP_ACT_TRK_SC0 + MAX_SESS_STKCTR - 1,
-	TCP_ACT_CLOSE, /* close at the sender's */
-	TCP_ACT_CAPTURE, /* capture a fetched sample */
-	TCP_ACT_CUSTOM, /* Use for custom registered keywords. */
-	TCP_ACT_CUSTOM_CONT, /* Use for custom registered keywords. */
-};
-
 struct tcp_action_kw {
 	const char *kw;
 	int (*parse)(const char **args, int *cur_arg, struct proxy *px,
diff --git a/src/hlua.c b/src/hlua.c
index 83c66ae..0c03b77 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -4420,7 +4420,7 @@
 {
 	if (!hlua_parse_rule(args, cur_arg, px, &rule->arg.hlua_rule, err))
 		return 0;
-	rule->action = TCP_ACT_CUSTOM_CONT;
+	rule->action = ACT_ACTION_CONT;
 	rule->action_ptr = hlua_tcp_req_act_wrapper;
 	return 1;
 }
@@ -4431,7 +4431,7 @@
 {
 	if (!hlua_parse_rule(args, cur_arg, px, &rule->arg.hlua_rule, err))
 		return 0;
-	rule->action = TCP_ACT_CUSTOM_CONT;
+	rule->action = ACT_ACTION_CONT;
 	rule->action_ptr = hlua_tcp_res_act_wrapper;
 	return 1;
 }
@@ -4442,7 +4442,7 @@
 {
 	if (!hlua_parse_rule(args, cur_arg, px, &rule->arg.hlua_rule, err))
 		return -1;
-	rule->action = HTTP_REQ_ACT_CUSTOM_CONT;
+	rule->action = ACT_ACTION_CONT;
 	rule->action_ptr = hlua_http_req_act_wrapper;
 	return 1;
 }
@@ -4453,7 +4453,7 @@
 {
 	if (!hlua_parse_rule(args, cur_arg, px, &rule->arg.hlua_rule, err))
 		return -1;
-	rule->action = HTTP_RES_ACT_CUSTOM_CONT;
+	rule->action = ACT_ACTION_CONT;
 	rule->action_ptr = hlua_http_res_act_wrapper;
 	return 1;
 }
diff --git a/src/proto_http.c b/src/proto_http.c
index 0d8f50c..17278aa 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -3628,14 +3628,14 @@
 			break;
 			}
 
-		case HTTP_REQ_ACT_CUSTOM_CONT:
+		case ACT_ACTION_CONT:
 			if (!rule->action_ptr(rule, px, s->sess, s)) {
 				s->current_rule = rule;
 				return HTTP_RULE_RES_YIELD;
 			}
 			break;
 
-		case HTTP_REQ_ACT_CUSTOM_STOP:
+		case ACT_ACTION_STOP:
 			rule->action_ptr(rule, px, s->sess, s);
 			return HTTP_RULE_RES_DONE;
 
@@ -3908,14 +3908,14 @@
 				return HTTP_RULE_RES_BADREQ;
 			return HTTP_RULE_RES_DONE;
 
-		case HTTP_RES_ACT_CUSTOM_CONT:
+		case ACT_ACTION_CONT:
 			if (!rule->action_ptr(rule, px, s->sess, s)) {
 				s->current_rule = rule;
 				return HTTP_RULE_RES_YIELD;
 			}
 			break;
 
-		case HTTP_RES_ACT_CUSTOM_STOP:
+		case ACT_ACTION_STOP:
 			rule->action_ptr(rule, px, s->sess, s);
 			return HTTP_RULE_RES_STOP;
 
@@ -12277,7 +12277,7 @@
 {
 	int cur_arg = *orig_arg;
 
-	rule->action = HTTP_REQ_ACT_CUSTOM_CONT;
+	rule->action = ACT_ACTION_CONT;
 
 	switch (args[0][4]) {
 	case 'm' :
@@ -12472,7 +12472,7 @@
 		px->req_cap = hdr;
 		px->to_log |= LW_REQHDR;
 
-		rule->action       = HTTP_REQ_ACT_CUSTOM_CONT;
+		rule->action       = ACT_ACTION_CONT;
 		rule->action_ptr   = http_action_req_capture;
 		rule->arg.cap.expr = expr;
 		rule->arg.cap.hdr  = hdr;
@@ -12500,7 +12500,7 @@
 
 		proxy->conf.args.ctx = ARGC_CAP;
 
-		rule->action       = HTTP_REQ_ACT_CUSTOM_CONT;
+		rule->action       = ACT_ACTION_CONT;
 		rule->action_ptr   = http_action_req_capture_by_id;
 		rule->arg.capid.expr = expr;
 		rule->arg.capid.idx  = id;
@@ -12622,7 +12622,7 @@
 
 	proxy->conf.args.ctx = ARGC_CAP;
 
-	rule->action       = HTTP_RES_ACT_CUSTOM_CONT;
+	rule->action       = ACT_ACTION_CONT;
 	rule->action_ptr   = http_action_res_capture_by_id;
 	rule->arg.capid.expr = expr;
 	rule->arg.capid.idx  = id;
diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index 2dab423..ef32207 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -1237,7 +1237,7 @@
 				}
 
 				/* accept */
-				if (rule->action == TCP_ACT_CUSTOM)
+				if (rule->action == ACT_ACTION_STOP)
 					break;
 				/* otherwise continue */
 			}
@@ -1363,7 +1363,7 @@
 				}
 
 				/* accept */
-				if (rule->action == TCP_ACT_CUSTOM)
+				if (rule->action == ACT_ACTION_STOP)
 					break;
 				/* otherwise continue */
 			}
@@ -1442,7 +1442,7 @@
 				/* Custom keywords. */
 				if (rule->action_ptr) {
 					rule->action_ptr(rule, sess->fe, sess, NULL);
-					if (rule->action == TCP_ACT_CUSTOM_CONT)
+					if (rule->action == ACT_ACTION_CONT)
 						continue;
 				}
 
diff --git a/src/vars.c b/src/vars.c
index 50fb36a..86ac93b 100644
--- a/src/vars.c
+++ b/src/vars.c
@@ -610,7 +610,7 @@
                    &rule->arg.vars.name,
                    &rule->arg.vars.scope))
 		return 0;
-	rule->action       = TCP_ACT_CUSTOM_CONT;
+	rule->action       = ACT_ACTION_CONT;
 	rule->action_ptr   = action_tcp_req_store;
 	return 1;
 }
@@ -624,7 +624,7 @@
                    &rule->arg.vars.name,
                    &rule->arg.vars.scope))
 		return 0;
-	rule->action       = TCP_ACT_CUSTOM_CONT;
+	rule->action       = ACT_ACTION_CONT;
 	rule->action_ptr   = action_tcp_res_store;
 	return 1;
 }
@@ -638,7 +638,7 @@
                    &rule->arg.vars.name,
                    &rule->arg.vars.scope))
 		return -1;
-	rule->action       = HTTP_REQ_ACT_CUSTOM_CONT;
+	rule->action       = ACT_ACTION_CONT;
 	rule->action_ptr   = action_http_req_store;
 	return 0;
 }
@@ -652,7 +652,7 @@
                    &rule->arg.vars.name,
                    &rule->arg.vars.scope))
 		return -1;
-	rule->action       = HTTP_RES_ACT_CUSTOM_CONT;
+	rule->action       = ACT_ACTION_CONT;
 	rule->action_ptr   = action_http_res_store;
 	return 0;
 }