]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add tmpl_attr_tail_is_raw()
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 9 Feb 2023 16:57:29 +0000 (10:57 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 9 Feb 2023 16:57:29 +0000 (10:57 -0600)
src/lib/server/tmpl.h

index 4ef40e9c700737b9d8adc9658b8b288a29c2674d..d58cc3afe772d0aab0356f9403e06fe8e926f220 100644 (file)
@@ -772,6 +772,22 @@ static inline bool tmpl_attr_tail_is_unresolved(tmpl_t const *vpt)
        return ar_is_normal(ar);
 }
 
+/** Return true if the last attribute reference is "raw"
+ *
+ * @hidecallergraph
+ */
+static inline bool tmpl_attr_tail_is_raw(tmpl_t const *vpt)
+{
+       tmpl_attr_t *ar;
+
+       tmpl_assert_type(tmpl_contains_attr(vpt));
+
+       ar = tmpl_attr_list_tail(tmpl_attr(vpt));
+       if (unlikely(!ar)) return false;
+
+       return ar_is_raw(ar);
+}
+
 /** Return the last attribute reference
  *
  * @hidecallergraph