* - The first item returned by the iterator.
*/
#define fr_cursor_talloc_iter_init(_cursor, _head, _iter, _ctx, _type) \
- _fr_cursor_init(_cursor, (void * const *)_head, offsetof(__typeof__(**(_head)), next), _iter, _ctx, #_type)
+ _fr_cursor_init(_cursor, (void **)_head, offsetof(__typeof__(**(_head)), next), _iter, _ctx, #_type)
/** Initialise a cursor with a custom iterator
*
* - The first item returned by the iterator.
*/
#define fr_cursor_iter_init(_cursor, _head, _iter, _ctx) \
- _fr_cursor_init(_cursor, (void * const *)_head, offsetof(__typeof__(**(_head)), next), _iter, _ctx, NULL)
+ _fr_cursor_init(_cursor, (void **)_head, offsetof(__typeof__(**(_head)), next), _iter, _ctx, NULL)
/** Initialise a cursor with runtime talloc type safety checks
*
* - The first item in the list.
*/
#define fr_cursor_talloc_init(_cursor, _head, _type) \
- _fr_cursor_init(_cursor, (void * const *)_head, offsetof(__typeof__(**(_head)), next), NULL, NULL, #_type)
+ _fr_cursor_init(_cursor, (void **)_head, offsetof(__typeof__(**(_head)), next), NULL, NULL, #_type)
/** Initialise a cursor
*
int fr_pair_list_copy(TALLOC_CTX *ctx, VALUE_PAIR **to, VALUE_PAIR *from);
int fr_pair_list_copy_by_da(TALLOC_CTX *ctx, VALUE_PAIR **to,
- VALUE_PAIR const *from, fr_dict_attr_t const *da);
+ VALUE_PAIR *from, fr_dict_attr_t const *da);
int fr_pair_list_copy_by_ancestor(TALLOC_CTX *ctx, VALUE_PAIR **to,
- VALUE_PAIR const *from, fr_dict_attr_t const *parent_da);
+ VALUE_PAIR *from, fr_dict_attr_t const *parent_da);
void fr_pair_list_move(TALLOC_CTX *ctx, VALUE_PAIR **to, VALUE_PAIR **from);
int fr_pair_list_move_by_da(TALLOC_CTX *ctx, VALUE_PAIR **to,
- VALUE_PAIR const *from, fr_dict_attr_t const *da);
+ VALUE_PAIR **from, fr_dict_attr_t const *da);
int fr_pair_list_move_by_ancestor(TALLOC_CTX *ctx, VALUE_PAIR **to,
- VALUE_PAIR const *from, fr_dict_attr_t const *da);
+ VALUE_PAIR **from, fr_dict_attr_t const *da);
/* Value manipulation */
int fr_pair_value_from_str(VALUE_PAIR *vp, char const *value, size_t len);
* - -1 on error.
*/
int fr_pair_list_copy_by_da(TALLOC_CTX *ctx, VALUE_PAIR **to,
- VALUE_PAIR const *from, fr_dict_attr_t const *da)
+ VALUE_PAIR *from, fr_dict_attr_t const *da)
{
fr_cursor_t src, dst, tmp;
* - -1 on error.
*/
int fr_pair_list_copy_by_ancestor(TALLOC_CTX *ctx, VALUE_PAIR **to,
- VALUE_PAIR const *from, fr_dict_attr_t const *parent_da)
+ VALUE_PAIR *from, fr_dict_attr_t const *parent_da)
{
fr_cursor_t src, dst, tmp;
* - 0 if no pairs were moved.
*/
int fr_pair_list_move_by_da(TALLOC_CTX *ctx, VALUE_PAIR **to,
- VALUE_PAIR const *from, fr_dict_attr_t const *da)
+ VALUE_PAIR **from, fr_dict_attr_t const *da)
{
fr_cursor_t src, dst;
}
fr_cursor_talloc_init(&dst, to, VALUE_PAIR);
- for (vp = fr_cursor_talloc_iter_init(&src, &from, fr_pair_iter_next_by_da, da, VALUE_PAIR);
+ for (vp = fr_cursor_talloc_iter_init(&src, from, fr_pair_iter_next_by_da, da, VALUE_PAIR);
vp;
vp = fr_cursor_next(&src), cnt++) {
VP_VERIFY(vp);
* - >0 number of pairs moved.
* - 0 if no pairs were moved.
*/
-int fr_pair_list_move_by_ancestor(TALLOC_CTX *ctx, VALUE_PAIR **to, VALUE_PAIR const *from,
- fr_dict_attr_t const *parent_da)
+int fr_pair_list_move_by_ancestor(TALLOC_CTX *ctx, VALUE_PAIR **to,
+ VALUE_PAIR **from, fr_dict_attr_t const *parent_da)
{
fr_cursor_t src, dst;
}
fr_cursor_talloc_init(&dst, to, VALUE_PAIR);
- for (vp = fr_cursor_talloc_iter_init(&src, &from, fr_pair_iter_next_by_ancestor, parent_da, VALUE_PAIR);
+ for (vp = fr_cursor_talloc_iter_init(&src, from, fr_pair_iter_next_by_ancestor, parent_da, VALUE_PAIR);
vp;
vp = fr_cursor_next(&src), cnt++) {
VP_VERIFY(vp);
default:
return -1;
}
- default:
return 0;
+
+ case FR_TYPE_IPV4_PREFIX:
+ case FR_TYPE_IPV6_PREFIX:
+ case FR_TYPE_COMBO_IP_PREFIX:
+ return 0;
+
+ default:
+ rad_assert(0);
+ return -1;
}
}