]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add tmpl_attr_head_is_list()
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 9 Feb 2023 18:40:09 +0000 (12:40 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 9 Feb 2023 18:41:09 +0000 (12:41 -0600)
src/lib/server/tmpl.h

index eb35a8bdd13e6f351f6bed86137091213215f3a5..3eee2a34362e6dc766524493ca8b4f7c0ee2a3e7 100644 (file)
@@ -691,6 +691,22 @@ static inline bool tmpl_attr_is_list_attr(tmpl_attr_t const *ar)
               (ar->ar_da == request_attr_state);
 }
 
+/** Return true if the head attribute reference is a list reference
+ *
+ * @hidecallergraph
+ */
+static inline bool tmpl_attr_head_is_list(tmpl_t const *vpt)
+{
+       tmpl_attr_t *ar;
+
+       tmpl_assert_type(tmpl_contains_attr(vpt));
+
+       ar = tmpl_attr_list_head(tmpl_attr(vpt));
+       if (unlikely(!ar)) return false;
+
+       return tmpl_attr_is_list_attr(ar);
+}
+
 /** Return true if the last attribute reference is "normal"
  *
  * @hidecallergraph