request_refs_t dst_request_def, pair_lists_t dst_list_def,
request_refs_t src_request_def, pair_lists_t src_list_def);
-value_pair_map_t *map_from_str(TALLOC_CTX *ctx, char const *lhs, FR_TOKEN lhs_type,
- FR_TOKEN op, char const *rhs, FR_TOKEN rhs_type,
- request_refs_t dst_request_def, pair_lists_t dst_list_def,
- request_refs_t src_request_def, pair_lists_t src_list_def);
+value_pair_map_t *map_from_fields(TALLOC_CTX *ctx, char const *lhs, FR_TOKEN lhs_type,
+ FR_TOKEN op, char const *rhs, FR_TOKEN rhs_type,
+ request_refs_t dst_request_def, pair_lists_t dst_list_def,
+ request_refs_t src_request_def, pair_lists_t src_list_def);
int map_from_cs(CONF_SECTION *cs, value_pair_map_t **head,
pair_lists_t dst_list_def, pair_lists_t src_list_def,
* in.
* @return value_pair_map_t if successful or NULL on error.
*/
-value_pair_map_t *map_from_str(TALLOC_CTX *ctx, char const *lhs, FR_TOKEN lhs_type,
- FR_TOKEN op, char const *rhs, FR_TOKEN rhs_type,
- request_refs_t dst_request_def,
- pair_lists_t dst_list_def,
- request_refs_t src_request_def,
- pair_lists_t src_list_def)
+value_pair_map_t *map_from_fields(TALLOC_CTX *ctx, char const *lhs, FR_TOKEN lhs_type,
+ FR_TOKEN op, char const *rhs, FR_TOKEN rhs_type,
+ request_refs_t dst_request_def,
+ pair_lists_t dst_list_def,
+ request_refs_t src_request_def,
+ pair_lists_t src_list_def)
{
value_pair_map_t *map;
return -1;
}
- map = map_from_str(request, tokens.l_opand, T_BARE_WORD, tokens.op, tokens.r_opand, tokens.quote,
- dst_request_def, dst_list_def, src_request_def, src_list_def);
+ map = map_from_fields(request, raw.l_opand, T_BARE_WORD, raw.op, raw.r_opand, raw.quote,
+ dst_request_def, dst_list_def, src_request_def, src_list_def);
if (!map) {
REDEBUG("Failed parsing attribute string: %s", fr_strerror());
return -1;
/*
* Re-parse the LHS as an attribute.
*/
- map = map_from_str(c, old->dst->name, T_BARE_WORD, old->op,
- old->src->name, T_BARE_WORD,
- REQUEST_CURRENT, PAIR_LIST_REQUEST,
- REQUEST_CURRENT, PAIR_LIST_REQUEST);
+ map = map_from_fields(c, old->dst->name, T_BARE_WORD, old->op,
+ old->src->name, T_BARE_WORD,
+ REQUEST_CURRENT, PAIR_LIST_REQUEST,
+ REQUEST_CURRENT, PAIR_LIST_REQUEST);
if (!map) {
cf_log_err(old->ci, "Failed parsing condition");
return false;
return_P("Unexpected regular expression");
}
- c->data.map = map_from_str(c, lhs, lhs_type, op, rhs, rhs_type,
- REQUEST_CURRENT, PAIR_LIST_REQUEST,
- REQUEST_CURRENT, PAIR_LIST_REQUEST);
+ c->data.map = map_from_fields(c, lhs, lhs_type, op, rhs, rhs_type,
+ REQUEST_CURRENT, PAIR_LIST_REQUEST,
+ REQUEST_CURRENT, PAIR_LIST_REQUEST);
if (!c->data.map) {
/*
* If strings are T_BARE_WORD and they start with '&',
(lhs_type != T_BARE_WORD)) {
return_0("Syntax error");
}
- c->data.map = map_from_str(c, lhs, lhs_type + 1, op, rhs, rhs_type,
- REQUEST_CURRENT, PAIR_LIST_REQUEST,
- REQUEST_CURRENT, PAIR_LIST_REQUEST);
+ c->data.map = map_from_fields(c, lhs, lhs_type + 1, op, rhs, rhs_type,
+ REQUEST_CURRENT, PAIR_LIST_REQUEST,
+ REQUEST_CURRENT, PAIR_LIST_REQUEST);
if (!c->data.map) {
return_0("Unknown attribute");
}