MEDIUM: sample: change the prototype of sample-fetches functions

This patch removes the "opt" entry from the prototype of the
sample-fetches fucntions. This permits to remove some weight
in the prototype call.
diff --git a/include/proto/proto_http.h b/include/proto/proto_http.h
index 817c98f..41a7dc6 100644
--- a/include/proto/proto_http.h
+++ b/include/proto/proto_http.h
@@ -126,10 +126,8 @@
 struct chunk *http_error_message(struct stream *s, int msgnum);
 struct redirect_rule *http_parse_redirect_rule(const char *file, int linenum, struct proxy *curproxy,
                                                const char **args, char **errmsg, int use_fmt);
-int smp_fetch_cookie(unsigned int opt, const struct arg *args, struct sample *smp,
-                     const char *kw, void *private);
-int smp_fetch_base32(unsigned int opt, const struct arg *args, struct sample *smp,
-                     const char *kw, void *private);
+int smp_fetch_cookie(const struct arg *args, struct sample *smp, const char *kw, void *private);
+int smp_fetch_base32(const struct arg *args, struct sample *smp, const char *kw, void *private);
 
 enum http_meth_t find_http_meth(const char *str, const int len);
 
diff --git a/include/types/sample.h b/include/types/sample.h
index 117b060..0d0aef7 100644
--- a/include/types/sample.h
+++ b/include/types/sample.h
@@ -294,8 +294,7 @@
 /* Descriptor for a sample fetch method */
 struct sample_fetch {
 	const char *kw;                           /* configuration keyword */
-	int (*process)(unsigned int opt,          /* fetch options (SMP_OPT_*) */
-	               const struct arg *arg_p,
+	int (*process)(const struct arg *arg_p,
 	               struct sample *smp,
 	               const char *kw,            /* fetch processing function */
 	               void *private);            /* private value. */
diff --git a/src/backend.c b/src/backend.c
index 08389df..26f5589 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -1486,8 +1486,7 @@
  * undefined behaviour.
  */
 static int
-smp_fetch_nbsrv(unsigned int opt, const struct arg *args, struct sample *smp,
-                const char *kw, void *private)
+smp_fetch_nbsrv(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct proxy *px;
 
@@ -1511,8 +1510,7 @@
  * undefined behaviour.
  */
 static int
-smp_fetch_srv_is_up(unsigned int opt, const struct arg *args, struct sample *smp,
-                    const char *kw, void *private)
+smp_fetch_srv_is_up(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct server *srv = args->data.srv;
 
@@ -1531,8 +1529,7 @@
  * undefined behaviour.
  */
 static int
-smp_fetch_connslots(unsigned int opt, const struct arg *args, struct sample *smp,
-                    const char *kw, void *private)
+smp_fetch_connslots(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct server *iterator;
 
@@ -1559,8 +1556,7 @@
 
 /* set temp integer to the id of the backend */
 static int
-smp_fetch_be_id(unsigned int opt, const struct arg *args, struct sample *smp,
-                const char *kw, void *private)
+smp_fetch_be_id(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->flags = SMP_F_VOL_TXN;
 	smp->type = SMP_T_UINT;
@@ -1570,8 +1566,7 @@
 
 /* set temp integer to the id of the server */
 static int
-smp_fetch_srv_id(unsigned int opt, const struct arg *args, struct sample *smp,
-                 const char *kw, void *private)
+smp_fetch_srv_id(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	if (!objt_server(smp->strm->target))
 		return 0;
@@ -1587,8 +1582,7 @@
  * undefined behaviour.
  */
 static int
-smp_fetch_be_sess_rate(unsigned int opt, const struct arg *args, struct sample *smp,
-                       const char *kw, void *private)
+smp_fetch_be_sess_rate(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->flags = SMP_F_VOL_TEST;
 	smp->type = SMP_T_UINT;
@@ -1601,8 +1595,7 @@
  * undefined behaviour.
  */
 static int
-smp_fetch_be_conn(unsigned int opt, const struct arg *args, struct sample *smp,
-                  const char *kw, void *private)
+smp_fetch_be_conn(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->flags = SMP_F_VOL_TEST;
 	smp->type = SMP_T_UINT;
@@ -1615,8 +1608,7 @@
  * undefined behaviour.
  */
 static int
-smp_fetch_queue_size(unsigned int opt, const struct arg *args, struct sample *smp,
-                     const char *kw, void *private)
+smp_fetch_queue_size(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->flags = SMP_F_VOL_TEST;
 	smp->type = SMP_T_UINT;
@@ -1633,8 +1625,7 @@
  * undefined behaviour.
  */
 static int
-smp_fetch_avg_queue_size(unsigned int opt, const struct arg *args, struct sample *smp,
-                         const char *kw, void *private)
+smp_fetch_avg_queue_size(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int nbsrv;
 	struct proxy *px;
@@ -1663,8 +1654,7 @@
  * undefined behaviour.
  */
 static int
-smp_fetch_srv_conn(unsigned int opt, const struct arg *args, struct sample *smp,
-                   const char *kw, void *private)
+smp_fetch_srv_conn(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->flags = SMP_F_VOL_TEST;
 	smp->type = SMP_T_UINT;
@@ -1677,8 +1667,7 @@
  * undefined behaviour.
  */
 static int
-smp_fetch_srv_sess_rate(unsigned int opt, const struct arg *args, struct sample *smp,
-                        const char *kw, void *private)
+smp_fetch_srv_sess_rate(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->flags = SMP_F_VOL_TEST;
 	smp->type = SMP_T_UINT;
diff --git a/src/compression.c b/src/compression.c
index 1012148..e8f13bb 100644
--- a/src/compression.c
+++ b/src/compression.c
@@ -838,8 +838,7 @@
 
 /* boolean, returns true if compression is used (either gzip or deflate) in the response */
 static int
-smp_fetch_res_comp(unsigned int opt, const struct arg *args, struct sample *smp,
-                   const char *kw, void *private)
+smp_fetch_res_comp(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->type = SMP_T_BOOL;
 	smp->data.uint = (smp->strm->comp_algo != NULL);
@@ -848,8 +847,7 @@
 
 /* string, returns algo */
 static int
-smp_fetch_res_comp_algo(unsigned int opt, const struct arg *args, struct sample *smp,
-                        const char *kw, void *private)
+smp_fetch_res_comp_algo(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	if (!smp->strm->comp_algo)
 		return 0;
diff --git a/src/frontend.c b/src/frontend.c
index 001b74d..efd6383 100644
--- a/src/frontend.c
+++ b/src/frontend.c
@@ -159,8 +159,7 @@
 
 /* set temp integer to the id of the frontend */
 static int
-smp_fetch_fe_id(unsigned int opt, const struct arg *args, struct sample *smp,
-                const char *kw, void *private)
+smp_fetch_fe_id(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->flags = SMP_F_VOL_SESS;
 	smp->type = SMP_T_UINT;
@@ -173,8 +172,7 @@
  * an undefined behaviour.
  */
 static int
-smp_fetch_fe_sess_rate(unsigned int opt, const struct arg *args, struct sample *smp,
-                       const char *kw, void *private)
+smp_fetch_fe_sess_rate(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->flags = SMP_F_VOL_TEST;
 	smp->type = SMP_T_UINT;
@@ -187,8 +185,7 @@
  * an undefined behaviour.
  */
 static int
-smp_fetch_fe_conn(unsigned int opt, const struct arg *args, struct sample *smp,
-                  const char *kw, void *private)
+smp_fetch_fe_conn(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->flags = SMP_F_VOL_TEST;
 	smp->type = SMP_T_UINT;
diff --git a/src/hlua.c b/src/hlua.c
index 2621630..a937e4f 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -2774,7 +2774,7 @@
 	smp.sess = hsmp->s->sess;
 	smp.strm = hsmp->s;
 	smp.opt = 0;
-	if (!f->process(0, args, &smp, f->kw, f->private)) {
+	if (!f->process(args, &smp, f->kw, f->private)) {
 		if (hsmp->stringsafe)
 			lua_pushstring(L, "");
 		else
@@ -3957,8 +3957,8 @@
  * doesn't allow "yield" functions because the HAProxy engine cannot
  * resume sample-fetches.
  */
-static int hlua_sample_fetch_wrapper(unsigned int opt, const struct arg *arg_p,
-                                     struct sample *smp, const char *kw, void *private)
+static int hlua_sample_fetch_wrapper(const struct arg *arg_p, struct sample *smp,
+                                     const char *kw, void *private)
 {
 	struct hlua_function *fcn = (struct hlua_function *)private;
 	struct stream *stream = smp->strm;
diff --git a/src/listener.c b/src/listener.c
index f4bdcc6..4d07031 100644
--- a/src/listener.c
+++ b/src/listener.c
@@ -591,8 +591,7 @@
 
 /* set temp integer to the number of connexions to the same listening socket */
 static int
-smp_fetch_dconn(unsigned int opt, const struct arg *args, struct sample *smp,
-                const char *kw, void *private)
+smp_fetch_dconn(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->type = SMP_T_UINT;
 	smp->data.uint = smp->sess->listener->nbconn;
@@ -601,8 +600,7 @@
 
 /* set temp integer to the id of the socket (listener) */
 static int
-smp_fetch_so_id(unsigned int opt, const struct arg *args, struct sample *smp,
-                const char *kw, void *private)
+smp_fetch_so_id(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->type = SMP_T_UINT;
 	smp->data.uint = smp->sess->listener->luid;
diff --git a/src/payload.c b/src/payload.c
index a80ac10..9bf2d88 100644
--- a/src/payload.c
+++ b/src/payload.c
@@ -29,10 +29,9 @@
  * used with content inspection.
  */
 static int
-smp_fetch_wait_end(unsigned int opt, const struct arg *args, struct sample *smp,
-                   const char *kw, void *private)
+smp_fetch_wait_end(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	if (!(opt & SMP_OPT_FINAL)) {
+	if (!(smp->opt & SMP_OPT_FINAL)) {
 		smp->flags |= SMP_F_MAY_CHANGE;
 		return 0;
 	}
@@ -43,12 +42,11 @@
 
 /* return the number of bytes in the request buffer */
 static int
-smp_fetch_len(unsigned int opt, const struct arg *args, struct sample *smp,
-              const char *kw, void *private)
+smp_fetch_len(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct channel *chn;
 
-	chn = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? &smp->strm->res : &smp->strm->req;
+	chn = ((smp->opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? &smp->strm->res : &smp->strm->req;
 	if (!chn->buf)
 		return 0;
 
@@ -60,15 +58,14 @@
 
 /* returns the type of SSL hello message (mainly used to detect an SSL hello) */
 static int
-smp_fetch_ssl_hello_type(unsigned int opt, const struct arg *args, struct sample *smp,
-                         const char *kw, void *private)
+smp_fetch_ssl_hello_type(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int hs_len;
 	int hs_type, bleft;
 	struct channel *chn;
 	const unsigned char *data;
 
-	chn = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? &smp->strm->res : &smp->strm->req;
+	chn = ((smp->opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? &smp->strm->res : &smp->strm->req;
 	if (!chn->buf)
 		goto not_ssl_hello;
 
@@ -128,8 +125,7 @@
  * Note: this decoder only works with non-wrapping data.
  */
 static int
-smp_fetch_req_ssl_ver(unsigned int opt, const struct arg *args, struct sample *smp,
-                      const char *kw, void *private)
+smp_fetch_req_ssl_ver(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int version, bleft, msg_len;
 	const unsigned char *data;
@@ -265,14 +261,13 @@
  *             - opaque hostname[name_len bytes]
  */
 static int
-smp_fetch_ssl_hello_sni(unsigned int opt, const struct arg *args, struct sample *smp,
-                        const char *kw, void *private)
+smp_fetch_ssl_hello_sni(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int hs_len, ext_len, bleft;
 	struct channel *chn;
 	unsigned char *data;
 
-	chn = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? &smp->strm->res : &smp->strm->req;
+	chn = ((smp->opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? &smp->strm->res : &smp->strm->req;
 	if (!chn->buf)
 		goto not_ssl_hello;
 
@@ -494,20 +489,18 @@
  * returned sample has type SMP_T_CSTR.
  */
 int
-smp_fetch_rdp_cookie(unsigned int opt, const struct arg *args, struct sample *smp,
-                     const char *kw, void *private)
+smp_fetch_rdp_cookie(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	return fetch_rdp_cookie_name(smp->strm, smp, args ? args->data.str.str : NULL, args ? args->data.str.len : 0);
 }
 
 /* returns either 1 or 0 depending on whether an RDP cookie is found or not */
 static int
-smp_fetch_rdp_cookie_cnt(unsigned int opt, const struct arg *args, struct sample *smp,
-                         const char *kw, void *private)
+smp_fetch_rdp_cookie_cnt(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int ret;
 
-	ret = smp_fetch_rdp_cookie(opt, args, smp, kw, private);
+	ret = smp_fetch_rdp_cookie(args, smp, kw, private);
 
 	if (smp->flags & SMP_F_MAY_CHANGE)
 		return 0;
@@ -520,8 +513,7 @@
 
 /* extracts part of a payload with offset and length at a given position */
 static int
-smp_fetch_payload_lv(unsigned int opt, const struct arg *arg_p, struct sample *smp,
-                     const char *kw, void *private)
+smp_fetch_payload_lv(const struct arg *arg_p, struct sample *smp, const char *kw, void *private)
 {
 	unsigned int len_offset = arg_p[0].data.uint;
 	unsigned int len_size = arg_p[1].data.uint;
@@ -534,7 +526,7 @@
 	/* by default buf offset == len offset + len size */
 	/* buf offset could be absolute or relative to len offset + len size if prefixed by + or - */
 
-	chn = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? &smp->strm->res : &smp->strm->req;
+	chn = ((smp->opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? &smp->strm->res : &smp->strm->req;
 	if (!chn->buf)
 		return 0;
 
@@ -574,14 +566,13 @@
 
 /* extracts some payload at a fixed position and length */
 static int
-smp_fetch_payload(unsigned int opt, const struct arg *arg_p, struct sample *smp,
-                  const char *kw, void *private)
+smp_fetch_payload(const struct arg *arg_p, struct sample *smp, const char *kw, void *private)
 {
 	unsigned int buf_offset = arg_p[0].data.uint;
 	unsigned int buf_size = arg_p[1].data.uint;
 	struct channel *chn;
 
-	chn = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? &smp->strm->res : &smp->strm->req;
+	chn = ((smp->opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? &smp->strm->res : &smp->strm->req;
 	if (!chn->buf)
 		return 0;
 
diff --git a/src/proto_http.c b/src/proto_http.c
index 70e3ab7..7ae4ed9 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -10176,10 +10176,10 @@
  * least the type and uint value are modified.
  */
 #define CHECK_HTTP_MESSAGE_FIRST() \
-	do { int r = smp_prefetch_http(smp->px, smp->strm, opt, args, smp, 1); if (r <= 0) return r; } while (0)
+	do { int r = smp_prefetch_http(smp->px, smp->strm, smp->opt, args, smp, 1); if (r <= 0) return r; } while (0)
 
 #define CHECK_HTTP_MESSAGE_FIRST_PERM() \
-	do { int r = smp_prefetch_http(smp->px, smp->strm, opt, args, smp, 0); if (r <= 0) return r; } while (0)
+	do { int r = smp_prefetch_http(smp->px, smp->strm, smp->opt, args, smp, 0); if (r <= 0) return r; } while (0)
 
 
 /* 1. Check on METHOD
@@ -10214,8 +10214,7 @@
  * This is intended to be used with pat_match_meth() only.
  */
 static int
-smp_fetch_meth(unsigned int opt, const struct arg *args, struct sample *smp,
-               const char *kw, void *private)
+smp_fetch_meth(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int meth;
 	struct http_txn *txn = smp->strm->txn;
@@ -10268,8 +10267,7 @@
 }
 
 static int
-smp_fetch_rqver(unsigned int opt, const struct arg *args, struct sample *smp,
-                const char *kw, void *private)
+smp_fetch_rqver(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct http_txn *txn = smp->strm->txn;
 	char *ptr;
@@ -10293,8 +10291,7 @@
 }
 
 static int
-smp_fetch_stver(unsigned int opt, const struct arg *args, struct sample *smp,
-                const char *kw, void *private)
+smp_fetch_stver(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct http_txn *txn;
 	char *ptr;
@@ -10323,8 +10320,7 @@
 
 /* 3. Check on Status Code. We manipulate integers here. */
 static int
-smp_fetch_stcode(unsigned int opt, const struct arg *args, struct sample *smp,
-                 const char *kw, void *private)
+smp_fetch_stcode(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct http_txn *txn;
 	char *ptr;
@@ -10349,8 +10345,7 @@
  * has been waited for using http-buffer-request.
  */
 static int
-smp_fetch_body(unsigned int opt, const struct arg *args, struct sample *smp,
-               const char *kw, void *private)
+smp_fetch_body(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct http_txn *txn = smp->strm->txn;
 	struct http_msg *msg;
@@ -10361,7 +10356,7 @@
 
 	CHECK_HTTP_MESSAGE_FIRST();
 
-	if ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ)
+	if ((smp->opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ)
 		msg = &txn->req;
 	else
 		msg = &txn->rsp;
@@ -10398,15 +10393,14 @@
  * has been waited for using http-buffer-request.
  */
 static int
-smp_fetch_body_len(unsigned int opt, const struct arg *args, struct sample *smp,
-                   const char *kw, void *private)
+smp_fetch_body_len(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct http_txn *txn = smp->strm->txn;
 	struct http_msg *msg;
 
 	CHECK_HTTP_MESSAGE_FIRST();
 
-	if ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ)
+	if ((smp->opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ)
 		msg = &txn->req;
 	else
 		msg = &txn->rsp;
@@ -10424,15 +10418,14 @@
  * for using http-buffer-request.
  */
 static int
-smp_fetch_body_size(unsigned int opt, const struct arg *args, struct sample *smp,
-                    const char *kw, void *private)
+smp_fetch_body_size(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct http_txn *txn = smp->strm->txn;
 	struct http_msg *msg;
 
 	CHECK_HTTP_MESSAGE_FIRST();
 
-	if ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ)
+	if ((smp->opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ)
 		msg = &txn->req;
 	else
 		msg = &txn->rsp;
@@ -10447,8 +10440,7 @@
 
 /* 4. Check on URL/URI. A pointer to the URI is stored. */
 static int
-smp_fetch_url(unsigned int opt, const struct arg *args, struct sample *smp,
-              const char *kw, void *private)
+smp_fetch_url(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct http_txn *txn;
 
@@ -10463,8 +10455,7 @@
 }
 
 static int
-smp_fetch_url_ip(unsigned int opt, const struct arg *args, struct sample *smp,
-                 const char *kw, void *private)
+smp_fetch_url_ip(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct http_txn *txn;
 	struct sockaddr_storage addr;
@@ -10483,8 +10474,7 @@
 }
 
 static int
-smp_fetch_url_port(unsigned int opt, const struct arg *args, struct sample *smp,
-                   const char *kw, void *private)
+smp_fetch_url_port(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct http_txn *txn;
 	struct sockaddr_storage addr;
@@ -10510,8 +10500,7 @@
  * returns full lines instead (useful for User-Agent or Date for example).
  */
 static int
-smp_fetch_fhdr(unsigned int opt, const struct arg *args, struct sample *smp,
-               const char *kw, void *private)
+smp_fetch_fhdr(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct hdr_idx *idx;
 	struct hdr_ctx *ctx = smp->ctx.a[0];
@@ -10540,13 +10529,13 @@
 	CHECK_HTTP_MESSAGE_FIRST();
 
 	idx = &smp->strm->txn->hdr_idx;
-	msg = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) ? &smp->strm->txn->req : &smp->strm->txn->rsp;
+	msg = ((smp->opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) ? &smp->strm->txn->req : &smp->strm->txn->rsp;
 
 	if (ctx && !(smp->flags & SMP_F_NOT_LAST))
 		/* search for header from the beginning */
 		ctx->idx = 0;
 
-	if (!occ && !(opt & SMP_OPT_ITERATE))
+	if (!occ && !(smp->opt & SMP_OPT_ITERATE))
 		/* no explicit occurrence and single fetch => last header by default */
 		occ = -1;
 
@@ -10568,8 +10557,7 @@
  * returns full lines instead (useful for User-Agent or Date for example).
  */
 static int
-smp_fetch_fhdr_cnt(unsigned int opt, const struct arg *args, struct sample *smp,
-                   const char *kw, void *private)
+smp_fetch_fhdr_cnt(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct hdr_idx *idx;
 	struct hdr_ctx ctx;
@@ -10586,7 +10574,7 @@
 	CHECK_HTTP_MESSAGE_FIRST();
 
 	idx = &smp->strm->txn->hdr_idx;
-	msg = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) ? &smp->strm->txn->req : &smp->strm->txn->rsp;
+	msg = ((smp->opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) ? &smp->strm->txn->req : &smp->strm->txn->rsp;
 
 	ctx.idx = 0;
 	cnt = 0;
@@ -10600,8 +10588,7 @@
 }
 
 static int
-smp_fetch_hdr_names(unsigned int opt, const struct arg *args, struct sample *smp,
-                    const char *kw, void *private)
+smp_fetch_hdr_names(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct hdr_idx *idx;
 	struct hdr_ctx ctx;
@@ -10615,7 +10602,7 @@
 	CHECK_HTTP_MESSAGE_FIRST();
 
 	idx = &smp->strm->txn->hdr_idx;
-	msg = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) ? &smp->strm->txn->req : &smp->strm->txn->rsp;
+	msg = ((smp->opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) ? &smp->strm->txn->req : &smp->strm->txn->rsp;
 
 	temp = get_trash_chunk();
 
@@ -10641,8 +10628,7 @@
  * headers are considered from the first one.
  */
 static int
-smp_fetch_hdr(unsigned int opt, const struct arg *args, struct sample *smp,
-              const char *kw, void *private)
+smp_fetch_hdr(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct hdr_idx *idx;
 	struct hdr_ctx *ctx = smp->ctx.a[0];
@@ -10671,13 +10657,13 @@
 	CHECK_HTTP_MESSAGE_FIRST();
 
 	idx = &smp->strm->txn->hdr_idx;
-	msg = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) ? &smp->strm->txn->req : &smp->strm->txn->rsp;
+	msg = ((smp->opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) ? &smp->strm->txn->req : &smp->strm->txn->rsp;
 
 	if (ctx && !(smp->flags & SMP_F_NOT_LAST))
 		/* search for header from the beginning */
 		ctx->idx = 0;
 
-	if (!occ && !(opt & SMP_OPT_ITERATE))
+	if (!occ && !(smp->opt & SMP_OPT_ITERATE))
 		/* no explicit occurrence and single fetch => last header by default */
 		occ = -1;
 
@@ -10698,8 +10684,7 @@
  * Accepts exactly 1 argument of type string.
  */
 static int
-smp_fetch_hdr_cnt(unsigned int opt, const struct arg *args, struct sample *smp,
-                  const char *kw, void *private)
+smp_fetch_hdr_cnt(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct hdr_idx *idx;
 	struct hdr_ctx ctx;
@@ -10716,7 +10701,7 @@
 	CHECK_HTTP_MESSAGE_FIRST();
 
 	idx = &smp->strm->txn->hdr_idx;
-	msg = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) ? &smp->strm->txn->req : &smp->strm->txn->rsp;
+	msg = ((smp->opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) ? &smp->strm->txn->req : &smp->strm->txn->rsp;
 
 	ctx.idx = 0;
 	cnt = 0;
@@ -10735,10 +10720,9 @@
  * may or may not be appropriate for everything.
  */
 static int
-smp_fetch_hdr_val(unsigned int opt, const struct arg *args, struct sample *smp,
-                  const char *kw, void *private)
+smp_fetch_hdr_val(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	int ret = smp_fetch_hdr(opt, args, smp, kw, private);
+	int ret = smp_fetch_hdr(args, smp, kw, private);
 
 	if (ret > 0) {
 		smp->type = SMP_T_UINT;
@@ -10753,12 +10737,11 @@
  * It returns an IPv4 or IPv6 address.
  */
 static int
-smp_fetch_hdr_ip(unsigned int opt, const struct arg *args, struct sample *smp,
-                 const char *kw, void *private)
+smp_fetch_hdr_ip(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int ret;
 
-	while ((ret = smp_fetch_hdr(opt, args, smp, kw, private)) > 0) {
+	while ((ret = smp_fetch_hdr(args, smp, kw, private)) > 0) {
 		if (url2ipv4((char *)smp->data.str.str, &smp->data.ipv4)) {
 			smp->type = SMP_T_IPV4;
 			break;
@@ -10785,8 +10768,7 @@
  * the first '/' after the possible hostname, and ends before the possible '?'.
  */
 static int
-smp_fetch_path(unsigned int opt, const struct arg *args, struct sample *smp,
-               const char *kw, void *private)
+smp_fetch_path(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct http_txn *txn;
 	char *ptr, *end;
@@ -10819,8 +10801,7 @@
  * The returned sample is of type string.
  */
 static int
-smp_fetch_base(unsigned int opt, const struct arg *args, struct sample *smp,
-               const char *kw, void *private)
+smp_fetch_base(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct http_txn *txn;
 	char *ptr, *end, *beg;
@@ -10832,7 +10813,7 @@
 	txn = smp->strm->txn;
 	ctx.idx = 0;
 	if (!http_find_header2("Host", 4, txn->req.chn->buf->p, &txn->hdr_idx, &ctx) || !ctx.vlen)
-		return smp_fetch_path(opt, args, smp, kw, private);
+		return smp_fetch_path(args, smp, kw, private);
 
 	/* OK we have the header value in ctx.line+ctx.val for ctx.vlen bytes */
 	temp = get_trash_chunk();
@@ -10867,8 +10848,7 @@
  * high-traffic sites without having to store whole paths.
  */
 int
-smp_fetch_base32(unsigned int opt, const struct arg *args, struct sample *smp,
-                 const char *kw, void *private)
+smp_fetch_base32(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct http_txn *txn;
 	struct hdr_ctx ctx;
@@ -10916,8 +10896,7 @@
  * 8 bytes would still work.
  */
 static int
-smp_fetch_base32_src(unsigned int opt, const struct arg *args, struct sample *smp,
-                     const char *kw, void *private)
+smp_fetch_base32_src(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct chunk *temp;
 	struct connection *cli_conn = objt_conn(smp->sess->origin);
@@ -10925,7 +10904,7 @@
 	if (!cli_conn)
 		return 0;
 
-	if (!smp_fetch_base32(opt, args, smp, kw, private))
+	if (!smp_fetch_base32(args, smp, kw, private))
 		return 0;
 
 	temp = get_trash_chunk();
@@ -10955,8 +10934,7 @@
  * of type string carrying the whole query string.
  */
 static int
-smp_fetch_query(unsigned int opt, const struct arg *args, struct sample *smp,
-                const char *kw, void *private)
+smp_fetch_query(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct http_txn *txn;
 	char *ptr, *end;
@@ -10981,8 +10959,7 @@
 }
 
 static int
-smp_fetch_proto_http(unsigned int opt, const struct arg *args, struct sample *smp,
-                     const char *kw, void *private)
+smp_fetch_proto_http(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	/* 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.
@@ -10997,8 +10974,7 @@
 
 /* return a valid test if the current request is the first one on the connection */
 static int
-smp_fetch_http_first_req(unsigned int opt, const struct arg *args, struct sample *smp,
-                         const char *kw, void *private)
+smp_fetch_http_first_req(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->type = SMP_T_BOOL;
 	smp->data.uint = !(smp->strm->txn->flags & TX_NOT_FIRST);
@@ -11007,8 +10983,7 @@
 
 /* Accepts exactly 1 argument of type userlist */
 static int
-smp_fetch_http_auth(unsigned int opt, const struct arg *args, struct sample *smp,
-                    const char *kw, void *private)
+smp_fetch_http_auth(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 
 	if (!args || args->type != ARGT_USR)
@@ -11027,8 +11002,7 @@
 
 /* Accepts exactly 1 argument of type userlist */
 static int
-smp_fetch_http_auth_grp(unsigned int opt, const struct arg *args, struct sample *smp,
-                        const char *kw, void *private)
+smp_fetch_http_auth_grp(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	if (!args || args->type != ARGT_USR)
 		return 0;
@@ -11156,8 +11130,7 @@
  * the "capture" option in the configuration file
  */
 static int
-smp_fetch_capture_header_req(unsigned int opt, const struct arg *args, struct sample *smp,
-                             const char *kw, void *private)
+smp_fetch_capture_header_req(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct proxy *fe = strm_fe(smp->strm);
 	int idx;
@@ -11182,8 +11155,7 @@
  * the "capture" option in the configuration file
  */
 static int
-smp_fetch_capture_header_res(unsigned int opt, const struct arg *args, struct sample *smp,
-                             const char *kw, void *private)
+smp_fetch_capture_header_res(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct proxy *fe = strm_fe(smp->strm);
 	int idx;
@@ -11206,8 +11178,7 @@
 
 /* Extracts the METHOD in the HTTP request, the txn->uri should be filled before the call */
 static int
-smp_fetch_capture_req_method(unsigned int opt, const struct arg *args, struct sample *smp,
-                             const char *kw, void *private)
+smp_fetch_capture_req_method(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct chunk *temp;
 	struct http_txn *txn = smp->strm->txn;
@@ -11234,8 +11205,7 @@
 
 /* Extracts the path in the HTTP request, the txn->uri should be filled before the call  */
 static int
-smp_fetch_capture_req_uri(unsigned int opt, const struct arg *args, struct sample *smp,
-                          const char *kw, void *private)
+smp_fetch_capture_req_uri(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct chunk *temp;
 	struct http_txn *txn = smp->strm->txn;
@@ -11273,8 +11243,7 @@
  * as a string (either "HTTP/1.0" or "HTTP/1.1").
  */
 static int
-smp_fetch_capture_req_ver(unsigned int opt, const struct arg *args, struct sample *smp,
-                          const char *kw, void *private)
+smp_fetch_capture_req_ver(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct http_txn *txn = smp->strm->txn;
 
@@ -11297,8 +11266,7 @@
  * as a string (either "HTTP/1.0" or "HTTP/1.1").
  */
 static int
-smp_fetch_capture_res_ver(unsigned int opt, const struct arg *args, struct sample *smp,
-                          const char *kw, void *private)
+smp_fetch_capture_res_ver(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct http_txn *txn = smp->strm->txn;
 
@@ -11328,8 +11296,7 @@
  * The returned sample is of type CSTR. Can be used to parse cookies in other
  * files.
  */
-int smp_fetch_cookie(unsigned int opt, const struct arg *args, struct sample *smp,
-                     const char *kw, void *private)
+int smp_fetch_cookie(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct http_txn *txn;
 	struct hdr_idx *idx;
@@ -11356,7 +11323,7 @@
 	txn = smp->strm->txn;
 	idx = &smp->strm->txn->hdr_idx;
 
-	if ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) {
+	if ((smp->opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) {
 		msg = &txn->req;
 		hdr_name = "Cookie";
 		hdr_name_len = 6;
@@ -11366,7 +11333,7 @@
 		hdr_name_len = 10;
 	}
 
-	if (!occ && !(opt & SMP_OPT_ITERATE))
+	if (!occ && !(smp->opt & SMP_OPT_ITERATE))
 		/* no explicit occurrence and single fetch => last cookie by default */
 		occ = -1;
 
@@ -11403,7 +11370,7 @@
 		smp->flags |= SMP_F_CONST;
 		smp->ctx.a[0] = extract_cookie_value(smp->ctx.a[0], smp->ctx.a[1],
 						 args->data.str.str, args->data.str.len,
-						 (opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ,
+						 (smp->opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ,
 						 &smp->data.str.str,
 						 &smp->data.str.len);
 		if (smp->ctx.a[0]) {
@@ -11430,8 +11397,7 @@
  * type UINT. Accepts exactly 1 argument of type string.
  */
 static int
-smp_fetch_cookie_cnt(unsigned int opt, const struct arg *args, struct sample *smp,
-                     const char *kw, void *private)
+smp_fetch_cookie_cnt(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct http_txn *txn;
 	struct hdr_idx *idx;
@@ -11451,7 +11417,7 @@
 	txn = smp->strm->txn;
 	idx = &smp->strm->txn->hdr_idx;
 
-	if ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) {
+	if ((smp->opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) {
 		msg = &txn->req;
 		hdr_name = "Cookie";
 		hdr_name_len = 6;
@@ -11483,7 +11449,7 @@
 		smp->flags |= SMP_F_CONST;
 		while ((val_beg = extract_cookie_value(val_beg, val_end,
 						       args->data.str.str, args->data.str.len,
-						       (opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ,
+						       (smp->opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ,
 						       &smp->data.str.str,
 						       &smp->data.str.len))) {
 			cnt++;
@@ -11500,10 +11466,9 @@
  * takes a mandatory argument of type string. It relies on smp_fetch_cookie().
  */
 static int
-smp_fetch_cookie_val(unsigned int opt, const struct arg *args, struct sample *smp,
-                     const char *kw, void *private)
+smp_fetch_cookie_val(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	int ret = smp_fetch_cookie(opt, args, smp, kw, private);
+	int ret = smp_fetch_cookie(args, smp, kw, private);
 
 	if (ret > 0) {
 		smp->type = SMP_T_UINT;
@@ -11605,8 +11570,7 @@
 }
 
 static int
-smp_fetch_url_param(unsigned int opt, const struct arg *args, struct sample *smp,
-                    const char *kw, void *private)
+smp_fetch_url_param(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	char delim = '?';
 	struct http_msg *msg;
@@ -11637,10 +11601,9 @@
  * above).
  */
 static int
-smp_fetch_url_param_val(unsigned int opt, const struct arg *args, struct sample *smp,
-                        const char *kw, void *private)
+smp_fetch_url_param_val(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	int ret = smp_fetch_url_param(opt, args, smp, kw, private);
+	int ret = smp_fetch_url_param(args, smp, kw, private);
 
 	if (ret > 0) {
 		smp->type = SMP_T_UINT;
@@ -11661,8 +11624,7 @@
  * as well as the path
  */
 static int
-smp_fetch_url32(unsigned int opt, const struct arg *args, struct sample *smp,
-                const char *kw, void *private)
+smp_fetch_url32(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct http_txn *txn;
 	struct hdr_ctx ctx;
@@ -11710,13 +11672,12 @@
  * 8 bytes would still work.
  */
 static int
-smp_fetch_url32_src(unsigned int opt, const struct arg *args, struct sample *smp,
-                    const char *kw, void *private)
+smp_fetch_url32_src(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct chunk *temp;
 	struct connection *cli_conn = objt_conn(smp->sess->origin);
 
-	if (!smp_fetch_url32(opt, args, smp, kw, private))
+	if (!smp_fetch_url32(args, smp, kw, private))
 		return 0;
 
 	temp = get_trash_chunk();
diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index 19f878e..3888378 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -1963,8 +1963,7 @@
 
 /* fetch the connection's source IPv4/IPv6 address */
 static int
-smp_fetch_src(unsigned int opt, const struct arg *args, struct sample *smp,
-              const char *kw, void *private)
+smp_fetch_src(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct connection *cli_conn = objt_conn(smp->sess->origin);
 
@@ -1990,8 +1989,7 @@
 
 /* set temp integer to the connection's source port */
 static int
-smp_fetch_sport(unsigned int opt, const struct arg *args, struct sample *smp,
-                const char *k, void *private)
+smp_fetch_sport(const struct arg *args, struct sample *smp, const char *k, void *private)
 {
 	struct connection *cli_conn = objt_conn(smp->sess->origin);
 
@@ -2008,8 +2006,7 @@
 
 /* fetch the connection's destination IPv4/IPv6 address */
 static int
-smp_fetch_dst(unsigned int opt, const struct arg *args, struct sample *smp,
-              const char *kw, void *private)
+smp_fetch_dst(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct connection *cli_conn = objt_conn(smp->sess->origin);
 
@@ -2037,8 +2034,7 @@
 
 /* set temp integer to the frontend connexion's destination port */
 static int
-smp_fetch_dport(unsigned int opt, const struct arg *args, struct sample *smp,
-                const char *kw, void *private)
+smp_fetch_dport(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct connection *cli_conn = objt_conn(smp->sess->origin);
 
diff --git a/src/sample.c b/src/sample.c
index 353d6bb..03540e1 100644
--- a/src/sample.c
+++ b/src/sample.c
@@ -1037,7 +1037,7 @@
 	p->sess = sess;
 	p->strm = strm;
 	p->opt  = opt;
-	if (!expr->fetch->process(opt, expr->arg_p, p, expr->fetch->kw, expr->fetch->private))
+	if (!expr->fetch->process(expr->arg_p, p, expr->fetch->kw, expr->fetch->private))
 		return NULL;
 
 	list_for_each_entry(conv_expr, &expr->conv_exprs, list) {
@@ -2131,8 +2131,7 @@
 
 /* force TRUE to be returned at the fetch level */
 static int
-smp_fetch_true(unsigned int opt, const struct arg *args, struct sample *smp,
-               const char *kw, void *private)
+smp_fetch_true(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->type = SMP_T_BOOL;
 	smp->data.uint = 1;
@@ -2141,8 +2140,7 @@
 
 /* force FALSE to be returned at the fetch level */
 static int
-smp_fetch_false(unsigned int opt, const struct arg *args, struct sample *smp,
-                const char *kw, void *private)
+smp_fetch_false(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->type = SMP_T_BOOL;
 	smp->data.uint = 0;
@@ -2151,8 +2149,7 @@
 
 /* retrieve environment variable $1 as a string */
 static int
-smp_fetch_env(unsigned int opt, const struct arg *args, struct sample *smp,
-              const char *kw, void *private)
+smp_fetch_env(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	char *env;
 
@@ -2174,8 +2171,7 @@
  * of args[0] seconds.
  */
 static int
-smp_fetch_date(unsigned int opt, const struct arg *args, struct sample *smp,
-               const char *kw, void *private)
+smp_fetch_date(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->data.uint = date.tv_sec;
 
@@ -2190,8 +2186,7 @@
 
 /* returns the number of processes */
 static int
-smp_fetch_nbproc(unsigned int opt, const struct arg *args, struct sample *smp,
-                 const char *kw, void *private)
+smp_fetch_nbproc(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->type = SMP_T_UINT;
 	smp->data.uint = global.nbproc;
@@ -2200,8 +2195,7 @@
 
 /* returns the number of the current process (between 1 and nbproc */
 static int
-smp_fetch_proc(unsigned int opt, const struct arg *args, struct sample *smp,
-               const char *kw, void *private)
+smp_fetch_proc(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->type = SMP_T_UINT;
 	smp->data.uint = relative_pid;
@@ -2212,8 +2206,7 @@
  * range specified in argument.
  */
 static int
-smp_fetch_rand(unsigned int opt, const struct arg *args, struct sample *smp,
-               const char *kw, void *private)
+smp_fetch_rand(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->data.uint = random();
 
@@ -2228,8 +2221,7 @@
 
 /* returns true if the current process is stopping */
 static int
-smp_fetch_stopping(unsigned int opt, const struct arg *args, struct sample *smp,
-                   const char *kw, void *private)
+smp_fetch_stopping(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->type = SMP_T_BOOL;
 	smp->data.uint = stopping;
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index d490955..d51d782 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -3084,8 +3084,7 @@
 
 /* boolean, returns true if client cert was present */
 static int
-smp_fetch_ssl_fc_has_crt(unsigned int opt, const struct arg *args, struct sample *smp,
-                         const char *kw, void *private)
+smp_fetch_ssl_fc_has_crt(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct connection *conn;
 
@@ -3110,8 +3109,7 @@
  * should be use.
  */
 static int
-smp_fetch_ssl_x_der(unsigned int opt, const struct arg *args, struct sample *smp,
-                    const char *kw, void *private)
+smp_fetch_ssl_x_der(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int cert_peer = (kw[4] == 'c') ? 1 : 0;
 	X509 *crt = NULL;
@@ -3155,8 +3153,7 @@
  * should be use.
  */
 static int
-smp_fetch_ssl_x_serial(unsigned int opt, const struct arg *args, struct sample *smp,
-                       const char *kw, void *private)
+smp_fetch_ssl_x_serial(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int cert_peer = (kw[4] == 'c') ? 1 : 0;
 	X509 *crt = NULL;
@@ -3200,8 +3197,7 @@
  * should be use.
  */
 static int
-smp_fetch_ssl_x_sha1(unsigned int opt, const struct arg *args, struct sample *smp,
-                     const char *kw, void *private)
+smp_fetch_ssl_x_sha1(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int cert_peer = (kw[4] == 'c') ? 1 : 0;
 	X509 *crt = NULL;
@@ -3245,8 +3241,7 @@
  * should be use.
  */
 static int
-smp_fetch_ssl_x_notafter(unsigned int opt, const struct arg *args, struct sample *smp,
-                         const char *kw, void *private)
+smp_fetch_ssl_x_notafter(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int cert_peer = (kw[4] == 'c') ? 1 : 0;
 	X509 *crt = NULL;
@@ -3289,8 +3284,7 @@
  * should be use.
  */
 static int
-smp_fetch_ssl_x_i_dn(unsigned int opt, const struct arg *args, struct sample *smp,
-                     const char *kw, void *private)
+smp_fetch_ssl_x_i_dn(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int cert_peer = (kw[4] == 'c') ? 1 : 0;
 	X509 *crt = NULL;
@@ -3349,8 +3343,7 @@
  * should be use.
  */
 static int
-smp_fetch_ssl_x_notbefore(unsigned int opt, const struct arg *args, struct sample *smp,
-                          const char *kw, void *private)
+smp_fetch_ssl_x_notbefore(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int cert_peer = (kw[4] == 'c') ? 1 : 0;
 	X509 *crt = NULL;
@@ -3393,8 +3386,7 @@
  * should be use.
  */
 static int
-smp_fetch_ssl_x_s_dn(unsigned int opt, const struct arg *args, struct sample *smp,
-                     const char *kw, void *private)
+smp_fetch_ssl_x_s_dn(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int cert_peer = (kw[4] == 'c') ? 1 : 0;
 	X509 *crt = NULL;
@@ -3450,8 +3442,7 @@
 
 /* integer, returns true if current session use a client certificate */
 static int
-smp_fetch_ssl_c_used(unsigned int opt, const struct arg *args, struct sample *smp,
-                     const char *kw, void *private)
+smp_fetch_ssl_c_used(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	X509 *crt;
 	struct connection *conn;
@@ -3481,8 +3472,7 @@
  * should be use.
  */
 static int
-smp_fetch_ssl_x_version(unsigned int opt, const struct arg *args, struct sample *smp,
-                        const char *kw, void *private)
+smp_fetch_ssl_x_version(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int cert_peer = (kw[4] == 'c') ? 1 : 0;
 	X509 *crt;
@@ -3518,8 +3508,7 @@
  * should be use.
  */
 static int
-smp_fetch_ssl_x_sig_alg(unsigned int opt, const struct arg *args, struct sample *smp,
-                        const char *kw, void *private)
+smp_fetch_ssl_x_sig_alg(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int cert_peer = (kw[4] == 'c') ? 1 : 0;
 	X509 *crt;
@@ -3567,8 +3556,7 @@
  * should be use.
  */
 static int
-smp_fetch_ssl_x_key_alg(unsigned int opt, const struct arg *args, struct sample *smp,
-                        const char *kw, void *private)
+smp_fetch_ssl_x_key_alg(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int cert_peer = (kw[4] == 'c') ? 1 : 0;
 	X509 *crt;
@@ -3615,8 +3603,7 @@
  * char is 'b'.
  */
 static int
-smp_fetch_ssl_fc(unsigned int opt, const struct arg *args, struct sample *smp,
-                 const char *kw, void *private)
+smp_fetch_ssl_fc(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int back_conn = (kw[4] == 'b') ? 1 : 0;
 	struct connection *conn = objt_conn(smp->strm->si[back_conn].end);
@@ -3628,8 +3615,7 @@
 
 /* boolean, returns true if client present a SNI */
 static int
-smp_fetch_ssl_fc_has_sni(unsigned int opt, const struct arg *args, struct sample *smp,
-                         const char *kw, void *private)
+smp_fetch_ssl_fc_has_sni(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
 	struct connection *conn = objt_conn(smp->sess->origin);
@@ -3649,8 +3635,7 @@
  * char is 'b'.
  */
 static int
-smp_fetch_ssl_fc_cipher(unsigned int opt, const struct arg *args, struct sample *smp,
-                        const char *kw, void *private)
+smp_fetch_ssl_fc_cipher(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int back_conn = (kw[4] == 'b') ? 1 : 0;
 	struct connection *conn;
@@ -3678,8 +3663,7 @@
  * char is 'b'.
  */
 static int
-smp_fetch_ssl_fc_alg_keysize(unsigned int opt, const struct arg *args, struct sample *smp,
-                             const char *kw, void *private)
+smp_fetch_ssl_fc_alg_keysize(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int back_conn = (kw[4] == 'b') ? 1 : 0;
 	struct connection *conn;
@@ -3703,8 +3687,7 @@
  * char is 'b'.
  */
 static int
-smp_fetch_ssl_fc_use_keysize(unsigned int opt, const struct arg *args, struct sample *smp,
-                             const char *kw, void *private)
+smp_fetch_ssl_fc_use_keysize(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int back_conn = (kw[4] == 'b') ? 1 : 0;
 	struct connection *conn;
@@ -3726,8 +3709,7 @@
 
 #ifdef OPENSSL_NPN_NEGOTIATED
 static int
-smp_fetch_ssl_fc_npn(unsigned int opt, const struct arg *args, struct sample *smp,
-                     const char *kw, void *private)
+smp_fetch_ssl_fc_npn(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct connection *conn;
 
@@ -3751,8 +3733,7 @@
 
 #ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
 static int
-smp_fetch_ssl_fc_alpn(unsigned int opt, const struct arg *args, struct sample *smp,
-                      const char *kw, void *private)
+smp_fetch_ssl_fc_alpn(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct connection *conn;
 
@@ -3779,8 +3760,7 @@
  * char is 'b'.
  */
 static int
-smp_fetch_ssl_fc_protocol(unsigned int opt, const struct arg *args, struct sample *smp,
-                          const char *kw, void *private)
+smp_fetch_ssl_fc_protocol(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int back_conn = (kw[4] == 'b') ? 1 : 0;
 	struct connection *conn;
@@ -3807,8 +3787,7 @@
  * char is 'b'.
  */
 static int
-smp_fetch_ssl_fc_session_id(unsigned int opt, const struct arg *args, struct sample *smp,
-                            const char *kw, void *private)
+smp_fetch_ssl_fc_session_id(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 #if OPENSSL_VERSION_NUMBER > 0x0090800fL
 	int back_conn = (kw[4] == 'b') ? 1 : 0;
@@ -3837,8 +3816,7 @@
 }
 
 static int
-smp_fetch_ssl_fc_sni(unsigned int opt, const struct arg *args, struct sample *smp,
-                     const char *kw, void *private)
+smp_fetch_ssl_fc_sni(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
 	struct connection *conn;
@@ -3862,8 +3840,7 @@
 }
 
 static int
-smp_fetch_ssl_fc_unique_id(unsigned int opt, const struct arg *args, struct sample *smp,
-                           const char *kw, void *private)
+smp_fetch_ssl_fc_unique_id(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 #if OPENSSL_VERSION_NUMBER > 0x0090800fL
 	int back_conn = (kw[4] == 'b') ? 1 : 0;
@@ -3903,8 +3880,7 @@
 
 /* integer, returns the first verify error in CA chain of client certificate chain. */
 static int
-smp_fetch_ssl_c_ca_err(unsigned int opt, const struct arg *args, struct sample *smp,
-                       const char *kw, void *private)
+smp_fetch_ssl_c_ca_err(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct connection *conn;
 
@@ -3926,8 +3902,7 @@
 
 /* integer, returns the depth of the first verify error in CA chain of client certificate chain. */
 static int
-smp_fetch_ssl_c_ca_err_depth(unsigned int opt, const struct arg *args, struct sample *smp,
-                             const char *kw, void *private)
+smp_fetch_ssl_c_ca_err_depth(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct connection *conn;
 
@@ -3949,8 +3924,7 @@
 
 /* integer, returns the first verify error on client certificate */
 static int
-smp_fetch_ssl_c_err(unsigned int opt, const struct arg *args, struct sample *smp,
-                    const char *kw, void *private)
+smp_fetch_ssl_c_err(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct connection *conn;
 
@@ -3972,8 +3946,7 @@
 
 /* integer, returns the verify result on client cert */
 static int
-smp_fetch_ssl_c_verify(unsigned int opt, const struct arg *args, struct sample *smp,
-                       const char *kw, void *private)
+smp_fetch_ssl_c_verify(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct connection *conn;
 
diff --git a/src/stream.c b/src/stream.c
index 133a93f..23f7f51 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -2585,8 +2585,7 @@
  * Supports being called as "sc[0-9]_tracked" only.
  */
 static int
-smp_fetch_sc_tracked(unsigned int opt, const struct arg *args, struct sample *smp,
-                     const char *kw, void *private)
+smp_fetch_sc_tracked(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->flags = SMP_F_VOL_TEST;
 	smp->type = SMP_T_BOOL;
@@ -2600,8 +2599,7 @@
  * zero is returned if the key is new.
  */
 static int
-smp_fetch_sc_get_gpc0(unsigned int opt, const struct arg *args, struct sample *smp,
-                      const char *kw, void *private)
+smp_fetch_sc_get_gpc0(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct stkctr *stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
 
@@ -2627,8 +2625,7 @@
  * Value zero is returned if the key is new.
  */
 static int
-smp_fetch_sc_gpc0_rate(unsigned int opt, const struct arg *args, struct sample *smp,
-                       const char *kw, void *private)
+smp_fetch_sc_gpc0_rate(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct stkctr *stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
 
@@ -2653,8 +2650,7 @@
  * Supports being called as "sc[0-9]_inc_gpc0" or "src_inc_gpc0" only.
  */
 static int
-smp_fetch_sc_inc_gpc0(unsigned int opt, const struct arg *args, struct sample *smp,
-                      const char *kw, void *private)
+smp_fetch_sc_inc_gpc0(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct stkctr *stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
 
@@ -2690,8 +2686,7 @@
  * Supports being called as "sc[0-9]_clr_gpc0" or "src_clr_gpc0" only.
  */
 static int
-smp_fetch_sc_clr_gpc0(unsigned int opt, const struct arg *args, struct sample *smp,
-                      const char *kw, void *private)
+smp_fetch_sc_clr_gpc0(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct stkctr *stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
 
@@ -2716,8 +2711,7 @@
  * "src_conn_cnt" only.
  */
 static int
-smp_fetch_sc_conn_cnt(unsigned int opt, const struct arg *args, struct sample *smp,
-                      const char *kw, void *private)
+smp_fetch_sc_conn_cnt(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct stkctr *stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
 
@@ -2741,8 +2735,7 @@
  * only.
  */
 static int
-smp_fetch_sc_conn_rate(unsigned int opt, const struct arg *args, struct sample *smp,
-                       const char *kw, void *private)
+smp_fetch_sc_conn_rate(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct stkctr *stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
 
@@ -2767,8 +2760,7 @@
  * Accepts exactly 1 argument of type table.
  */
 static int
-smp_fetch_src_updt_conn_cnt(unsigned int opt, const struct arg *args, struct sample *smp,
-                            const char *kw, void *private)
+smp_fetch_src_updt_conn_cnt(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct connection *conn = objt_conn(smp->sess->origin);
 	struct stksess *ts;
@@ -2804,8 +2796,7 @@
  * "src_conn_cur" only.
  */
 static int
-smp_fetch_sc_conn_cur(unsigned int opt, const struct arg *args, struct sample *smp,
-                      const char *kw, void *private)
+smp_fetch_sc_conn_cur(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct stkctr *stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
 
@@ -2829,8 +2820,7 @@
  * "src_sess_cnt" only.
  */
 static int
-smp_fetch_sc_sess_cnt(unsigned int opt, const struct arg *args, struct sample *smp,
-                      const char *kw, void *private)
+smp_fetch_sc_sess_cnt(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct stkctr *stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
 
@@ -2853,8 +2843,7 @@
  * Supports being called as "sc[0-9]_sess_rate" or "src_sess_rate" only.
  */
 static int
-smp_fetch_sc_sess_rate(unsigned int opt, const struct arg *args, struct sample *smp,
-                       const char *kw, void *private)
+smp_fetch_sc_sess_rate(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct stkctr *stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
 
@@ -2879,8 +2868,7 @@
  * "src_http_req_cnt" only.
  */
 static int
-smp_fetch_sc_http_req_cnt(unsigned int opt, const struct arg *args, struct sample *smp,
-                          const char *kw, void *private)
+smp_fetch_sc_http_req_cnt(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct stkctr *stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
 
@@ -2904,8 +2892,7 @@
  * "src_http_req_rate" only.
  */
 static int
-smp_fetch_sc_http_req_rate(unsigned int opt, const struct arg *args, struct sample *smp,
-                           const char *kw, void *private)
+smp_fetch_sc_http_req_rate(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct stkctr *stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
 
@@ -2930,8 +2917,7 @@
  * "src_http_err_cnt" only.
  */
 static int
-smp_fetch_sc_http_err_cnt(unsigned int opt, const struct arg *args, struct sample *smp,
-                          const char *kw, void *private)
+smp_fetch_sc_http_err_cnt(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct stkctr *stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
 
@@ -2955,8 +2941,7 @@
  * "src_http_err_rate" only.
  */
 static int
-smp_fetch_sc_http_err_rate(unsigned int opt, const struct arg *args, struct sample *smp,
-                           const char *kw, void *private)
+smp_fetch_sc_http_err_rate(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct stkctr *stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
 
@@ -2981,8 +2966,7 @@
  * "sc[0-9]_kbytes_in" or "src_kbytes_in" only.
  */
 static int
-smp_fetch_sc_kbytes_in(unsigned int opt, const struct arg *args, struct sample *smp,
-                       const char *kw, void *private)
+smp_fetch_sc_kbytes_in(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct stkctr *stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
 
@@ -3006,8 +2990,7 @@
  * "sc[0-9]_bytes_in_rate" or "src_bytes_in_rate" only.
  */
 static int
-smp_fetch_sc_bytes_in_rate(unsigned int opt, const struct arg *args, struct sample *smp,
-                           const char *kw, void *private)
+smp_fetch_sc_bytes_in_rate(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct stkctr *stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
 
@@ -3032,8 +3015,7 @@
  * "sc[0-9]_kbytes_out" or "src_kbytes_out" only.
  */
 static int
-smp_fetch_sc_kbytes_out(unsigned int opt, const struct arg *args, struct sample *smp,
-                        const char *kw, void *private)
+smp_fetch_sc_kbytes_out(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct stkctr *stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
 
@@ -3057,8 +3039,7 @@
  * "sc[0-9]_bytes_out_rate" or "src_bytes_out_rate" only.
  */
 static int
-smp_fetch_sc_bytes_out_rate(unsigned int opt, const struct arg *args, struct sample *smp,
-                            const char *kw, void *private)
+smp_fetch_sc_bytes_out_rate(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct stkctr *stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
 
@@ -3082,8 +3063,7 @@
  * tracked frontend counters. Supports being called as "sc[0-9]_trackers" only.
  */
 static int
-smp_fetch_sc_trackers(unsigned int opt, const struct arg *args, struct sample *smp,
-                      const char *kw, void *private)
+smp_fetch_sc_trackers(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct stkctr *stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
 
@@ -3100,8 +3080,7 @@
  * Accepts exactly 1 argument of type table.
  */
 static int
-smp_fetch_table_cnt(unsigned int opt, const struct arg *args, struct sample *smp,
-                    const char *kw, void *private)
+smp_fetch_table_cnt(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->flags = SMP_F_VOL_TEST;
 	smp->type = SMP_T_UINT;
@@ -3113,8 +3092,7 @@
  * Accepts exactly 1 argument of type table.
  */
 static int
-smp_fetch_table_avl(unsigned int opt, const struct arg *args, struct sample *smp,
-                    const char *kw, void *private)
+smp_fetch_table_avl(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct proxy *px;