* @param[in] list to iterate over.
* @param[in] current The fr_value_box_t cursor->current. Will be advanced and checked to
* see if it matches the specified fr_dict_attr_t.
- * @param[in] uctx The fr_dict_attr_t to search for.
+ * @param[in] uctx unused
* @return
* - Next matching fr_pair_t.
* - NULL if not more matching fr_pair_ts could be found.
_fr_pair_iter_next_value, NULL, NULL, NULL, NULL, NULL, is_const);
}
+/** Iterate over pairs
+ *
+ * @param[in] list to iterate over.
+ * @param[in] current The fr_value_box_t cursor->current. Will be advanced and checked to
+ * see if it matches the specified fr_dict_attr_t.
+ * @param[in] uctx The parent dcursor
+ * @return
+ * - Next matching fr_pair_t.
+ * - NULL if not more matching fr_pair_ts could be found.
+ */
+static void *_fr_pair_iter_next_dcursor_value(UNUSED fr_dlist_head_t *list, void *current, void *uctx)
+{
+ fr_pair_t *vp;
+ fr_dcursor_t *parent = uctx;
+
+ if (!current) {
+ vp = NULL;
+ } else {
+ vp = (fr_pair_t *) ((uint8_t *) current - offsetof(fr_pair_t, data));
+ PAIR_VERIFY(vp);
+ }
+
+ while ((vp = fr_dcursor_next(parent))) {
+ PAIR_VERIFY(vp);
+
+ if (!fr_type_is_leaf(vp->da->type)) break;
+
+ continue;
+ }
+
+ return vp;
+}
+
+/** Initialises a special dcursor over another cursor which returns #fr_pair_t, but we return #fr_value_box_t
+ *
+ * Filters can be applied later with fr_dcursor_filter_set.
+ *
+ * @param[out] cursor to initialise.
+ * @param[in] list to iterate over.
+ * @param[in] parent to iterate over
+ * @param[in] is_const whether the fr_pair_list_t is const.
+ * @return
+ * - NULL if src does not point to any items.
+ * - The first pair in the list.
+ */
+fr_value_box_t *_fr_pair_dcursor_nested_init(fr_dcursor_t *cursor, fr_pair_list_t const *list, fr_dcursor_t *parent,
+ bool is_const)
+{
+ return _fr_dcursor_init(cursor, fr_pair_order_list_dlist_head(&list->order),
+ _fr_pair_iter_next_dcursor_value, NULL, NULL, NULL, NULL, parent, is_const);
+}
+
/** Add a VP to the start of the list.
*
* Links an additional VP 'add' at the beginning a list.
bool is_const) CC_HINT(nonnull);
+/** Initialises a special dcursor which returns only the values of a pair from a parent dcursor
+ *
+ * @note - the list cannot be modified, and structural attributes are not returned.
+ *
+ * @param[out] cursor to initialise.
+ * @param[in] list to iterate over.
+ * @return
+ * - NULL if src does not point to any items.
+ * - The first pair in the list.
+ */
+#define fr_pair_dcursor_nested_init(_cursor, _list, _parent) \
+ _fr_pair_dcursor_nested_init(_cursor, \
+ _list, \
+ _parent, \
+ IS_CONST(fr_pair_list_t *, _list))
+fr_value_box_t *_fr_pair_dcursor_nested_init(fr_dcursor_t *cursor, fr_pair_list_t const *list, fr_dcursor_t *parent,
+ bool is_const) CC_HINT(nonnull);
+
/** Compare two attributes using and operator.
*
* @return