MINOR: converters: add a "void *private" argument to converters
This permits to store specific configuration pointer. It is useful
with future Lua integration.
diff --git a/include/types/sample.h b/include/types/sample.h
index a5140d6..2dd18e6 100644
--- a/include/types/sample.h
+++ b/include/types/sample.h
@@ -261,7 +261,8 @@
struct sample_conv {
const char *kw; /* configuration keyword */
int (*process)(const struct arg *arg_p,
- struct sample *smp); /* process function */
+ struct sample *smp,
+ void *private); /* process function */
unsigned int arg_mask; /* arguments (ARG*()) */
int (*val_args)(struct arg *arg_p,
struct sample_conv *smp_conv,
@@ -269,7 +270,7 @@
char **err_msg); /* argument validation function */
unsigned int in_type; /* expected input sample type */
unsigned int out_type; /* output sample type */
- unsigned int private; /* private values. only used by maps */
+ void *private; /* private values. only used by maps and Lua */
};
/* sample conversion expression */
diff --git a/src/map.c b/src/map.c
index a4fd54b..ec760d1 100644
--- a/src/map.c
+++ b/src/map.c
@@ -133,12 +133,12 @@
desc->do_free = 1;
/* Set the match method. */
- desc->pat.match = pat_match_fcts[conv->private];
- desc->pat.parse = pat_parse_fcts[conv->private];
- desc->pat.index = pat_index_fcts[conv->private];
- desc->pat.delete = pat_delete_fcts[conv->private];
- desc->pat.prune = pat_prune_fcts[conv->private];
- desc->pat.expect_type = pat_match_types[conv->private];
+ desc->pat.match = pat_match_fcts[(long)conv->private];
+ desc->pat.parse = pat_parse_fcts[(long)conv->private];
+ desc->pat.index = pat_index_fcts[(long)conv->private];
+ desc->pat.delete = pat_delete_fcts[(long)conv->private];
+ desc->pat.prune = pat_prune_fcts[(long)conv->private];
+ desc->pat.expect_type = pat_match_types[(long)conv->private];
/* Set the output parse method. */
switch (desc->conv->out_type) {
@@ -184,7 +184,7 @@
return 1;
}
-static int sample_conv_map(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_map(const struct arg *arg_p, struct sample *smp, void *private)
{
struct map_descriptor *desc;
struct pattern *pat;
@@ -239,36 +239,36 @@
* The arguments are: <file>[,<default value>]
*/
static struct sample_conv_kw_list sample_conv_kws = {ILH, {
- { "map", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_STR, PAT_MATCH_STR },
- { "map_str", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_STR, PAT_MATCH_STR },
- { "map_beg", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_STR, PAT_MATCH_BEG },
- { "map_sub", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_STR, PAT_MATCH_SUB },
- { "map_dir", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_STR, PAT_MATCH_DIR },
- { "map_dom", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_STR, PAT_MATCH_DOM },
- { "map_end", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_STR, PAT_MATCH_END },
- { "map_reg", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_STR, PAT_MATCH_REG },
- { "map_int", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_UINT, SMP_T_STR, PAT_MATCH_INT },
- { "map_ip", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_ADDR, SMP_T_STR, PAT_MATCH_IP },
+ { "map", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_STR, (void *)PAT_MATCH_STR },
+ { "map_str", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_STR, (void *)PAT_MATCH_STR },
+ { "map_beg", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_STR, (void *)PAT_MATCH_BEG },
+ { "map_sub", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_STR, (void *)PAT_MATCH_SUB },
+ { "map_dir", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_STR, (void *)PAT_MATCH_DIR },
+ { "map_dom", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_STR, (void *)PAT_MATCH_DOM },
+ { "map_end", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_STR, (void *)PAT_MATCH_END },
+ { "map_reg", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_STR, (void *)PAT_MATCH_REG },
+ { "map_int", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_UINT, SMP_T_STR, (void *)PAT_MATCH_INT },
+ { "map_ip", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_ADDR, SMP_T_STR, (void *)PAT_MATCH_IP },
- { "map_str_int", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_UINT, PAT_MATCH_STR },
- { "map_beg_int", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_UINT, PAT_MATCH_BEG },
- { "map_sub_int", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_UINT, PAT_MATCH_SUB },
- { "map_dir_int", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_UINT, PAT_MATCH_DIR },
- { "map_dom_int", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_UINT, PAT_MATCH_DOM },
- { "map_end_int", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_UINT, PAT_MATCH_END },
- { "map_reg_int", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_UINT, PAT_MATCH_REG },
- { "map_int_int", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_UINT, SMP_T_UINT, PAT_MATCH_INT },
- { "map_ip_int", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_ADDR, SMP_T_UINT, PAT_MATCH_IP },
+ { "map_str_int", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_UINT, (void *)PAT_MATCH_STR },
+ { "map_beg_int", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_UINT, (void *)PAT_MATCH_BEG },
+ { "map_sub_int", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_UINT, (void *)PAT_MATCH_SUB },
+ { "map_dir_int", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_UINT, (void *)PAT_MATCH_DIR },
+ { "map_dom_int", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_UINT, (void *)PAT_MATCH_DOM },
+ { "map_end_int", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_UINT, (void *)PAT_MATCH_END },
+ { "map_reg_int", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_UINT, (void *)PAT_MATCH_REG },
+ { "map_int_int", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_UINT, SMP_T_UINT, (void *)PAT_MATCH_INT },
+ { "map_ip_int", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_ADDR, SMP_T_UINT, (void *)PAT_MATCH_IP },
- { "map_str_ip", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_IPV4, PAT_MATCH_STR },
- { "map_beg_ip", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_IPV4, PAT_MATCH_BEG },
- { "map_sub_ip", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_IPV4, PAT_MATCH_SUB },
- { "map_dir_ip", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_IPV4, PAT_MATCH_DIR },
- { "map_dom_ip", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_IPV4, PAT_MATCH_DOM },
- { "map_end_ip", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_IPV4, PAT_MATCH_END },
- { "map_reg_ip", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_IPV4, PAT_MATCH_REG },
- { "map_int_ip", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_UINT, SMP_T_IPV4, PAT_MATCH_INT },
- { "map_ip_ip", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_ADDR, SMP_T_IPV4, PAT_MATCH_IP },
+ { "map_str_ip", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_IPV4, (void *)PAT_MATCH_STR },
+ { "map_beg_ip", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_IPV4, (void *)PAT_MATCH_BEG },
+ { "map_sub_ip", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_IPV4, (void *)PAT_MATCH_SUB },
+ { "map_dir_ip", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_IPV4, (void *)PAT_MATCH_DIR },
+ { "map_dom_ip", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_IPV4, (void *)PAT_MATCH_DOM },
+ { "map_end_ip", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_IPV4, (void *)PAT_MATCH_END },
+ { "map_reg_ip", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_STR, SMP_T_IPV4, (void *)PAT_MATCH_REG },
+ { "map_int_ip", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_UINT, SMP_T_IPV4, (void *)PAT_MATCH_INT },
+ { "map_ip_ip", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_ADDR, SMP_T_IPV4, (void *)PAT_MATCH_IP },
{ /* END */ },
}};
diff --git a/src/proto_http.c b/src/proto_http.c
index 4484bcf..3738aa4 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -11377,7 +11377,7 @@
* adds an optional offset found in args[0] and emits a string representing
* the date in RFC-1123/5322 format.
*/
-static int sample_conv_http_date(const struct arg *args, struct sample *smp)
+static int sample_conv_http_date(const struct arg *args, struct sample *smp, void *private)
{
const char day[7][4] = { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" };
const char mon[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
@@ -11428,7 +11428,7 @@
}
/* Arguments: The list of expected value, the number of parts returned and the separator */
-static int sample_conv_q_prefered(const struct arg *args, struct sample *smp)
+static int sample_conv_q_prefered(const struct arg *args, struct sample *smp, void *private)
{
const char *al = smp->data.str.str;
const char *end = al + smp->data.str.len;
diff --git a/src/sample.c b/src/sample.c
index 57b2c00..14a7197 100644
--- a/src/sample.c
+++ b/src/sample.c
@@ -967,7 +967,7 @@
/* OK cast succeeded */
- if (!conv_expr->conv->process(conv_expr->arg_p, p))
+ if (!conv_expr->conv->process(conv_expr->arg_p, p, conv_expr->conv->private))
return NULL;
}
return p;
@@ -1275,7 +1275,7 @@
/* These functions set the data type on return. */
/*****************************************************************/
-static int sample_conv_bin2base64(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_bin2base64(const struct arg *arg_p, struct sample *smp, void *private)
{
struct chunk *trash = get_trash_chunk();
int b64_len;
@@ -1292,7 +1292,7 @@
return 1;
}
-static int sample_conv_bin2hex(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_bin2hex(const struct arg *arg_p, struct sample *smp, void *private)
{
struct chunk *trash = get_trash_chunk();
unsigned char c;
@@ -1311,7 +1311,7 @@
}
/* hashes the binary input into a 32-bit unsigned int */
-static int sample_conv_djb2(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_djb2(const struct arg *arg_p, struct sample *smp, void *private)
{
smp->data.uint = hash_djb2(smp->data.str.str, smp->data.str.len);
if (arg_p && arg_p->data.uint)
@@ -1320,7 +1320,7 @@
return 1;
}
-static int sample_conv_str2lower(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_str2lower(const struct arg *arg_p, struct sample *smp, void *private)
{
int i;
@@ -1337,7 +1337,7 @@
return 1;
}
-static int sample_conv_str2upper(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_str2upper(const struct arg *arg_p, struct sample *smp, void *private)
{
int i;
@@ -1355,7 +1355,7 @@
}
/* takes the netmask in arg_p */
-static int sample_conv_ipmask(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_ipmask(const struct arg *arg_p, struct sample *smp, void *private)
{
smp->data.ipv4.s_addr &= arg_p->data.ipv4.s_addr;
smp->type = SMP_T_IPV4;
@@ -1366,7 +1366,7 @@
* adds an optional offset found in args[1] and emits a string representing
* the local time in the format specified in args[1] using strftime().
*/
-static int sample_conv_ltime(const struct arg *args, struct sample *smp)
+static int sample_conv_ltime(const struct arg *args, struct sample *smp, void *private)
{
struct chunk *temp;
time_t curr_date = smp->data.uint;
@@ -1383,7 +1383,7 @@
}
/* hashes the binary input into a 32-bit unsigned int */
-static int sample_conv_sdbm(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_sdbm(const struct arg *arg_p, struct sample *smp, void *private)
{
smp->data.uint = hash_sdbm(smp->data.str.str, smp->data.str.len);
if (arg_p && arg_p->data.uint)
@@ -1396,7 +1396,7 @@
* adds an optional offset found in args[1] and emits a string representing
* the UTC date in the format specified in args[1] using strftime().
*/
-static int sample_conv_utime(const struct arg *args, struct sample *smp)
+static int sample_conv_utime(const struct arg *args, struct sample *smp, void *private)
{
struct chunk *temp;
time_t curr_date = smp->data.uint;
@@ -1413,7 +1413,7 @@
}
/* hashes the binary input into a 32-bit unsigned int */
-static int sample_conv_wt6(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_wt6(const struct arg *arg_p, struct sample *smp, void *private)
{
smp->data.uint = hash_wt6(smp->data.str.str, smp->data.str.len);
if (arg_p && arg_p->data.uint)
@@ -1423,7 +1423,7 @@
}
/* hashes the binary input into a 32-bit unsigned int */
-static int sample_conv_crc32(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_crc32(const struct arg *arg_p, struct sample *smp, void *private)
{
smp->data.uint = hash_crc32(smp->data.str.str, smp->data.str.len);
if (arg_p && arg_p->data.uint)
@@ -1503,7 +1503,7 @@
return 0;
}
-static int sample_conv_json(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_json(const struct arg *arg_p, struct sample *smp, void *private)
{
struct chunk *temp;
char _str[7]; /* \u + 4 hex digit + null char for sprintf. */
@@ -1617,7 +1617,7 @@
/* This sample function is designed to extract some bytes from an input buffer.
* First arg is the offset.
* Optional second arg is the length to truncate */
-static int sample_conv_bytes(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_bytes(const struct arg *arg_p, struct sample *smp, void *private)
{
if (smp->data.str.len <= arg_p[0].data.uint) {
smp->data.str.len = 0;
@@ -1674,7 +1674,7 @@
* First arg is the index of the field (start at 1)
* Second arg is a char list of separators (type string)
*/
-static int sample_conv_field(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_field(const struct arg *arg_p, struct sample *smp, void *private)
{
unsigned int field;
char *start, *end;
@@ -1725,7 +1725,7 @@
* First arg is the index of the word (start at 1)
* Second arg is a char list of words separators (type string)
*/
-static int sample_conv_word(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_word(const struct arg *arg_p, struct sample *smp, void *private)
{
unsigned int word;
char *start, *end;
@@ -1819,7 +1819,7 @@
* location until nothing matches anymore. First arg is the regex to apply to
* the input string, second arg is the replacement expression.
*/
-static int sample_conv_regsub(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_regsub(const struct arg *arg_p, struct sample *smp, void *private)
{
char *start, *end;
struct my_regex *reg = arg_p[0].data.reg;
@@ -1891,7 +1891,7 @@
/* Takes a UINT on input, applies a binary twos complement and returns the UINT
* result.
*/
-static int sample_conv_binary_cpl(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_binary_cpl(const struct arg *arg_p, struct sample *smp, void *private)
{
smp->data.uint = ~smp->data.uint;
return 1;
@@ -1900,7 +1900,7 @@
/* Takes a UINT on input, applies a binary "and" with the UINT in arg_p, and
* returns the UINT result.
*/
-static int sample_conv_binary_and(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_binary_and(const struct arg *arg_p, struct sample *smp, void *private)
{
smp->data.uint &= arg_p->data.uint;
return 1;
@@ -1909,7 +1909,7 @@
/* Takes a UINT on input, applies a binary "or" with the UINT in arg_p, and
* returns the UINT result.
*/
-static int sample_conv_binary_or(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_binary_or(const struct arg *arg_p, struct sample *smp, void *private)
{
smp->data.uint |= arg_p->data.uint;
return 1;
@@ -1918,7 +1918,7 @@
/* Takes a UINT on input, applies a binary "xor" with the UINT in arg_p, and
* returns the UINT result.
*/
-static int sample_conv_binary_xor(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_binary_xor(const struct arg *arg_p, struct sample *smp, void *private)
{
smp->data.uint ^= arg_p->data.uint;
return 1;
@@ -1927,7 +1927,7 @@
/* Takes a UINT on input, applies an arithmetic "add" with the UINT in arg_p,
* and returns the UINT result.
*/
-static int sample_conv_arith_add(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_arith_add(const struct arg *arg_p, struct sample *smp, void *private)
{
smp->data.uint += arg_p->data.uint;
return 1;
@@ -1936,7 +1936,7 @@
/* Takes a UINT on input, applies an arithmetic "sub" with the UINT in arg_p,
* and returns the UINT result.
*/
-static int sample_conv_arith_sub(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_arith_sub(const struct arg *arg_p, struct sample *smp, void *private)
{
smp->data.uint -= arg_p->data.uint;
return 1;
@@ -1945,7 +1945,7 @@
/* Takes a UINT on input, applies an arithmetic "mul" with the UINT in arg_p,
* and returns the UINT result.
*/
-static int sample_conv_arith_mul(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_arith_mul(const struct arg *arg_p, struct sample *smp, void *private)
{
smp->data.uint *= arg_p->data.uint;
return 1;
@@ -1955,7 +1955,7 @@
* and returns the UINT result. If arg_p makes the result overflow, then the
* largest possible quantity is returned.
*/
-static int sample_conv_arith_div(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_arith_div(const struct arg *arg_p, struct sample *smp, void *private)
{
if (arg_p->data.uint)
smp->data.uint /= arg_p->data.uint;
@@ -1968,7 +1968,7 @@
* and returns the UINT result. If arg_p makes the result overflow, then zero
* is returned.
*/
-static int sample_conv_arith_mod(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_arith_mod(const struct arg *arg_p, struct sample *smp, void *private)
{
if (arg_p->data.uint)
smp->data.uint %= arg_p->data.uint;
@@ -1980,7 +1980,7 @@
/* Takes an UINT on input, applies an arithmetic "neg" and returns the UINT
* result.
*/
-static int sample_conv_arith_neg(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_arith_neg(const struct arg *arg_p, struct sample *smp, void *private)
{
smp->data.uint = -smp->data.uint;
return 1;
@@ -1989,7 +1989,7 @@
/* Takes a UINT on input, returns true is the value is non-null, otherwise
* false. The output is a BOOL.
*/
-static int sample_conv_arith_bool(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_arith_bool(const struct arg *arg_p, struct sample *smp, void *private)
{
smp->data.uint = !!smp->data.uint;
smp->type = SMP_T_BOOL;
@@ -1999,7 +1999,7 @@
/* Takes a UINT on input, returns false is the value is non-null, otherwise
* truee. The output is a BOOL.
*/
-static int sample_conv_arith_not(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_arith_not(const struct arg *arg_p, struct sample *smp, void *private)
{
smp->data.uint = !smp->data.uint;
smp->type = SMP_T_BOOL;
@@ -2009,7 +2009,7 @@
/* Takes a UINT on input, returns true is the value is odd, otherwise false.
* The output is a BOOL.
*/
-static int sample_conv_arith_odd(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_arith_odd(const struct arg *arg_p, struct sample *smp, void *private)
{
smp->data.uint = smp->data.uint & 1;
smp->type = SMP_T_BOOL;
@@ -2019,7 +2019,7 @@
/* Takes a UINT on input, returns true is the value is even, otherwise false.
* The output is a BOOL.
*/
-static int sample_conv_arith_even(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_arith_even(const struct arg *arg_p, struct sample *smp, void *private)
{
smp->data.uint = !(smp->data.uint & 1);
smp->type = SMP_T_BOOL;
diff --git a/src/stick_table.c b/src/stick_table.c
index 32fd60a..9fe0b86 100644
--- a/src/stick_table.c
+++ b/src/stick_table.c
@@ -809,7 +809,7 @@
* the table's type. This is a double conversion, but in the future we might
* support automatic input types to perform the cast on the fly.
*/
-static int sample_conv_in_table(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_in_table(const struct arg *arg_p, struct sample *smp, void *private)
{
struct stktable *t;
struct stktable_key *key;
@@ -835,7 +835,7 @@
* be easily performed. If the inspected parameter is not stored in the table,
* <not found> is returned.
*/
-static int sample_conv_table_bytes_in_rate(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_table_bytes_in_rate(const struct arg *arg_p, struct sample *smp, void *private)
{
struct stktable *t;
struct stktable_key *key;
@@ -871,7 +871,7 @@
* be easily performed. If the inspected parameter is not stored in the table,
* <not found> is returned.
*/
-static int sample_conv_table_conn_cnt(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_table_conn_cnt(const struct arg *arg_p, struct sample *smp, void *private)
{
struct stktable *t;
struct stktable_key *key;
@@ -906,7 +906,7 @@
* can be easily performed. If the inspected parameter is not stored in the
* table, <not found> is returned.
*/
-static int sample_conv_table_conn_cur(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_table_conn_cur(const struct arg *arg_p, struct sample *smp, void *private)
{
struct stktable *t;
struct stktable_key *key;
@@ -941,7 +941,7 @@
* be easily performed. If the inspected parameter is not stored in the table,
* <not found> is returned.
*/
-static int sample_conv_table_conn_rate(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_table_conn_rate(const struct arg *arg_p, struct sample *smp, void *private)
{
struct stktable *t;
struct stktable_key *key;
@@ -977,7 +977,7 @@
* be easily performed. If the inspected parameter is not stored in the table,
* <not found> is returned.
*/
-static int sample_conv_table_bytes_out_rate(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_table_bytes_out_rate(const struct arg *arg_p, struct sample *smp, void *private)
{
struct stktable *t;
struct stktable_key *key;
@@ -1013,7 +1013,7 @@
* be easily performed. If the inspected parameter is not stored in the table,
* <not found> is returned.
*/
-static int sample_conv_table_gpc0(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_table_gpc0(const struct arg *arg_p, struct sample *smp, void *private)
{
struct stktable *t;
struct stktable_key *key;
@@ -1048,7 +1048,7 @@
* be easily performed. If the inspected parameter is not stored in the table,
* <not found> is returned.
*/
-static int sample_conv_table_gpc0_rate(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_table_gpc0_rate(const struct arg *arg_p, struct sample *smp, void *private)
{
struct stktable *t;
struct stktable_key *key;
@@ -1084,7 +1084,7 @@
* comparisons can be easily performed. If the inspected parameter is not stored
* in the table, <not found> is returned.
*/
-static int sample_conv_table_http_err_cnt(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_table_http_err_cnt(const struct arg *arg_p, struct sample *smp, void *private)
{
struct stktable *t;
struct stktable_key *key;
@@ -1119,7 +1119,7 @@
* be easily performed. If the inspected parameter is not stored in the table,
* <not found> is returned.
*/
-static int sample_conv_table_http_err_rate(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_table_http_err_rate(const struct arg *arg_p, struct sample *smp, void *private)
{
struct stktable *t;
struct stktable_key *key;
@@ -1155,7 +1155,7 @@
* can be easily performed. If the inspected parameter is not stored in the
* table, <not found> is returned.
*/
-static int sample_conv_table_http_req_cnt(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_table_http_req_cnt(const struct arg *arg_p, struct sample *smp, void *private)
{
struct stktable *t;
struct stktable_key *key;
@@ -1190,7 +1190,7 @@
* performed. If the inspected parameter is not stored in the table, <not found>
* is returned.
*/
-static int sample_conv_table_http_req_rate(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_table_http_req_rate(const struct arg *arg_p, struct sample *smp, void *private)
{
struct stktable *t;
struct stktable_key *key;
@@ -1226,7 +1226,7 @@
* be easily performed. If the inspected parameter is not stored in the table,
* <not found> is returned.
*/
-static int sample_conv_table_kbytes_in(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_table_kbytes_in(const struct arg *arg_p, struct sample *smp, void *private)
{
struct stktable *t;
struct stktable_key *key;
@@ -1261,7 +1261,7 @@
* be easily performed. If the inspected parameter is not stored in the table,
* <not found> is returned.
*/
-static int sample_conv_table_kbytes_out(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_table_kbytes_out(const struct arg *arg_p, struct sample *smp, void *private)
{
struct stktable *t;
struct stktable_key *key;
@@ -1296,7 +1296,7 @@
* easily performed. If the inspected parameter is not stored in the table,
* <not found> is returned.
*/
-static int sample_conv_table_server_id(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_table_server_id(const struct arg *arg_p, struct sample *smp, void *private)
{
struct stktable *t;
struct stktable_key *key;
@@ -1331,7 +1331,7 @@
* can be easily performed. If the inspected parameter is not stored in the
* table, <not found> is returned.
*/
-static int sample_conv_table_sess_cnt(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_table_sess_cnt(const struct arg *arg_p, struct sample *smp, void *private)
{
struct stktable *t;
struct stktable_key *key;
@@ -1366,7 +1366,7 @@
* performed. If the inspected parameter is not stored in the table, <not found>
* is returned.
*/
-static int sample_conv_table_sess_rate(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_table_sess_rate(const struct arg *arg_p, struct sample *smp, void *private)
{
struct stktable *t;
struct stktable_key *key;
@@ -1402,7 +1402,7 @@
* comparisons can be easily performed. If the inspected parameter is not
* stored in the table, <not found> is returned.
*/
-static int sample_conv_table_trackers(const struct arg *arg_p, struct sample *smp)
+static int sample_conv_table_trackers(const struct arg *arg_p, struct sample *smp, void *private)
{
struct stktable *t;
struct stktable_key *key;