#include <types/stick_table.h>
+enum act_from {
+ ACT_F_TCP_REQ_CON, /* tcp-request connection */
+ ACT_F_TCP_REQ_CNT, /* tcp-request content */
+ ACT_F_TCP_RES_CNT, /* tcp-response content */
+ ACT_F_HTTP_REQ, /* http-request */
+ ACT_F_HTTP_RES, /* http-response */
+};
+
struct act_rule {
struct list list;
struct acl_cond *cond; /* acl condition to meet */
unsigned int action; /* HTTP_REQ_* */
+ 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,
struct session *sess, struct stream *s); /* ptr to custom action */
char *errmsg = NULL;
cur_arg = 1;
/* try in the module list */
+ rule->from = ACT_F_HTTP_REQ;
if (custom->parse(args, &cur_arg, proxy, rule, &errmsg) < 0) {
Alert("parsing [%s:%d] : error detected in %s '%s' while parsing 'http-request %s' rule : %s.\n",
file, linenum, proxy_type_str(proxy), proxy->id, args[0], errmsg);
char *errmsg = NULL;
cur_arg = 1;
/* try in the module list */
+ rule->from = ACT_F_HTTP_RES;
if (custom->parse(args, &cur_arg, proxy, rule, &errmsg) < 0) {
Alert("parsing [%s:%d] : error detected in %s '%s' while parsing 'http-response %s' rule : %s.\n",
file, linenum, proxy_type_str(proxy), proxy->id, args[0], errmsg);
kw = tcp_res_cont_action(args[arg]);
if (kw) {
arg++;
+ rule->from = ACT_F_TCP_RES_CNT;
if (!kw->parse((const char **)args, &arg, curpx, rule, err))
return -1;
} else {
}
else {
struct tcp_action_kw *kw;
- if (where & SMP_VAL_FE_CON_ACC)
+ if (where & SMP_VAL_FE_CON_ACC) {
kw = tcp_req_conn_action(args[arg]);
- else
+ rule->from = ACT_F_TCP_REQ_CON;
+ } else {
kw = tcp_req_cont_action(args[arg]);
+ rule->from = ACT_F_TCP_REQ_CNT;
+ }
if (kw) {
arg++;
if (!kw->parse((const char **)args, &arg, curpx, rule, err))