{
int ret;
fr_pair_t *vp;
- fr_cursor_t cursor;
/*
* The attribute isn't an array, so it MUST have a
}
MEM(vp = fr_pair_afrom_da(parent, da));
- (void) fr_cursor_init(&cursor, &parent->options);
/*
* Add in the first value.
vp->op = T_OP_EQ;
- fr_cursor_append(&cursor, vp);
- (void) fr_cursor_tail(&cursor);
+ fr_pair_add(&parent->options, vp);
// @todo - print out ISC names...
IDEBUG("%.*s option %s %s ", state->braces, spaces, da->name, value);
vp->op = T_OP_EQ;
- fr_cursor_append(&cursor, vp);
- (void) fr_cursor_tail(&cursor);
+ fr_pair_add(&parent->options, vp);
// @todo - print out ISC names...
IDEBUG("%.*s option %s %.*ss ", state->braces, spaces, da->name, state->token_len, state->token);
{
int ret;
fr_pair_t *vp;
- fr_cursor_t cursor;
if (!info->parent) return -1; /* internal error */
ret = fr_value_box_copy(vp, &(vp->data), info->argv[0]);
if (ret < 0) return ret;
- (void) fr_cursor_init(&cursor, &info->parent->options);
- (void) fr_cursor_tail(&cursor);
- fr_cursor_append(&cursor, vp);
+ fr_pair_add(&info->parent->options, vp);
talloc_free(info);
return 2;
* Find a "fixed-address" sub-statement.
*/
for (info = host->child; info != NULL; info = info->next) {
- fr_cursor_t cursor;
-
if (!info->cmd) return -1; /* internal error */
/*
ret = fr_value_box_copy(vp, &(vp->data), info->argv[0]);
if (ret < 0) return ret;
- /*
- * <sigh> I miss pair_add()
- */
- (void) fr_cursor_init(&cursor, &request->reply_pairs);
- (void) fr_cursor_tail(&cursor);
- fr_cursor_append(&cursor, vp);
+ fr_pair_add(&request->reply_pairs, vp);
/*
* If we've found a fixed IP, then tell
*/
if (!fr_pair_list_empty(&head->options)) {
fr_pair_t *vp = NULL;
- fr_cursor_t option_cursor;
- fr_cursor_t reply_cursor;
-
- (void) fr_cursor_init(&reply_cursor, &request->reply_pairs);
- (void) fr_cursor_tail(&reply_cursor);
/*
* Walk over the input list, adding the options
* options that match. This would likely be
* faster.
*/
- for (vp = fr_cursor_init(&option_cursor, &head->options);
+ for (vp = fr_pair_list_head(&head->options);
vp != NULL;
- vp = fr_cursor_next(&option_cursor)) {
+ vp = fr_pair_list_next(&head->options, vp)) {
fr_pair_t *reply;
reply = fr_pair_find_by_da(&request->reply_pairs, vp->da);
copy = fr_pair_copy(request->reply_ctx, vp);
if (!copy) return -1;
- fr_cursor_append(&reply_cursor, copy);
- (void) fr_cursor_tail(&reply_cursor);
+ fr_pair_add(&request->reply_pairs, copy);
- next = fr_cursor_next_peek(&option_cursor);
+ next = fr_pair_list_next(&head->options, vp);
if (!next) break;
if (next->da != vp->da) break;
- vp = fr_cursor_next(&option_cursor);
+ vp = fr_pair_list_next(&head->options, vp);
}
}