]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add fr_value_box_set_attr to populate FR_TYPE_ATTR boxes
authorNick Porter <nick@portercomputing.co.uk>
Wed, 1 Oct 2025 10:55:43 +0000 (11:55 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Wed, 1 Oct 2025 10:55:43 +0000 (11:55 +0100)
src/lib/util/value.c
src/lib/util/value.h

index 6e7a5a96af69da0dfc262e04584623e9092ac781..d53a86933f3027fda0fa7f338b5ffe957b71aa64 100644 (file)
@@ -4947,6 +4947,13 @@ void fr_value_box_set_cursor(fr_value_box_t *dst, fr_type_t type, void *cursor,
        dst->vb_cursor_name = name;
 }
 
+void fr_value_box_set_attr(fr_value_box_t *dst, fr_dict_attr_t const *da)
+{
+       fr_value_box_init(dst, FR_TYPE_ATTR, NULL, false);
+       dst->vb_attr = da;
+       dst->enumv = da;
+}
+
 /** Increment a boxed value
  *
  * Implements safe integer overflow.
index 3dfdbf28ebb742b342948de7604cfc57587b9f46..5d3a36fec83789961dd02b8d71b6d92f0100a37d 100644 (file)
@@ -1215,6 +1215,8 @@ void              fr_value_box_set_cursor(fr_value_box_t *dst, fr_type_t type, void *ptr, ch
 
 #define                fr_value_box_get_cursor(_dst) talloc_get_type_abort((_dst)->vb_cursor, fr_dcursor_t)
 
+void           fr_value_box_set_attr(fr_value_box_t *dst, fr_dict_attr_t const *da);
+
 /** @name Parsing
  *
  * @{