]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: arg: Add an argument type to keep a reference on opaque data
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 7 Aug 2020 11:56:00 +0000 (13:56 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 7 Aug 2020 12:20:07 +0000 (14:20 +0200)
The ARGT_PTR argument type may now be used to keep a reference to opaque data in
the argument array used by sample fetches and converters. It is a generic way to
point on data. I guess it could be used for some other arguments, like proxy,
server, map or stick-table.

include/haproxy/arg-t.h

index 55d7e443c008aa3de1950e214c069bcd7566ec2c..3c5591f28b202fbef99a96918d51645c03b23698 100644 (file)
@@ -61,6 +61,7 @@ enum {
        ARGT_REG,      /* a pointer to a regex */
        ARGT_VAR,      /* contains a variable description. */
        ARGT_PBUF_FNUM, /* a protocol buffer field number */
+       ARGT_PTR,       /* a pointer to opaque data */
        /* please update arg_type_names[] in args.c if you add entries here */
 };
 
@@ -106,6 +107,7 @@ union arg_data {
        struct my_regex *reg;
        struct pbuf_fid fid;
        struct var_desc var;
+       void *ptr;
 };
 
 struct arg {