/* always fake a data retrieval */
int acl_fetch_nothing(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp);
+ const struct arg *args, struct sample *smp);
/* always return false */
int acl_match_nothing(struct sample *smp, struct acl_pattern *pattern);
const char *kw;
int (*parse)(const char **text, struct acl_pattern *pattern, int *opaque);
int (*fetch)(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp);
+ const struct arg *args, struct sample *smp);
int (*match)(struct sample *smp, struct acl_pattern *pattern);
unsigned int requires; /* bit mask of all ACL_USE_* required to evaluate this keyword */
int arg_mask; /* mask describing up to 7 arg types */
/* force TRUE to be returned at the fetch level */
static int
acl_fetch_true(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
smp->type = SMP_T_BOOL;
smp->data.uint = 1;
*/
static int
acl_fetch_wait_end(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (dir & ACL_PARTIAL) {
smp->flags |= SMP_F_MAY_CHANGE;
/* force FALSE to be returned at the fetch level */
static int
acl_fetch_false(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
smp->type = SMP_T_BOOL;
smp->data.uint = 0;
/* return the number of bytes in the request buffer */
static int
acl_fetch_req_len(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4 || !l4->req)
return 0;
static int
acl_fetch_ssl_hello_type(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
int hs_len;
int hs_type, bleft;
*/
static int
acl_fetch_req_ssl_ver(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
int version, bleft, msg_len;
const unsigned char *data;
*/
static int
acl_fetch_ssl_hello_sni(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
int hs_len, ext_len, bleft;
struct buffer *b;
/* always fake a data retrieval */
int acl_fetch_nothing(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
return 1;
}
/* we need to reset context and flags */
memset(&smp, 0, sizeof(smp));
fetch_next:
- if (!expr->kw->fetch(px, l4, l7, dir, expr, &smp)) {
+ if (!expr->kw->fetch(px, l4, l7, dir, expr->args, &smp)) {
/* maybe we could not fetch because of missing data */
if (smp.flags & SMP_F_MAY_CHANGE && dir & ACL_PARTIAL)
acl_res |= ACL_PAT_MISS;
*/
static int
acl_fetch_nbsrv(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
smp->flags = SMP_F_VOL_TEST;
smp->type = SMP_T_UINT;
- px = expr->args->data.prx;
+ px = args->data.prx;
if (px->srv_act)
smp->data.uint = px->srv_act;
*/
static int
acl_fetch_srv_is_up(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
- struct server *srv = expr->args->data.srv;
+ struct server *srv = args->data.srv;
smp->flags = SMP_F_VOL_TEST;
smp->type = SMP_T_BOOL;
*/
static int
acl_fetch_connslots(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct server *iterator;
smp->type = SMP_T_UINT;
smp->data.uint = 0;
- for (iterator = expr->args->data.prx->srv; iterator; iterator = iterator->next) {
+ for (iterator = args->data.prx->srv; iterator; iterator = iterator->next) {
if ((iterator->state & SRV_RUNNING) == 0)
continue;
/* set temp integer to the id of the backend */
static int
acl_fetch_be_id(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
smp->flags = SMP_F_VOL_TXN;
smp->type = SMP_T_UINT;
/* set temp integer to the id of the server */
static int
acl_fetch_srv_id(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!target_srv(&l4->target))
return 0;
*/
static int
acl_fetch_be_sess_rate(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
smp->flags = SMP_F_VOL_TEST;
smp->type = SMP_T_UINT;
- smp->data.uint = read_freq_ctr(&expr->args->data.prx->be_sess_per_sec);
+ smp->data.uint = read_freq_ctr(&args->data.prx->be_sess_per_sec);
return 1;
}
*/
static int
acl_fetch_be_conn(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
smp->flags = SMP_F_VOL_TEST;
smp->type = SMP_T_UINT;
- smp->data.uint = expr->args->data.prx->beconn;
+ smp->data.uint = args->data.prx->beconn;
return 1;
}
*/
static int
acl_fetch_queue_size(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
smp->flags = SMP_F_VOL_TEST;
smp->type = SMP_T_UINT;
- smp->data.uint = expr->args->data.prx->totpend;
+ smp->data.uint = args->data.prx->totpend;
return 1;
}
*/
static int
acl_fetch_avg_queue_size(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
int nbsrv;
smp->flags = SMP_F_VOL_TEST;
smp->type = SMP_T_UINT;
- px = expr->args->data.prx;
+ px = args->data.prx;
if (px->srv_act)
nbsrv = px->srv_act;
*/
static int
acl_fetch_srv_conn(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
smp->flags = SMP_F_VOL_TEST;
smp->type = SMP_T_UINT;
- smp->data.uint = expr->args->data.srv->cur_sess;
+ smp->data.uint = args->data.srv->cur_sess;
return 1;
}
/* set temp integer to the id of the frontend */
static int
acl_fetch_fe_id(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
smp->flags = SMP_F_VOL_SESS;
smp->type = SMP_T_UINT;
*/
static int
acl_fetch_fe_sess_rate(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
smp->flags = SMP_F_VOL_TEST;
smp->type = SMP_T_UINT;
- smp->data.uint = read_freq_ctr(&expr->args->data.prx->fe_sess_per_sec);
+ smp->data.uint = read_freq_ctr(&args->data.prx->fe_sess_per_sec);
return 1;
}
*/
static int
acl_fetch_fe_conn(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
smp->flags = SMP_F_VOL_TEST;
smp->type = SMP_T_UINT;
- smp->data.uint = expr->args->data.prx->feconn;
+ smp->data.uint = args->data.prx->feconn;
return 1;
}
/* This function ensures that the prerequisites for an L7 fetch are ready,
* which means that a request or response is ready. If some data is missing,
* a parsing attempt is made. This is useful in TCP-based ACLs which are able
- * to extract data from L7.
+ * to extract data from L7. If <req_vol> is non-null during a request prefetch,
+ * another test is made to ensure the required information is not gone.
*
* The function returns :
* 0 if some data is missing or if the requested data cannot be fetched
*/
static int
acl_prefetch_http(struct proxy *px, struct session *s, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp, int req_vol)
{
struct http_txn *txn = l7;
struct http_msg *msg = &txn->req;
/* Check for a dependency on a request */
smp->type = SMP_T_BOOL;
- if (expr->kw->requires & ACL_USE_L7REQ_ANY) {
+ if ((dir & ACL_DIR_MASK) == ACL_DIR_REQ) {
if (unlikely(!s->req))
return 0;
}
}
- if ((expr->kw->requires & ACL_USE_L7REQ_VOLATILE) &&
- txn->rsp.msg_state != HTTP_MSG_RPBEFORE)
+ if (req_vol && txn->rsp.msg_state != HTTP_MSG_RPBEFORE)
return 0; /* data might have moved and indexes changed */
/* otherwise everything's ready for the request */
}
-
- /* Check for a dependency on a response */
- if (expr->kw->requires & ACL_USE_L7RTR_ANY) {
+ else {
+ /* Check for a dependency on a response */
if (txn->rsp.msg_state < HTTP_MSG_BODY)
return 0;
}
}
#define CHECK_HTTP_MESSAGE_FIRST() \
- do { int r = acl_prefetch_http(px, l4, l7, dir, expr, smp); if (r <= 0) return r; } while (0)
+ do { int r = acl_prefetch_http(px, l4, l7, dir, args, smp, 1); if (r <= 0) return r; } while (0)
+
+#define CHECK_HTTP_MESSAGE_FIRST_PERM() \
+ do { int r = acl_prefetch_http(px, l4, l7, dir, args, smp, 0); if (r <= 0) return r; } while (0)
/* 1. Check on METHOD
*/
static int
acl_fetch_meth(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
int meth;
struct http_txn *txn = l7;
- CHECK_HTTP_MESSAGE_FIRST();
+ CHECK_HTTP_MESSAGE_FIRST_PERM();
meth = txn->meth;
smp->type = SMP_T_UINT;
static int
acl_fetch_rqver(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct http_txn *txn = l7;
char *ptr;
static int
acl_fetch_stver(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct http_txn *txn = l7;
char *ptr;
/* 3. Check on Status Code. We manipulate integers here. */
static int
acl_fetch_stcode(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct http_txn *txn = l7;
char *ptr;
/* 4. Check on URL/URI. A pointer to the URI is stored. */
static int
acl_fetch_url(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct http_txn *txn = l7;
static int
acl_fetch_url_ip(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct http_txn *txn = l7;
static int
acl_fetch_url_port(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct http_txn *txn = l7;
*/
static int
acl_fetch_hdr(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct http_txn *txn = l7;
struct hdr_idx *idx = &txn->hdr_idx;
struct hdr_ctx *ctx = (struct hdr_ctx *)smp->ctx.a;
const struct http_msg *msg = ((dir & ACL_DIR_MASK) == ACL_DIR_REQ) ? &txn->req : &txn->rsp;
- if (!expr->args || expr->args->type != ARGT_STR)
+ if (!args || args->type != ARGT_STR)
return 0;
CHECK_HTTP_MESSAGE_FIRST();
/* search for header from the beginning */
ctx->idx = 0;
- if (http_find_header2(expr->args->data.str.str, expr->args->data.str.len, msg->buf->p + msg->sol, idx, ctx)) {
+ if (http_find_header2(args->data.str.str, args->data.str.len, msg->buf->p + msg->sol, idx, ctx)) {
smp->flags |= SMP_F_NOT_LAST;
smp->flags |= SMP_F_VOL_HDR;
smp->type = SMP_T_CSTR;
*/
static int
acl_fetch_hdr_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct http_txn *txn = l7;
struct hdr_idx *idx = &txn->hdr_idx;
const struct http_msg *msg = ((dir & ACL_DIR_MASK) == ACL_DIR_REQ) ? &txn->req : &txn->rsp;
int cnt;
- if (!expr->args || expr->args->type != ARGT_STR)
+ if (!args || args->type != ARGT_STR)
return 0;
CHECK_HTTP_MESSAGE_FIRST();
ctx.idx = 0;
cnt = 0;
- while (http_find_header2(expr->args->data.str.str, expr->args->data.str.len, msg->buf->p + msg->sol, idx, &ctx))
+ while (http_find_header2(args->data.str.str, args->data.str.len, msg->buf->p + msg->sol, idx, &ctx))
cnt++;
smp->type = SMP_T_UINT;
*/
static int
acl_fetch_hdr_val(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
- int ret = acl_fetch_hdr(px, l4, l7, dir, expr, smp);
+ int ret = acl_fetch_hdr(px, l4, l7, dir, args, smp);
if (ret > 0) {
smp->type = SMP_T_UINT;
*/
static int
acl_fetch_hdr_ip(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
int ret;
- while ((ret = acl_fetch_hdr(px, l4, l7, dir, expr, smp)) > 0) {
+ while ((ret = acl_fetch_hdr(px, l4, l7, dir, args, smp)) > 0) {
smp->type = SMP_T_IPV4;
if (url2ipv4((char *)smp->data.str.str, &smp->data.ipv4))
break;
*/
static int
acl_fetch_path(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct http_txn *txn = l7;
char *ptr, *end;
static int
acl_fetch_proto_http(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
/* Note: hdr_idx.v cannot be NULL in this ACL because the ACL is tagged
* as a layer7 ACL, which involves automatic allocation of hdr_idx.
*/
- CHECK_HTTP_MESSAGE_FIRST();
+ CHECK_HTTP_MESSAGE_FIRST_PERM();
smp->type = SMP_T_BOOL;
smp->data.uint = 1;
/* return a valid test if the current request is the first one on the connection */
static int
acl_fetch_http_first_req(struct proxy *px, struct session *s, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!s)
return 0;
/* Accepts exactly 1 argument of type userlist */
static int
acl_fetch_http_auth(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
- if (!expr->args || expr->args->type != ARGT_USR)
+ if (!args || args->type != ARGT_USR)
return 0;
CHECK_HTTP_MESSAGE_FIRST();
return 0;
smp->type = SMP_T_BOOL;
- smp->data.uint = check_user(expr->args->data.usr, 0, l4->txn.auth.user, l4->txn.auth.pass);
+ smp->data.uint = check_user(args->data.usr, 0, l4->txn.auth.user, l4->txn.auth.pass);
return 1;
}
* smp->ctx.a[0] for the in-header position, smp->ctx.a[1] for the
* end-of-header-value, and smp->ctx.a[2] for the hdr_idx. Depending on
* the direction, multiple cookies may be parsed on the same line or not.
- * The cookie name is in expr->arg and the name length in expr->args->data.str.len.
+ * The cookie name is in args and the name length in args->data.str.len.
* Accepts exactly 1 argument of type string.
*/
static int
acl_fetch_cookie_value(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct http_txn *txn = l7;
struct hdr_idx *idx = &txn->hdr_idx;
int hdr_name_len;
char *sol;
- if (!expr->args || expr->args->type != ARGT_STR)
+ if (!args || args->type != ARGT_STR)
return 0;
CHECK_HTTP_MESSAGE_FIRST();
if (!http_find_header2(hdr_name, hdr_name_len, sol, idx, ctx))
goto out;
- if (ctx->vlen < expr->args->data.str.len + 1)
+ if (ctx->vlen < args->data.str.len + 1)
continue;
smp->ctx.a[0] = ctx->line + ctx->val;
smp->type = SMP_T_CSTR;
smp->ctx.a[0] = extract_cookie_value(smp->ctx.a[0], smp->ctx.a[1],
- expr->args->data.str.str, expr->args->data.str.len,
+ args->data.str.str, args->data.str.len,
(dir & ACL_DIR_MASK) == ACL_DIR_REQ,
&smp->data.str.str,
&smp->data.str.len);
}
/* Iterate over all cookies present in a request to count how many occurrences
- * match the name in expr->arg and expr->args->data.str.len. If <multi> is non-null, then
+ * match the name in args and args->data.str.len. If <multi> is non-null, then
* multiple cookies may be parsed on the same line.
* Accepts exactly 1 argument of type string.
*/
static int
acl_fetch_cookie_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct http_txn *txn = l7;
struct hdr_idx *idx = &txn->hdr_idx;
char *val_beg, *val_end;
char *sol;
- if (!expr->args || expr->args->type != ARGT_STR)
+ if (!args || args->type != ARGT_STR)
return 0;
CHECK_HTTP_MESSAGE_FIRST();
if (!http_find_header2(hdr_name, hdr_name_len, sol, idx, &ctx))
break;
- if (ctx.vlen < expr->args->data.str.len + 1)
+ if (ctx.vlen < args->data.str.len + 1)
continue;
val_beg = ctx.line + ctx.val;
smp->type = SMP_T_CSTR;
while ((val_beg = extract_cookie_value(val_beg, val_end,
- expr->args->data.str.str, expr->args->data.str.len,
+ args->data.str.str, args->data.str.len,
(dir & ACL_DIR_MASK) == ACL_DIR_REQ,
&smp->data.str.str,
&smp->data.str.len))) {
static int
acl_fetch_rdp_cookie(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
- return smp_fetch_rdp_cookie(px, l4, l7, dir, expr->args, smp);
+ return smp_fetch_rdp_cookie(px, l4, l7, dir, args, smp);
}
/* returns either 1 or 0 depending on whether an RDP cookie is found or not */
static int
acl_fetch_rdp_cookie_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
int ret;
- ret = smp_fetch_rdp_cookie(px, l4, l7, dir, expr->args, smp);
+ ret = smp_fetch_rdp_cookie(px, l4, l7, dir, args, smp);
if (smp->flags & SMP_F_MAY_CHANGE)
return 0;
/* copy the source IPv4/v6 address into temp_pattern */
static int
acl_fetch_src(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
switch (l4->si[0].addr.from.ss_family) {
case AF_INET:
/* set temp integer to the connection's source port */
static int
acl_fetch_sport(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
smp->type = SMP_T_UINT;
if (!(smp->data.uint = get_host_port(&l4->si[0].addr.from)))
/* set test->ptr to point to the frontend's IPv4/IPv6 address and test->i to the family */
static int
acl_fetch_dst(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
stream_sock_get_to_addr(&l4->si[0]);
/* set temp integer to the frontend connexion's destination port */
static int
acl_fetch_dport(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
stream_sock_get_to_addr(&l4->si[0]);
/* set temp integer to the number of connexions to the same listening socket */
static int
acl_fetch_dconn(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
smp->type = SMP_T_UINT;
smp->data.uint = l4->listener->nbconn;
/* set temp integer to the id of the socket (listener) */
static int
acl_fetch_so_id(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
smp->type = SMP_T_UINT;
smp->data.uint = l4->listener->luid;
*/
static int
acl_fetch_sc1_get_gpc0(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr1_entry)
return 0;
*/
static int
acl_fetch_sc2_get_gpc0(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr2_entry)
return 0;
*/
static int
acl_fetch_src_get_gpc0(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct stktable_key *key;
if (!key)
return 0;
- px = expr->args->data.prx;
+ px = args->data.prx;
return acl_fetch_get_gpc0(&px->table, smp, stktable_lookup_key(&px->table, key));
}
*/
static int
acl_fetch_sc1_inc_gpc0(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr1_entry)
return 0;
*/
static int
acl_fetch_sc2_inc_gpc0(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr2_entry)
return 0;
*/
static int
acl_fetch_src_inc_gpc0(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct stktable_key *key;
if (!key)
return 0;
- px = expr->args->data.prx;
+ px = args->data.prx;
return acl_fetch_inc_gpc0(&px->table, smp, stktable_update_key(&px->table, key));
}
*/
static int
acl_fetch_sc1_clr_gpc0(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr1_entry)
return 0;
*/
static int
acl_fetch_sc2_clr_gpc0(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr2_entry)
return 0;
*/
static int
acl_fetch_src_clr_gpc0(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct stktable_key *key;
if (!key)
return 0;
- px = expr->args->data.prx;
+ px = args->data.prx;
return acl_fetch_clr_gpc0(&px->table, smp, stktable_update_key(&px->table, key));
}
/* set temp integer to the cumulated number of connections from the session's tracked FE counters */
static int
acl_fetch_sc1_conn_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr1_entry)
return 0;
/* set temp integer to the cumulated number of connections from the session's tracked BE counters */
static int
acl_fetch_sc2_conn_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr2_entry)
return 0;
*/
static int
acl_fetch_src_conn_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct stktable_key *key;
if (!key)
return 0;
- px = expr->args->data.prx;
+ px = args->data.prx;
return acl_fetch_conn_cnt(&px->table, smp, stktable_lookup_key(&px->table, key));
}
*/
static int
acl_fetch_sc1_conn_rate(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr1_entry)
return 0;
*/
static int
acl_fetch_sc2_conn_rate(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr2_entry)
return 0;
*/
static int
acl_fetch_src_conn_rate(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct stktable_key *key;
if (!key)
return 0;
- px = expr->args->data.prx;
+ px = args->data.prx;
return acl_fetch_conn_rate(&px->table, smp, stktable_lookup_key(&px->table, key));
}
*/
static int
acl_fetch_src_updt_conn_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct stksess *ts;
struct stktable_key *key;
if (!key)
return 0;
- px = expr->args->data.prx;
+ px = args->data.prx;
if ((ts = stktable_update_key(&px->table, key)) == NULL)
/* entry does not exist and could not be created */
/* set temp integer to the number of concurrent connections from the session's tracked FE counters */
static int
acl_fetch_sc1_conn_cur(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr1_entry)
return 0;
/* set temp integer to the number of concurrent connections from the session's tracked BE counters */
static int
acl_fetch_sc2_conn_cur(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr2_entry)
return 0;
*/
static int
acl_fetch_src_conn_cur(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct stktable_key *key;
if (!key)
return 0;
- px = expr->args->data.prx;
+ px = args->data.prx;
return acl_fetch_conn_cur(&px->table, smp, stktable_lookup_key(&px->table, key));
}
/* set temp integer to the cumulated number of sessions from the session's tracked FE counters */
static int
acl_fetch_sc1_sess_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr1_entry)
return 0;
/* set temp integer to the cumulated number of sessions from the session's tracked BE counters */
static int
acl_fetch_sc2_sess_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr2_entry)
return 0;
*/
static int
acl_fetch_src_sess_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct stktable_key *key;
if (!key)
return 0;
- px = expr->args->data.prx;
+ px = args->data.prx;
return acl_fetch_sess_cnt(&px->table, smp, stktable_lookup_key(&px->table, key));
}
*/
static int
acl_fetch_sc1_sess_rate(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr1_entry)
return 0;
*/
static int
acl_fetch_sc2_sess_rate(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr2_entry)
return 0;
*/
static int
acl_fetch_src_sess_rate(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct stktable_key *key;
if (!key)
return 0;
- px = expr->args->data.prx;
+ px = args->data.prx;
return acl_fetch_sess_rate(&px->table, smp, stktable_lookup_key(&px->table, key));
}
/* set temp integer to the cumulated number of sessions from the session's tracked FE counters */
static int
acl_fetch_sc1_http_req_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr1_entry)
return 0;
/* set temp integer to the cumulated number of sessions from the session's tracked BE counters */
static int
acl_fetch_sc2_http_req_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr2_entry)
return 0;
*/
static int
acl_fetch_src_http_req_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct stktable_key *key;
if (!key)
return 0;
- px = expr->args->data.prx;
+ px = args->data.prx;
return acl_fetch_http_req_cnt(&px->table, smp, stktable_lookup_key(&px->table, key));
}
*/
static int
acl_fetch_sc1_http_req_rate(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr1_entry)
return 0;
*/
static int
acl_fetch_sc2_http_req_rate(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr2_entry)
return 0;
*/
static int
acl_fetch_src_http_req_rate(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct stktable_key *key;
if (!key)
return 0;
- px = expr->args->data.prx;
+ px = args->data.prx;
return acl_fetch_http_req_rate(&px->table, smp, stktable_lookup_key(&px->table, key));
}
/* set temp integer to the cumulated number of sessions from the session's tracked FE counters */
static int
acl_fetch_sc1_http_err_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr1_entry)
return 0;
/* set temp integer to the cumulated number of sessions from the session's tracked BE counters */
static int
acl_fetch_sc2_http_err_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr2_entry)
return 0;
*/
static int
acl_fetch_src_http_err_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct stktable_key *key;
if (!key)
return 0;
- px = expr->args->data.prx;
+ px = args->data.prx;
return acl_fetch_http_err_cnt(&px->table, smp, stktable_lookup_key(&px->table, key));
}
*/
static int
acl_fetch_sc1_http_err_rate(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr1_entry)
return 0;
*/
static int
acl_fetch_sc2_http_err_rate(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr2_entry)
return 0;
*/
static int
acl_fetch_src_http_err_rate(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct stktable_key *key;
if (!key)
return 0;
- px = expr->args->data.prx;
+ px = args->data.prx;
return acl_fetch_http_err_rate(&px->table, smp, stktable_lookup_key(&px->table, key));
}
*/
static int
acl_fetch_sc1_kbytes_in(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr1_entry)
return 0;
*/
static int
acl_fetch_sc2_kbytes_in(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr2_entry)
return 0;
*/
static int
acl_fetch_src_kbytes_in(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct stktable_key *key;
if (!key)
return 0;
- px = expr->args->data.prx;
+ px = args->data.prx;
return acl_fetch_kbytes_in(&px->table, smp, stktable_lookup_key(&px->table, key));
}
*/
static int
acl_fetch_sc1_bytes_in_rate(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr1_entry)
return 0;
*/
static int
acl_fetch_sc2_bytes_in_rate(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr2_entry)
return 0;
*/
static int
acl_fetch_src_bytes_in_rate(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct stktable_key *key;
if (!key)
return 0;
- px = expr->args->data.prx;
+ px = args->data.prx;
return acl_fetch_bytes_in_rate(&px->table, smp, stktable_lookup_key(&px->table, key));
}
*/
static int
acl_fetch_sc1_kbytes_out(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr1_entry)
return 0;
*/
static int
acl_fetch_sc2_kbytes_out(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr2_entry)
return 0;
*/
static int
acl_fetch_src_kbytes_out(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct stktable_key *key;
if (!key)
return 0;
- px = expr->args->data.prx;
+ px = args->data.prx;
return acl_fetch_kbytes_out(&px->table, smp, stktable_lookup_key(&px->table, key));
}
*/
static int
acl_fetch_sc1_bytes_out_rate(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr1_entry)
return 0;
*/
static int
acl_fetch_sc2_bytes_out_rate(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
if (!l4->stkctr2_entry)
return 0;
*/
static int
acl_fetch_src_bytes_out_rate(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
struct stktable_key *key;
if (!key)
return 0;
- px = expr->args->data.prx;
+ px = args->data.prx;
return acl_fetch_bytes_out_rate(&px->table, smp, stktable_lookup_key(&px->table, key));
}
*/
static int
acl_fetch_table_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
smp->flags = SMP_F_VOL_TEST;
smp->type = SMP_T_UINT;
- smp->data.uint = expr->args->data.prx->table.current;
+ smp->data.uint = args->data.prx->table.current;
return 1;
}
*/
static int
acl_fetch_table_avl(struct proxy *px, struct session *l4, void *l7, int dir,
- struct acl_expr *expr, struct sample *smp)
+ const struct arg *args, struct sample *smp)
{
- px = expr->args->data.prx;
+ px = args->data.prx;
smp->flags = SMP_F_VOL_TEST;
smp->type = SMP_T_UINT;
smp->data.uint = px->table.size - px->table.current;