MEDIUM: acl: replace acl_expr with args in acl fetch_* functions

Having the args everywhere will make it easier to share fetch functions
between patterns and ACLs. The only place where we could have needed
the expr was in the http_prefetch function which can do well without.
diff --git a/src/session.c b/src/session.c
index b4c0a82..f381f9e 100644
--- a/src/session.c
+++ b/src/session.c
@@ -2327,7 +2327,7 @@
  */
 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;
@@ -2339,7 +2339,7 @@
  */
 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;
@@ -2352,7 +2352,7 @@
  */
 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;
 
@@ -2360,7 +2360,7 @@
 	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));
 }
 
@@ -2387,7 +2387,7 @@
  */
 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;
@@ -2399,7 +2399,7 @@
  */
 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;
@@ -2412,7 +2412,7 @@
  */
 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;
 
@@ -2420,7 +2420,7 @@
 	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));
 }
 
@@ -2448,7 +2448,7 @@
  */
 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;
@@ -2460,7 +2460,7 @@
  */
 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;
@@ -2473,7 +2473,7 @@
  */
 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;
 
@@ -2481,7 +2481,7 @@
 	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));
 }
 
@@ -2504,7 +2504,7 @@
 /* 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;
@@ -2515,7 +2515,7 @@
 /* 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;
@@ -2529,7 +2529,7 @@
  */
 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;
 
@@ -2537,7 +2537,7 @@
 	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));
 }
 
@@ -2563,7 +2563,7 @@
  */
 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;
@@ -2576,7 +2576,7 @@
  */
 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;
@@ -2590,7 +2590,7 @@
  */
 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;
 
@@ -2598,7 +2598,7 @@
 	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));
 }
 
@@ -2608,7 +2608,7 @@
  */
 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;
@@ -2618,7 +2618,7 @@
 	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 */
@@ -2654,7 +2654,7 @@
 /* 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;
@@ -2665,7 +2665,7 @@
 /* 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;
@@ -2679,7 +2679,7 @@
  */
 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;
 
@@ -2687,7 +2687,7 @@
 	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));
 }
 
@@ -2710,7 +2710,7 @@
 /* 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;
@@ -2721,7 +2721,7 @@
 /* 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;
@@ -2735,7 +2735,7 @@
  */
 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;
 
@@ -2743,7 +2743,7 @@
 	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));
 }
 
@@ -2769,7 +2769,7 @@
  */
 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;
@@ -2782,7 +2782,7 @@
  */
 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;
@@ -2796,7 +2796,7 @@
  */
 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;
 
@@ -2804,7 +2804,7 @@
 	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));
 }
 
@@ -2827,7 +2827,7 @@
 /* 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;
@@ -2838,7 +2838,7 @@
 /* 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;
@@ -2852,7 +2852,7 @@
  */
 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;
 
@@ -2860,7 +2860,7 @@
 	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));
 }
 
@@ -2886,7 +2886,7 @@
  */
 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;
@@ -2899,7 +2899,7 @@
  */
 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;
@@ -2913,7 +2913,7 @@
  */
 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;
 
@@ -2921,7 +2921,7 @@
 	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));
 }
 
@@ -2944,7 +2944,7 @@
 /* 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;
@@ -2955,7 +2955,7 @@
 /* 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;
@@ -2969,7 +2969,7 @@
  */
 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;
 
@@ -2977,7 +2977,7 @@
 	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));
 }
 
@@ -3003,7 +3003,7 @@
  */
 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;
@@ -3016,7 +3016,7 @@
  */
 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;
@@ -3030,7 +3030,7 @@
  */
 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;
 
@@ -3038,7 +3038,7 @@
 	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));
 }
 
@@ -3064,7 +3064,7 @@
  */
 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;
@@ -3077,7 +3077,7 @@
  */
 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;
@@ -3091,7 +3091,7 @@
  */
 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;
 
@@ -3099,7 +3099,7 @@
 	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));
 }
 
@@ -3127,7 +3127,7 @@
  */
 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;
@@ -3140,7 +3140,7 @@
  */
 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;
@@ -3154,7 +3154,7 @@
  */
 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;
 
@@ -3162,7 +3162,7 @@
 	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));
 }
 
@@ -3188,7 +3188,7 @@
  */
 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;
@@ -3201,7 +3201,7 @@
  */
 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;
@@ -3215,7 +3215,7 @@
  */
 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;
 
@@ -3223,7 +3223,7 @@
 	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));
 }
 
@@ -3251,7 +3251,7 @@
  */
 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;
@@ -3264,7 +3264,7 @@
  */
 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;
@@ -3278,7 +3278,7 @@
  */
 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;
 
@@ -3286,7 +3286,7 @@
 	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));
 }
 
@@ -3295,11 +3295,11 @@
  */
 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;
 }
 
@@ -3308,9 +3308,9 @@
  */
 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;