static inline void session_store_counters(struct session *s)
{
void *ptr;
+ int i;
- if (s->stkctr2_entry) {
- ptr = stktable_data_ptr(s->stkctr2_table, s->stkctr2_entry, STKTABLE_DT_CONN_CUR);
+ for (i = 0; i < sizeof(s->stkctr) / sizeof(s->stkctr[0]); i++) {
+ if (!s->stkctr[i].entry)
+ continue;
+ ptr = stktable_data_ptr(s->stkctr[i].table, s->stkctr[i].entry, STKTABLE_DT_CONN_CUR);
if (ptr)
stktable_data_cast(ptr, conn_cur)--;
- s->stkctr2_entry->ref_cnt--;
- stksess_kill_if_expired(s->stkctr2_table, s->stkctr2_entry);
- s->stkctr2_entry = NULL;
- }
-
- if (s->stkctr1_entry) {
- ptr = stktable_data_ptr(s->stkctr1_table, s->stkctr1_entry, STKTABLE_DT_CONN_CUR);
- if (ptr)
- stktable_data_cast(ptr, conn_cur)--;
- s->stkctr1_entry->ref_cnt--;
- stksess_kill_if_expired(s->stkctr1_table, s->stkctr1_entry);
- s->stkctr1_entry = NULL;
+ s->stkctr[i].entry->ref_cnt--;
+ stksess_kill_if_expired(s->stkctr[i].table, s->stkctr[i].entry);
+ s->stkctr[i].entry = NULL;
}
}
static inline void session_stop_backend_counters(struct session *s)
{
void *ptr;
+ int i;
if (!(s->flags & (SN_BE_TRACK_SC1|SN_BE_TRACK_SC2)))
return;
- if ((s->flags & SN_BE_TRACK_SC1) && s->stkctr1_entry) {
- ptr = stktable_data_ptr(s->stkctr1_table, s->stkctr1_entry, STKTABLE_DT_CONN_CUR);
- if (ptr)
- stktable_data_cast(ptr, conn_cur)--;
- s->stkctr1_entry->ref_cnt--;
- stksess_kill_if_expired(s->stkctr1_table, s->stkctr1_entry);
- s->stkctr1_entry = NULL;
- }
+ for (i = 0; i < sizeof(s->stkctr) / sizeof(s->stkctr[0]); i++) {
+ if (!s->stkctr[i].entry)
+ continue;
+
+ if ((i == 0) && !(s->flags & SN_BE_TRACK_SC1))
+ continue;
- if ((s->flags & SN_BE_TRACK_SC2) && s->stkctr2_entry) {
- ptr = stktable_data_ptr(s->stkctr2_table, s->stkctr2_entry, STKTABLE_DT_CONN_CUR);
+ if ((i == 1) && !(s->flags & SN_BE_TRACK_SC2))
+ continue;
+
+ ptr = stktable_data_ptr(s->stkctr[i].table, s->stkctr[i].entry, STKTABLE_DT_CONN_CUR);
if (ptr)
stktable_data_cast(ptr, conn_cur)--;
- s->stkctr2_entry->ref_cnt--;
- stksess_kill_if_expired(s->stkctr2_table, s->stkctr2_entry);
- s->stkctr2_entry = NULL;
+ s->stkctr[i].entry->ref_cnt--;
+ stksess_kill_if_expired(s->stkctr[i].table, s->stkctr[i].entry);
+ s->stkctr[i].entry = NULL;
}
s->flags &= ~(SN_BE_TRACK_SC1|SN_BE_TRACK_SC2);
}
ts->expire = tick_add(now_ms, MS_TO_TICKS(t->expire));
}
-/* Enable tracking of session counters as stkctr1 on stksess <ts>. The caller is
- * responsible for ensuring that <t> and <ts> are valid pointers. Some controls
- * are performed to ensure the state can still change.
- */
-static inline void session_track_stkctr1(struct session *s, struct stktable *t, struct stksess *ts)
-{
- if (s->stkctr1_entry)
- return;
-
- ts->ref_cnt++;
- s->stkctr1_table = t;
- s->stkctr1_entry = ts;
- session_start_counters(t, ts);
-}
-
-/* Enable tracking of session counters as stkctr1 on stksess <ts>. The caller is
+/* Enable tracking of session counters as <stkctr> on stksess <ts>. The caller is
* responsible for ensuring that <t> and <ts> are valid pointers. Some controls
* are performed to ensure the state can still change.
*/
-static inline void session_track_stkctr2(struct session *s, struct stktable *t, struct stksess *ts)
+static inline void session_track_stkctr(struct stkctr *ctr, struct stktable *t, struct stksess *ts)
{
- if (s->stkctr2_entry)
+ if (ctr->entry)
return;
ts->ref_cnt++;
- s->stkctr2_table = t;
- s->stkctr2_entry = ts;
+ ctr->table = t;
+ ctr->entry = ts;
session_start_counters(t, ts);
}
static void inline session_inc_http_req_ctr(struct session *s)
{
void *ptr;
+ int i;
- if (s->stkctr2_entry) {
- ptr = stktable_data_ptr(s->stkctr2_table, s->stkctr2_entry, STKTABLE_DT_HTTP_REQ_CNT);
- if (ptr)
- stktable_data_cast(ptr, http_req_cnt)++;
+ for (i = 0; i < sizeof(s->stkctr) / sizeof(s->stkctr[0]); i++) {
+ if (!s->stkctr[i].entry)
+ continue;
- ptr = stktable_data_ptr(s->stkctr2_table, s->stkctr2_entry, STKTABLE_DT_HTTP_REQ_RATE);
- if (ptr)
- update_freq_ctr_period(&stktable_data_cast(ptr, http_req_rate),
- s->stkctr2_table->data_arg[STKTABLE_DT_HTTP_REQ_RATE].u, 1);
- }
-
- if (s->stkctr1_entry) {
- ptr = stktable_data_ptr(s->stkctr1_table, s->stkctr1_entry, STKTABLE_DT_HTTP_REQ_CNT);
+ ptr = stktable_data_ptr(s->stkctr[i].table, s->stkctr[i].entry, STKTABLE_DT_HTTP_REQ_CNT);
if (ptr)
stktable_data_cast(ptr, http_req_cnt)++;
- ptr = stktable_data_ptr(s->stkctr1_table, s->stkctr1_entry, STKTABLE_DT_HTTP_REQ_RATE);
+ ptr = stktable_data_ptr(s->stkctr[i].table, s->stkctr[i].entry, STKTABLE_DT_HTTP_REQ_RATE);
if (ptr)
update_freq_ctr_period(&stktable_data_cast(ptr, http_req_rate),
- s->stkctr1_table->data_arg[STKTABLE_DT_HTTP_REQ_RATE].u, 1);
+ s->stkctr[i].table->data_arg[STKTABLE_DT_HTTP_REQ_RATE].u, 1);
}
}
static void inline session_inc_be_http_req_ctr(struct session *s)
{
void *ptr;
+ int i;
if (likely(!(s->flags & (SN_BE_TRACK_SC1|SN_BE_TRACK_SC2))))
return;
- if ((s->flags & SN_BE_TRACK_SC2) && s->stkctr2_entry) {
- ptr = stktable_data_ptr(s->stkctr2_table, s->stkctr2_entry, STKTABLE_DT_HTTP_REQ_CNT);
- if (ptr)
- stktable_data_cast(ptr, http_req_cnt)++;
+ for (i = 0; i < sizeof(s->stkctr) / sizeof(s->stkctr[0]); i++) {
+ if (!s->stkctr[i].entry)
+ continue;
- ptr = stktable_data_ptr(s->stkctr2_table, s->stkctr2_entry, STKTABLE_DT_HTTP_REQ_RATE);
- if (ptr)
- update_freq_ctr_period(&stktable_data_cast(ptr, http_req_rate),
- s->stkctr2_table->data_arg[STKTABLE_DT_HTTP_REQ_RATE].u, 1);
- }
+ if ((i == 0) && !(s->flags & SN_BE_TRACK_SC1))
+ continue;
+
+ if ((i == 1) && !(s->flags & SN_BE_TRACK_SC2))
+ continue;
- if ((s->flags & SN_BE_TRACK_SC1) && s->stkctr1_entry) {
- ptr = stktable_data_ptr(s->stkctr1_table, s->stkctr1_entry, STKTABLE_DT_HTTP_REQ_CNT);
+ ptr = stktable_data_ptr(s->stkctr[i].table, s->stkctr[i].entry, STKTABLE_DT_HTTP_REQ_CNT);
if (ptr)
stktable_data_cast(ptr, http_req_cnt)++;
- ptr = stktable_data_ptr(s->stkctr1_table, s->stkctr1_entry, STKTABLE_DT_HTTP_REQ_RATE);
+ ptr = stktable_data_ptr(s->stkctr[i].table, s->stkctr[i].entry, STKTABLE_DT_HTTP_REQ_RATE);
if (ptr)
update_freq_ctr_period(&stktable_data_cast(ptr, http_req_rate),
- s->stkctr1_table->data_arg[STKTABLE_DT_HTTP_REQ_RATE].u, 1);
+ s->stkctr[i].table->data_arg[STKTABLE_DT_HTTP_REQ_RATE].u, 1);
}
}
static void inline session_inc_http_err_ctr(struct session *s)
{
void *ptr;
+ int i;
- if (s->stkctr2_entry) {
- ptr = stktable_data_ptr(s->stkctr2_table, s->stkctr2_entry, STKTABLE_DT_HTTP_ERR_CNT);
- if (ptr)
- stktable_data_cast(ptr, http_err_cnt)++;
-
- ptr = stktable_data_ptr(s->stkctr2_table, s->stkctr2_entry, STKTABLE_DT_HTTP_ERR_RATE);
- if (ptr)
- update_freq_ctr_period(&stktable_data_cast(ptr, http_err_rate),
- s->stkctr2_table->data_arg[STKTABLE_DT_HTTP_ERR_RATE].u, 1);
- }
+ for (i = 0; i < sizeof(s->stkctr) / sizeof(s->stkctr[0]); i++) {
+ if (!s->stkctr[i].entry)
+ continue;
- if (s->stkctr1_entry) {
- ptr = stktable_data_ptr(s->stkctr1_table, s->stkctr1_entry, STKTABLE_DT_HTTP_ERR_CNT);
+ ptr = stktable_data_ptr(s->stkctr[i].table, s->stkctr[i].entry, STKTABLE_DT_HTTP_ERR_CNT);
if (ptr)
stktable_data_cast(ptr, http_err_cnt)++;
- ptr = stktable_data_ptr(s->stkctr1_table, s->stkctr1_entry, STKTABLE_DT_HTTP_ERR_RATE);
+ ptr = stktable_data_ptr(s->stkctr[i].table, s->stkctr[i].entry, STKTABLE_DT_HTTP_ERR_RATE);
if (ptr)
update_freq_ctr_period(&stktable_data_cast(ptr, http_err_rate),
- s->stkctr1_table->data_arg[STKTABLE_DT_HTTP_ERR_RATE].u, 1);
+ s->stkctr[i].table->data_arg[STKTABLE_DT_HTTP_ERR_RATE].u, 1);
}
}
*/
s->flags = 0;
s->logs.logwait = p->to_log;
- s->stkctr1_entry = NULL;
- s->stkctr2_entry = NULL;
- s->stkctr1_table = NULL;
- s->stkctr2_table = NULL;
+ s->stkctr[0].entry = NULL;
+ s->stkctr[1].entry = NULL;
+ s->stkctr[0].table = NULL;
+ s->stkctr[1].table = NULL;
s->listener = l;
s->fe = p;
task_free(t);
out_free_session:
p->feconn--;
- if (s->stkctr1_entry || s->stkctr2_entry)
+ if (s->stkctr[0].entry || s->stkctr[1].entry)
session_store_counters(s);
pool_free2(pool2_connection, s->si[1].conn);
out_fail_conn1:
conn_full_close(s->si[0].conn);
s->fe->feconn--;
- if (s->stkctr1_entry || s->stkctr2_entry)
+ if (s->stkctr[0].entry || s->stkctr[1].entry)
session_store_counters(s);
if (!(s->listener->options & LI_O_UNLIMITED))
struct http_txn *txn;
struct task *t = s->task;
int ret;
+ int i;
ret = -1; /* assume unrecoverable error by default */
/* Let's count a session now */
proxy_inc_fe_sess_ctr(l, p);
- if (s->stkctr1_entry) {
- void *ptr;
-
- ptr = stktable_data_ptr(s->stkctr1_table, s->stkctr1_entry, STKTABLE_DT_SESS_CNT);
- if (ptr)
- stktable_data_cast(ptr, sess_cnt)++;
- ptr = stktable_data_ptr(s->stkctr1_table, s->stkctr1_entry, STKTABLE_DT_SESS_RATE);
- if (ptr)
- update_freq_ctr_period(&stktable_data_cast(ptr, sess_rate),
- s->stkctr1_table->data_arg[STKTABLE_DT_SESS_RATE].u, 1);
- }
-
- if (s->stkctr2_entry) {
+ for (i = 0; i < sizeof(s->stkctr) / sizeof(s->stkctr[0]); i++) {
void *ptr;
- ptr = stktable_data_ptr(s->stkctr2_table, s->stkctr2_entry, STKTABLE_DT_SESS_CNT);
+ if (!s->stkctr[i].entry)
+ continue;
+
+ ptr = stktable_data_ptr(s->stkctr[i].table, s->stkctr[i].entry, STKTABLE_DT_SESS_CNT);
if (ptr)
stktable_data_cast(ptr, sess_cnt)++;
- ptr = stktable_data_ptr(s->stkctr2_table, s->stkctr2_entry, STKTABLE_DT_SESS_RATE);
+ ptr = stktable_data_ptr(s->stkctr[i].table, s->stkctr[i].entry, STKTABLE_DT_SESS_RATE);
if (ptr)
update_freq_ctr_period(&stktable_data_cast(ptr, sess_rate),
- s->stkctr2_table->data_arg[STKTABLE_DT_SESS_RATE].u, 1);
+ s->stkctr[i].table->data_arg[STKTABLE_DT_SESS_RATE].u, 1);
}
/* this part should be common with other protocols */
pool_free2(fe->req_cap_pool, txn->req.cap);
}
- if (s->stkctr1_entry || s->stkctr2_entry)
+ if (s->stkctr[0].entry || s->stkctr[1].entry)
session_store_counters(s);
list_for_each_entry_safe(bref, back, &s->back_refs, users) {
void session_process_counters(struct session *s)
{
unsigned long long bytes;
+ void *ptr;
+ int i;
if (s->req) {
bytes = s->req->total - s->logs.bytes_in;
s->logs.bytes_in = s->req->total;
if (bytes) {
- s->fe->fe_counters.bytes_in += bytes;
+ s->fe->fe_counters.bytes_in += bytes;
- s->be->be_counters.bytes_in += bytes;
+ s->be->be_counters.bytes_in += bytes;
if (objt_server(s->target))
- objt_server(s->target)->counters.bytes_in += bytes;
+ objt_server(s->target)->counters.bytes_in += bytes;
if (s->listener->counters)
- s->listener->counters->bytes_in += bytes;
+ s->listener->counters->bytes_in += bytes;
- if (s->stkctr2_entry) {
- void *ptr;
+ for (i = 0; i < sizeof(s->stkctr) / sizeof(s->stkctr[0]); i++) {
+ if (!s->stkctr[i].entry)
+ continue;
- ptr = stktable_data_ptr(s->stkctr2_table,
- s->stkctr2_entry,
- STKTABLE_DT_BYTES_IN_CNT);
+ ptr = stktable_data_ptr(s->stkctr[i].table,
+ s->stkctr[i].entry,
+ STKTABLE_DT_BYTES_IN_CNT);
if (ptr)
stktable_data_cast(ptr, bytes_in_cnt) += bytes;
- ptr = stktable_data_ptr(s->stkctr2_table,
- s->stkctr2_entry,
- STKTABLE_DT_BYTES_IN_RATE);
+ ptr = stktable_data_ptr(s->stkctr[i].table,
+ s->stkctr[i].entry,
+ STKTABLE_DT_BYTES_IN_RATE);
if (ptr)
update_freq_ctr_period(&stktable_data_cast(ptr, bytes_in_rate),
- s->stkctr2_table->data_arg[STKTABLE_DT_BYTES_IN_RATE].u, bytes);
- }
-
- if (s->stkctr1_entry) {
- void *ptr;
-
- ptr = stktable_data_ptr(s->stkctr1_table,
- s->stkctr1_entry,
- STKTABLE_DT_BYTES_IN_CNT);
- if (ptr)
- stktable_data_cast(ptr, bytes_in_cnt) += bytes;
-
- ptr = stktable_data_ptr(s->stkctr1_table,
- s->stkctr1_entry,
- STKTABLE_DT_BYTES_IN_RATE);
- if (ptr)
- update_freq_ctr_period(&stktable_data_cast(ptr, bytes_in_rate),
- s->stkctr1_table->data_arg[STKTABLE_DT_BYTES_IN_RATE].u, bytes);
+ s->stkctr[i].table->data_arg[STKTABLE_DT_BYTES_IN_RATE].u, bytes);
}
}
}
bytes = s->rep->total - s->logs.bytes_out;
s->logs.bytes_out = s->rep->total;
if (bytes) {
- s->fe->fe_counters.bytes_out += bytes;
+ s->fe->fe_counters.bytes_out += bytes;
- s->be->be_counters.bytes_out += bytes;
+ s->be->be_counters.bytes_out += bytes;
if (objt_server(s->target))
- objt_server(s->target)->counters.bytes_out += bytes;
+ objt_server(s->target)->counters.bytes_out += bytes;
if (s->listener->counters)
- s->listener->counters->bytes_out += bytes;
-
- if (s->stkctr2_entry) {
- void *ptr;
-
- ptr = stktable_data_ptr(s->stkctr2_table,
- s->stkctr2_entry,
- STKTABLE_DT_BYTES_OUT_CNT);
- if (ptr)
- stktable_data_cast(ptr, bytes_out_cnt) += bytes;
-
- ptr = stktable_data_ptr(s->stkctr2_table,
- s->stkctr2_entry,
- STKTABLE_DT_BYTES_OUT_RATE);
- if (ptr)
- update_freq_ctr_period(&stktable_data_cast(ptr, bytes_out_rate),
- s->stkctr2_table->data_arg[STKTABLE_DT_BYTES_OUT_RATE].u, bytes);
- }
+ s->listener->counters->bytes_out += bytes;
- if (s->stkctr1_entry) {
- void *ptr;
+ for (i = 0; i < sizeof(s->stkctr) / sizeof(s->stkctr[0]); i++) {
+ if (!s->stkctr[i].entry)
+ continue;
- ptr = stktable_data_ptr(s->stkctr1_table,
- s->stkctr1_entry,
- STKTABLE_DT_BYTES_OUT_CNT);
+ ptr = stktable_data_ptr(s->stkctr[i].table,
+ s->stkctr[i].entry,
+ STKTABLE_DT_BYTES_OUT_CNT);
if (ptr)
stktable_data_cast(ptr, bytes_out_cnt) += bytes;
- ptr = stktable_data_ptr(s->stkctr1_table,
- s->stkctr1_entry,
- STKTABLE_DT_BYTES_OUT_RATE);
+ ptr = stktable_data_ptr(s->stkctr[i].table,
+ s->stkctr[i].entry,
+ STKTABLE_DT_BYTES_OUT_RATE);
if (ptr)
update_freq_ctr_period(&stktable_data_cast(ptr, bytes_out_rate),
- s->stkctr1_table->data_arg[STKTABLE_DT_BYTES_OUT_RATE].u, bytes);
+ s->stkctr[i].table->data_arg[STKTABLE_DT_BYTES_OUT_RATE].u, bytes);
}
}
}
acl_fetch_sc1_get_gpc0(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr1_entry)
+ if (!l4->stkctr[0].entry)
return 0;
- return acl_fetch_get_gpc0(l4->stkctr1_table, smp, l4->stkctr1_entry);
+ return acl_fetch_get_gpc0(l4->stkctr[0].table, smp, l4->stkctr[0].entry);
}
/* set temp integer to the General Purpose Counter 0 value from the session's tracked
acl_fetch_sc2_get_gpc0(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr2_entry)
+ if (!l4->stkctr[1].entry)
return 0;
- return acl_fetch_get_gpc0(l4->stkctr2_table, smp, l4->stkctr2_entry);
+ return acl_fetch_get_gpc0(l4->stkctr[1].table, smp, l4->stkctr[1].entry);
}
/* set temp integer to the General Purpose Counter 0 value from the session's source
acl_fetch_sc1_inc_gpc0(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr1_entry)
+ if (!l4->stkctr[0].entry)
return 0;
- return acl_fetch_inc_gpc0(l4->stkctr1_table, smp, l4->stkctr1_entry);
+ return acl_fetch_inc_gpc0(l4->stkctr[0].table, smp, l4->stkctr[0].entry);
}
/* Increment the General Purpose Counter 0 value from the session's tracked
acl_fetch_sc2_inc_gpc0(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr2_entry)
+ if (!l4->stkctr[1].entry)
return 0;
- return acl_fetch_inc_gpc0(l4->stkctr2_table, smp, l4->stkctr2_entry);
+ return acl_fetch_inc_gpc0(l4->stkctr[1].table, smp, l4->stkctr[1].entry);
}
/* Increment the General Purpose Counter 0 value from the session's source
acl_fetch_sc1_clr_gpc0(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr1_entry)
+ if (!l4->stkctr[0].entry)
return 0;
- return acl_fetch_clr_gpc0(l4->stkctr1_table, smp, l4->stkctr1_entry);
+ return acl_fetch_clr_gpc0(l4->stkctr[0].table, smp, l4->stkctr[0].entry);
}
/* Clear the General Purpose Counter 0 value from the session's tracked
acl_fetch_sc2_clr_gpc0(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr2_entry)
+ if (!l4->stkctr[1].entry)
return 0;
- return acl_fetch_clr_gpc0(l4->stkctr2_table, smp, l4->stkctr2_entry);
+ return acl_fetch_clr_gpc0(l4->stkctr[1].table, smp, l4->stkctr[1].entry);
}
/* Clear the General Purpose Counter 0 value from the session's source address
acl_fetch_sc1_conn_cnt(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr1_entry)
+ if (!l4->stkctr[0].entry)
return 0;
- return acl_fetch_conn_cnt(l4->stkctr1_table, smp, l4->stkctr1_entry);
+ return acl_fetch_conn_cnt(l4->stkctr[0].table, smp, l4->stkctr[0].entry);
}
/* set temp integer to the cumulated number of connections from the session's tracked BE counters */
acl_fetch_sc2_conn_cnt(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr2_entry)
+ if (!l4->stkctr[1].entry)
return 0;
- return acl_fetch_conn_cnt(l4->stkctr2_table, smp, l4->stkctr2_entry);
+ return acl_fetch_conn_cnt(l4->stkctr[1].table, smp, l4->stkctr[1].entry);
}
/* set temp integer to the cumulated number of connections from the session's source
acl_fetch_sc1_conn_rate(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr1_entry)
+ if (!l4->stkctr[0].entry)
return 0;
- return acl_fetch_conn_rate(l4->stkctr1_table, smp, l4->stkctr1_entry);
+ return acl_fetch_conn_rate(l4->stkctr[0].table, smp, l4->stkctr[0].entry);
}
/* set temp integer to the connection rate from the session's tracked BE counters over
acl_fetch_sc2_conn_rate(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr2_entry)
+ if (!l4->stkctr[1].entry)
return 0;
- return acl_fetch_conn_rate(l4->stkctr2_table, smp, l4->stkctr2_entry);
+ return acl_fetch_conn_rate(l4->stkctr[1].table, smp, l4->stkctr[1].entry);
}
/* set temp integer to the connection rate from the session's source address in the
acl_fetch_sc1_conn_cur(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr1_entry)
+ if (!l4->stkctr[0].entry)
return 0;
- return acl_fetch_conn_cur(l4->stkctr1_table, smp, l4->stkctr1_entry);
+ return acl_fetch_conn_cur(l4->stkctr[0].table, smp, l4->stkctr[0].entry);
}
/* set temp integer to the number of concurrent connections from the session's tracked BE counters */
acl_fetch_sc2_conn_cur(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr2_entry)
+ if (!l4->stkctr[1].entry)
return 0;
- return acl_fetch_conn_cur(l4->stkctr2_table, smp, l4->stkctr2_entry);
+ return acl_fetch_conn_cur(l4->stkctr[1].table, smp, l4->stkctr[1].entry);
}
/* set temp integer to the number of concurrent connections from the session's source
acl_fetch_sc1_sess_cnt(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr1_entry)
+ if (!l4->stkctr[0].entry)
return 0;
- return acl_fetch_sess_cnt(l4->stkctr1_table, smp, l4->stkctr1_entry);
+ return acl_fetch_sess_cnt(l4->stkctr[0].table, smp, l4->stkctr[0].entry);
}
/* set temp integer to the cumulated number of sessions from the session's tracked BE counters */
acl_fetch_sc2_sess_cnt(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr2_entry)
+ if (!l4->stkctr[1].entry)
return 0;
- return acl_fetch_sess_cnt(l4->stkctr2_table, smp, l4->stkctr2_entry);
+ return acl_fetch_sess_cnt(l4->stkctr[1].table, smp, l4->stkctr[1].entry);
}
/* set temp integer to the cumulated number of session from the session's source
acl_fetch_sc1_sess_rate(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr1_entry)
+ if (!l4->stkctr[0].entry)
return 0;
- return acl_fetch_sess_rate(l4->stkctr1_table, smp, l4->stkctr1_entry);
+ return acl_fetch_sess_rate(l4->stkctr[0].table, smp, l4->stkctr[0].entry);
}
/* set temp integer to the session rate from the session's tracked BE counters over
acl_fetch_sc2_sess_rate(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr2_entry)
+ if (!l4->stkctr[1].entry)
return 0;
- return acl_fetch_sess_rate(l4->stkctr2_table, smp, l4->stkctr2_entry);
+ return acl_fetch_sess_rate(l4->stkctr[1].table, smp, l4->stkctr[1].entry);
}
/* set temp integer to the session rate from the session's source address in the
acl_fetch_sc1_http_req_cnt(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr1_entry)
+ if (!l4->stkctr[0].entry)
return 0;
- return acl_fetch_http_req_cnt(l4->stkctr1_table, smp, l4->stkctr1_entry);
+ return acl_fetch_http_req_cnt(l4->stkctr[0].table, smp, l4->stkctr[0].entry);
}
/* set temp integer to the cumulated number of sessions from the session's tracked BE counters */
acl_fetch_sc2_http_req_cnt(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr2_entry)
+ if (!l4->stkctr[1].entry)
return 0;
- return acl_fetch_http_req_cnt(l4->stkctr2_table, smp, l4->stkctr2_entry);
+ return acl_fetch_http_req_cnt(l4->stkctr[1].table, smp, l4->stkctr[1].entry);
}
/* set temp integer to the cumulated number of session from the session's source
acl_fetch_sc1_http_req_rate(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr1_entry)
+ if (!l4->stkctr[0].entry)
return 0;
- return acl_fetch_http_req_rate(l4->stkctr1_table, smp, l4->stkctr1_entry);
+ return acl_fetch_http_req_rate(l4->stkctr[0].table, smp, l4->stkctr[0].entry);
}
/* set temp integer to the session rate from the session's tracked BE counters over
acl_fetch_sc2_http_req_rate(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr2_entry)
+ if (!l4->stkctr[1].entry)
return 0;
- return acl_fetch_http_req_rate(l4->stkctr2_table, smp, l4->stkctr2_entry);
+ return acl_fetch_http_req_rate(l4->stkctr[1].table, smp, l4->stkctr[1].entry);
}
/* set temp integer to the session rate from the session's source address in the
acl_fetch_sc1_http_err_cnt(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr1_entry)
+ if (!l4->stkctr[0].entry)
return 0;
- return acl_fetch_http_err_cnt(l4->stkctr1_table, smp, l4->stkctr1_entry);
+ return acl_fetch_http_err_cnt(l4->stkctr[0].table, smp, l4->stkctr[0].entry);
}
/* set temp integer to the cumulated number of sessions from the session's tracked BE counters */
acl_fetch_sc2_http_err_cnt(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr2_entry)
+ if (!l4->stkctr[1].entry)
return 0;
- return acl_fetch_http_err_cnt(l4->stkctr2_table, smp, l4->stkctr2_entry);
+ return acl_fetch_http_err_cnt(l4->stkctr[1].table, smp, l4->stkctr[1].entry);
}
/* set temp integer to the cumulated number of session from the session's source
acl_fetch_sc1_http_err_rate(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr1_entry)
+ if (!l4->stkctr[0].entry)
return 0;
- return acl_fetch_http_err_rate(l4->stkctr1_table, smp, l4->stkctr1_entry);
+ return acl_fetch_http_err_rate(l4->stkctr[0].table, smp, l4->stkctr[0].entry);
}
/* set temp integer to the session rate from the session's tracked BE counters over
acl_fetch_sc2_http_err_rate(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr2_entry)
+ if (!l4->stkctr[1].entry)
return 0;
- return acl_fetch_http_err_rate(l4->stkctr2_table, smp, l4->stkctr2_entry);
+ return acl_fetch_http_err_rate(l4->stkctr[1].table, smp, l4->stkctr[1].entry);
}
/* set temp integer to the session rate from the session's source address in the
acl_fetch_sc1_kbytes_in(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr1_entry)
+ if (!l4->stkctr[0].entry)
return 0;
- return acl_fetch_kbytes_in(l4->stkctr1_table, smp, l4->stkctr1_entry);
+ return acl_fetch_kbytes_in(l4->stkctr[0].table, smp, l4->stkctr[0].entry);
}
/* set temp integer to the number of kbytes received from clients according to the
acl_fetch_sc2_kbytes_in(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr2_entry)
+ if (!l4->stkctr[1].entry)
return 0;
- return acl_fetch_kbytes_in(l4->stkctr2_table, smp, l4->stkctr2_entry);
+ return acl_fetch_kbytes_in(l4->stkctr[1].table, smp, l4->stkctr[1].entry);
}
/* set temp integer to the number of kbytes received from the session's source
acl_fetch_sc1_bytes_in_rate(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr1_entry)
+ if (!l4->stkctr[0].entry)
return 0;
- return acl_fetch_bytes_in_rate(l4->stkctr1_table, smp, l4->stkctr1_entry);
+ return acl_fetch_bytes_in_rate(l4->stkctr[0].table, smp, l4->stkctr[0].entry);
}
/* set temp integer to the bytes rate from clients from the session's tracked BE
acl_fetch_sc2_bytes_in_rate(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr2_entry)
+ if (!l4->stkctr[1].entry)
return 0;
- return acl_fetch_bytes_in_rate(l4->stkctr2_table, smp, l4->stkctr2_entry);
+ return acl_fetch_bytes_in_rate(l4->stkctr[1].table, smp, l4->stkctr[1].entry);
}
/* set temp integer to the bytes rate from clients from the session's source address
acl_fetch_sc1_kbytes_out(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr1_entry)
+ if (!l4->stkctr[0].entry)
return 0;
- return acl_fetch_kbytes_out(l4->stkctr1_table, smp, l4->stkctr1_entry);
+ return acl_fetch_kbytes_out(l4->stkctr[0].table, smp, l4->stkctr[0].entry);
}
/* set temp integer to the number of kbytes sent to clients according to the session's
acl_fetch_sc2_kbytes_out(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr2_entry)
+ if (!l4->stkctr[1].entry)
return 0;
- return acl_fetch_kbytes_out(l4->stkctr2_table, smp, l4->stkctr2_entry);
+ return acl_fetch_kbytes_out(l4->stkctr[1].table, smp, l4->stkctr[1].entry);
}
/* set temp integer to the number of kbytes sent to the session's source address in
acl_fetch_sc1_bytes_out_rate(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr1_entry)
+ if (!l4->stkctr[0].entry)
return 0;
- return acl_fetch_bytes_out_rate(l4->stkctr1_table, smp, l4->stkctr1_entry);
+ return acl_fetch_bytes_out_rate(l4->stkctr[0].table, smp, l4->stkctr[0].entry);
}
/* set temp integer to the bytes rate to clients from the session's tracked BE counters
acl_fetch_sc2_bytes_out_rate(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr2_entry)
+ if (!l4->stkctr[1].entry)
return 0;
- return acl_fetch_bytes_out_rate(l4->stkctr2_table, smp, l4->stkctr2_entry);
+ return acl_fetch_bytes_out_rate(l4->stkctr[1].table, smp, l4->stkctr[1].entry);
}
/* set temp integer to the bytes rate to client from the session's source address in
acl_fetch_sc1_trackers(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr1_entry)
+ if (!l4->stkctr[0].entry)
return 0;
- return l4->stkctr1_entry->ref_cnt;
+ return l4->stkctr[0].entry->ref_cnt;
}
/* set temp integer to the number of active trackers on the SC1 entry */
acl_fetch_sc2_trackers(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
const struct arg *args, struct sample *smp)
{
- if (!l4->stkctr2_entry)
+ if (!l4->stkctr[1].entry)
return 0;
- return l4->stkctr2_entry->ref_cnt;
+ return l4->stkctr[1].entry->ref_cnt;
}
/* set temp integer to the number of used entries in the table pointed to by expr.