MINOR: action: Use trk_idx instead of tcp/http_trk_idx
So tcp_trk_idx and http_trk_idx have been removed.
diff --git a/include/proto/proto_http.h b/include/proto/proto_http.h
index d046f53..c4d16ae 100644
--- a/include/proto/proto_http.h
+++ b/include/proto/proto_http.h
@@ -226,14 +226,6 @@
return len;
}
-/* for an http-request/response action ACT_ACTION_TRK_SC*, return a tracking index
- * starting at zero for SC0. Unknown actions also return zero.
- */
-static inline int http_trk_idx(int trk_action)
-{
- return trk_action - ACT_ACTION_TRK_SC0;
-}
-
#endif /* _PROTO_PROTO_HTTP_H */
/*
diff --git a/include/proto/tcp_rules.h b/include/proto/tcp_rules.h
index 3aa62ab..bf920a1 100644
--- a/include/proto/tcp_rules.h
+++ b/include/proto/tcp_rules.h
@@ -37,14 +37,6 @@
void tcp_req_cont_keywords_register(struct action_kw_list *kw_list);
void tcp_res_cont_keywords_register(struct action_kw_list *kw_list);
-/* for a tcp-request action ACT_TCP_TRK_*, return a tracking index starting at
- * zero for SC0. Unknown actions also return zero.
- */
-static inline int tcp_trk_idx(int trk_action)
-{
- return trk_action - ACT_ACTION_TRK_SC0;
-}
-
#endif /* _PROTO_TCP_RULES_H */
/*
diff --git a/src/cfgparse.c b/src/cfgparse.c
index ed74960..77b9b08 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -54,6 +54,7 @@
#include <types/stats.h>
#include <proto/acl.h>
+#include <proto/action.h>
#include <proto/auth.h>
#include <proto/backend.h>
#include <proto/channel.h>
@@ -7879,7 +7880,7 @@
if (!target) {
Alert("Proxy '%s': unable to find table '%s' referenced by track-sc%d.\n",
curproxy->id, trule->arg.trk_ctr.table.n,
- tcp_trk_idx(trule->action));
+ trk_idx(trule->action));
cfgerr++;
}
else if (target->table.size == 0) {
@@ -7890,7 +7891,7 @@
else if (!stktable_compatible_sample(trule->arg.trk_ctr.expr, target->table.type)) {
Alert("Proxy '%s': stick-table '%s' uses a type incompatible with the 'track-sc%d' rule.\n",
curproxy->id, trule->arg.trk_ctr.table.n ? trule->arg.trk_ctr.table.n : curproxy->id,
- tcp_trk_idx(trule->action));
+ trk_idx(trule->action));
cfgerr++;
}
else {
@@ -7918,7 +7919,7 @@
if (!target) {
Alert("Proxy '%s': unable to find table '%s' referenced by track-sc%d.\n",
curproxy->id, trule->arg.trk_ctr.table.n,
- tcp_trk_idx(trule->action));
+ trk_idx(trule->action));
cfgerr++;
}
else if (target->table.size == 0) {
@@ -7929,7 +7930,7 @@
else if (!stktable_compatible_sample(trule->arg.trk_ctr.expr, target->table.type)) {
Alert("Proxy '%s': stick-table '%s' uses a type incompatible with the 'track-sc%d' rule.\n",
curproxy->id, trule->arg.trk_ctr.table.n ? trule->arg.trk_ctr.table.n : curproxy->id,
- tcp_trk_idx(trule->action));
+ trk_idx(trule->action));
cfgerr++;
}
else {
@@ -7957,7 +7958,7 @@
if (!target) {
Alert("Proxy '%s': unable to find table '%s' referenced by track-sc%d.\n",
curproxy->id, trule->arg.trk_ctr.table.n,
- tcp_trk_idx(trule->action));
+ trk_idx(trule->action));
cfgerr++;
}
else if (target->table.size == 0) {
@@ -7968,7 +7969,7 @@
else if (!stktable_compatible_sample(trule->arg.trk_ctr.expr, target->table.type)) {
Alert("Proxy '%s': stick-table '%s' uses a type incompatible with the 'track-sc%d' rule.\n",
curproxy->id, trule->arg.trk_ctr.table.n ? trule->arg.trk_ctr.table.n : curproxy->id,
- tcp_trk_idx(trule->action));
+ trk_idx(trule->action));
cfgerr++;
}
else {
@@ -8022,7 +8023,7 @@
if (!target) {
Alert("Proxy '%s': unable to find table '%s' referenced by track-sc%d.\n",
curproxy->id, hrqrule->arg.trk_ctr.table.n,
- http_trk_idx(hrqrule->action));
+ trk_idx(hrqrule->action));
cfgerr++;
}
else if (target->table.size == 0) {
@@ -8033,7 +8034,7 @@
else if (!stktable_compatible_sample(hrqrule->arg.trk_ctr.expr, target->table.type)) {
Alert("Proxy '%s': stick-table '%s' uses a type incompatible with the 'track-sc%d' rule.\n",
curproxy->id, hrqrule->arg.trk_ctr.table.n ? hrqrule->arg.trk_ctr.table.n : curproxy->id,
- http_trk_idx(hrqrule->action));
+ trk_idx(hrqrule->action));
cfgerr++;
}
else {
@@ -8061,7 +8062,7 @@
if (!target) {
Alert("Proxy '%s': unable to find table '%s' referenced by track-sc%d.\n",
curproxy->id, hrqrule->arg.trk_ctr.table.n,
- http_trk_idx(hrqrule->action));
+ trk_idx(hrqrule->action));
cfgerr++;
}
else if (target->table.size == 0) {
@@ -8072,7 +8073,7 @@
else if (!stktable_compatible_sample(hrqrule->arg.trk_ctr.expr, target->table.type)) {
Alert("Proxy '%s': stick-table '%s' uses a type incompatible with the 'track-sc%d' rule.\n",
curproxy->id, hrqrule->arg.trk_ctr.table.n ? hrqrule->arg.trk_ctr.table.n : curproxy->id,
- http_trk_idx(hrqrule->action));
+ trk_idx(hrqrule->action));
cfgerr++;
}
else {
diff --git a/src/proto_http.c b/src/proto_http.c
index e632ce5..23f683c 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -2717,7 +2717,7 @@
* applies.
*/
- if (stkctr_entry(&s->stkctr[http_trk_idx(rule->action)]) == NULL) {
+ if (stkctr_entry(&s->stkctr[trk_idx(rule->action)]) == NULL) {
struct stktable *t;
struct stksess *ts;
struct stktable_key *key;
@@ -2727,7 +2727,7 @@
key = stktable_fetch_key(t, s->be, sess, s, SMP_OPT_DIR_REQ | SMP_OPT_FINAL, rule->arg.trk_ctr.expr, NULL);
if (key && (ts = stktable_get_entry(t, key))) {
- stream_track_stkctr(&s->stkctr[http_trk_idx(rule->action)], t, ts);
+ stream_track_stkctr(&s->stkctr[trk_idx(rule->action)], t, ts);
/* let's count a new HTTP request as it's the first time we do it */
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_HTTP_REQ_CNT);
@@ -2739,9 +2739,9 @@
update_freq_ctr_period(&stktable_data_cast(ptr, http_req_rate),
t->data_arg[STKTABLE_DT_HTTP_REQ_RATE].u, 1);
- stkctr_set_flags(&s->stkctr[http_trk_idx(rule->action)], STKCTR_TRACK_CONTENT);
+ stkctr_set_flags(&s->stkctr[trk_idx(rule->action)], STKCTR_TRACK_CONTENT);
if (sess->fe != s->be)
- stkctr_set_flags(&s->stkctr[http_trk_idx(rule->action)], STKCTR_TRACK_BACKEND);
+ stkctr_set_flags(&s->stkctr[trk_idx(rule->action)], STKCTR_TRACK_BACKEND);
}
}
break;
@@ -2990,7 +2990,7 @@
* applies.
*/
- if (stkctr_entry(&s->stkctr[http_trk_idx(rule->action)]) == NULL) {
+ if (stkctr_entry(&s->stkctr[trk_idx(rule->action)]) == NULL) {
struct stktable *t;
struct stksess *ts;
struct stktable_key *key;
@@ -3000,7 +3000,7 @@
key = stktable_fetch_key(t, s->be, sess, s, SMP_OPT_DIR_RES | SMP_OPT_FINAL, rule->arg.trk_ctr.expr, NULL);
if (key && (ts = stktable_get_entry(t, key))) {
- stream_track_stkctr(&s->stkctr[http_trk_idx(rule->action)], t, ts);
+ stream_track_stkctr(&s->stkctr[trk_idx(rule->action)], t, ts);
/* let's count a new HTTP request as it's the first time we do it */
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_HTTP_REQ_CNT);
@@ -3012,9 +3012,9 @@
update_freq_ctr_period(&stktable_data_cast(ptr, http_req_rate),
t->data_arg[STKTABLE_DT_HTTP_REQ_RATE].u, 1);
- stkctr_set_flags(&s->stkctr[http_trk_idx(rule->action)], STKCTR_TRACK_CONTENT);
+ stkctr_set_flags(&s->stkctr[trk_idx(rule->action)], STKCTR_TRACK_CONTENT);
if (sess->fe != s->be)
- stkctr_set_flags(&s->stkctr[http_trk_idx(rule->action)], STKCTR_TRACK_BACKEND);
+ stkctr_set_flags(&s->stkctr[trk_idx(rule->action)], STKCTR_TRACK_BACKEND);
/* When the client triggers a 4xx from the server, it's most often due
* to a missing object or permission. These events should be tracked
diff --git a/src/tcp_rules.c b/src/tcp_rules.c
index b87ab4b..d15b153 100644
--- a/src/tcp_rules.c
+++ b/src/tcp_rules.c
@@ -184,7 +184,7 @@
struct stktable_key *key;
struct sample smp;
- if (stkctr_entry(&s->stkctr[tcp_trk_idx(rule->action)]))
+ if (stkctr_entry(&s->stkctr[trk_idx(rule->action)]))
continue;
t = rule->arg.trk_ctr.table.t;
@@ -194,10 +194,10 @@
goto missing_data; /* key might appear later */
if (key && (ts = stktable_get_entry(t, key))) {
- stream_track_stkctr(&s->stkctr[tcp_trk_idx(rule->action)], t, ts);
- stkctr_set_flags(&s->stkctr[tcp_trk_idx(rule->action)], STKCTR_TRACK_CONTENT);
+ stream_track_stkctr(&s->stkctr[trk_idx(rule->action)], t, ts);
+ stkctr_set_flags(&s->stkctr[trk_idx(rule->action)], STKCTR_TRACK_CONTENT);
if (sess->fe != s->be)
- stkctr_set_flags(&s->stkctr[tcp_trk_idx(rule->action)], STKCTR_TRACK_BACKEND);
+ stkctr_set_flags(&s->stkctr[trk_idx(rule->action)], STKCTR_TRACK_BACKEND);
}
}
else if (rule->action == ACT_TCP_CAPTURE) {
@@ -440,14 +440,14 @@
*/
struct stktable_key *key;
- if (stkctr_entry(&sess->stkctr[tcp_trk_idx(rule->action)]))
+ if (stkctr_entry(&sess->stkctr[trk_idx(rule->action)]))
continue;
t = rule->arg.trk_ctr.table.t;
key = stktable_fetch_key(t, sess->fe, sess, NULL, SMP_OPT_DIR_REQ|SMP_OPT_FINAL, rule->arg.trk_ctr.expr, NULL);
if (key && (ts = stktable_get_entry(t, key)))
- stream_track_stkctr(&sess->stkctr[tcp_trk_idx(rule->action)], t, ts);
+ stream_track_stkctr(&sess->stkctr[trk_idx(rule->action)], t, ts);
}
else if (rule->action == ACT_TCP_EXPECT_PX) {
conn->flags |= CO_FL_ACCEPT_PROXY;
@@ -527,14 +527,14 @@
*/
struct stktable_key *key;
- if (stkctr_entry(&sess->stkctr[tcp_trk_idx(rule->action)]))
+ if (stkctr_entry(&sess->stkctr[trk_idx(rule->action)]))
continue;
t = rule->arg.trk_ctr.table.t;
key = stktable_fetch_key(t, sess->fe, sess, NULL, SMP_OPT_DIR_REQ|SMP_OPT_FINAL, rule->arg.trk_ctr.expr, NULL);
if (key && (ts = stktable_get_entry(t, key)))
- stream_track_stkctr(&sess->stkctr[tcp_trk_idx(rule->action)], t, ts);
+ stream_track_stkctr(&sess->stkctr[trk_idx(rule->action)], t, ts);
}
else {
/* Custom keywords. */