]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
make node->attr a talloc'd pointer
authorAlan T. DeKok <aland@freeradius.org>
Mon, 23 Jan 2017 20:45:58 +0000 (15:45 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 23 Jan 2017 20:45:58 +0000 (15:45 -0500)
And move alternate into a "union" with attr.

And add a "regex_index" field to the union, because we can't
just steal node->attr->tmpl_num.  Which was always a hack.

src/main/xlat.h

index f95e7009b0f50e1b6fe82c3e7d017f4c112578e3..123c79596dc6c5209b855f474bbc72ae229a62b0 100644 (file)
@@ -64,9 +64,14 @@ struct xlat_exp {
        xlat_exp_t      *next;          //!< Next in the list.
 
        xlat_exp_t      *child;         //!< Nested expansion.
-       xlat_exp_t      *alternate;     //!< Alternative expansion if this one expanded to a zero length string.
 
-       vp_tmpl_t       attr;           //!< An attribute template.
+       union {
+               xlat_exp_t      *alternate;     //!< Alternative expansion if this one expanded to a zero length string.
+
+               vp_tmpl_t       *attr;          //!< An attribute template.
+
+               int             regex_index;    //!< for %{1} and friends.
+       };
        xlat_t const    *xlat;          //!< The xlat expansion to expand format with.
 };