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(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw);
+ const struct arg *args, struct sample *smp, const char *kw, void *private);
int
smp_fetch_base32(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw);
+ 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);
unsigned int opt, /* fetch options (SMP_OPT_*) */
const struct arg *arg_p,
struct sample *smp,
- const char *kw); /* fetch processing function */
+ const char *kw, /* fetch processing function */
+ void *private); /* private value. */
unsigned int arg_mask; /* arguments (ARG*()) */
int (*val_args)(struct arg *arg_p,
char **err_msg); /* argument validation function */
unsigned long out_type; /* output sample type */
unsigned int use; /* fetch source (SMP_USE_*) */
unsigned int val; /* fetch validity (SMP_VAL_*) */
+ void *private; /* private values. only used by Lua */
};
/* sample expression */
*/
static int
smp_fetch_nbsrv(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->flags = SMP_F_VOL_TEST;
smp->type = SMP_T_UINT;
*/
static int
smp_fetch_srv_is_up(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct server *srv = args->data.srv;
*/
static int
smp_fetch_connslots(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ 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(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ 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(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
if (!objt_server(l4->target))
return 0;
*/
static int
smp_fetch_be_sess_rate(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->flags = SMP_F_VOL_TEST;
smp->type = SMP_T_UINT;
*/
static int
smp_fetch_be_conn(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->flags = SMP_F_VOL_TEST;
smp->type = SMP_T_UINT;
*/
static int
smp_fetch_queue_size(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->flags = SMP_F_VOL_TEST;
smp->type = SMP_T_UINT;
*/
static int
smp_fetch_avg_queue_size(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int nbsrv;
*/
static int
smp_fetch_srv_conn(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->flags = SMP_F_VOL_TEST;
smp->type = SMP_T_UINT;
*/
static int
smp_fetch_srv_sess_rate(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ 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(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->type = SMP_T_BOOL;
smp->data.uint = (l4->comp_algo != NULL);
/* string, returns algo */
static int
smp_fetch_res_comp_algo(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
if (!l4->comp_algo)
return 0;
/* set temp integer to the id of the frontend */
static int
smp_fetch_fe_id(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->flags = SMP_F_VOL_SESS;
smp->type = SMP_T_UINT;
*/
static int
smp_fetch_fe_sess_rate(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->flags = SMP_F_VOL_TEST;
smp->type = SMP_T_UINT;
*/
static int
smp_fetch_fe_conn(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->flags = SMP_F_VOL_TEST;
smp->type = SMP_T_UINT;
/* set temp integer to the number of connexions to the same listening socket */
static int
smp_fetch_dconn(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->type = SMP_T_UINT;
smp->data.uint = l4->listener->nbconn;
/* set temp integer to the id of the socket (listener) */
static int
smp_fetch_so_id(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->type = SMP_T_UINT;
smp->data.uint = l4->listener->luid;
*/
static int
smp_fetch_wait_end(struct proxy *px, struct session *s, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
if (!(opt & SMP_OPT_FINAL)) {
smp->flags |= SMP_F_MAY_CHANGE;
/* return the number of bytes in the request buffer */
static int
smp_fetch_len(struct proxy *px, struct session *s, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct channel *chn = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? s->rep : s->req;
/* returns the type of SSL hello message (mainly used to detect an SSL hello) */
static int
smp_fetch_ssl_hello_type(struct proxy *px, struct session *s, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int hs_len;
int hs_type, bleft;
*/
static int
smp_fetch_req_ssl_ver(struct proxy *px, struct session *s, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int version, bleft, msg_len;
const unsigned char *data;
*/
static int
smp_fetch_ssl_hello_sni(struct proxy *px, struct session *s, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int hs_len, ext_len, bleft;
struct channel *chn;
*/
int
smp_fetch_rdp_cookie(struct proxy *px, struct session *s, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
return fetch_rdp_cookie_name(s, 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(struct proxy *px, struct session *s, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int ret;
- ret = smp_fetch_rdp_cookie(px, s, l7, opt, args, smp, kw);
+ ret = smp_fetch_rdp_cookie(px, s, l7, opt, 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(struct proxy *px, struct session *s, void *l7, unsigned int opt,
- const struct arg *arg_p, struct sample *smp, const char *kw)
+ 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;
/* extracts some payload at a fixed position and length */
static int
smp_fetch_payload(struct proxy *px, struct session *s, void *l7, unsigned int opt,
- const struct arg *arg_p, struct sample *smp, const char *kw)
+ 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;
*/
static int
smp_fetch_meth(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int meth;
struct http_txn *txn = l7;
static int
smp_fetch_rqver(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn = l7;
char *ptr;
static int
smp_fetch_stver(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn = l7;
char *ptr;
/* 3. Check on Status Code. We manipulate integers here. */
static int
smp_fetch_stcode(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn = l7;
char *ptr;
/* 4. Check on URL/URI. A pointer to the URI is stored. */
static int
smp_fetch_url(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn = l7;
static int
smp_fetch_url_ip(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn = l7;
struct sockaddr_storage addr;
static int
smp_fetch_url_port(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn = l7;
struct sockaddr_storage addr;
*/
static int
smp_fetch_fhdr(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn = l7;
struct hdr_idx *idx = &txn->hdr_idx;
*/
static int
smp_fetch_fhdr_cnt(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn = l7;
struct hdr_idx *idx = &txn->hdr_idx;
static int
smp_fetch_hdr_names(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn = l7;
struct hdr_idx *idx = &txn->hdr_idx;
*/
static int
smp_fetch_hdr(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn = l7;
struct hdr_idx *idx = &txn->hdr_idx;
*/
static int
smp_fetch_hdr_cnt(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn = l7;
struct hdr_idx *idx = &txn->hdr_idx;
*/
static int
smp_fetch_hdr_val(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- int ret = smp_fetch_hdr(px, l4, l7, opt, args, smp, kw);
+ int ret = smp_fetch_hdr(px, l4, l7, opt, args, smp, kw, private);
if (ret > 0) {
smp->type = SMP_T_UINT;
*/
static int
smp_fetch_hdr_ip(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int ret;
- while ((ret = smp_fetch_hdr(px, l4, l7, opt, args, smp, kw)) > 0) {
+ while ((ret = smp_fetch_hdr(px, l4, l7, opt, args, smp, kw, private)) > 0) {
if (url2ipv4((char *)smp->data.str.str, &smp->data.ipv4)) {
smp->type = SMP_T_IPV4;
break;
*/
static int
smp_fetch_path(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn = l7;
char *ptr, *end;
*/
static int
smp_fetch_base(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn = l7;
char *ptr, *end, *beg;
ctx.idx = 0;
if (!http_find_header2("Host", 4, txn->req.chn->buf->p, &txn->hdr_idx, &ctx) || !ctx.vlen)
- return smp_fetch_path(px, l4, l7, opt, args, smp, kw);
+ return smp_fetch_path(px, l4, l7, opt, args, smp, kw, private);
/* OK we have the header value in ctx.line+ctx.val for ctx.vlen bytes */
temp = get_trash_chunk();
*/
int
smp_fetch_base32(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn = l7;
struct hdr_ctx ctx;
*/
static int
smp_fetch_base32_src(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct chunk *temp;
struct connection *cli_conn = objt_conn(l4->si[0].end);
if (!cli_conn)
return 0;
- if (!smp_fetch_base32(px, l4, l7, opt, args, smp, kw))
+ if (!smp_fetch_base32(px, l4, l7, opt, args, smp, kw, private))
return 0;
temp = get_trash_chunk();
*/
static int
smp_fetch_query(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn = l7;
char *ptr, *end;
static int
smp_fetch_proto_http(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ 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(struct proxy *px, struct session *s, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
if (!s)
return 0;
/* Accepts exactly 1 argument of type userlist */
static int
smp_fetch_http_auth(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ 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(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
if (!args || args->type != ARGT_USR)
*/
static int
smp_fetch_capture_header_req(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct proxy *fe = l4->fe;
struct http_txn *txn = l7;
*/
static int
smp_fetch_capture_header_res(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct proxy *fe = l4->fe;
struct http_txn *txn = l7;
/* Extracts the METHOD in the HTTP request, the txn->uri should be filled before the call */
static int
smp_fetch_capture_req_method(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct chunk *temp;
struct http_txn *txn = l7;
/* Extracts the path in the HTTP request, the txn->uri should be filled before the call */
static int
smp_fetch_capture_req_uri(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct chunk *temp;
struct http_txn *txn = l7;
*/
static int
smp_fetch_capture_req_ver(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn = l7;
*/
static int
smp_fetch_capture_res_ver(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn = l7;
* files.
*/
int smp_fetch_cookie(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn = l7;
struct hdr_idx *idx = &txn->hdr_idx;
*/
static int
smp_fetch_cookie_cnt(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn = l7;
struct hdr_idx *idx = &txn->hdr_idx;
*/
static int
smp_fetch_cookie_val(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- int ret = smp_fetch_cookie(px, l4, l7, opt, args, smp, kw);
+ int ret = smp_fetch_cookie(px, l4, l7, opt, args, smp, kw, private);
if (ret > 0) {
smp->type = SMP_T_UINT;
static int
smp_fetch_url_param(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
char delim = '?';
struct http_txn *txn = l7;
*/
static int
smp_fetch_url_param_val(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- int ret = smp_fetch_url_param(px, l4, l7, opt, args, smp, kw);
+ int ret = smp_fetch_url_param(px, l4, l7, opt, args, smp, kw, private);
if (ret > 0) {
smp->type = SMP_T_UINT;
*/
static int
smp_fetch_url32(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn = l7;
struct hdr_ctx ctx;
*/
static int
smp_fetch_url32_src(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct chunk *temp;
struct connection *cli_conn = objt_conn(l4->si[0].end);
- if (!smp_fetch_url32(px, l4, l7, opt, args, smp, kw))
+ if (!smp_fetch_url32(px, l4, l7, opt, args, smp, kw, private))
return 0;
temp = get_trash_chunk();
/* fetch the connection's source IPv4/IPv6 address */
static int
smp_fetch_src(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct connection *cli_conn = objt_conn(l4->si[0].end);
/* set temp integer to the connection's source port */
static int
smp_fetch_sport(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *k, void *private)
{
struct connection *cli_conn = objt_conn(l4->si[0].end);
/* fetch the connection's destination IPv4/IPv6 address */
static int
smp_fetch_dst(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct connection *cli_conn = objt_conn(l4->si[0].end);
/* set temp integer to the frontend connexion's destination port */
static int
smp_fetch_dport(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct connection *cli_conn = objt_conn(l4->si[0].end);
memset(p, 0, sizeof(*p));
}
- if (!expr->fetch->process(px, l4, l7, opt, expr->arg_p, p, expr->fetch->kw))
+ if (!expr->fetch->process(px, l4, l7, opt, 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(struct proxy *px, struct session *s, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ 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(struct proxy *px, struct session *s, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ 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(struct proxy *px, struct session *s, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
char *env;
*/
static int
smp_fetch_date(struct proxy *px, struct session *s, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ 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(struct proxy *px, struct session *s, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ 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(struct proxy *px, struct session *s, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->type = SMP_T_UINT;
smp->data.uint = relative_pid;
*/
static int
smp_fetch_rand(struct proxy *px, struct session *s, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ 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(struct proxy *px, struct session *s, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->type = SMP_T_BOOL;
smp->data.uint = stopping;
*/
static int
smp_fetch_sc_tracked(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->flags = SMP_F_VOL_TEST;
smp->type = SMP_T_BOOL;
*/
static int
smp_fetch_sc_get_gpc0(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
*/
static int
smp_fetch_sc_gpc0_rate(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
*/
static int
smp_fetch_sc_inc_gpc0(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
*/
static int
smp_fetch_sc_clr_gpc0(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
*/
static int
smp_fetch_sc_conn_cnt(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
*/
static int
smp_fetch_sc_conn_rate(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
*/
static int
smp_fetch_src_updt_conn_cnt(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct connection *conn = objt_conn(l4->si[0].end);
struct stksess *ts;
*/
static int
smp_fetch_sc_conn_cur(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
*/
static int
smp_fetch_sc_sess_cnt(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
*/
static int
smp_fetch_sc_sess_rate(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
*/
static int
smp_fetch_sc_http_req_cnt(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
*/
static int
smp_fetch_sc_http_req_rate(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
*/
static int
smp_fetch_sc_http_err_cnt(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
*/
static int
smp_fetch_sc_http_err_rate(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
*/
static int
smp_fetch_sc_kbytes_in(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
*/
static int
smp_fetch_sc_bytes_in_rate(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
*/
static int
smp_fetch_sc_kbytes_out(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
*/
static int
smp_fetch_sc_bytes_out_rate(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
*/
static int
smp_fetch_sc_trackers(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
*/
static int
smp_fetch_table_cnt(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->flags = SMP_F_VOL_TEST;
smp->type = SMP_T_UINT;
*/
static int
smp_fetch_table_avl(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
px = args->data.prx;
smp->flags = SMP_F_VOL_TEST;
/* boolean, returns true if client cert was present */
static int
smp_fetch_ssl_fc_has_crt(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct connection *conn;
*/
static int
smp_fetch_ssl_x_der(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int cert_peer = (kw[4] == 'c') ? 1 : 0;
X509 *crt = NULL;
*/
static int
smp_fetch_ssl_x_serial(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int cert_peer = (kw[4] == 'c') ? 1 : 0;
X509 *crt = NULL;
*/
static int
smp_fetch_ssl_x_sha1(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int cert_peer = (kw[4] == 'c') ? 1 : 0;
X509 *crt = NULL;
*/
static int
smp_fetch_ssl_x_notafter(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int cert_peer = (kw[4] == 'c') ? 1 : 0;
X509 *crt = NULL;
*/
static int
smp_fetch_ssl_x_i_dn(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int cert_peer = (kw[4] == 'c') ? 1 : 0;
X509 *crt = NULL;
*/
static int
smp_fetch_ssl_x_notbefore(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int cert_peer = (kw[4] == 'c') ? 1 : 0;
X509 *crt = NULL;
*/
static int
smp_fetch_ssl_x_s_dn(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ 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(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
X509 *crt;
struct connection *conn;
*/
static int
smp_fetch_ssl_x_version(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int cert_peer = (kw[4] == 'c') ? 1 : 0;
X509 *crt;
*/
static int
smp_fetch_ssl_x_sig_alg(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int cert_peer = (kw[4] == 'c') ? 1 : 0;
X509 *crt;
*/
static int
smp_fetch_ssl_x_key_alg(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int cert_peer = (kw[4] == 'c') ? 1 : 0;
X509 *crt;
*/
static int
smp_fetch_ssl_fc(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ 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(l4->si[back_conn].end);
/* boolean, returns true if client present a SNI */
static int
smp_fetch_ssl_fc_has_sni(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
struct connection *conn = objt_conn(l4->si[0].end);
*/
static int
smp_fetch_ssl_fc_cipher(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int back_conn = (kw[4] == 'b') ? 1 : 0;
struct connection *conn;
*/
static int
smp_fetch_ssl_fc_alg_keysize(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int back_conn = (kw[4] == 'b') ? 1 : 0;
struct connection *conn;
*/
static int
smp_fetch_ssl_fc_use_keysize(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ 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(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ 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(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct connection *conn;
*/
static int
smp_fetch_ssl_fc_protocol(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int back_conn = (kw[4] == 'b') ? 1 : 0;
struct connection *conn;
*/
static int
smp_fetch_ssl_fc_session_id(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ 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(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ 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(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ 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(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ 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(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ 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(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ 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(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp, const char *kw)
+ const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct connection *conn;