The currently available list of transformation keywords include :
add(<value>)
- Adds <value> to the input value of type unsigned integer, and returns the
- result as an unsigned integer.
+ Adds <value> to the input value of type signed integer, and returns the
+ result as a signed integer.
and(<value>)
- Performs a bitwise "AND" between <value> and the input value of type unsigned
- integer, and returns the result as an unsigned integer.
+ Performs a bitwise "AND" between <value> and the input value of type signed
+ integer, and returns the result as an signed integer.
base64
Converts a binary input sample to a base64 string. It is used to log or
an SSL ID can be copied in a header).
bool
- Returns a boolean TRUE if the input value of type unsigned integer is
+ Returns a boolean TRUE if the input value of type signed integer is
non-null, otherwise returns FALSE. Used in conjunction with and(), it can be
used to report true/false for bit testing on input values (eg: verify the
presence of a flag).
optionnaly truncated at the given length.
cpl
- Takes the input value of type unsigned integer, applies a twos-complement
- (flips all bits) and returns the result as an unsigned integer.
+ Takes the input value of type signed integer, applies a ones-complement
+ (flips all bits) and returns the result as an signed integer.
crc32([<avalanche>])
Hashes a binary input sample into an unsigned 32-bit quantity using the CRC32
converter only exists when haproxy was built with debugging enabled.
div(<value>)
- Divides the input value of type unsigned integer by <value>, and returns the
- result as an unsigned integer. If <value> is null, the largest unsigned
- integer is returned (typically 2^32-1).
+ Divides the input value of type signed integer by <value>, and returns the
+ result as an signed integer. If <value> is null, the largest unsigned
+ integer is returned (typically 2^63-1).
djb2([<avalanche>])
Hashes a binary input sample into an unsigned 32-bit quantity using the DJB2
"hash-type" directive.
even
- Returns a boolean TRUE if the input value of type unsigned integer is even
+ Returns a boolean TRUE if the input value of type signed integer is even
otherwise returns FALSE. It is functionally equivalent to "not,and(1),bool".
field(<index>,<delimiters>)
`------------------------------------ leading spaces ignored
mod(<value>)
- Divides the input value of type unsigned integer by <value>, and returns the
- remainder as an unsigned integer. If <value> is null, then zero is returned.
+ Divides the input value of type signed integer by <value>, and returns the
+ remainder as an signed integer. If <value> is null, then zero is returned.
mul(<value>)
- Multiplies the input value of type unsigned integer by <value>, and returns
- the product as an unsigned integer. In case of overflow, the higher bits are
+ Multiplies the input value of type signed integer by <value>, and returns
+ the product as an signed integer. In case of overflow, the higher bits are
lost, leading to seemingly strange values.
neg
- Takes the input value of type unsigned integer, computes the opposite value,
- and returns the remainder as an unsigned integer. 0 is identity. This
- operator is provided for reversed subtracts : in order to subtract the input
- from a constant, simply perform a "neg,add(value)".
+ Takes the input value of type signed integer, computes the opposite value,
+ and returns the remainder as an signed integer. 0 is identity. This operator
+ is provided for reversed subtracts : in order to subtract the input from a
+ constant, simply perform a "neg,add(value)".
not
- Returns a boolean FALSE if the input value of type unsigned integer is
+ Returns a boolean FALSE if the input value of type signed integer is
non-null, otherwise returns TRUE. Used in conjunction with and(), it can be
used to report true/false for bit testing on input values (eg: verify the
absence of a flag).
odd
- Returns a boolean TRUE if the input value of type unsigned integer is odd
+ Returns a boolean TRUE if the input value of type signed integer is odd
otherwise returns FALSE. It is functionally equivalent to "and(1),bool".
or(<value>)
- Performs a bitwise "OR" between <value> and the input value of type unsigned
- integer, and returns the result as an unsigned integer.
+ Performs a bitwise "OR" between <value> and the input value of type signed
+ integer, and returns the result as an signed integer.
regsub(<regex>,<subst>[,<flags>])
Applies a regex-based substitution to the input string. It does the same
contain characters 'a-z', 'A-Z', '0-9' and '_'.
sub(<value>)
- Subtracts <value> from the input value of type unsigned integer, and returns
- the result as an unsigned integer. Note: in order to subtract the input from
+ Subtracts <value> from the input value of type signed integer, and returns
+ the result as an signed integer. Note: in order to subtract the input from
a constant, simply perform a "neg,add(value)".
table_bytes_in_rate(<table>)
xor(<value>)
Performs a bitwise "XOR" (exclusive OR) between <value> and the input value
- of type unsigned integer, and returns the result as an unsigned integer.
+ of type signed integer, and returns the result as an signed integer.
7.3.2. Fetching samples from internal states
tcp-request content accept if ! too_fast
tcp-request content accept if WAIT_END
+int(<integer>) : signed integer
+ Returns a signed integer.
+
ipv4(<ipv4>) : ipv4
Returns an ipv4.
needed to take some routing decisions for example, or just for debugging
purposes. This random must not be used for security purposes.
-sint(<sint>) : signed integer
- Returns a signed integer.
-
srv_conn([<backend>/]<server>) : integer
Returns an integer value corresponding to the number of currently established
connections on the designated server, possibly including the connection being
stick-table or in the designated stick-table. See also src_conn_cnt and
table_avl for other entry counting methods.
-uint(<uint>) : unsigned integer
- Returns an unsigned integer.
-
var(<var-name>) : undefined
Returns a variable with the stored type. If the variable is not set, the
sample fetch fails. The name of the variable starts by an indication about its
enum {
SMP_T_ANY = 0, /* any type */
SMP_T_BOOL, /* boolean */
- SMP_T_UINT, /* unsigned 32bits integer type */
- SMP_T_SINT, /* signed 32bits integer type */
+ SMP_T_SINT, /* signed 64bits integer type */
SMP_T_ADDR, /* ipv4 or ipv6, only used for input type compatibility */
SMP_T_IPV4, /* ipv4 type */
SMP_T_IPV6, /* ipv6 type */
unsigned int flags; /* SMP_F_* */
int type; /* SMP_T_* */
union {
- unsigned int uint; /* used for unsigned 32bits integers and booleans */
- int sint; /* used for signed 32bits integers */
+ long long int sint; /* used for signed 64bits integers */
struct in_addr ipv4; /* used for ipv4 addresses */
struct in6_addr ipv6; /* used for ipv6 addresses */
struct chunk str; /* used for char strings or buffers */
struct sample_storage {
int type; /* SMP_T_* */
union {
- unsigned int uint; /* used for unsigned 32bits integers and booleans */
- int sint; /* used for signed 32bits integers */
+ long long int sint; /* used for signed 64bits integers */
struct in_addr ipv4; /* used for ipv4 addresses */
struct in6_addr ipv6; /* used for ipv6 addresses */
struct chunk str; /* used for char strings or buffers */
expr->pat.expect_type = pat_match_types[PAT_MATCH_BOOL];
break;
case SMP_T_SINT:
- case SMP_T_UINT:
expr->pat.parse = pat_parse_fcts[PAT_MATCH_INT];
expr->pat.index = pat_index_fcts[PAT_MATCH_INT];
expr->pat.match = pat_match_fcts[PAT_MATCH_INT];
struct proxy *px;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
+ smp->type = SMP_T_SINT;
px = args->data.prx;
if (px->srv_act)
- smp->data.uint = px->srv_act;
+ smp->data.sint = px->srv_act;
else if (px->lbprm.fbck)
- smp->data.uint = 1;
+ smp->data.sint = 1;
else
- smp->data.uint = px->srv_bck;
+ smp->data.sint = px->srv_bck;
return 1;
}
smp->type = SMP_T_BOOL;
if (!(srv->admin & SRV_ADMF_MAINT) &&
(!(srv->check.state & CHK_ST_CONFIGURED) || (srv->state != SRV_ST_STOPPED)))
- smp->data.uint = 1;
+ smp->data.sint = 1;
else
- smp->data.uint = 0;
+ smp->data.sint = 0;
return 1;
}
struct server *iterator;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
for (iterator = args->data.prx->srv; iterator; iterator = iterator->next) {
if (iterator->state == SRV_ST_STOPPED)
if (iterator->maxconn == 0 || iterator->maxqueue == 0) {
/* configuration is stupid */
- smp->data.uint = -1; /* FIXME: stupid value! */
+ smp->data.sint = -1; /* FIXME: stupid value! */
return 1;
}
- smp->data.uint += (iterator->maxconn - iterator->cur_sess)
+ smp->data.sint += (iterator->maxconn - iterator->cur_sess)
+ (iterator->maxqueue - iterator->nbpend);
}
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;
- smp->data.uint = smp->strm->be->uuid;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = smp->strm->be->uuid;
return 1;
}
if (!objt_server(smp->strm->target))
return 0;
- smp->type = SMP_T_UINT;
- smp->data.uint = objt_server(smp->strm->target)->puid;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = objt_server(smp->strm->target)->puid;
return 1;
}
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;
- smp->data.uint = read_freq_ctr(&args->data.prx->be_sess_per_sec);
+ smp->type = SMP_T_SINT;
+ smp->data.sint = read_freq_ctr(&args->data.prx->be_sess_per_sec);
return 1;
}
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;
- smp->data.uint = args->data.prx->beconn;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = args->data.prx->beconn;
return 1;
}
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;
- smp->data.uint = args->data.prx->totpend;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = args->data.prx->totpend;
return 1;
}
struct proxy *px;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
+ smp->type = SMP_T_SINT;
px = args->data.prx;
if (px->srv_act)
nbsrv = px->srv_bck;
if (nbsrv > 0)
- smp->data.uint = (px->totpend + nbsrv - 1) / nbsrv;
+ smp->data.sint = (px->totpend + nbsrv - 1) / nbsrv;
else
- smp->data.uint = px->totpend * 2;
+ smp->data.sint = px->totpend * 2;
return 1;
}
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;
- smp->data.uint = args->data.srv->cur_sess;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = args->data.srv->cur_sess;
return 1;
}
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;
- smp->data.uint = read_freq_ctr(&args->data.srv->sess_per_sec);
+ smp->type = SMP_T_SINT;
+ smp->data.sint = read_freq_ctr(&args->data.srv->sess_per_sec);
return 1;
}
* Please take care of keeping this list alphabetically sorted.
*/
static struct sample_fetch_kw_list smp_kws = {ILH, {
- { "avg_queue", smp_fetch_avg_queue_size, ARG1(1,BE), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "be_conn", smp_fetch_be_conn, ARG1(1,BE), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "be_id", smp_fetch_be_id, 0, NULL, SMP_T_UINT, SMP_USE_BKEND, },
- { "be_sess_rate", smp_fetch_be_sess_rate, ARG1(1,BE), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "connslots", smp_fetch_connslots, ARG1(1,BE), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "nbsrv", smp_fetch_nbsrv, ARG1(1,BE), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "queue", smp_fetch_queue_size, ARG1(1,BE), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "srv_conn", smp_fetch_srv_conn, ARG1(1,SRV), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "srv_id", smp_fetch_srv_id, 0, NULL, SMP_T_UINT, SMP_USE_SERVR, },
+ { "avg_queue", smp_fetch_avg_queue_size, ARG1(1,BE), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "be_conn", smp_fetch_be_conn, ARG1(1,BE), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "be_id", smp_fetch_be_id, 0, NULL, SMP_T_SINT, SMP_USE_BKEND, },
+ { "be_sess_rate", smp_fetch_be_sess_rate, ARG1(1,BE), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "connslots", smp_fetch_connslots, ARG1(1,BE), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "nbsrv", smp_fetch_nbsrv, ARG1(1,BE), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "queue", smp_fetch_queue_size, ARG1(1,BE), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "srv_conn", smp_fetch_srv_conn, ARG1(1,SRV), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "srv_id", smp_fetch_srv_id, 0, NULL, SMP_T_SINT, SMP_USE_SERVR, },
{ "srv_is_up", smp_fetch_srv_is_up, ARG1(1,SRV), NULL, SMP_T_BOOL, SMP_USE_INTRN, },
- { "srv_sess_rate", smp_fetch_srv_sess_rate, ARG1(1,SRV), NULL, SMP_T_UINT, SMP_USE_INTRN, },
+ { "srv_sess_rate", smp_fetch_srv_sess_rate, ARG1(1,SRV), NULL, SMP_T_SINT, SMP_USE_INTRN, },
{ /* END */ },
}};
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);
+ smp->data.sint = (smp->strm->comp_algo != NULL);
return 1;
}
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;
- smp->data.uint = smp->sess->fe->uuid;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = smp->sess->fe->uuid;
return 1;
}
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;
- smp->data.uint = read_freq_ctr(&args->data.prx->fe_sess_per_sec);
+ smp->type = SMP_T_SINT;
+ smp->data.sint = read_freq_ctr(&args->data.prx->fe_sess_per_sec);
return 1;
}
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->data.uint = args->data.prx->feconn;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = args->data.prx->feconn;
return 1;
}
* Please take care of keeping this list alphabetically sorted.
*/
static struct sample_fetch_kw_list smp_kws = {ILH, {
- { "fe_conn", smp_fetch_fe_conn, ARG1(1,FE), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "fe_id", smp_fetch_fe_id, 0, NULL, SMP_T_UINT, SMP_USE_FTEND, },
- { "fe_sess_rate", smp_fetch_fe_sess_rate, ARG1(1,FE), NULL, SMP_T_UINT, SMP_USE_INTRN, },
+ { "fe_conn", smp_fetch_fe_conn, ARG1(1,FE), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "fe_id", smp_fetch_fe_id, 0, NULL, SMP_T_SINT, SMP_USE_FTEND, },
+ { "fe_sess_rate", smp_fetch_fe_sess_rate, ARG1(1,FE), NULL, SMP_T_SINT, SMP_USE_INTRN, },
{ /* END */ },
}};
switch (smp->type) {
case SMP_T_SINT:
case SMP_T_BOOL:
- case SMP_T_UINT:
lua_pushinteger(L, smp->data.sint);
break;
case SMP_T_SINT:
case SMP_T_BOOL:
- case SMP_T_UINT:
case SMP_T_IPV4:
case SMP_T_IPV6:
case SMP_T_ADDR: /* This type is never used to qualify a sample. */
case LUA_TBOOLEAN:
smp->type = SMP_T_BOOL;
- smp->data.uint = lua_toboolean(L, ud);
+ smp->data.sint = lua_toboolean(L, ud);
break;
case LUA_TSTRING:
case LUA_TTHREAD:
case LUA_TLIGHTUSERDATA:
smp->type = SMP_T_BOOL;
- smp->data.uint = 0;
+ smp->data.sint = 0;
break;
}
return 1;
case PAT_MATCH_DOM: conv.in_type = SMP_T_STR; break;
case PAT_MATCH_END: conv.in_type = SMP_T_STR; break;
case PAT_MATCH_REG: conv.in_type = SMP_T_STR; break;
- case PAT_MATCH_INT: conv.in_type = SMP_T_UINT; break;
+ case PAT_MATCH_INT: conv.in_type = SMP_T_SINT; break;
case PAT_MATCH_IP: conv.in_type = SMP_T_ADDR; break;
default:
WILL_LJMP(luaL_error(L, "'new' doesn't support this match mode."));
MAY_LJMP(check_args(L, 2, "lookup"));
desc = MAY_LJMP(hlua_checkmap(L, 1));
- if (desc->pat.expect_type == SMP_T_UINT) {
- smp.type = SMP_T_UINT;
- smp.data.uint = MAY_LJMP(luaL_checkinteger(L, 2));
+ if (desc->pat.expect_type == SMP_T_SINT) {
+ smp.type = SMP_T_SINT;
+ smp.data.sint = MAY_LJMP(luaL_checkinteger(L, 2));
}
else {
smp.type = SMP_T_STR;
static int
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;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = smp->sess->listener->nbconn;
return 1;
}
static int
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;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = smp->sess->listener->luid;
return 1;
}
* Please take care of keeping this list alphabetically sorted.
*/
static struct sample_fetch_kw_list smp_kws = {ILH, {
- { "dst_conn", smp_fetch_dconn, 0, NULL, SMP_T_UINT, SMP_USE_FTEND, },
- { "so_id", smp_fetch_so_id, 0, NULL, SMP_T_UINT, SMP_USE_FTEND, },
+ { "dst_conn", smp_fetch_dconn, 0, NULL, SMP_T_SINT, SMP_USE_FTEND, },
+ { "so_id", smp_fetch_so_id, 0, NULL, SMP_T_SINT, SMP_USE_FTEND, },
{ /* END */ },
}};
*/
int map_parse_int(const char *text, struct sample_storage *smp)
{
- long long int value;
- char *error;
-
- /* parse interger and convert it. Return the value in 64 format. */
- value = strtoll(text, &error, 10);
- if (*error != '\0')
+ smp->type = SMP_T_SINT;
+ smp->data.sint = read_int64(&text, text + strlen(text));
+ if (*text != '\0')
return 0;
-
- /* check sign iand limits */
- if (value < 0) {
- if (value < INT_MIN)
- return 0;
- smp->type = SMP_T_SINT;
- smp->data.sint = value;
- }
- else {
- if (value > UINT_MAX)
- return 0;
- smp->type = SMP_T_UINT;
- smp->data.uint = value;
- }
-
return 1;
}
/* Set the output parse method. */
switch (desc->conv->out_type) {
case SMP_T_STR: desc->pat.parse_smp = map_parse_str; break;
- case SMP_T_UINT: desc->pat.parse_smp = map_parse_int; break;
+ case SMP_T_SINT: desc->pat.parse_smp = map_parse_int; break;
case SMP_T_IPV4: desc->pat.parse_smp = map_parse_ip; break;
case SMP_T_IPV6: desc->pat.parse_smp = map_parse_ip6; break;
default:
}
/* Return just int sample containing 1. */
- smp->type = SMP_T_UINT;
- smp->data.uint= 1;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 1;
return 1;
}
smp->data.str = arg_p[1].data.str;
break;
- case SMP_T_UINT:
- smp->type = SMP_T_UINT;
- smp->data.uint = arg_p[1].data.uint;
+ case SMP_T_SINT:
+ smp->type = SMP_T_SINT;
+ smp->data.sint = arg_p[1].data.uint;
break;
case SMP_T_IPV4:
{ "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_int", sample_conv_map, ARG2(1,STR,STR), sample_load_map, SMP_T_SINT, 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,UINT), sample_load_map, SMP_T_STR, SMP_T_UINT, (void *)PAT_MATCH_STR },
- { "map_beg_int", sample_conv_map, ARG2(1,STR,UINT), sample_load_map, SMP_T_STR, SMP_T_UINT, (void *)PAT_MATCH_BEG },
- { "map_sub_int", sample_conv_map, ARG2(1,STR,UINT), sample_load_map, SMP_T_STR, SMP_T_UINT, (void *)PAT_MATCH_SUB },
- { "map_dir_int", sample_conv_map, ARG2(1,STR,UINT), sample_load_map, SMP_T_STR, SMP_T_UINT, (void *)PAT_MATCH_DIR },
- { "map_dom_int", sample_conv_map, ARG2(1,STR,UINT), sample_load_map, SMP_T_STR, SMP_T_UINT, (void *)PAT_MATCH_DOM },
- { "map_end_int", sample_conv_map, ARG2(1,STR,UINT), sample_load_map, SMP_T_STR, SMP_T_UINT, (void *)PAT_MATCH_END },
- { "map_reg_int", sample_conv_map, ARG2(1,STR,UINT), sample_load_map, SMP_T_STR, SMP_T_UINT, (void *)PAT_MATCH_REG },
- { "map_int_int", sample_conv_map, ARG2(1,STR,UINT), sample_load_map, SMP_T_UINT, SMP_T_UINT, (void *)PAT_MATCH_INT },
- { "map_ip_int", sample_conv_map, ARG2(1,STR,UINT), sample_load_map, SMP_T_ADDR, SMP_T_UINT, (void *)PAT_MATCH_IP },
+ { "map_str_int", sample_conv_map, ARG2(1,STR,UINT), sample_load_map, SMP_T_STR, SMP_T_SINT, (void *)PAT_MATCH_STR },
+ { "map_beg_int", sample_conv_map, ARG2(1,STR,UINT), sample_load_map, SMP_T_STR, SMP_T_SINT, (void *)PAT_MATCH_BEG },
+ { "map_sub_int", sample_conv_map, ARG2(1,STR,UINT), sample_load_map, SMP_T_STR, SMP_T_SINT, (void *)PAT_MATCH_SUB },
+ { "map_dir_int", sample_conv_map, ARG2(1,STR,UINT), sample_load_map, SMP_T_STR, SMP_T_SINT, (void *)PAT_MATCH_DIR },
+ { "map_dom_int", sample_conv_map, ARG2(1,STR,UINT), sample_load_map, SMP_T_STR, SMP_T_SINT, (void *)PAT_MATCH_DOM },
+ { "map_end_int", sample_conv_map, ARG2(1,STR,UINT), sample_load_map, SMP_T_STR, SMP_T_SINT, (void *)PAT_MATCH_END },
+ { "map_reg_int", sample_conv_map, ARG2(1,STR,UINT), sample_load_map, SMP_T_STR, SMP_T_SINT, (void *)PAT_MATCH_REG },
+ { "map_int_int", sample_conv_map, ARG2(1,STR,UINT), sample_load_map, SMP_T_SINT, SMP_T_SINT, (void *)PAT_MATCH_INT },
+ { "map_ip_int", sample_conv_map, ARG2(1,STR,UINT), sample_load_map, SMP_T_ADDR, SMP_T_SINT, (void *)PAT_MATCH_IP },
{ "map_str_ip", sample_conv_map, ARG2(1,STR,IPV4), sample_load_map, SMP_T_STR, SMP_T_IPV4, (void *)PAT_MATCH_STR },
{ "map_beg_ip", sample_conv_map, ARG2(1,STR,IPV4), sample_load_map, SMP_T_STR, SMP_T_IPV4, (void *)PAT_MATCH_BEG },
{ "map_dom_ip", sample_conv_map, ARG2(1,STR,IPV4), sample_load_map, SMP_T_STR, SMP_T_IPV4, (void *)PAT_MATCH_DOM },
{ "map_end_ip", sample_conv_map, ARG2(1,STR,IPV4), sample_load_map, SMP_T_STR, SMP_T_IPV4, (void *)PAT_MATCH_END },
{ "map_reg_ip", sample_conv_map, ARG2(1,STR,IPV4), sample_load_map, SMP_T_STR, SMP_T_IPV4, (void *)PAT_MATCH_REG },
- { "map_int_ip", sample_conv_map, ARG2(1,STR,IPV4), sample_load_map, SMP_T_UINT, SMP_T_IPV4, (void *)PAT_MATCH_INT },
+ { "map_int_ip", sample_conv_map, ARG2(1,STR,IPV4), sample_load_map, SMP_T_SINT, SMP_T_IPV4, (void *)PAT_MATCH_INT },
{ "map_ip_ip", sample_conv_map, ARG2(1,STR,IPV4), sample_load_map, SMP_T_ADDR, SMP_T_IPV4, (void *)PAT_MATCH_IP },
{ /* END */ },
/* Just used for checking configuration compatibility */
int pat_match_types[PAT_MATCH_NUM] = {
- [PAT_MATCH_FOUND] = SMP_T_UINT,
- [PAT_MATCH_BOOL] = SMP_T_UINT,
- [PAT_MATCH_INT] = SMP_T_UINT,
+ [PAT_MATCH_FOUND] = SMP_T_SINT,
+ [PAT_MATCH_BOOL] = SMP_T_SINT,
+ [PAT_MATCH_INT] = SMP_T_SINT,
[PAT_MATCH_IP] = SMP_T_ADDR,
[PAT_MATCH_BIN] = SMP_T_BIN,
[PAT_MATCH_LEN] = SMP_T_STR,
{
const char *ptr = text;
- pattern->type = SMP_T_UINT;
+ pattern->type = SMP_T_SINT;
/* Empty string is not valid */
if (!*text)
{
const char *ptr = text;
- pattern->type = SMP_T_UINT;
+ pattern->type = SMP_T_SINT;
/* Search ':' or '-' separator. */
while (*ptr != '\0' && *ptr != ':' && *ptr != '-')
/* always return false */
struct pattern *pat_match_nothing(struct sample *smp, struct pattern_expr *expr, int fill)
{
- if (smp->data.uint) {
+ if (smp->data.sint) {
if (fill) {
static_pattern.smp = NULL;
static_pattern.ref = NULL;
list_for_each_entry(lst, &expr->patterns, list) {
pattern = &lst->pat;
- if ((!pattern->val.range.min_set || pattern->val.range.min <= smp->data.uint) &&
- (!pattern->val.range.max_set || smp->data.uint <= pattern->val.range.max))
+ if ((!pattern->val.range.min_set || pattern->val.range.min <= smp->data.sint) &&
+ (!pattern->val.range.max_set || smp->data.sint <= pattern->val.range.max))
return pattern;
}
return NULL;
static_pattern.smp = NULL;
static_pattern.ref = NULL;
static_pattern.sflags = 0;
- static_pattern.type = SMP_T_UINT;
+ static_pattern.type = SMP_T_SINT;
static_pattern.val.i = 1;
}
return &static_pattern;
return 0;
}
smp->type = SMP_T_BOOL;
- smp->data.uint = 1;
+ smp->data.sint = 1;
return 1;
}
if (!chn->buf)
return 0;
- smp->type = SMP_T_UINT;
- smp->data.uint = chn->buf->i;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = chn->buf->i;
smp->flags = SMP_F_VOLATILE | SMP_F_MAY_CHANGE;
return 1;
}
/* Elliptic curves extension */
if (ext_type == 10) {
smp->type = SMP_T_BOOL;
- smp->data.uint = 1;
+ smp->data.sint = 1;
smp->flags = SMP_F_VOLATILE;
return 1;
}
goto not_ssl_hello;
}
- smp->type = SMP_T_UINT;
- smp->data.uint = hs_type;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = hs_type;
smp->flags = SMP_F_VOLATILE;
return 1;
/* OK that's enough. We have at least the whole message, and we have
* the protocol version.
*/
- smp->type = SMP_T_UINT;
- smp->data.uint = version;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = version;
smp->flags = SMP_F_VOLATILE;
return 1;
return 0;
smp->flags = SMP_F_VOLATILE;
- smp->type = SMP_T_UINT;
- smp->data.uint = ret;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = ret;
return 1;
}
*/
static struct sample_fetch_kw_list smp_kws = {ILH, {
{ "payload", smp_fetch_payload, ARG2(2,UINT,UINT), NULL, SMP_T_BIN, SMP_USE_L6REQ|SMP_USE_L6RES },
- { "payload_lv", smp_fetch_payload_lv, ARG3(2,UINT,UINT,SINT), val_payload_lv, SMP_T_BIN, SMP_USE_L6REQ|SMP_USE_L6RES },
+ { "payload_lv", smp_fetch_payload_lv, ARG3(2,UINT,UINT,UINT), val_payload_lv, SMP_T_BIN, SMP_USE_L6REQ|SMP_USE_L6RES },
{ "rdp_cookie", smp_fetch_rdp_cookie, ARG1(0,STR), NULL, SMP_T_STR, SMP_USE_L6REQ },
- { "rdp_cookie_cnt", smp_fetch_rdp_cookie_cnt, ARG1(0,STR), NULL, SMP_T_UINT, SMP_USE_L6REQ },
- { "rep_ssl_hello_type", smp_fetch_ssl_hello_type, 0, NULL, SMP_T_UINT, SMP_USE_L6RES },
- { "req_len", smp_fetch_len, 0, NULL, SMP_T_UINT, SMP_USE_L6REQ },
- { "req_ssl_hello_type", smp_fetch_ssl_hello_type, 0, NULL, SMP_T_UINT, SMP_USE_L6REQ },
+ { "rdp_cookie_cnt", smp_fetch_rdp_cookie_cnt, ARG1(0,STR), NULL, SMP_T_SINT, SMP_USE_L6REQ },
+ { "rep_ssl_hello_type", smp_fetch_ssl_hello_type, 0, NULL, SMP_T_SINT, SMP_USE_L6RES },
+ { "req_len", smp_fetch_len, 0, NULL, SMP_T_SINT, SMP_USE_L6REQ },
+ { "req_ssl_hello_type", smp_fetch_ssl_hello_type, 0, NULL, SMP_T_SINT, SMP_USE_L6REQ },
{ "req_ssl_sni", smp_fetch_ssl_hello_sni, 0, NULL, SMP_T_STR, SMP_USE_L6REQ },
- { "req_ssl_ver", smp_fetch_req_ssl_ver, 0, NULL, SMP_T_UINT, SMP_USE_L6REQ },
+ { "req_ssl_ver", smp_fetch_req_ssl_ver, 0, NULL, SMP_T_SINT, SMP_USE_L6REQ },
- { "req.len", smp_fetch_len, 0, NULL, SMP_T_UINT, SMP_USE_L6REQ },
+ { "req.len", smp_fetch_len, 0, NULL, SMP_T_SINT, SMP_USE_L6REQ },
{ "req.payload", smp_fetch_payload, ARG2(2,UINT,UINT), NULL, SMP_T_BIN, SMP_USE_L6REQ },
- { "req.payload_lv", smp_fetch_payload_lv, ARG3(2,UINT,UINT,SINT), val_payload_lv, SMP_T_BIN, SMP_USE_L6REQ },
+ { "req.payload_lv", smp_fetch_payload_lv, ARG3(2,UINT,UINT,UINT), val_payload_lv, SMP_T_BIN, SMP_USE_L6REQ },
{ "req.rdp_cookie", smp_fetch_rdp_cookie, ARG1(0,STR), NULL, SMP_T_STR, SMP_USE_L6REQ },
- { "req.rdp_cookie_cnt", smp_fetch_rdp_cookie_cnt, ARG1(0,STR), NULL, SMP_T_UINT, SMP_USE_L6REQ },
+ { "req.rdp_cookie_cnt", smp_fetch_rdp_cookie_cnt, ARG1(0,STR), NULL, SMP_T_SINT, SMP_USE_L6REQ },
{ "req.ssl_ec_ext", smp_fetch_req_ssl_ec_ext, 0, NULL, SMP_T_BOOL, SMP_USE_L6REQ },
- { "req.ssl_hello_type", smp_fetch_ssl_hello_type, 0, NULL, SMP_T_UINT, SMP_USE_L6REQ },
+ { "req.ssl_hello_type", smp_fetch_ssl_hello_type, 0, NULL, SMP_T_SINT, SMP_USE_L6REQ },
{ "req.ssl_sni", smp_fetch_ssl_hello_sni, 0, NULL, SMP_T_STR, SMP_USE_L6REQ },
- { "req.ssl_ver", smp_fetch_req_ssl_ver, 0, NULL, SMP_T_UINT, SMP_USE_L6REQ },
- { "res.len", smp_fetch_len, 0, NULL, SMP_T_UINT, SMP_USE_L6RES },
+ { "req.ssl_ver", smp_fetch_req_ssl_ver, 0, NULL, SMP_T_SINT, SMP_USE_L6REQ },
+ { "res.len", smp_fetch_len, 0, NULL, SMP_T_SINT, SMP_USE_L6RES },
{ "res.payload", smp_fetch_payload, ARG2(2,UINT,UINT), NULL, SMP_T_BIN, SMP_USE_L6RES },
{ "res.payload_lv", smp_fetch_payload_lv, ARG3(2,UINT,UINT,SINT), val_payload_lv, SMP_T_BIN, SMP_USE_L6RES },
- { "res.ssl_hello_type", smp_fetch_ssl_hello_type, 0, NULL, SMP_T_UINT, SMP_USE_L6RES },
+ { "res.ssl_hello_type", smp_fetch_ssl_hello_type, 0, NULL, SMP_T_SINT, SMP_USE_L6RES },
{ "wait_end", smp_fetch_wait_end, 0, NULL, SMP_T_BOOL, SMP_USE_INTRN },
{ /* END */ },
}};
if (unlikely(s->req.buf->i + s->req.buf->p >
s->req.buf->data + s->req.buf->size - global.tune.maxrewrite)) {
msg->msg_state = HTTP_MSG_ERROR;
- smp->data.uint = 1;
+ smp->data.sint = 1;
return 1;
}
}
/* everything's OK */
- smp->data.uint = 1;
+ smp->data.sint = 1;
return 1;
}
len = txn->rsp.sl.st.c_l;
ptr = txn->rsp.chn->buf->p + txn->rsp.sl.st.c;
- smp->type = SMP_T_UINT;
- smp->data.uint = __strl2ui(ptr, len);
+ smp->type = SMP_T_SINT;
+ smp->data.sint = __strl2ui(ptr, len);
smp->flags = SMP_F_VOL_1ST;
return 1;
}
else
msg = &txn->rsp;
- smp->type = SMP_T_UINT;
- smp->data.uint = http_body_bytes(msg);
+ smp->type = SMP_T_SINT;
+ smp->data.sint = http_body_bytes(msg);
smp->flags = SMP_F_VOL_TEST;
return 1;
else
msg = &txn->rsp;
- smp->type = SMP_T_UINT;
- smp->data.uint = msg->body_len;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = msg->body_len;
smp->flags = SMP_F_VOL_TEST;
return 1;
if (((struct sockaddr_in *)&addr)->sin_family != AF_INET)
return 0;
- smp->type = SMP_T_UINT;
- smp->data.uint = ntohs(((struct sockaddr_in *)&addr)->sin_port);
+ smp->type = SMP_T_SINT;
+ smp->data.sint = ntohs(((struct sockaddr_in *)&addr)->sin_port);
smp->flags = 0;
return 1;
}
while (http_find_full_header2(name, len, msg->chn->buf->p, idx, &ctx))
cnt++;
- smp->type = SMP_T_UINT;
- smp->data.uint = cnt;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = cnt;
smp->flags = SMP_F_VOL_HDR;
return 1;
}
while (http_find_header2(name, len, msg->chn->buf->p, idx, &ctx))
cnt++;
- smp->type = SMP_T_UINT;
- smp->data.uint = cnt;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = cnt;
smp->flags = SMP_F_VOL_HDR;
return 1;
}
int ret = smp_fetch_hdr(args, smp, kw, private);
if (ret > 0) {
- smp->type = SMP_T_UINT;
- smp->data.uint = strl2ic(smp->data.str.str, smp->data.str.len);
+ smp->type = SMP_T_SINT;
+ smp->data.sint = strl2ic(smp->data.str.str, smp->data.str.len);
}
return ret;
}
hash = full_hash(hash);
- smp->type = SMP_T_UINT;
- smp->data.uint = hash;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = hash;
smp->flags = SMP_F_VOL_1ST;
return 1;
}
return 0;
temp = get_trash_chunk();
- *(unsigned int *)temp->str = htonl(smp->data.uint);
+ *(unsigned int *)temp->str = htonl(smp->data.sint);
temp->len += sizeof(unsigned int);
switch (cli_conn->addr.from.ss_family) {
CHECK_HTTP_MESSAGE_FIRST_PERM();
smp->type = SMP_T_BOOL;
- smp->data.uint = 1;
+ smp->data.sint = 1;
return 1;
}
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);
+ smp->data.sint = !(smp->strm->txn->flags & TX_NOT_FIRST);
return 1;
}
return 0;
smp->type = SMP_T_BOOL;
- smp->data.uint = check_user(args->data.usr, smp->strm->txn->auth.user,
+ smp->data.sint = check_user(args->data.usr, smp->strm->txn->auth.user,
smp->strm->txn->auth.pass);
return 1;
}
}
}
- smp->type = SMP_T_UINT;
- smp->data.uint = cnt;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = cnt;
smp->flags |= SMP_F_VOL_HDR;
return 1;
}
int ret = smp_fetch_cookie(args, smp, kw, private);
if (ret > 0) {
- smp->type = SMP_T_UINT;
- smp->data.uint = strl2ic(smp->data.str.str, smp->data.str.len);
+ smp->type = SMP_T_SINT;
+ smp->data.sint = strl2ic(smp->data.str.str, smp->data.str.len);
}
return ret;
int ret = smp_fetch_url_param(args, smp, kw, private);
if (ret > 0) {
- smp->type = SMP_T_UINT;
- smp->data.uint = strl2ic(smp->data.str.str, smp->data.str.len);
+ smp->type = SMP_T_SINT;
+ smp->data.sint = strl2ic(smp->data.str.str, smp->data.str.len);
}
return ret;
}
hash = full_hash(hash);
- smp->type = SMP_T_UINT;
- smp->data.uint = hash;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = hash;
smp->flags = SMP_F_VOL_1ST;
return 1;
}
{
struct chunk *temp;
struct connection *cli_conn = objt_conn(smp->sess->origin);
+ unsigned int hash;
if (!smp_fetch_url32(args, smp, kw, private))
return 0;
+ /* The returned hash is a 32 bytes integer. */
+ hash = smp->data.sint;
+
temp = get_trash_chunk();
- memcpy(temp->str + temp->len, &smp->data.uint, sizeof(smp->data.uint));
- temp->len += sizeof(smp->data.uint);
+ memcpy(temp->str + temp->len, &hash, sizeof(hash));
+ temp->len += sizeof(hash);
switch (cli_conn->addr.from.ss_family) {
case AF_INET:
const char mon[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
struct chunk *temp;
struct tm *tm;
- time_t curr_date = smp->data.uint;
+ time_t curr_date = smp->data.sint;
/* add offset */
if (args && (args[0].type == ARGT_SINT || args[0].type == ARGT_UINT))
/* Note: must not be declared <const> as its list will be overwritten */
static struct sample_fetch_kw_list sample_fetch_keywords = {ILH, {
{ "base", smp_fetch_base, 0, NULL, SMP_T_STR, SMP_USE_HRQHV },
- { "base32", smp_fetch_base32, 0, NULL, SMP_T_UINT, SMP_USE_HRQHV },
+ { "base32", smp_fetch_base32, 0, NULL, SMP_T_SINT, SMP_USE_HRQHV },
{ "base32+src", smp_fetch_base32_src, 0, NULL, SMP_T_BIN, SMP_USE_HRQHV },
/* capture are allocated and are permanent in the stream */
*/
{ "cook", smp_fetch_cookie, ARG1(0,STR), NULL, SMP_T_STR, SMP_USE_HRQHV },
{ "cookie", smp_fetch_cookie, ARG1(0,STR), NULL, SMP_T_STR, SMP_USE_HRQHV|SMP_USE_HRSHV },
- { "cook_cnt", smp_fetch_cookie_cnt, ARG1(0,STR), NULL, SMP_T_UINT, SMP_USE_HRQHV },
- { "cook_val", smp_fetch_cookie_val, ARG1(0,STR), NULL, SMP_T_UINT, SMP_USE_HRQHV },
+ { "cook_cnt", smp_fetch_cookie_cnt, ARG1(0,STR), NULL, SMP_T_SINT, SMP_USE_HRQHV },
+ { "cook_val", smp_fetch_cookie_val, ARG1(0,STR), NULL, SMP_T_SINT, SMP_USE_HRQHV },
/* hdr is valid in both directions (eg: for "stick ...") but hdr_* are
* only here to match the ACL's name, are request-only and are used for
* ACL compatibility only.
*/
{ "hdr", smp_fetch_hdr, ARG2(0,STR,SINT), val_hdr, SMP_T_STR, SMP_USE_HRQHV|SMP_USE_HRSHV },
- { "hdr_cnt", smp_fetch_hdr_cnt, ARG1(0,STR), NULL, SMP_T_UINT, SMP_USE_HRQHV },
+ { "hdr_cnt", smp_fetch_hdr_cnt, ARG1(0,STR), NULL, SMP_T_SINT, SMP_USE_HRQHV },
{ "hdr_ip", smp_fetch_hdr_ip, ARG2(0,STR,SINT), val_hdr, SMP_T_IPV4, SMP_USE_HRQHV },
- { "hdr_val", smp_fetch_hdr_val, ARG2(0,STR,SINT), val_hdr, SMP_T_UINT, SMP_USE_HRQHV },
+ { "hdr_val", smp_fetch_hdr_val, ARG2(0,STR,SINT), val_hdr, SMP_T_SINT, SMP_USE_HRQHV },
{ "http_auth", smp_fetch_http_auth, ARG1(1,USR), NULL, SMP_T_BOOL, SMP_USE_HRQHV },
{ "http_auth_group", smp_fetch_http_auth_grp, ARG1(1,USR), NULL, SMP_T_STR, SMP_USE_HRQHV },
{ "req_ver", smp_fetch_rqver, 0, NULL, SMP_T_STR, SMP_USE_HRQHV },
{ "req.body", smp_fetch_body, 0, NULL, SMP_T_BIN, SMP_USE_HRQHV },
- { "req.body_len", smp_fetch_body_len, 0, NULL, SMP_T_UINT, SMP_USE_HRQHV },
- { "req.body_size", smp_fetch_body_size, 0, NULL, SMP_T_UINT, SMP_USE_HRQHV },
+ { "req.body_len", smp_fetch_body_len, 0, NULL, SMP_T_SINT, SMP_USE_HRQHV },
+ { "req.body_size", smp_fetch_body_size, 0, NULL, SMP_T_SINT, SMP_USE_HRQHV },
{ "req.body_param", smp_fetch_body_param, ARG1(0,STR), NULL, SMP_T_BIN, SMP_USE_HRQHV },
/* HTTP version on the response path */
/* explicit req.{cook,hdr} are used to force the fetch direction to be request-only */
{ "req.cook", smp_fetch_cookie, ARG1(0,STR), NULL, SMP_T_STR, SMP_USE_HRQHV },
- { "req.cook_cnt", smp_fetch_cookie_cnt, ARG1(0,STR), NULL, SMP_T_UINT, SMP_USE_HRQHV },
- { "req.cook_val", smp_fetch_cookie_val, ARG1(0,STR), NULL, SMP_T_UINT, SMP_USE_HRQHV },
+ { "req.cook_cnt", smp_fetch_cookie_cnt, ARG1(0,STR), NULL, SMP_T_SINT, SMP_USE_HRQHV },
+ { "req.cook_val", smp_fetch_cookie_val, ARG1(0,STR), NULL, SMP_T_SINT, SMP_USE_HRQHV },
{ "req.fhdr", smp_fetch_fhdr, ARG2(0,STR,SINT), val_hdr, SMP_T_STR, SMP_USE_HRQHV },
- { "req.fhdr_cnt", smp_fetch_fhdr_cnt, ARG1(0,STR), NULL, SMP_T_UINT, SMP_USE_HRQHV },
+ { "req.fhdr_cnt", smp_fetch_fhdr_cnt, ARG1(0,STR), NULL, SMP_T_SINT, SMP_USE_HRQHV },
{ "req.hdr", smp_fetch_hdr, ARG2(0,STR,SINT), val_hdr, SMP_T_STR, SMP_USE_HRQHV },
- { "req.hdr_cnt", smp_fetch_hdr_cnt, ARG1(0,STR), NULL, SMP_T_UINT, SMP_USE_HRQHV },
+ { "req.hdr_cnt", smp_fetch_hdr_cnt, ARG1(0,STR), NULL, SMP_T_SINT, SMP_USE_HRQHV },
{ "req.hdr_ip", smp_fetch_hdr_ip, ARG2(0,STR,SINT), val_hdr, SMP_T_IPV4, SMP_USE_HRQHV },
{ "req.hdr_names", smp_fetch_hdr_names, ARG1(0,STR), NULL, SMP_T_STR, SMP_USE_HRQHV },
- { "req.hdr_val", smp_fetch_hdr_val, ARG2(0,STR,SINT), val_hdr, SMP_T_UINT, SMP_USE_HRQHV },
+ { "req.hdr_val", smp_fetch_hdr_val, ARG2(0,STR,SINT), val_hdr, SMP_T_SINT, SMP_USE_HRQHV },
/* explicit req.{cook,hdr} are used to force the fetch direction to be response-only */
{ "res.cook", smp_fetch_cookie, ARG1(0,STR), NULL, SMP_T_STR, SMP_USE_HRSHV },
- { "res.cook_cnt", smp_fetch_cookie_cnt, ARG1(0,STR), NULL, SMP_T_UINT, SMP_USE_HRSHV },
- { "res.cook_val", smp_fetch_cookie_val, ARG1(0,STR), NULL, SMP_T_UINT, SMP_USE_HRSHV },
+ { "res.cook_cnt", smp_fetch_cookie_cnt, ARG1(0,STR), NULL, SMP_T_SINT, SMP_USE_HRSHV },
+ { "res.cook_val", smp_fetch_cookie_val, ARG1(0,STR), NULL, SMP_T_SINT, SMP_USE_HRSHV },
{ "res.fhdr", smp_fetch_fhdr, ARG2(0,STR,SINT), val_hdr, SMP_T_STR, SMP_USE_HRSHV },
- { "res.fhdr_cnt", smp_fetch_fhdr_cnt, ARG1(0,STR), NULL, SMP_T_UINT, SMP_USE_HRSHV },
+ { "res.fhdr_cnt", smp_fetch_fhdr_cnt, ARG1(0,STR), NULL, SMP_T_SINT, SMP_USE_HRSHV },
{ "res.hdr", smp_fetch_hdr, ARG2(0,STR,SINT), val_hdr, SMP_T_STR, SMP_USE_HRSHV },
- { "res.hdr_cnt", smp_fetch_hdr_cnt, ARG1(0,STR), NULL, SMP_T_UINT, SMP_USE_HRSHV },
+ { "res.hdr_cnt", smp_fetch_hdr_cnt, ARG1(0,STR), NULL, SMP_T_SINT, SMP_USE_HRSHV },
{ "res.hdr_ip", smp_fetch_hdr_ip, ARG2(0,STR,SINT), val_hdr, SMP_T_IPV4, SMP_USE_HRSHV },
{ "res.hdr_names", smp_fetch_hdr_names, ARG1(0,STR), NULL, SMP_T_STR, SMP_USE_HRSHV },
- { "res.hdr_val", smp_fetch_hdr_val, ARG2(0,STR,SINT), val_hdr, SMP_T_UINT, SMP_USE_HRSHV },
+ { "res.hdr_val", smp_fetch_hdr_val, ARG2(0,STR,SINT), val_hdr, SMP_T_SINT, SMP_USE_HRSHV },
/* scook is valid only on the response and is used for ACL compatibility */
{ "scook", smp_fetch_cookie, ARG1(0,STR), NULL, SMP_T_STR, SMP_USE_HRSHV },
- { "scook_cnt", smp_fetch_cookie_cnt, ARG1(0,STR), NULL, SMP_T_UINT, SMP_USE_HRSHV },
- { "scook_val", smp_fetch_cookie_val, ARG1(0,STR), NULL, SMP_T_UINT, SMP_USE_HRSHV },
+ { "scook_cnt", smp_fetch_cookie_cnt, ARG1(0,STR), NULL, SMP_T_SINT, SMP_USE_HRSHV },
+ { "scook_val", smp_fetch_cookie_val, ARG1(0,STR), NULL, SMP_T_SINT, SMP_USE_HRSHV },
{ "set-cookie", smp_fetch_cookie, ARG1(0,STR), NULL, SMP_T_STR, SMP_USE_HRSHV }, /* deprecated */
/* shdr is valid only on the response and is used for ACL compatibility */
{ "shdr", smp_fetch_hdr, ARG2(0,STR,SINT), val_hdr, SMP_T_STR, SMP_USE_HRSHV },
- { "shdr_cnt", smp_fetch_hdr_cnt, ARG1(0,STR), NULL, SMP_T_UINT, SMP_USE_HRSHV },
+ { "shdr_cnt", smp_fetch_hdr_cnt, ARG1(0,STR), NULL, SMP_T_SINT, SMP_USE_HRSHV },
{ "shdr_ip", smp_fetch_hdr_ip, ARG2(0,STR,SINT), val_hdr, SMP_T_IPV4, SMP_USE_HRSHV },
- { "shdr_val", smp_fetch_hdr_val, ARG2(0,STR,SINT), val_hdr, SMP_T_UINT, SMP_USE_HRSHV },
+ { "shdr_val", smp_fetch_hdr_val, ARG2(0,STR,SINT), val_hdr, SMP_T_SINT, SMP_USE_HRSHV },
- { "status", smp_fetch_stcode, 0, NULL, SMP_T_UINT, SMP_USE_HRSHP },
+ { "status", smp_fetch_stcode, 0, NULL, SMP_T_SINT, SMP_USE_HRSHP },
{ "url", smp_fetch_url, 0, NULL, SMP_T_STR, SMP_USE_HRQHV },
- { "url32", smp_fetch_url32, 0, NULL, SMP_T_UINT, SMP_USE_HRQHV },
+ { "url32", smp_fetch_url32, 0, NULL, SMP_T_SINT, SMP_USE_HRQHV },
{ "url32+src", smp_fetch_url32_src, 0, NULL, SMP_T_BIN, SMP_USE_HRQHV },
{ "url_ip", smp_fetch_url_ip, 0, NULL, SMP_T_IPV4, SMP_USE_HRQHV },
- { "url_port", smp_fetch_url_port, 0, NULL, SMP_T_UINT, SMP_USE_HRQHV },
+ { "url_port", smp_fetch_url_port, 0, NULL, SMP_T_SINT, SMP_USE_HRQHV },
{ "url_param", smp_fetch_url_param, ARG2(0,STR,STR), NULL, SMP_T_STR, SMP_USE_HRQHV },
{ "urlp" , smp_fetch_url_param, ARG2(0,STR,STR), NULL, SMP_T_STR, SMP_USE_HRQHV },
- { "urlp_val", smp_fetch_url_param_val, ARG2(0,STR,STR), NULL, SMP_T_UINT, SMP_USE_HRQHV },
+ { "urlp_val", smp_fetch_url_param_val, ARG2(0,STR,STR), NULL, SMP_T_SINT, SMP_USE_HRQHV },
{ /* END */ },
}};
/************************************************************************/
/* Note: must not be declared <const> as its list will be overwritten */
static struct sample_conv_kw_list sample_conv_kws = {ILH, {
- { "http_date", sample_conv_http_date, ARG1(0,SINT), NULL, SMP_T_UINT, SMP_T_STR},
+ { "http_date", sample_conv_http_date, ARG1(0,SINT), NULL, SMP_T_SINT, SMP_T_STR},
{ "language", sample_conv_q_prefered, ARG2(1,STR,STR), NULL, SMP_T_STR, SMP_T_STR},
{ "capture-req", smp_conv_req_capture, ARG1(1,UINT), NULL, SMP_T_STR, SMP_T_STR},
{ "capture-res", smp_conv_res_capture, ARG1(1,UINT), NULL, SMP_T_STR, SMP_T_STR},
if (!cli_conn)
return 0;
- smp->type = SMP_T_UINT;
- if (!(smp->data.uint = get_host_port(&cli_conn->addr.from)))
+ smp->type = SMP_T_SINT;
+ if (!(smp->data.sint = get_host_port(&cli_conn->addr.from)))
return 0;
smp->flags = 0;
conn_get_to_addr(cli_conn);
- smp->type = SMP_T_UINT;
- if (!(smp->data.uint = get_host_port(&cli_conn->addr.to)))
+ smp->type = SMP_T_SINT;
+ if (!(smp->data.sint = get_host_port(&cli_conn->addr.to)))
return 0;
smp->flags = 0;
*/
static struct sample_fetch_kw_list sample_fetch_keywords = {ILH, {
{ "dst", smp_fetch_dst, 0, NULL, SMP_T_IPV4, SMP_USE_L4CLI },
- { "dst_port", smp_fetch_dport, 0, NULL, SMP_T_UINT, SMP_USE_L4CLI },
+ { "dst_port", smp_fetch_dport, 0, NULL, SMP_T_SINT, SMP_USE_L4CLI },
{ "src", smp_fetch_src, 0, NULL, SMP_T_IPV4, SMP_USE_L4CLI },
- { "src_port", smp_fetch_sport, 0, NULL, SMP_T_UINT, SMP_USE_L4CLI },
+ { "src_port", smp_fetch_sport, 0, NULL, SMP_T_SINT, SMP_USE_L4CLI },
{ /* END */ },
}};
const char *smp_to_type[SMP_TYPES] = {
[SMP_T_ANY] = "any",
[SMP_T_BOOL] = "bool",
- [SMP_T_UINT] = "uint",
[SMP_T_SINT] = "sint",
[SMP_T_ADDR] = "addr",
[SMP_T_IPV4] = "ipv4",
static int c_ip2int(struct sample *smp)
{
- smp->data.uint = ntohl(smp->data.ipv4.s_addr);
- smp->type = SMP_T_UINT;
+ smp->data.sint = ntohl(smp->data.ipv4.s_addr);
+ smp->type = SMP_T_SINT;
return 1;
}
static int c_int2ip(struct sample *smp)
{
- smp->data.ipv4.s_addr = htonl(smp->data.uint);
+ smp->data.ipv4.s_addr = htonl((unsigned int)smp->data.sint);
smp->type = SMP_T_IPV4;
return 1;
}
struct chunk *trash = get_trash_chunk();
char *pos;
- pos = ultoa_r(smp->data.uint, trash->str, trash->size);
- if (!pos)
- return 0;
-
- trash->size = trash->size - (pos - trash->str);
- trash->str = pos;
- trash->len = strlen(pos);
- smp->data.str = *trash;
- smp->type = SMP_T_STR;
- smp->flags &= ~SMP_F_CONST;
- return 1;
-}
-
-static int c_sint2str(struct sample *smp)
-{
- struct chunk *trash = get_trash_chunk();
- char *pos;
-
- pos = sltoa_r(smp->data.sint, trash->str, trash->size);
+ pos = lltoa_r(smp->data.sint, trash->str, trash->size);
if (!pos)
return 0;
switch (smp->type) {
case SMP_T_BOOL:
- case SMP_T_UINT:
case SMP_T_SINT:
case SMP_T_ADDR:
case SMP_T_IPV4:
static int c_str2int(struct sample *smp)
{
- int i;
- uint32_t ret = 0;
+ const char *str;
+ const char *end;
if (smp->data.str.len == 0)
return 0;
- for (i = 0; i < smp->data.str.len; i++) {
- uint32_t val = smp->data.str.str[i] - '0';
+ str = smp->data.str.str;
+ end = smp->data.str.str + smp->data.str.len;
- if (val > 9) {
- if (i == 0)
- return 0;
- break;
- }
-
- ret = ret * 10 + val;
- }
-
- smp->data.uint = ret;
- smp->type = SMP_T_UINT;
+ smp->data.sint = read_int64(&str, end);
+ smp->type = SMP_T_SINT;
smp->flags &= ~SMP_F_CONST;
return 1;
}
{
struct chunk *chk = get_trash_chunk();
- *(unsigned int *)chk->str = htonl(smp->data.uint);
- chk->len = 4;
+ *(unsigned long long int *)chk->str = htonll(smp->data.sint);
+ chk->len = 8;
smp->data.str = *chk;
smp->type = SMP_T_BIN;
/*****************************************************************/
sample_cast_fct sample_casts[SMP_TYPES][SMP_TYPES] = {
-/* to: ANY BOOL UINT SINT ADDR IPV4 IPV6 STR BIN METH */
-/* from: ANY */ { c_none, c_none, c_none, c_none, c_none, c_none, c_none, c_none, c_none, c_none, },
-/* BOOL */ { c_none, c_none, c_none, c_none, NULL, NULL, NULL, c_int2str, NULL, NULL, },
-/* UINT */ { c_none, c_none, c_none, c_none, c_int2ip, c_int2ip, NULL, c_int2str, c_int2bin, NULL, },
-/* SINT */ { c_none, c_none, c_none, c_none, c_int2ip, c_int2ip, NULL, c_sint2str, c_int2bin, NULL, },
-/* ADDR */ { c_none, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, },
-/* IPV4 */ { c_none, NULL, c_ip2int, c_ip2int, c_none, c_none, c_ip2ipv6, c_ip2str, c_addr2bin, NULL, },
-/* IPV6 */ { c_none, NULL, NULL, NULL, c_none, NULL, c_none, c_ipv62str, c_addr2bin, NULL, },
-/* STR */ { c_none, c_str2int, c_str2int, c_str2int, c_str2addr, c_str2ip, c_str2ipv6, c_none, c_none, c_str2meth, },
-/* BIN */ { c_none, NULL, NULL, NULL, NULL, NULL, NULL, c_bin2str, c_none, c_str2meth, },
-/* METH */ { c_none, NULL, NULL, NULL, NULL, NULL, NULL, c_meth2str, c_meth2str, c_none, }
+/* to: ANY BOOL SINT ADDR IPV4 IPV6 STR BIN METH */
+/* from: ANY */ { c_none, c_none, c_none, c_none, c_none, c_none, c_none, c_none, c_none, },
+/* BOOL */ { c_none, c_none, c_none, NULL, NULL, NULL, c_int2str, NULL, NULL, },
+/* SINT */ { c_none, c_none, c_none, c_int2ip, c_int2ip, NULL, c_int2str, c_int2bin, NULL, },
+/* ADDR */ { c_none, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, },
+/* IPV4 */ { c_none, NULL, c_ip2int, c_none, c_none, c_ip2ipv6, c_ip2str, c_addr2bin, NULL, },
+/* IPV6 */ { c_none, NULL, NULL, c_none, NULL, c_none, c_ipv62str, c_addr2bin, NULL, },
+/* STR */ { c_none, c_str2int, c_str2int, c_str2addr, c_str2ip, c_str2ipv6, c_none, c_none, c_str2meth, },
+/* BIN */ { c_none, NULL, NULL, NULL, NULL, NULL, c_bin2str, c_none, c_str2meth, },
+/* METH */ { c_none, NULL, NULL, NULL, NULL, NULL, c_meth2str, c_meth2str, c_none, }
};
/*
/* hashes the binary input into a 32-bit unsigned int */
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);
+ smp->data.sint = hash_djb2(smp->data.str.str, smp->data.str.len);
if (arg_p && arg_p->data.uint)
- smp->data.uint = full_hash(smp->data.uint);
- smp->type = SMP_T_UINT;
+ smp->data.sint = full_hash(smp->data.sint);
+ smp->type = SMP_T_SINT;
return 1;
}
static int sample_conv_ltime(const struct arg *args, struct sample *smp, void *private)
{
struct chunk *temp;
- time_t curr_date = smp->data.uint;
+ time_t curr_date = smp->data.sint;
struct tm *tm;
/* add offset */
/* hashes the binary input into a 32-bit unsigned int */
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);
+ smp->data.sint = hash_sdbm(smp->data.str.str, smp->data.str.len);
if (arg_p && arg_p->data.uint)
- smp->data.uint = full_hash(smp->data.uint);
- smp->type = SMP_T_UINT;
+ smp->data.sint = full_hash(smp->data.sint);
+ smp->type = SMP_T_SINT;
return 1;
}
static int sample_conv_utime(const struct arg *args, struct sample *smp, void *private)
{
struct chunk *temp;
- time_t curr_date = smp->data.uint;
+ time_t curr_date = smp->data.sint;
struct tm *tm;
/* add offset */
/* hashes the binary input into a 32-bit unsigned int */
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);
+ smp->data.sint = hash_wt6(smp->data.str.str, smp->data.str.len);
if (arg_p && arg_p->data.uint)
- smp->data.uint = full_hash(smp->data.uint);
- smp->type = SMP_T_UINT;
+ smp->data.sint = full_hash(smp->data.sint);
+ smp->type = SMP_T_SINT;
return 1;
}
/* hashes the binary input into a 32-bit unsigned int */
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);
+ smp->data.sint = hash_crc32(smp->data.str.str, smp->data.str.len);
if (arg_p && arg_p->data.uint)
- smp->data.uint = full_hash(smp->data.uint);
- smp->type = SMP_T_UINT;
+ smp->data.sint = full_hash(smp->data.sint);
+ smp->type = SMP_T_SINT;
return 1;
}
return 1;
}
-/* Takes a UINT on input, applies a binary twos complement and returns the UINT
+/* Takes a SINT on input, applies a binary twos complement and returns the SINT
* result.
*/
static int sample_conv_binary_cpl(const struct arg *arg_p, struct sample *smp, void *private)
{
- smp->data.uint = ~smp->data.uint;
+ smp->data.sint = ~smp->data.sint;
return 1;
}
-/* Takes a UINT on input, applies a binary "and" with the UINT in arg_p, and
- * returns the UINT result.
+/* Takes a SINT on input, applies a binary "and" with the UINT in arg_p, and
+ * returns the SINT result.
*/
static int sample_conv_binary_and(const struct arg *arg_p, struct sample *smp, void *private)
{
- smp->data.uint &= arg_p->data.uint;
+ smp->data.sint &= arg_p->data.uint;
return 1;
}
-/* Takes a UINT on input, applies a binary "or" with the UINT in arg_p, and
- * returns the UINT result.
+/* Takes a SINT on input, applies a binary "or" with the UINT in arg_p, and
+ * returns the SINT result.
*/
static int sample_conv_binary_or(const struct arg *arg_p, struct sample *smp, void *private)
{
- smp->data.uint |= arg_p->data.uint;
+ smp->data.sint |= arg_p->data.uint;
return 1;
}
-/* Takes a UINT on input, applies a binary "xor" with the UINT in arg_p, and
- * returns the UINT result.
+/* Takes a SINT on input, applies a binary "xor" with the UINT in arg_p, and
+ * returns the SINT result.
*/
static int sample_conv_binary_xor(const struct arg *arg_p, struct sample *smp, void *private)
{
- smp->data.uint ^= arg_p->data.uint;
+ smp->data.sint ^= arg_p->data.uint;
return 1;
}
-/* Takes a UINT on input, applies an arithmetic "add" with the UINT in arg_p,
- * and returns the UINT result.
+/* Takes a SINT on input, applies an arithmetic "add" with the UINT in arg_p,
+ * and returns the SINT result.
*/
static int sample_conv_arith_add(const struct arg *arg_p, struct sample *smp, void *private)
{
- smp->data.uint += arg_p->data.uint;
+ smp->data.sint += arg_p->data.uint;
return 1;
}
-/* Takes a UINT on input, applies an arithmetic "sub" with the UINT in arg_p,
- * and returns the UINT result.
+/* Takes a SINT on input, applies an arithmetic "sub" with the UINT in arg_p,
+ * and returns the SINT result.
*/
static int sample_conv_arith_sub(const struct arg *arg_p,
struct sample *smp, void *private)
{
- smp->data.uint -= arg_p->data.uint;
+ smp->data.sint -= arg_p->data.uint;
return 1;
}
-/* Takes a UINT on input, applies an arithmetic "mul" with the UINT in arg_p,
- * and returns the UINT result.
+/* Takes a SINT on input, applies an arithmetic "mul" with the UINT in arg_p,
+ * and returns the SINT result.
*/
static int sample_conv_arith_mul(const struct arg *arg_p,
struct sample *smp, void *private)
{
- smp->data.uint *= arg_p->data.uint;
+ smp->data.sint *= arg_p->data.uint;
return 1;
}
-/* Takes a UINT on input, applies an arithmetic "div" with the UINT in arg_p,
- * and returns the UINT result. If arg_p makes the result overflow, then the
+/* Takes a SINT on input, applies an arithmetic "div" with the SINT in arg_p,
+ * and returns the SINT 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, void *private)
{
if (arg_p->data.uint)
- smp->data.uint /= arg_p->data.uint;
+ smp->data.sint /= arg_p->data.uint;
else
- smp->data.uint = ~0;
+ smp->data.sint = ~0;
return 1;
}
-/* Takes a UINT on input, applies an arithmetic "mod" with the UINT in arg_p,
- * and returns the UINT result. If arg_p makes the result overflow, then zero
+/* Takes a SINT on input, applies an arithmetic "mod" with the SINT in arg_p,
+ * and returns the SINT 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, void *private)
{
if (arg_p->data.uint)
- smp->data.uint %= arg_p->data.uint;
+ smp->data.sint %= arg_p->data.uint;
else
- smp->data.uint = 0;
+ smp->data.sint = 0;
return 1;
}
-/* Takes an UINT on input, applies an arithmetic "neg" and returns the UINT
+/* Takes an SINT on input, applies an arithmetic "neg" and returns the SINT
* result.
*/
static int sample_conv_arith_neg(const struct arg *arg_p,
struct sample *smp, void *private)
{
- smp->data.uint = -smp->data.uint;
+ smp->data.sint = -smp->data.sint;
return 1;
}
-/* Takes a UINT on input, returns true is the value is non-null, otherwise
+/* Takes a SINT 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, void *private)
{
- smp->data.uint = !!smp->data.uint;
+ smp->data.sint = !!smp->data.sint;
smp->type = SMP_T_BOOL;
return 1;
}
-/* Takes a UINT on input, returns false is the value is non-null, otherwise
+/* Takes a SINT 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, void *private)
{
- smp->data.uint = !smp->data.uint;
+ smp->data.sint = !smp->data.sint;
smp->type = SMP_T_BOOL;
return 1;
}
-/* Takes a UINT on input, returns true is the value is odd, otherwise false.
+/* Takes a SINT 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, void *private)
{
- smp->data.uint = smp->data.uint & 1;
+ smp->data.sint = smp->data.sint & 1;
smp->type = SMP_T_BOOL;
return 1;
}
-/* Takes a UINT on input, returns true is the value is even, otherwise false.
+/* Takes a SINT 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, void *private)
{
- smp->data.uint = !(smp->data.uint & 1);
+ smp->data.sint = !(smp->data.sint & 1);
smp->type = SMP_T_BOOL;
return 1;
}
smp_fetch_true(const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->type = SMP_T_BOOL;
- smp->data.uint = 1;
+ smp->data.sint = 1;
return 1;
}
smp_fetch_false(const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->type = SMP_T_BOOL;
- smp->data.uint = 0;
+ smp->data.sint = 0;
return 1;
}
static int
smp_fetch_date(const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- smp->data.uint = date.tv_sec;
+ smp->data.sint = date.tv_sec;
/* add offset */
if (args && (args[0].type == ARGT_SINT || args[0].type == ARGT_UINT))
- smp->data.uint += args[0].data.sint;
+ smp->data.sint += args[0].data.sint;
- smp->type = SMP_T_UINT;
+ smp->type = SMP_T_SINT;
smp->flags |= SMP_F_VOL_TEST | SMP_F_MAY_CHANGE;
return 1;
}
static int
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;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = global.nbproc;
return 1;
}
static int
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;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = relative_pid;
return 1;
}
static int
smp_fetch_rand(const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- smp->data.uint = random();
+ smp->data.sint = random();
/* reduce if needed. Don't do a modulo, use all bits! */
if (args && args[0].type == ARGT_UINT)
- smp->data.uint = ((uint64_t)smp->data.uint * args[0].data.uint) / ((u64)RAND_MAX+1);
+ smp->data.sint = (smp->data.sint * args[0].data.uint) / ((u64)RAND_MAX+1);
- smp->type = SMP_T_UINT;
+ smp->type = SMP_T_SINT;
smp->flags |= SMP_F_VOL_TEST | SMP_F_MAY_CHANGE;
return 1;
}
smp_fetch_stopping(const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->type = SMP_T_BOOL;
- smp->data.uint = stopping;
+ smp->data.sint = stopping;
return 1;
}
static int smp_fetch_const_bool(const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->type = SMP_T_BOOL;
- smp->data.uint = args[0].data.uint;
- return 1;
-}
-
-static int smp_fetch_const_uint(const struct arg *args, struct sample *smp, const char *kw, void *private)
-{
- smp->type = SMP_T_UINT;
- smp->data.uint = args[0].data.uint;
+ smp->data.sint = args[0].data.uint;
return 1;
}
-static int smp_fetch_const_sint(const struct arg *args, struct sample *smp, const char *kw, void *private)
+static int smp_fetch_const_int(const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->type = SMP_T_SINT;
smp->data.sint = args[0].data.sint;
{ "always_false", smp_fetch_false, 0, NULL, SMP_T_BOOL, SMP_USE_INTRN },
{ "always_true", smp_fetch_true, 0, NULL, SMP_T_BOOL, SMP_USE_INTRN },
{ "env", smp_fetch_env, ARG1(1,STR), NULL, SMP_T_STR, SMP_USE_INTRN },
- { "date", smp_fetch_date, ARG1(0,SINT), NULL, SMP_T_UINT, SMP_USE_INTRN },
- { "nbproc", smp_fetch_nbproc,0, NULL, SMP_T_UINT, SMP_USE_INTRN },
- { "proc", smp_fetch_proc, 0, NULL, SMP_T_UINT, SMP_USE_INTRN },
- { "rand", smp_fetch_rand, ARG1(0,UINT), NULL, SMP_T_UINT, SMP_USE_INTRN },
+ { "date", smp_fetch_date, ARG1(0,SINT), NULL, SMP_T_SINT, SMP_USE_INTRN },
+ { "nbproc", smp_fetch_nbproc,0, NULL, SMP_T_SINT, SMP_USE_INTRN },
+ { "proc", smp_fetch_proc, 0, NULL, SMP_T_SINT, SMP_USE_INTRN },
+ { "rand", smp_fetch_rand, ARG1(0,UINT), NULL, SMP_T_SINT, SMP_USE_INTRN },
{ "stopping", smp_fetch_stopping, 0, NULL, SMP_T_BOOL, SMP_USE_INTRN },
{ "str", smp_fetch_const_str, ARG1(1,STR), NULL , SMP_T_STR, SMP_USE_INTRN },
{ "bool", smp_fetch_const_bool, ARG1(1,STR), smp_check_const_bool, SMP_T_BOOL, SMP_USE_INTRN },
- { "uint", smp_fetch_const_uint, ARG1(1,UINT), NULL , SMP_T_UINT, SMP_USE_INTRN },
- { "sint", smp_fetch_const_sint, ARG1(1,SINT), NULL , SMP_T_SINT, SMP_USE_INTRN },
+ { "int", smp_fetch_const_int, ARG1(1,SINT), NULL , SMP_T_SINT, SMP_USE_INTRN },
{ "ipv4", smp_fetch_const_ipv4, ARG1(1,IPV4), NULL , SMP_T_IPV4, SMP_USE_INTRN },
{ "ipv6", smp_fetch_const_ipv6, ARG1(1,IPV6), NULL , SMP_T_IPV6, SMP_USE_INTRN },
{ "bin", smp_fetch_const_bin, ARG1(1,STR), smp_check_const_bin , SMP_T_BIN, SMP_USE_INTRN },
{ "lower", sample_conv_str2lower, 0, NULL, SMP_T_STR, SMP_T_STR },
{ "hex", sample_conv_bin2hex, 0, NULL, SMP_T_BIN, SMP_T_STR },
{ "ipmask", sample_conv_ipmask, ARG1(1,MSK4), NULL, SMP_T_IPV4, SMP_T_IPV4 },
- { "ltime", sample_conv_ltime, ARG2(1,STR,SINT), NULL, SMP_T_UINT, SMP_T_STR },
- { "utime", sample_conv_utime, ARG2(1,STR,SINT), NULL, SMP_T_UINT, SMP_T_STR },
- { "crc32", sample_conv_crc32, ARG1(0,UINT), NULL, SMP_T_BIN, SMP_T_UINT },
- { "djb2", sample_conv_djb2, ARG1(0,UINT), NULL, SMP_T_BIN, SMP_T_UINT },
- { "sdbm", sample_conv_sdbm, ARG1(0,UINT), NULL, SMP_T_BIN, SMP_T_UINT },
- { "wt6", sample_conv_wt6, ARG1(0,UINT), NULL, SMP_T_BIN, SMP_T_UINT },
+ { "ltime", sample_conv_ltime, ARG2(1,STR,SINT), NULL, SMP_T_SINT, SMP_T_STR },
+ { "utime", sample_conv_utime, ARG2(1,STR,SINT), NULL, SMP_T_SINT, SMP_T_STR },
+ { "crc32", sample_conv_crc32, ARG1(0,UINT), NULL, SMP_T_BIN, SMP_T_SINT },
+ { "djb2", sample_conv_djb2, ARG1(0,UINT), NULL, SMP_T_BIN, SMP_T_SINT },
+ { "sdbm", sample_conv_sdbm, ARG1(0,UINT), NULL, SMP_T_BIN, SMP_T_SINT },
+ { "wt6", sample_conv_wt6, ARG1(0,UINT), NULL, SMP_T_BIN, SMP_T_SINT },
{ "json", sample_conv_json, ARG1(1,STR), sample_conv_json_check, SMP_T_STR, SMP_T_STR },
{ "bytes", sample_conv_bytes, ARG2(1,UINT,UINT), NULL, SMP_T_BIN, SMP_T_BIN },
{ "field", sample_conv_field, ARG2(2,UINT,STR), sample_conv_field_check, SMP_T_STR, SMP_T_STR },
{ "word", sample_conv_word, ARG2(2,UINT,STR), sample_conv_field_check, SMP_T_STR, SMP_T_STR },
{ "regsub", sample_conv_regsub, ARG3(2,REG,STR,STR), sample_conv_regsub_check, SMP_T_STR, SMP_T_STR },
- { "and", sample_conv_binary_and, ARG1(1,UINT), NULL, SMP_T_UINT, SMP_T_UINT },
- { "or", sample_conv_binary_or, ARG1(1,UINT), NULL, SMP_T_UINT, SMP_T_UINT },
- { "xor", sample_conv_binary_xor, ARG1(1,UINT), NULL, SMP_T_UINT, SMP_T_UINT },
- { "cpl", sample_conv_binary_cpl, 0, NULL, SMP_T_UINT, SMP_T_UINT },
- { "bool", sample_conv_arith_bool, 0, NULL, SMP_T_UINT, SMP_T_BOOL },
- { "not", sample_conv_arith_not, 0, NULL, SMP_T_UINT, SMP_T_BOOL },
- { "odd", sample_conv_arith_odd, 0, NULL, SMP_T_UINT, SMP_T_BOOL },
- { "even", sample_conv_arith_even, 0, NULL, SMP_T_UINT, SMP_T_BOOL },
- { "add", sample_conv_arith_add, ARG1(1,UINT), NULL, SMP_T_UINT, SMP_T_UINT },
- { "sub", sample_conv_arith_sub, ARG1(1,UINT), NULL, SMP_T_UINT, SMP_T_UINT },
- { "mul", sample_conv_arith_mul, ARG1(1,UINT), NULL, SMP_T_UINT, SMP_T_UINT },
- { "div", sample_conv_arith_div, ARG1(1,UINT), NULL, SMP_T_UINT, SMP_T_UINT },
- { "mod", sample_conv_arith_mod, ARG1(1,UINT), NULL, SMP_T_UINT, SMP_T_UINT },
- { "neg", sample_conv_arith_neg, 0, NULL, SMP_T_UINT, SMP_T_UINT },
+ { "and", sample_conv_binary_and, ARG1(1,UINT), NULL, SMP_T_SINT, SMP_T_SINT },
+ { "or", sample_conv_binary_or, ARG1(1,UINT), NULL, SMP_T_SINT, SMP_T_SINT },
+ { "xor", sample_conv_binary_xor, ARG1(1,UINT), NULL, SMP_T_SINT, SMP_T_SINT },
+ { "cpl", sample_conv_binary_cpl, 0, NULL, SMP_T_SINT, SMP_T_SINT },
+ { "bool", sample_conv_arith_bool, 0, NULL, SMP_T_SINT, SMP_T_BOOL },
+ { "not", sample_conv_arith_not, 0, NULL, SMP_T_SINT, SMP_T_BOOL },
+ { "odd", sample_conv_arith_odd, 0, NULL, SMP_T_SINT, SMP_T_BOOL },
+ { "even", sample_conv_arith_even, 0, NULL, SMP_T_SINT, SMP_T_BOOL },
+ { "add", sample_conv_arith_add, ARG1(1,UINT), NULL, SMP_T_SINT, SMP_T_SINT },
+ { "sub", sample_conv_arith_sub, ARG1(1,UINT), NULL, SMP_T_SINT, SMP_T_SINT },
+ { "mul", sample_conv_arith_mul, ARG1(1,UINT), NULL, SMP_T_SINT, SMP_T_SINT },
+ { "div", sample_conv_arith_div, ARG1(1,UINT), NULL, SMP_T_SINT, SMP_T_SINT },
+ { "mod", sample_conv_arith_mod, ARG1(1,UINT), NULL, SMP_T_SINT, SMP_T_SINT },
+ { "neg", sample_conv_arith_neg, 0, NULL, SMP_T_SINT, SMP_T_SINT },
{ NULL, NULL, 0, 0, 0 },
}};
smp->flags = 0;
smp->type = SMP_T_BOOL;
- smp->data.uint = SSL_SOCK_ST_FL_VERIFY_DONE & conn->xprt_st ? 1 : 0;
+ smp->data.sint = SSL_SOCK_ST_FL_VERIFY_DONE & conn->xprt_st ? 1 : 0;
return 1;
}
}
smp->type = SMP_T_BOOL;
- smp->data.uint = (crt != NULL);
+ smp->data.sint = (crt != NULL);
return 1;
}
if (!crt)
return 0;
- smp->data.uint = (unsigned int)(1 + X509_get_version(crt));
+ smp->data.sint = (unsigned int)(1 + X509_get_version(crt));
/* SSL_get_peer_certificate increase X509 * ref count */
if (cert_peer)
X509_free(crt);
- smp->type = SMP_T_UINT;
+ smp->type = SMP_T_SINT;
return 1;
}
struct connection *conn = objt_conn(smp->strm->si[back_conn].end);
smp->type = SMP_T_BOOL;
- smp->data.uint = (conn && conn->xprt == &ssl_sock);
+ smp->data.sint = (conn && conn->xprt == &ssl_sock);
return 1;
}
struct connection *conn = objt_conn(smp->sess->origin);
smp->type = SMP_T_BOOL;
- smp->data.uint = (conn && conn->xprt == &ssl_sock) &&
+ smp->data.sint = (conn && conn->xprt == &ssl_sock) &&
conn->xprt_ctx &&
SSL_get_servername(conn->xprt_ctx, TLSEXT_NAMETYPE_host_name) != NULL;
return 1;
struct connection *conn = objt_conn(smp->sess->origin);
smp->type = SMP_T_BOOL;
- smp->data.uint = (conn && conn->xprt == &ssl_sock) &&
+ smp->data.sint = (conn && conn->xprt == &ssl_sock) &&
conn->xprt_ctx &&
SSL_session_reused(conn->xprt_ctx);
return 1;
{
int back_conn = (kw[4] == 'b') ? 1 : 0;
struct connection *conn;
+ int sint;
smp->flags = 0;
if (!conn || !conn->xprt_ctx || conn->xprt != &ssl_sock)
return 0;
- if (!SSL_get_cipher_bits(conn->xprt_ctx, (int *)&smp->data.uint))
+ if (!SSL_get_cipher_bits(conn->xprt_ctx, &sint))
return 0;
- smp->type = SMP_T_UINT;
+ smp->data.sint = sint;
+ smp->type = SMP_T_SINT;
return 1;
}
if (!conn || !conn->xprt_ctx || conn->xprt != &ssl_sock)
return 0;
- smp->data.uint = (unsigned int)SSL_get_cipher_bits(conn->xprt_ctx, NULL);
- if (!smp->data.uint)
+ smp->data.sint = (unsigned int)SSL_get_cipher_bits(conn->xprt_ctx, NULL);
+ if (!smp->data.sint)
return 0;
- smp->type = SMP_T_UINT;
+ smp->type = SMP_T_SINT;
return 1;
}
return 0;
}
- smp->type = SMP_T_UINT;
- smp->data.uint = (unsigned int)SSL_SOCK_ST_TO_CA_ERROR(conn->xprt_st);
+ smp->type = SMP_T_SINT;
+ smp->data.sint = (unsigned long long int)SSL_SOCK_ST_TO_CA_ERROR(conn->xprt_st);
smp->flags = 0;
return 1;
return 0;
}
- smp->type = SMP_T_UINT;
- smp->data.uint = (unsigned int)SSL_SOCK_ST_TO_CAEDEPTH(conn->xprt_st);
+ smp->type = SMP_T_SINT;
+ smp->data.sint = (long long int)SSL_SOCK_ST_TO_CAEDEPTH(conn->xprt_st);
smp->flags = 0;
return 1;
return 0;
}
- smp->type = SMP_T_UINT;
- smp->data.uint = (unsigned int)SSL_SOCK_ST_TO_CRTERROR(conn->xprt_st);
+ smp->type = SMP_T_SINT;
+ smp->data.sint = (long long int)SSL_SOCK_ST_TO_CRTERROR(conn->xprt_st);
smp->flags = 0;
return 1;
if (!conn->xprt_ctx)
return 0;
- smp->type = SMP_T_UINT;
- smp->data.uint = (unsigned int)SSL_get_verify_result(conn->xprt_ctx);
+ smp->type = SMP_T_SINT;
+ smp->data.sint = (long long int)SSL_get_verify_result(conn->xprt_ctx);
smp->flags = 0;
return 1;
*/
static struct sample_fetch_kw_list sample_fetch_keywords = {ILH, {
{ "ssl_bc", smp_fetch_ssl_fc, 0, NULL, SMP_T_BOOL, SMP_USE_L5SRV },
- { "ssl_bc_alg_keysize", smp_fetch_ssl_fc_alg_keysize, 0, NULL, SMP_T_UINT, SMP_USE_L5SRV },
+ { "ssl_bc_alg_keysize", smp_fetch_ssl_fc_alg_keysize, 0, NULL, SMP_T_SINT, SMP_USE_L5SRV },
{ "ssl_bc_cipher", smp_fetch_ssl_fc_cipher, 0, NULL, SMP_T_STR, SMP_USE_L5SRV },
{ "ssl_bc_protocol", smp_fetch_ssl_fc_protocol, 0, NULL, SMP_T_STR, SMP_USE_L5SRV },
{ "ssl_bc_unique_id", smp_fetch_ssl_fc_unique_id, 0, NULL, SMP_T_BIN, SMP_USE_L5SRV },
- { "ssl_bc_use_keysize", smp_fetch_ssl_fc_use_keysize, 0, NULL, SMP_T_UINT, SMP_USE_L5SRV },
+ { "ssl_bc_use_keysize", smp_fetch_ssl_fc_use_keysize, 0, NULL, SMP_T_SINT, SMP_USE_L5SRV },
{ "ssl_bc_session_id", smp_fetch_ssl_fc_session_id, 0, NULL, SMP_T_BIN, SMP_USE_L5SRV },
- { "ssl_c_ca_err", smp_fetch_ssl_c_ca_err, 0, NULL, SMP_T_UINT, SMP_USE_L5CLI },
- { "ssl_c_ca_err_depth", smp_fetch_ssl_c_ca_err_depth, 0, NULL, SMP_T_UINT, SMP_USE_L5CLI },
+ { "ssl_c_ca_err", smp_fetch_ssl_c_ca_err, 0, NULL, SMP_T_SINT, SMP_USE_L5CLI },
+ { "ssl_c_ca_err_depth", smp_fetch_ssl_c_ca_err_depth, 0, NULL, SMP_T_SINT, SMP_USE_L5CLI },
{ "ssl_c_der", smp_fetch_ssl_x_der, 0, NULL, SMP_T_BIN, SMP_USE_L5CLI },
- { "ssl_c_err", smp_fetch_ssl_c_err, 0, NULL, SMP_T_UINT, SMP_USE_L5CLI },
+ { "ssl_c_err", smp_fetch_ssl_c_err, 0, NULL, SMP_T_SINT, SMP_USE_L5CLI },
{ "ssl_c_i_dn", smp_fetch_ssl_x_i_dn, ARG2(0,STR,SINT), NULL, SMP_T_STR, SMP_USE_L5CLI },
{ "ssl_c_key_alg", smp_fetch_ssl_x_key_alg, 0, NULL, SMP_T_STR, SMP_USE_L5CLI },
{ "ssl_c_notafter", smp_fetch_ssl_x_notafter, 0, NULL, SMP_T_STR, SMP_USE_L5CLI },
{ "ssl_c_serial", smp_fetch_ssl_x_serial, 0, NULL, SMP_T_BIN, SMP_USE_L5CLI },
{ "ssl_c_sha1", smp_fetch_ssl_x_sha1, 0, NULL, SMP_T_BIN, SMP_USE_L5CLI },
{ "ssl_c_used", smp_fetch_ssl_c_used, 0, NULL, SMP_T_BOOL, SMP_USE_L5CLI },
- { "ssl_c_verify", smp_fetch_ssl_c_verify, 0, NULL, SMP_T_UINT, SMP_USE_L5CLI },
- { "ssl_c_version", smp_fetch_ssl_x_version, 0, NULL, SMP_T_UINT, SMP_USE_L5CLI },
+ { "ssl_c_verify", smp_fetch_ssl_c_verify, 0, NULL, SMP_T_SINT, SMP_USE_L5CLI },
+ { "ssl_c_version", smp_fetch_ssl_x_version, 0, NULL, SMP_T_SINT, SMP_USE_L5CLI },
{ "ssl_f_der", smp_fetch_ssl_x_der, 0, NULL, SMP_T_BIN, SMP_USE_L5CLI },
{ "ssl_f_i_dn", smp_fetch_ssl_x_i_dn, ARG2(0,STR,SINT), NULL, SMP_T_STR, SMP_USE_L5CLI },
{ "ssl_f_key_alg", smp_fetch_ssl_x_key_alg, 0, NULL, SMP_T_STR, SMP_USE_L5CLI },
{ "ssl_f_s_dn", smp_fetch_ssl_x_s_dn, ARG2(0,STR,SINT), NULL, SMP_T_STR, SMP_USE_L5CLI },
{ "ssl_f_serial", smp_fetch_ssl_x_serial, 0, NULL, SMP_T_BIN, SMP_USE_L5CLI },
{ "ssl_f_sha1", smp_fetch_ssl_x_sha1, 0, NULL, SMP_T_BIN, SMP_USE_L5CLI },
- { "ssl_f_version", smp_fetch_ssl_x_version, 0, NULL, SMP_T_UINT, SMP_USE_L5CLI },
+ { "ssl_f_version", smp_fetch_ssl_x_version, 0, NULL, SMP_T_SINT, SMP_USE_L5CLI },
{ "ssl_fc", smp_fetch_ssl_fc, 0, NULL, SMP_T_BOOL, SMP_USE_L5CLI },
- { "ssl_fc_alg_keysize", smp_fetch_ssl_fc_alg_keysize, 0, NULL, SMP_T_UINT, SMP_USE_L5CLI },
+ { "ssl_fc_alg_keysize", smp_fetch_ssl_fc_alg_keysize, 0, NULL, SMP_T_SINT, SMP_USE_L5CLI },
{ "ssl_fc_cipher", smp_fetch_ssl_fc_cipher, 0, NULL, SMP_T_STR, SMP_USE_L5CLI },
{ "ssl_fc_has_crt", smp_fetch_ssl_fc_has_crt, 0, NULL, SMP_T_BOOL, SMP_USE_L5CLI },
{ "ssl_fc_has_sni", smp_fetch_ssl_fc_has_sni, 0, NULL, SMP_T_BOOL, SMP_USE_L5CLI },
#endif
{ "ssl_fc_protocol", smp_fetch_ssl_fc_protocol, 0, NULL, SMP_T_STR, SMP_USE_L5CLI },
{ "ssl_fc_unique_id", smp_fetch_ssl_fc_unique_id, 0, NULL, SMP_T_BIN, SMP_USE_L5CLI },
- { "ssl_fc_use_keysize", smp_fetch_ssl_fc_use_keysize, 0, NULL, SMP_T_UINT, SMP_USE_L5CLI },
+ { "ssl_fc_use_keysize", smp_fetch_ssl_fc_use_keysize, 0, NULL, SMP_T_SINT, SMP_USE_L5CLI },
{ "ssl_fc_session_id", smp_fetch_ssl_fc_session_id, 0, NULL, SMP_T_BIN, SMP_USE_L5CLI },
{ "ssl_fc_sni", smp_fetch_ssl_fc_sni, 0, NULL, SMP_T_STR, SMP_USE_L5CLI },
{ NULL, NULL, 0, 0, 0 },
static void *k_int2int(struct sample *smp, union stktable_key_data *kdata, size_t *len)
{
- return (void *)&smp->data.uint;
+ kdata->integer = smp->data.sint;
+ return (void *)&kdata->integer;
}
static void *k_ip2ip(struct sample *smp, union stktable_key_data *kdata, size_t *len)
static void *k_int2ip(struct sample *smp, union stktable_key_data *kdata, size_t *len)
{
- kdata->ip.s_addr = htonl(smp->data.uint);
+ kdata->ip.s_addr = htonl((unsigned int)smp->data.sint);
return (void *)&kdata->ip.s_addr;
}
{
void *key;
- key = (void *)ultoa_r(smp->data.uint, kdata->buf, *len);
+ key = (void *)lltoa_r(smp->data.sint, kdata->buf, *len);
if (!key)
return NULL;
/* table type: IP IPV6 INTEGER STRING BINARY */
/* patt. type: ANY */ { k_ip2ip, k_ip2ipv6, k_int2int, k_str2str, k_str2str },
/* BOOL */ { NULL, NULL, k_int2int, k_int2str, NULL },
-/* UINT */ { k_int2ip, NULL, k_int2int, k_int2str, NULL },
/* SINT */ { k_int2ip, NULL, k_int2int, k_int2str, NULL },
/* ADDR */ { k_ip2ip, k_ip2ipv6, k_ip2int, k_ip2str, NULL },
/* IPV4 */ { k_ip2ip, k_ip2ipv6, k_ip2int, k_ip2str, k_ip2bin },
ts = stktable_lookup_key(t, key);
smp->type = SMP_T_BOOL;
- smp->data.uint = !!ts;
+ smp->data.sint = !!ts;
smp->flags = SMP_F_VOL_TEST;
return 1;
}
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
ts = stktable_lookup_key(t, key);
if (!ts) /* key not present */
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = read_freq_ctr_period(&stktable_data_cast(ptr, bytes_in_rate),
+ smp->data.sint = read_freq_ctr_period(&stktable_data_cast(ptr, bytes_in_rate),
t->data_arg[STKTABLE_DT_BYTES_IN_RATE].u);
return 1;
}
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
ts = stktable_lookup_key(t, key);
if (!ts) /* key not present */
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = stktable_data_cast(ptr, conn_cnt);
+ smp->data.sint = stktable_data_cast(ptr, conn_cnt);
return 1;
}
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
ts = stktable_lookup_key(t, key);
if (!ts) /* key not present */
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = stktable_data_cast(ptr, conn_cur);
+ smp->data.sint = stktable_data_cast(ptr, conn_cur);
return 1;
}
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
ts = stktable_lookup_key(t, key);
if (!ts) /* key not present */
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = read_freq_ctr_period(&stktable_data_cast(ptr, conn_rate),
+ smp->data.sint = read_freq_ctr_period(&stktable_data_cast(ptr, conn_rate),
t->data_arg[STKTABLE_DT_CONN_RATE].u);
return 1;
}
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
ts = stktable_lookup_key(t, key);
if (!ts) /* key not present */
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = read_freq_ctr_period(&stktable_data_cast(ptr, bytes_out_rate),
+ smp->data.sint = read_freq_ctr_period(&stktable_data_cast(ptr, bytes_out_rate),
t->data_arg[STKTABLE_DT_BYTES_OUT_RATE].u);
return 1;
}
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
ts = stktable_lookup_key(t, key);
if (!ts) /* key not present */
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = stktable_data_cast(ptr, gpc0);
+ smp->data.sint = stktable_data_cast(ptr, gpc0);
return 1;
}
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
ts = stktable_lookup_key(t, key);
if (!ts) /* key not present */
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = read_freq_ctr_period(&stktable_data_cast(ptr, gpc0_rate),
+ smp->data.sint = read_freq_ctr_period(&stktable_data_cast(ptr, gpc0_rate),
t->data_arg[STKTABLE_DT_GPC0_RATE].u);
return 1;
}
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
ts = stktable_lookup_key(t, key);
if (!ts) /* key not present */
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = stktable_data_cast(ptr, http_err_cnt);
+ smp->data.sint = stktable_data_cast(ptr, http_err_cnt);
return 1;
}
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
ts = stktable_lookup_key(t, key);
if (!ts) /* key not present */
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = read_freq_ctr_period(&stktable_data_cast(ptr, http_err_rate),
+ smp->data.sint = read_freq_ctr_period(&stktable_data_cast(ptr, http_err_rate),
t->data_arg[STKTABLE_DT_HTTP_ERR_RATE].u);
return 1;
}
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
ts = stktable_lookup_key(t, key);
if (!ts) /* key not present */
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = stktable_data_cast(ptr, http_req_cnt);
+ smp->data.sint = stktable_data_cast(ptr, http_req_cnt);
return 1;
}
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
ts = stktable_lookup_key(t, key);
if (!ts) /* key not present */
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = read_freq_ctr_period(&stktable_data_cast(ptr, http_req_rate),
+ smp->data.sint = read_freq_ctr_period(&stktable_data_cast(ptr, http_req_rate),
t->data_arg[STKTABLE_DT_HTTP_REQ_RATE].u);
return 1;
}
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
ts = stktable_lookup_key(t, key);
if (!ts) /* key not present */
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = stktable_data_cast(ptr, bytes_in_cnt) >> 10;
+ smp->data.sint = stktable_data_cast(ptr, bytes_in_cnt) >> 10;
return 1;
}
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
ts = stktable_lookup_key(t, key);
if (!ts) /* key not present */
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = stktable_data_cast(ptr, bytes_out_cnt) >> 10;
+ smp->data.sint = stktable_data_cast(ptr, bytes_out_cnt) >> 10;
return 1;
}
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
ts = stktable_lookup_key(t, key);
if (!ts) /* key not present */
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = stktable_data_cast(ptr, server_id);
+ smp->data.sint = stktable_data_cast(ptr, server_id);
return 1;
}
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
ts = stktable_lookup_key(t, key);
if (!ts) /* key not present */
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = stktable_data_cast(ptr, sess_cnt);
+ smp->data.sint = stktable_data_cast(ptr, sess_cnt);
return 1;
}
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
ts = stktable_lookup_key(t, key);
if (!ts) /* key not present */
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = read_freq_ctr_period(&stktable_data_cast(ptr, sess_rate),
+ smp->data.sint = read_freq_ctr_period(&stktable_data_cast(ptr, sess_rate),
t->data_arg[STKTABLE_DT_SESS_RATE].u);
return 1;
}
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
ts = stktable_lookup_key(t, key);
if (ts)
- smp->data.uint = ts->ref_cnt;
+ smp->data.sint = ts->ref_cnt;
return 1;
}
/* Note: must not be declared <const> as its list will be overwritten */
static struct sample_conv_kw_list sample_conv_kws = {ILH, {
{ "in_table", sample_conv_in_table, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_BOOL },
- { "table_bytes_in_rate", sample_conv_table_bytes_in_rate, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_UINT },
- { "table_bytes_out_rate", sample_conv_table_bytes_out_rate, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_UINT },
- { "table_conn_cnt", sample_conv_table_conn_cnt, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_UINT },
- { "table_conn_cur", sample_conv_table_conn_cur, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_UINT },
- { "table_conn_rate", sample_conv_table_conn_rate, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_UINT },
- { "table_gpc0", sample_conv_table_gpc0, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_UINT },
- { "table_gpc0_rate", sample_conv_table_gpc0_rate, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_UINT },
- { "table_http_err_cnt", sample_conv_table_http_err_cnt, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_UINT },
- { "table_http_err_rate", sample_conv_table_http_err_rate, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_UINT },
- { "table_http_req_cnt", sample_conv_table_http_req_cnt, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_UINT },
- { "table_http_req_rate", sample_conv_table_http_req_rate, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_UINT },
- { "table_kbytes_in", sample_conv_table_kbytes_in, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_UINT },
- { "table_kbytes_out", sample_conv_table_kbytes_out, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_UINT },
- { "table_server_id", sample_conv_table_server_id, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_UINT },
- { "table_sess_cnt", sample_conv_table_sess_cnt, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_UINT },
- { "table_sess_rate", sample_conv_table_sess_rate, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_UINT },
- { "table_trackers", sample_conv_table_trackers, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_UINT },
+ { "table_bytes_in_rate", sample_conv_table_bytes_in_rate, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_SINT },
+ { "table_bytes_out_rate", sample_conv_table_bytes_out_rate, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_SINT },
+ { "table_conn_cnt", sample_conv_table_conn_cnt, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_SINT },
+ { "table_conn_cur", sample_conv_table_conn_cur, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_SINT },
+ { "table_conn_rate", sample_conv_table_conn_rate, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_SINT },
+ { "table_gpc0", sample_conv_table_gpc0, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_SINT },
+ { "table_gpc0_rate", sample_conv_table_gpc0_rate, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_SINT },
+ { "table_http_err_cnt", sample_conv_table_http_err_cnt, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_SINT },
+ { "table_http_err_rate", sample_conv_table_http_err_rate, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_SINT },
+ { "table_http_req_cnt", sample_conv_table_http_req_cnt, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_SINT },
+ { "table_http_req_rate", sample_conv_table_http_req_rate, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_SINT },
+ { "table_kbytes_in", sample_conv_table_kbytes_in, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_SINT },
+ { "table_kbytes_out", sample_conv_table_kbytes_out, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_SINT },
+ { "table_server_id", sample_conv_table_server_id, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_SINT },
+ { "table_sess_cnt", sample_conv_table_sess_cnt, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_SINT },
+ { "table_sess_rate", sample_conv_table_sess_rate, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_SINT },
+ { "table_trackers", sample_conv_table_trackers, ARG1(1,TAB), NULL, SMP_T_STR, SMP_T_SINT },
{ /* END */ },
}};
{
smp->flags = SMP_F_VOL_TEST;
smp->type = SMP_T_BOOL;
- smp->data.uint = !!smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
+ smp->data.sint = !!smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
return 1;
}
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
if (stkctr_entry(stkctr) != NULL) {
void *ptr = stktable_data_ptr(stkctr->table, stkctr_entry(stkctr), STKTABLE_DT_GPC0);
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = stktable_data_cast(ptr, gpc0);
+ smp->data.sint = stktable_data_cast(ptr, gpc0);
}
return 1;
}
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
if (stkctr_entry(stkctr) != NULL) {
void *ptr = stktable_data_ptr(stkctr->table, stkctr_entry(stkctr), STKTABLE_DT_GPC0_RATE);
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = read_freq_ctr_period(&stktable_data_cast(ptr, gpc0_rate),
+ smp->data.sint = read_freq_ctr_period(&stktable_data_cast(ptr, gpc0_rate),
stkctr->table->data_arg[STKTABLE_DT_GPC0_RATE].u);
}
return 1;
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
if (stkctr_entry(stkctr) != NULL) {
void *ptr1,*ptr2;
if (ptr1) {
update_freq_ctr_period(&stktable_data_cast(ptr1, gpc0_rate),
stkctr->table->data_arg[STKTABLE_DT_GPC0_RATE].u, 1);
- smp->data.uint = (&stktable_data_cast(ptr1, gpc0_rate))->curr_ctr;
+ smp->data.sint = (&stktable_data_cast(ptr1, gpc0_rate))->curr_ctr;
}
ptr2 = stktable_data_ptr(stkctr->table, stkctr_entry(stkctr), STKTABLE_DT_GPC0);
if (ptr2)
- smp->data.uint = ++stktable_data_cast(ptr2, gpc0);
+ smp->data.sint = ++stktable_data_cast(ptr2, gpc0);
/* If data was modified, we need to touch to re-schedule sync */
if (ptr1 || ptr2)
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
if (stkctr_entry(stkctr) != NULL) {
void *ptr = stktable_data_ptr(stkctr->table, stkctr_entry(stkctr), STKTABLE_DT_GPC0);
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = stktable_data_cast(ptr, gpc0);
+ smp->data.sint = stktable_data_cast(ptr, gpc0);
stktable_data_cast(ptr, gpc0) = 0;
/* If data was modified, we need to touch to re-schedule sync */
stktable_touch(stkctr->table, stkctr_entry(stkctr), 1);
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
if (stkctr_entry(stkctr) != NULL) {
void *ptr = stktable_data_ptr(stkctr->table, stkctr_entry(stkctr), STKTABLE_DT_CONN_CNT);
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = stktable_data_cast(ptr, conn_cnt);
+ smp->data.sint = stktable_data_cast(ptr, conn_cnt);
}
return 1;
}
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
if (stkctr_entry(stkctr) != NULL) {
void *ptr = stktable_data_ptr(stkctr->table, stkctr_entry(stkctr), STKTABLE_DT_CONN_RATE);
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = read_freq_ctr_period(&stktable_data_cast(ptr, conn_rate),
+ smp->data.sint = read_freq_ctr_period(&stktable_data_cast(ptr, conn_rate),
stkctr->table->data_arg[STKTABLE_DT_CONN_RATE].u);
}
return 1;
if (!ptr)
return 0; /* parameter not stored in this table */
- smp->type = SMP_T_UINT;
- smp->data.uint = ++stktable_data_cast(ptr, conn_cnt);
+ smp->type = SMP_T_SINT;
+ smp->data.sint = ++stktable_data_cast(ptr, conn_cnt);
/* Touch was previously performed by stktable_update_key */
smp->flags = SMP_F_VOL_TEST;
return 1;
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
if (stkctr_entry(stkctr) != NULL) {
void *ptr = stktable_data_ptr(stkctr->table, stkctr_entry(stkctr), STKTABLE_DT_CONN_CUR);
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = stktable_data_cast(ptr, conn_cur);
+ smp->data.sint = stktable_data_cast(ptr, conn_cur);
}
return 1;
}
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
if (stkctr_entry(stkctr) != NULL) {
void *ptr = stktable_data_ptr(stkctr->table, stkctr_entry(stkctr), STKTABLE_DT_SESS_CNT);
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = stktable_data_cast(ptr, sess_cnt);
+ smp->data.sint = stktable_data_cast(ptr, sess_cnt);
}
return 1;
}
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
if (stkctr_entry(stkctr) != NULL) {
void *ptr = stktable_data_ptr(stkctr->table, stkctr_entry(stkctr), STKTABLE_DT_SESS_RATE);
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = read_freq_ctr_period(&stktable_data_cast(ptr, sess_rate),
+ smp->data.sint = read_freq_ctr_period(&stktable_data_cast(ptr, sess_rate),
stkctr->table->data_arg[STKTABLE_DT_SESS_RATE].u);
}
return 1;
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
if (stkctr_entry(stkctr) != NULL) {
void *ptr = stktable_data_ptr(stkctr->table, stkctr_entry(stkctr), STKTABLE_DT_HTTP_REQ_CNT);
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = stktable_data_cast(ptr, http_req_cnt);
+ smp->data.sint = stktable_data_cast(ptr, http_req_cnt);
}
return 1;
}
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
if (stkctr_entry(stkctr) != NULL) {
void *ptr = stktable_data_ptr(stkctr->table, stkctr_entry(stkctr), STKTABLE_DT_HTTP_REQ_RATE);
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = read_freq_ctr_period(&stktable_data_cast(ptr, http_req_rate),
+ smp->data.sint = read_freq_ctr_period(&stktable_data_cast(ptr, http_req_rate),
stkctr->table->data_arg[STKTABLE_DT_HTTP_REQ_RATE].u);
}
return 1;
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
if (stkctr_entry(stkctr) != NULL) {
void *ptr = stktable_data_ptr(stkctr->table, stkctr_entry(stkctr), STKTABLE_DT_HTTP_ERR_CNT);
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = stktable_data_cast(ptr, http_err_cnt);
+ smp->data.sint = stktable_data_cast(ptr, http_err_cnt);
}
return 1;
}
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
if (stkctr_entry(stkctr) != NULL) {
void *ptr = stktable_data_ptr(stkctr->table, stkctr_entry(stkctr), STKTABLE_DT_HTTP_ERR_RATE);
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = read_freq_ctr_period(&stktable_data_cast(ptr, http_err_rate),
+ smp->data.sint = read_freq_ctr_period(&stktable_data_cast(ptr, http_err_rate),
stkctr->table->data_arg[STKTABLE_DT_HTTP_ERR_RATE].u);
}
return 1;
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
if (stkctr_entry(stkctr) != NULL) {
void *ptr = stktable_data_ptr(stkctr->table, stkctr_entry(stkctr), STKTABLE_DT_BYTES_IN_CNT);
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = stktable_data_cast(ptr, bytes_in_cnt) >> 10;
+ smp->data.sint = stktable_data_cast(ptr, bytes_in_cnt) >> 10;
}
return 1;
}
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
if (stkctr_entry(stkctr) != NULL) {
void *ptr = stktable_data_ptr(stkctr->table, stkctr_entry(stkctr), STKTABLE_DT_BYTES_IN_RATE);
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = read_freq_ctr_period(&stktable_data_cast(ptr, bytes_in_rate),
+ smp->data.sint = read_freq_ctr_period(&stktable_data_cast(ptr, bytes_in_rate),
stkctr->table->data_arg[STKTABLE_DT_BYTES_IN_RATE].u);
}
return 1;
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
if (stkctr_entry(stkctr) != NULL) {
void *ptr = stktable_data_ptr(stkctr->table, stkctr_entry(stkctr), STKTABLE_DT_BYTES_OUT_CNT);
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = stktable_data_cast(ptr, bytes_out_cnt) >> 10;
+ smp->data.sint = stktable_data_cast(ptr, bytes_out_cnt) >> 10;
}
return 1;
}
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = 0;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = 0;
if (stkctr_entry(stkctr) != NULL) {
void *ptr = stktable_data_ptr(stkctr->table, stkctr_entry(stkctr), STKTABLE_DT_BYTES_OUT_RATE);
if (!ptr)
return 0; /* parameter not stored */
- smp->data.uint = read_freq_ctr_period(&stktable_data_cast(ptr, bytes_out_rate),
+ smp->data.sint = read_freq_ctr_period(&stktable_data_cast(ptr, bytes_out_rate),
stkctr->table->data_arg[STKTABLE_DT_BYTES_OUT_RATE].u);
}
return 1;
return 0;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = stkctr_entry(stkctr)->ref_cnt;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = stkctr_entry(stkctr)->ref_cnt;
return 1;
}
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;
- smp->data.uint = args->data.prx->table.current;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = args->data.prx->table.current;
return 1;
}
px = args->data.prx;
smp->flags = SMP_F_VOL_TEST;
- smp->type = SMP_T_UINT;
- smp->data.uint = px->table.size - px->table.current;
+ smp->type = SMP_T_SINT;
+ smp->data.sint = px->table.size - px->table.current;
return 1;
}
* Please take care of keeping this list alphabetically sorted.
*/
static struct sample_fetch_kw_list smp_fetch_keywords = {ILH, {
- { "sc_bytes_in_rate", smp_fetch_sc_bytes_in_rate, ARG2(1,UINT,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc_bytes_out_rate", smp_fetch_sc_bytes_out_rate, ARG2(1,UINT,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc_clr_gpc0", smp_fetch_sc_clr_gpc0, ARG2(1,UINT,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc_conn_cnt", smp_fetch_sc_conn_cnt, ARG2(1,UINT,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc_conn_cur", smp_fetch_sc_conn_cur, ARG2(1,UINT,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc_conn_rate", smp_fetch_sc_conn_rate, ARG2(1,UINT,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc_get_gpc0", smp_fetch_sc_get_gpc0, ARG2(1,UINT,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc_gpc0_rate", smp_fetch_sc_gpc0_rate, ARG2(1,UINT,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc_http_err_cnt", smp_fetch_sc_http_err_cnt, ARG2(1,UINT,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc_http_err_rate", smp_fetch_sc_http_err_rate, ARG2(1,UINT,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc_http_req_cnt", smp_fetch_sc_http_req_cnt, ARG2(1,UINT,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc_http_req_rate", smp_fetch_sc_http_req_rate, ARG2(1,UINT,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc_inc_gpc0", smp_fetch_sc_inc_gpc0, ARG2(1,UINT,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc_kbytes_in", smp_fetch_sc_kbytes_in, ARG2(1,UINT,TAB), NULL, SMP_T_UINT, SMP_USE_L4CLI, },
- { "sc_kbytes_out", smp_fetch_sc_kbytes_out, ARG2(1,UINT,TAB), NULL, SMP_T_UINT, SMP_USE_L4CLI, },
- { "sc_sess_cnt", smp_fetch_sc_sess_cnt, ARG2(1,UINT,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc_sess_rate", smp_fetch_sc_sess_rate, ARG2(1,UINT,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
+ { "sc_bytes_in_rate", smp_fetch_sc_bytes_in_rate, ARG2(1,UINT,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc_bytes_out_rate", smp_fetch_sc_bytes_out_rate, ARG2(1,UINT,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc_clr_gpc0", smp_fetch_sc_clr_gpc0, ARG2(1,UINT,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc_conn_cnt", smp_fetch_sc_conn_cnt, ARG2(1,UINT,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc_conn_cur", smp_fetch_sc_conn_cur, ARG2(1,UINT,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc_conn_rate", smp_fetch_sc_conn_rate, ARG2(1,UINT,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc_get_gpc0", smp_fetch_sc_get_gpc0, ARG2(1,UINT,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc_gpc0_rate", smp_fetch_sc_gpc0_rate, ARG2(1,UINT,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc_http_err_cnt", smp_fetch_sc_http_err_cnt, ARG2(1,UINT,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc_http_err_rate", smp_fetch_sc_http_err_rate, ARG2(1,UINT,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc_http_req_cnt", smp_fetch_sc_http_req_cnt, ARG2(1,UINT,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc_http_req_rate", smp_fetch_sc_http_req_rate, ARG2(1,UINT,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc_inc_gpc0", smp_fetch_sc_inc_gpc0, ARG2(1,UINT,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc_kbytes_in", smp_fetch_sc_kbytes_in, ARG2(1,UINT,TAB), NULL, SMP_T_SINT, SMP_USE_L4CLI, },
+ { "sc_kbytes_out", smp_fetch_sc_kbytes_out, ARG2(1,UINT,TAB), NULL, SMP_T_SINT, SMP_USE_L4CLI, },
+ { "sc_sess_cnt", smp_fetch_sc_sess_cnt, ARG2(1,UINT,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc_sess_rate", smp_fetch_sc_sess_rate, ARG2(1,UINT,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
{ "sc_tracked", smp_fetch_sc_tracked, ARG2(1,UINT,TAB), NULL, SMP_T_BOOL, SMP_USE_INTRN, },
- { "sc_trackers", smp_fetch_sc_trackers, ARG2(1,UINT,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc0_bytes_in_rate", smp_fetch_sc_bytes_in_rate, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc0_bytes_out_rate", smp_fetch_sc_bytes_out_rate, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc0_clr_gpc0", smp_fetch_sc_clr_gpc0, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc0_conn_cnt", smp_fetch_sc_conn_cnt, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc0_conn_cur", smp_fetch_sc_conn_cur, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc0_conn_rate", smp_fetch_sc_conn_rate, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc0_get_gpc0", smp_fetch_sc_get_gpc0, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc0_gpc0_rate", smp_fetch_sc_gpc0_rate, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc0_http_err_cnt", smp_fetch_sc_http_err_cnt, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc0_http_err_rate", smp_fetch_sc_http_err_rate, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc0_http_req_cnt", smp_fetch_sc_http_req_cnt, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc0_http_req_rate", smp_fetch_sc_http_req_rate, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc0_inc_gpc0", smp_fetch_sc_inc_gpc0, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc0_kbytes_in", smp_fetch_sc_kbytes_in, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_L4CLI, },
- { "sc0_kbytes_out", smp_fetch_sc_kbytes_out, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_L4CLI, },
- { "sc0_sess_cnt", smp_fetch_sc_sess_cnt, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc0_sess_rate", smp_fetch_sc_sess_rate, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
+ { "sc_trackers", smp_fetch_sc_trackers, ARG2(1,UINT,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc0_bytes_in_rate", smp_fetch_sc_bytes_in_rate, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc0_bytes_out_rate", smp_fetch_sc_bytes_out_rate, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc0_clr_gpc0", smp_fetch_sc_clr_gpc0, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc0_conn_cnt", smp_fetch_sc_conn_cnt, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc0_conn_cur", smp_fetch_sc_conn_cur, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc0_conn_rate", smp_fetch_sc_conn_rate, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc0_get_gpc0", smp_fetch_sc_get_gpc0, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc0_gpc0_rate", smp_fetch_sc_gpc0_rate, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc0_http_err_cnt", smp_fetch_sc_http_err_cnt, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc0_http_err_rate", smp_fetch_sc_http_err_rate, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc0_http_req_cnt", smp_fetch_sc_http_req_cnt, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc0_http_req_rate", smp_fetch_sc_http_req_rate, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc0_inc_gpc0", smp_fetch_sc_inc_gpc0, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc0_kbytes_in", smp_fetch_sc_kbytes_in, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_L4CLI, },
+ { "sc0_kbytes_out", smp_fetch_sc_kbytes_out, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_L4CLI, },
+ { "sc0_sess_cnt", smp_fetch_sc_sess_cnt, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc0_sess_rate", smp_fetch_sc_sess_rate, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
{ "sc0_tracked", smp_fetch_sc_tracked, ARG1(0,TAB), NULL, SMP_T_BOOL, SMP_USE_INTRN, },
- { "sc0_trackers", smp_fetch_sc_trackers, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc1_bytes_in_rate", smp_fetch_sc_bytes_in_rate, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc1_bytes_out_rate", smp_fetch_sc_bytes_out_rate, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc1_clr_gpc0", smp_fetch_sc_clr_gpc0, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc1_conn_cnt", smp_fetch_sc_conn_cnt, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc1_conn_cur", smp_fetch_sc_conn_cur, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc1_conn_rate", smp_fetch_sc_conn_rate, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc1_get_gpc0", smp_fetch_sc_get_gpc0, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc1_gpc0_rate", smp_fetch_sc_gpc0_rate, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc1_http_err_cnt", smp_fetch_sc_http_err_cnt, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc1_http_err_rate", smp_fetch_sc_http_err_rate, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc1_http_req_cnt", smp_fetch_sc_http_req_cnt, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc1_http_req_rate", smp_fetch_sc_http_req_rate, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc1_inc_gpc0", smp_fetch_sc_inc_gpc0, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc1_kbytes_in", smp_fetch_sc_kbytes_in, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_L4CLI, },
- { "sc1_kbytes_out", smp_fetch_sc_kbytes_out, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_L4CLI, },
- { "sc1_sess_cnt", smp_fetch_sc_sess_cnt, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc1_sess_rate", smp_fetch_sc_sess_rate, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
+ { "sc0_trackers", smp_fetch_sc_trackers, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc1_bytes_in_rate", smp_fetch_sc_bytes_in_rate, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc1_bytes_out_rate", smp_fetch_sc_bytes_out_rate, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc1_clr_gpc0", smp_fetch_sc_clr_gpc0, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc1_conn_cnt", smp_fetch_sc_conn_cnt, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc1_conn_cur", smp_fetch_sc_conn_cur, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc1_conn_rate", smp_fetch_sc_conn_rate, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc1_get_gpc0", smp_fetch_sc_get_gpc0, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc1_gpc0_rate", smp_fetch_sc_gpc0_rate, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc1_http_err_cnt", smp_fetch_sc_http_err_cnt, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc1_http_err_rate", smp_fetch_sc_http_err_rate, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc1_http_req_cnt", smp_fetch_sc_http_req_cnt, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc1_http_req_rate", smp_fetch_sc_http_req_rate, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc1_inc_gpc0", smp_fetch_sc_inc_gpc0, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc1_kbytes_in", smp_fetch_sc_kbytes_in, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_L4CLI, },
+ { "sc1_kbytes_out", smp_fetch_sc_kbytes_out, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_L4CLI, },
+ { "sc1_sess_cnt", smp_fetch_sc_sess_cnt, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc1_sess_rate", smp_fetch_sc_sess_rate, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
{ "sc1_tracked", smp_fetch_sc_tracked, ARG1(0,TAB), NULL, SMP_T_BOOL, SMP_USE_INTRN, },
- { "sc1_trackers", smp_fetch_sc_trackers, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc2_bytes_in_rate", smp_fetch_sc_bytes_in_rate, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc2_bytes_out_rate", smp_fetch_sc_bytes_out_rate, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc2_clr_gpc0", smp_fetch_sc_clr_gpc0, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc2_conn_cnt", smp_fetch_sc_conn_cnt, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc2_conn_cur", smp_fetch_sc_conn_cur, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc2_conn_rate", smp_fetch_sc_conn_rate, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc2_get_gpc0", smp_fetch_sc_get_gpc0, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc2_gpc0_rate", smp_fetch_sc_gpc0_rate, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc2_http_err_cnt", smp_fetch_sc_http_err_cnt, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc2_http_err_rate", smp_fetch_sc_http_err_rate, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc2_http_req_cnt", smp_fetch_sc_http_req_cnt, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc2_http_req_rate", smp_fetch_sc_http_req_rate, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc2_inc_gpc0", smp_fetch_sc_inc_gpc0, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc2_kbytes_in", smp_fetch_sc_kbytes_in, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_L4CLI, },
- { "sc2_kbytes_out", smp_fetch_sc_kbytes_out, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_L4CLI, },
- { "sc2_sess_cnt", smp_fetch_sc_sess_cnt, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "sc2_sess_rate", smp_fetch_sc_sess_rate, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
+ { "sc1_trackers", smp_fetch_sc_trackers, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc2_bytes_in_rate", smp_fetch_sc_bytes_in_rate, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc2_bytes_out_rate", smp_fetch_sc_bytes_out_rate, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc2_clr_gpc0", smp_fetch_sc_clr_gpc0, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc2_conn_cnt", smp_fetch_sc_conn_cnt, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc2_conn_cur", smp_fetch_sc_conn_cur, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc2_conn_rate", smp_fetch_sc_conn_rate, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc2_get_gpc0", smp_fetch_sc_get_gpc0, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc2_gpc0_rate", smp_fetch_sc_gpc0_rate, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc2_http_err_cnt", smp_fetch_sc_http_err_cnt, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc2_http_err_rate", smp_fetch_sc_http_err_rate, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc2_http_req_cnt", smp_fetch_sc_http_req_cnt, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc2_http_req_rate", smp_fetch_sc_http_req_rate, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc2_inc_gpc0", smp_fetch_sc_inc_gpc0, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc2_kbytes_in", smp_fetch_sc_kbytes_in, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_L4CLI, },
+ { "sc2_kbytes_out", smp_fetch_sc_kbytes_out, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_L4CLI, },
+ { "sc2_sess_cnt", smp_fetch_sc_sess_cnt, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "sc2_sess_rate", smp_fetch_sc_sess_rate, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
{ "sc2_tracked", smp_fetch_sc_tracked, ARG1(0,TAB), NULL, SMP_T_BOOL, SMP_USE_INTRN, },
- { "sc2_trackers", smp_fetch_sc_trackers, ARG1(0,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "src_bytes_in_rate", smp_fetch_sc_bytes_in_rate, ARG1(1,TAB), NULL, SMP_T_UINT, SMP_USE_L4CLI, },
- { "src_bytes_out_rate", smp_fetch_sc_bytes_out_rate, ARG1(1,TAB), NULL, SMP_T_UINT, SMP_USE_L4CLI, },
- { "src_clr_gpc0", smp_fetch_sc_clr_gpc0, ARG1(1,TAB), NULL, SMP_T_UINT, SMP_USE_L4CLI, },
- { "src_conn_cnt", smp_fetch_sc_conn_cnt, ARG1(1,TAB), NULL, SMP_T_UINT, SMP_USE_L4CLI, },
- { "src_conn_cur", smp_fetch_sc_conn_cur, ARG1(1,TAB), NULL, SMP_T_UINT, SMP_USE_L4CLI, },
- { "src_conn_rate", smp_fetch_sc_conn_rate, ARG1(1,TAB), NULL, SMP_T_UINT, SMP_USE_L4CLI, },
- { "src_get_gpc0", smp_fetch_sc_get_gpc0, ARG1(1,TAB), NULL, SMP_T_UINT, SMP_USE_L4CLI, },
- { "src_gpc0_rate", smp_fetch_sc_gpc0_rate, ARG1(1,TAB), NULL, SMP_T_UINT, SMP_USE_L4CLI, },
- { "src_http_err_cnt", smp_fetch_sc_http_err_cnt, ARG1(1,TAB), NULL, SMP_T_UINT, SMP_USE_L4CLI, },
- { "src_http_err_rate", smp_fetch_sc_http_err_rate, ARG1(1,TAB), NULL, SMP_T_UINT, SMP_USE_L4CLI, },
- { "src_http_req_cnt", smp_fetch_sc_http_req_cnt, ARG1(1,TAB), NULL, SMP_T_UINT, SMP_USE_L4CLI, },
- { "src_http_req_rate", smp_fetch_sc_http_req_rate, ARG1(1,TAB), NULL, SMP_T_UINT, SMP_USE_L4CLI, },
- { "src_inc_gpc0", smp_fetch_sc_inc_gpc0, ARG1(1,TAB), NULL, SMP_T_UINT, SMP_USE_L4CLI, },
- { "src_kbytes_in", smp_fetch_sc_kbytes_in, ARG1(1,TAB), NULL, SMP_T_UINT, SMP_USE_L4CLI, },
- { "src_kbytes_out", smp_fetch_sc_kbytes_out, ARG1(1,TAB), NULL, SMP_T_UINT, SMP_USE_L4CLI, },
- { "src_sess_cnt", smp_fetch_sc_sess_cnt, ARG1(1,TAB), NULL, SMP_T_UINT, SMP_USE_L4CLI, },
- { "src_sess_rate", smp_fetch_sc_sess_rate, ARG1(1,TAB), NULL, SMP_T_UINT, SMP_USE_L4CLI, },
- { "src_updt_conn_cnt", smp_fetch_src_updt_conn_cnt, ARG1(1,TAB), NULL, SMP_T_UINT, SMP_USE_L4CLI, },
- { "table_avl", smp_fetch_table_avl, ARG1(1,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
- { "table_cnt", smp_fetch_table_cnt, ARG1(1,TAB), NULL, SMP_T_UINT, SMP_USE_INTRN, },
+ { "sc2_trackers", smp_fetch_sc_trackers, ARG1(0,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "src_bytes_in_rate", smp_fetch_sc_bytes_in_rate, ARG1(1,TAB), NULL, SMP_T_SINT, SMP_USE_L4CLI, },
+ { "src_bytes_out_rate", smp_fetch_sc_bytes_out_rate, ARG1(1,TAB), NULL, SMP_T_SINT, SMP_USE_L4CLI, },
+ { "src_clr_gpc0", smp_fetch_sc_clr_gpc0, ARG1(1,TAB), NULL, SMP_T_SINT, SMP_USE_L4CLI, },
+ { "src_conn_cnt", smp_fetch_sc_conn_cnt, ARG1(1,TAB), NULL, SMP_T_SINT, SMP_USE_L4CLI, },
+ { "src_conn_cur", smp_fetch_sc_conn_cur, ARG1(1,TAB), NULL, SMP_T_SINT, SMP_USE_L4CLI, },
+ { "src_conn_rate", smp_fetch_sc_conn_rate, ARG1(1,TAB), NULL, SMP_T_SINT, SMP_USE_L4CLI, },
+ { "src_get_gpc0", smp_fetch_sc_get_gpc0, ARG1(1,TAB), NULL, SMP_T_SINT, SMP_USE_L4CLI, },
+ { "src_gpc0_rate", smp_fetch_sc_gpc0_rate, ARG1(1,TAB), NULL, SMP_T_SINT, SMP_USE_L4CLI, },
+ { "src_http_err_cnt", smp_fetch_sc_http_err_cnt, ARG1(1,TAB), NULL, SMP_T_SINT, SMP_USE_L4CLI, },
+ { "src_http_err_rate", smp_fetch_sc_http_err_rate, ARG1(1,TAB), NULL, SMP_T_SINT, SMP_USE_L4CLI, },
+ { "src_http_req_cnt", smp_fetch_sc_http_req_cnt, ARG1(1,TAB), NULL, SMP_T_SINT, SMP_USE_L4CLI, },
+ { "src_http_req_rate", smp_fetch_sc_http_req_rate, ARG1(1,TAB), NULL, SMP_T_SINT, SMP_USE_L4CLI, },
+ { "src_inc_gpc0", smp_fetch_sc_inc_gpc0, ARG1(1,TAB), NULL, SMP_T_SINT, SMP_USE_L4CLI, },
+ { "src_kbytes_in", smp_fetch_sc_kbytes_in, ARG1(1,TAB), NULL, SMP_T_SINT, SMP_USE_L4CLI, },
+ { "src_kbytes_out", smp_fetch_sc_kbytes_out, ARG1(1,TAB), NULL, SMP_T_SINT, SMP_USE_L4CLI, },
+ { "src_sess_cnt", smp_fetch_sc_sess_cnt, ARG1(1,TAB), NULL, SMP_T_SINT, SMP_USE_L4CLI, },
+ { "src_sess_rate", smp_fetch_sc_sess_rate, ARG1(1,TAB), NULL, SMP_T_SINT, SMP_USE_L4CLI, },
+ { "src_updt_conn_cnt", smp_fetch_src_updt_conn_cnt, ARG1(1,TAB), NULL, SMP_T_SINT, SMP_USE_L4CLI, },
+ { "table_avl", smp_fetch_table_avl, ARG1(1,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
+ { "table_cnt", smp_fetch_table_cnt, ARG1(1,TAB), NULL, SMP_T_SINT, SMP_USE_INTRN, },
{ /* END */ },
}};
/* Copy data. If the data needs memory, the function can fail. */
switch (var->data.type) {
case SMP_T_BOOL:
- case SMP_T_UINT:
case SMP_T_SINT:
var->data.data.sint = smp->data.sint;
break;