typedef int (*radius_map_getvalue_t)(VALUE_PAIR **out, REQUEST *request, value_pair_map_t const *map, void *ctx);
-value_pair_map_t *map_from_cp(TALLOC_CTX *ctx, CONF_PAIR *cp,
- 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_afrom_cp(TALLOC_CTX *ctx, CONF_PAIR *cp,
+ 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_afrom_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,
- unsigned int max);
+int map_afrom_cs(value_pair_map_t **out, CONF_SECTION *cs,
+ pair_lists_t dst_list_def, pair_lists_t src_list_def,
+ unsigned int max);
-int map_from_vp_str(value_pair_map_t **out, REQUEST *request, char const *raw,
+int map_afrom_vp_str(value_pair_map_t **out, REQUEST *request, char const *raw,
request_refs_t dst_request_def, pair_lists_t dst_list_def,
request_refs_t src_request_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_cp(TALLOC_CTX *ctx, CONF_PAIR *cp,
+value_pair_map_t *map_afrom_cp(TALLOC_CTX *ctx, CONF_PAIR *cp,
request_refs_t dst_request_def, pair_lists_t dst_list_def,
request_refs_t src_request_def, pair_lists_t src_list_def)
{
* Uses 'name2' of section to set default request and lists.
*
* @param[in] cs the update section
- * @param[out] head Where to store the head of the map.
+ * @param[out] out Where to store the head of the map.
* @param[in] dst_list_def The default destination list, usually dictated by
* the section the module is being called in.
* @param[in] src_list_def The default source list, usually dictated by the
* @param[in] max number of mappings to process.
* @return -1 on error, else 0.
*/
-int map_from_cs(CONF_SECTION *cs, value_pair_map_t **head,
- pair_lists_t dst_list_def, pair_lists_t src_list_def,
- unsigned int max)
+int map_afrom_cs(value_pair_map_t **out, CONF_SECTION *cs, pair_lists_t dst_list_def, pair_lists_t src_list_def,
+ unsigned int max)
{
char const *cs_list, *p;
value_pair_map_t **tail, *map;
TALLOC_CTX *ctx;
- *head = NULL;
- tail = head;
+ *out = NULL;
+ tail = out;
if (!cs) return 0;
}
cp = cf_itemtopair(ci);
- map = map_from_cp(ctx, cp, request_def, dst_list_def, REQUEST_CURRENT, src_list_def);
+ map = map_afrom_cp(ctx, cp, request_def, dst_list_def, REQUEST_CURRENT, src_list_def);
if (!map) {
goto error;
}
return 0;
error:
- TALLOC_FREE(*head);
+ TALLOC_FREE(*out);
return -1;
}
* in.
* @return value_pair_map_t if successful or NULL on error.
*/
-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_afrom_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)
{
ssize_t slen;
value_pair_map_t *map;
* @param src_list_def to use if attribute isn't qualified.
* @return 0 on success, < 0 on error.
*/
-int map_from_vp_str(value_pair_map_t **out, REQUEST *request, char const *vp_str,
- 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_afrom_vp_str(value_pair_map_t **out, REQUEST *request, char const *vp_str,
+ request_refs_t dst_request_def, pair_lists_t dst_list_def,
+ request_refs_t src_request_def, pair_lists_t src_list_def)
{
char const *p = vp_str;
FR_TOKEN quote;
return -1;
}
- 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);
+ map = map_afrom_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;
/*
* This looks at cs->name2 to determine which list to update
*/
- rcode = map_from_cs(cs, &head, PAIR_LIST_REQUEST, PAIR_LIST_REQUEST, 128);
+ rcode = map_afrom_cs(&head, cs, PAIR_LIST_REQUEST, PAIR_LIST_REQUEST, 128);
if (rcode < 0) return NULL; /* message already printed */
if (!head) {
{
value_pair_map_t *map;
- if (map_from_cs(cf_section_sub_find(inst->cs, "update"),
- head, PAIR_LIST_REQUEST,
- PAIR_LIST_REQUEST, MAX_ATTRMAP) < 0) {
+ if (map_afrom_cs(head, cf_section_sub_find(inst->cs, "update"),
+ PAIR_LIST_REQUEST, PAIR_LIST_REQUEST, MAX_ATTRMAP) < 0) {
return -1;
}
value_pair_map_t *attr = NULL;
RDEBUG3("Parsing valuepair string \"%s\"", self->values[i]->bv_val);
- if (map_from_vp_str(&attr, request, self->values[i]->bv_val,
- map->lhs->tmpl_request, map->lhs->tmpl_list,
- REQUEST_CURRENT, PAIR_LIST_REQUEST) < 0) {
+ if (map_afrom_vp_str(&attr, request, self->values[i]->bv_val,
+ map->lhs->tmpl_request, map->lhs->tmpl_list,
+ REQUEST_CURRENT, PAIR_LIST_REQUEST) < 0) {
RWDEBUG("Failed parsing \"%s\" as valuepair, skipping...", self->values[i]->bv_val);
continue;
}
{
value_pair_map_t *map;
- if (map_from_cs(cf_section_sub_find(inst->cs, "update"),
- head, PAIR_LIST_REPLY,
- PAIR_LIST_REQUEST, LDAP_MAX_ATTRMAP) < 0) {
+ if (map_afrom_cs(head, cf_section_sub_find(inst->cs, "update"),
+ PAIR_LIST_REPLY,
+ PAIR_LIST_REQUEST, LDAP_MAX_ATTRMAP) < 0) {
return -1;
}
/*
value_pair_map_t *attr;
RDEBUG3("Parsing attribute string '%s'", values[i]);
- if (map_from_vp_str(&attr, request, values[i],
- REQUEST_CURRENT, PAIR_LIST_REPLY,
- REQUEST_CURRENT, PAIR_LIST_REQUEST) < 0) {
+ if (map_afrom_vp_str(&attr, request, values[i],
+ REQUEST_CURRENT, PAIR_LIST_REPLY,
+ REQUEST_CURRENT, PAIR_LIST_REQUEST) < 0) {
RWDEBUG("Failed parsing '%s' value \"%s\" as valuepair, skipping...",
inst->valuepair_attr, values[i]);
continue;