]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: samples: extract the anonymous union and create the union sample_value
authorThierry FOURNIER <tfournier@arpalert.org>
Thu, 20 Aug 2015 11:52:51 +0000 (13:52 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 20 Aug 2015 15:13:46 +0000 (17:13 +0200)
This extract is not really required, but it maybe will be usefull later.
A comming soonpatch about simplification of stick table values will
use this union

include/types/sample.h

index 10b941b009ed60e0565ee65b9bd94d66fbdd4a15..6d30943e5708e8df168573029d61c3485bfaaf4b 100644 (file)
@@ -242,16 +242,18 @@ struct meth {
        struct chunk str;
 };
 
+union sample_value {
+       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 meth     meth;  /* used for http method */
+};
+
 /* Used to store sample constant */
 struct sample_data {
        int type;                 /* SMP_T_* */
-       union {
-               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 meth     meth;  /* used for http method */
-       } data;                        /* sample data */
+       union sample_value data;  /* sample data */
 };
 
 /* a sample is a typed data extracted from a stream. It has a type, contents,