]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add fields to store attribute location
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 23 Oct 2024 06:08:00 +0000 (00:08 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 24 Oct 2024 23:07:55 +0000 (17:07 -0600)
src/lib/util/dict.h
src/lib/util/dict_util.c

index 245deecd62899411fc6fd850d666b8b689f1e9f1..211daeb057d9304e37db12b1cdf8e6c1a63acf23 100644 (file)
@@ -188,6 +188,11 @@ struct dict_attr_s {
 
        fr_dict_attr_flags_t    flags;                          //!< Flags.
 
+       char const              *filename;                      //!< Where the attribute was defined.
+                                                               ///< this buffer's lifetime is bound to the
+                                                               ///< fr_dict_t.
+       int                     line;                           //!< Line number where the attribute was defined.
+
        uint8_t                 ext[FR_DICT_ATTR_EXT_MAX];      //!< Extensions to the dictionary attribute.
 } CC_HINT(aligned(FR_EXT_ALIGNMENT));
 
index 91ce677624836b0ccff36e60b999d4964a2ee4e7..5dbdae876262ad23524c7ad520140b35b9308635 100644 (file)
@@ -642,6 +642,14 @@ int dict_attr_init(fr_dict_attr_t **da_p,
         *      This attribute is just a reference to another.
         */
        if (args->ref) if (dict_attr_ref_init(da_p, args->ref) < 0) return -1;
+/** Set where the dictionary attribute was defined
+ *
+ */
+void dict_attr_location_init(fr_dict_attr_t *da, char const *filename, int line)
+{
+       da->filename = filename;
+       da->line = line;
+}
 
        /*
         *      Name is a separate talloc chunk.  We allocate