]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Rename map_from_str to map_from_fields
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 11 Sep 2014 17:30:58 +0000 (13:30 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 11 Sep 2014 20:02:28 +0000 (16:02 -0400)
src/include/map.h
src/main/map.c
src/main/modcall.c
src/main/parser.c

index 604482db1c4938fb00b9f62ebfb9033aa6daaea7..ba225b8e34ed62bac2c991674951f7990c424a38 100644 (file)
@@ -61,10 +61,10 @@ 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_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,
index d7e7e191b731106ddc879df13c897e03c0dfc4fb..bc62d46efdabae637663a8d4cbddbb7101f8d066 100644 (file)
@@ -343,12 +343,12 @@ error:
  *     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;
 
@@ -399,8 +399,8 @@ int map_from_vp_str(value_pair_map_t **out, REQUEST *request, char const *raw,
                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;
index 8cbd52d48ce3bce1224092be38c064c1983e65f9..469bc0164ae67bfe63d7a0ce786ace1b40ece273 100644 (file)
@@ -3004,10 +3004,10 @@ static bool pass2_callback(UNUSED void *ctx, fr_cond_t *c)
                /*
                 *      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;
index 4fcd1f00dddf5ea6574e2a875a21081e127caf8b..f2d917541276ee14788bc5229797ec048ef45dde 100644 (file)
@@ -640,9 +640,9 @@ static ssize_t condition_tokenize(TALLOC_CTX *ctx, CONF_ITEM *ci, char const *st
                                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 '&',
@@ -654,9 +654,9 @@ static ssize_t condition_tokenize(TALLOC_CTX *ctx, CONF_ITEM *ci, char const *st
                                    (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");
                                }