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);
/* 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. */
* 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;
* 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;
* 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;
/* 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;
/* 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;
* 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;
* 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;
* 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;
* 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;
* 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;
* 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;
/* 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);
/* 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;
/* 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;
* 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;
* 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;
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
* 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;
/* 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;
/* 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;
* 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;
}
/* 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;
/* 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;
* 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;
* - 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;
* 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;
/* 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;
/* 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;
/* 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;
* 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
* 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;
}
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;
}
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;
/* 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;
* 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;
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;
* 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;
* 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;
/* 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;
}
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;
}
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;
* 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];
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;
* 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;
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;
}
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;
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();
* 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];
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;
* 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;
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;
* 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;
* 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;
* 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;
* 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;
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();
* 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;
* 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);
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();
* 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;
}
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.
/* 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);
/* 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)
/* 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;
* 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;
* 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;
/* 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;
/* 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;
* 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;
* 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;
* 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;
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;
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;
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]) {
* 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;
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;
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++;
* 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;
}
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;
* 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;
* 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;
* 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();
/* 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);
/* 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);
/* 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);
/* 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);
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) {
/* 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;
/* 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;
/* 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;
* 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;
/* 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;
/* 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;
* 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();
/* 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;
/* 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;
* 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;
* 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;
* 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;
* 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;
* 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;
* 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;
* 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;
/* 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;
* 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;
* 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;
* 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;
* 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);
/* 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);
* 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;
* 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;
* 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;
#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;
#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;
* 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;
* 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;
}
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;
}
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;
/* 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;
/* 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;
/* 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;
/* 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;
* 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;
* 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);
* 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);
* 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);
* 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);
* "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);
* 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);
* 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;
* "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);
* "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);
* 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);
* "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);
* "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);
* "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);
* "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);
* "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);
* "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);
* "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);
* "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);
* 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);
* 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;
* 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;