]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Move fields around, and add "type" and "tainted" flags.
authorAlan T. DeKok <aland@freeradius.org>
Tue, 15 Nov 2016 15:41:08 +0000 (10:41 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 15 Nov 2016 15:56:57 +0000 (10:56 -0500)
So that value_data_t becomes a bit more like a real boxed value
structure

src/include/pair.h

index 49370eb4bcf1381f18b8528f2b18b9b13b81f5b4..0f3af7b15876bad80f9ec70346a60c9bb4839ca4 100644 (file)
@@ -59,6 +59,13 @@ extern "C" {
  */
 typedef struct value_data value_data_t;
 struct value_data {
+       PW_TYPE                         type;                   //!< type of this value-data
+       size_t                          length;                 //!< Length of value data.
+
+       bool                            tainted;                //!< i.e. did it come from an untrusted source
+
+       value_data_t                    *next;                  //!< Next in a series of value_data.
+
        union {
                char const              *strvalue;              //!< Pointer to UTF-8 string.
                uint8_t const           *octets;                //!< Pointer to binary string.
@@ -90,9 +97,6 @@ struct value_data {
 
                void                    *ptr;                   //!< generic pointer.
        };
-
-       size_t          length;                                 //!< Length of value data.
-       value_data_t    *next;                                  //!< Next in a series of value_data.
 };
 
 /** The type of value a VALUE_PAIR contains
@@ -189,6 +193,7 @@ typedef struct value_pair_raw {
 #define vp_decimal     data.decimal
 
 #define vp_length      data.length
+#define vp_tainted     data.tainted
 
 #  define debug_pair(vp)       do { if (fr_debug_lvl && fr_log_fp) { \
                                        fr_pair_fprint(fr_log_fp, vp); \