]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
rename fr_pair_list_move() to fr_pair_list_move_op()
authorAlan T. DeKok <aland@freeradius.org>
Wed, 8 Dec 2021 18:09:19 +0000 (13:09 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 9 Dec 2021 12:09:29 +0000 (07:09 -0500)
because it's a legacy function, and shouldn't match the new
API layout.

src/bin/radsniff.c
src/lib/server/map.c
src/lib/server/pairmove.c
src/lib/util/dpair_legacy.c
src/lib/util/pair_legacy.c
src/lib/util/pair_legacy.h
src/lib/util/pair_legacy_tests.c
src/modules/rlm_exec/rlm_exec.c
src/modules/rlm_files/rlm_files.c

index 41279e763a7b457f5d528d25d229a03abc831353..bb5bac37e0ff2547b3f50508718482918d65ccc3 100644 (file)
@@ -1479,7 +1479,7 @@ static void rs_packet_process(uint64_t count, rs_event_t *event, struct pcap_pkt
                         *      The delay is so we can detect retransmissions.
                         */
                        original->linked = talloc_steal(original, packet);
-                       fr_pair_list_move(&original->link_vps, &decoded, T_OP_ADD_EQ);  /* Move the vps over */
+                       fr_pair_list_move_op(&original->link_vps, &decoded, T_OP_ADD_EQ);       /* Move the vps over */
                        rs_tv_add_ms(&header->ts, conf->stats.timeout, &original->when);
                        if (fr_event_timer_at(NULL, event->list, &original->event,
                                              fr_time_from_timeval(&original->when), _rs_event, original) < 0) {
@@ -1672,7 +1672,7 @@ static void rs_packet_process(uint64_t count, rs_event_t *event, struct pcap_pkt
                        fr_pair_list_free(&original->packet_vps);
                        fr_radius_packet_free(&original->packet);
                        original->packet = talloc_steal(original, packet);
-                       fr_pair_list_move(&original->packet_vps, &decoded, T_OP_ADD_EQ);
+                       fr_pair_list_move_op(&original->packet_vps, &decoded, T_OP_ADD_EQ);
 
                        /* Request may need to be reinserted as the 5 tuple of the response may of changed */
                        if (rs_packet_cmp(original, &search) != 0) {
@@ -1683,7 +1683,7 @@ static void rs_packet_process(uint64_t count, rs_event_t *event, struct pcap_pkt
                        fr_pair_list_free(&original->expect_vps);
                        fr_radius_packet_free(&original->expect);
                        original->expect = talloc_steal(original, search.expect);
-                       fr_pair_list_move(&original->expect_vps, &search.expect_vps, T_OP_ADD_EQ);
+                       fr_pair_list_move_op(&original->expect_vps, &search.expect_vps, T_OP_ADD_EQ);
 
                        /* Disarm the timer for the cleanup event for the original request */
                        fr_event_timer_delete(&original->event);
@@ -1700,10 +1700,10 @@ static void rs_packet_process(uint64_t count, rs_event_t *event, struct pcap_pkt
                        original->capture_p = original->capture;
 
                        original->packet = talloc_steal(original, packet);
-                       fr_pair_list_move(&original->packet_vps, &decoded, T_OP_ADD_EQ);
+                       fr_pair_list_move_op(&original->packet_vps, &decoded, T_OP_ADD_EQ);
 
                        original->expect = talloc_steal(original, search.expect);
-                       fr_pair_list_move(&original->expect_vps, &search.expect_vps, T_OP_ADD_EQ);
+                       fr_pair_list_move_op(&original->expect_vps, &search.expect_vps, T_OP_ADD_EQ);
 
                        if (!fr_pair_list_empty(&search.link_vps)) {
                                bool ret;
@@ -1714,7 +1714,7 @@ static void rs_packet_process(uint64_t count, rs_event_t *event, struct pcap_pkt
                                     vp = fr_pair_list_next(&search.link_vps, vp)) {
                                        fr_pair_steal(original, vp);
                                }
-                               fr_pair_list_move(&original->link_vps, &search.link_vps, T_OP_ADD_EQ);
+                               fr_pair_list_move_op(&original->link_vps, &search.link_vps, T_OP_ADD_EQ);
 
                                /* We should never have conflicts */
                                ret = fr_rb_insert(link_tree, original);
index d932a4cffb55bb2ff40c4f8e2492da7eed7fbbf9..d2815896ec74e84d821dff3f38477f4cfea3567b 100644 (file)
@@ -1580,13 +1580,13 @@ int map_to_request(request_t *request, map_t const *map, radius_map_getvalue_t f
                                FALL_THROUGH;
 
                case T_OP_ADD_EQ:
-                               fr_pair_list_move(list, &src_list, T_OP_ADD_EQ);
+                               fr_pair_list_move_op(list, &src_list, T_OP_ADD_EQ);
                                fr_pair_list_free(&src_list);
                        }
                        goto update;
 
                case T_OP_PREPEND:
-                       fr_pair_list_move(list, &src_list, map->op);
+                       fr_pair_list_move_op(list, &src_list, map->op);
                        fr_pair_list_free(&src_list);
                        goto update;
 
index e08d6226e8f7d64a056cb624254ad56e21a8b805..69d9c55e212ae87d5a8bd46b6089e9e964ca3973 100644 (file)
@@ -35,7 +35,7 @@ RCSID("$Id$")
 #include <ctype.h>
 
 /*
- *     The fr_pair_list_move() function in src/lib/valuepair.c does all sorts of
+ *     The fr_pair_list_move_op() function in src/lib/valuepair.c does all sorts of
  *     extra magic that we don't want here.
  *
  *     FIXME: integrate this with the code calling it, so that we
@@ -58,7 +58,7 @@ void radius_pairmove(request_t *request, fr_pair_list_t *to, fr_pair_list_t *fro
         *
         *      It also means that the operators apply ONLY to the
         *      attributes in the original list.  With the previous
-        *      implementation of fr_pair_list_move(), adding two attributes
+        *      implementation of fr_pair_list_move_op(), adding two attributes
         *      via "+=" and then "=" would mean that the second one
         *      wasn't added, because of the existence of the first
         *      one in the "to" list.  This implementation doesn't
index c8b7c8ced8654ac9a48f931aa5655103dec60c2b..97066d37381762cdab6ca5abb624aa43902b7200 100644 (file)
@@ -647,7 +647,7 @@ int fr_pair_list_afrom_file(TALLOC_CTX *ctx, fr_dict_t const *dict, fr_pair_list
  *
  * @see radius_pairmove
  */
-void fr_pair_list_move(fr_pair_list_t *to, fr_pair_list_t *from, fr_token_t op)
+void fr_pair_list_move_op(fr_pair_list_t *to, fr_pair_list_t *from, fr_token_t op)
 {
        fr_pair_t *i, *found;
        fr_pair_list_t head_new, head_prepend;
index eaf2dd57c77f5386707bf742cd2a14e62748b4c2..9a46eaf5a15ccf9c91cb27250d09439d12813736 100644 (file)
@@ -703,7 +703,7 @@ int fr_pair_list_afrom_file(TALLOC_CTX *ctx, fr_dict_t const *dict, fr_pair_list
  *
  * @see radius_pairmove
  */
-void fr_pair_list_move(fr_pair_list_t *to, fr_pair_list_t *from, fr_token_t op)
+void fr_pair_list_move_op(fr_pair_list_t *to, fr_pair_list_t *from, fr_token_t op)
 {
        fr_pair_t *i, *found;
        fr_pair_list_t head_new, head_prepend;
index 62aa31781f09870c015668886f7471cea7731083..468a348b3ebeeb5d73d3e1e36ee1efe3e271bb8b 100644 (file)
@@ -44,7 +44,7 @@ fr_token_t    fr_pair_list_afrom_str(TALLOC_CTX *ctx, fr_dict_t const *dict,
 int            fr_pair_list_afrom_file(TALLOC_CTX *ctx, fr_dict_t const *dict,
                                        fr_pair_list_t *out, FILE *fp, bool *pfiledone);
 
-void           fr_pair_list_move(fr_pair_list_t *to, fr_pair_list_t *from, fr_token_t op);
+void           fr_pair_list_move_op(fr_pair_list_t *to, fr_pair_list_t *from, fr_token_t op);
 
 #ifdef __cplusplus
 }
index 96388a09e0f5af03c04a760c261720924c0de8d8..966f04d52a7eda16b2841a38720c93297d6fd501 100644 (file)
@@ -209,7 +209,7 @@ static void test_fr_pair_list_afrom_file(void)
        fclose(fp);
 }
 
-static void test_fr_pair_list_move(void)
+static void test_fr_pair_list_move_op(void)
 {
        fr_pair_t      *vp;
        fr_pair_list_t old_list, new_list;
@@ -224,8 +224,8 @@ static void test_fr_pair_list_move(void)
        TEST_CHECK(fr_pair_list_afrom_file(autofree, test_dict, &old_list, fp, &pfiledone) == 0);
        TEST_CHECK(pfiledone == true);
 
-       TEST_CASE("Move pair from 'old_list' to 'new_list' using fr_pair_list_move()");
-       fr_pair_list_move(&new_list, &old_list, T_OP_ADD_EQ);
+       TEST_CASE("Move pair from 'old_list' to 'new_list' using fr_pair_list_move_op()");
+       fr_pair_list_move_op(&new_list, &old_list, T_OP_ADD_EQ);
 
        TEST_CASE("Looking for Test-Uint32-0");
        TEST_CHECK((vp = fr_pair_find_by_da_idx(&new_list, fr_dict_attr_test_uint32, 0)) != NULL);
@@ -263,7 +263,7 @@ TEST_LIST = {
        { "fr_pair_mark_xlat",       test_fr_pair_mark_xlat },
        { "fr_pair_list_afrom_str",  test_fr_pair_list_afrom_str },
        { "fr_pair_list_afrom_file", test_fr_pair_list_afrom_file },
-       { "fr_pair_list_move",       test_fr_pair_list_move },
+       { "fr_pair_list_move_op",       test_fr_pair_list_move_op },
 
        { NULL }
 };
index 50e076eeb3cf88a13330538cfaf564aa89724d1b..458bfcbdbf3a3306cc85a9bb392b33225117452b 100644 (file)
@@ -380,7 +380,7 @@ static unlang_action_t mod_exec_wait_resume(rlm_rcode_t *p_result, module_ctx_t
                        ctx = tmpl_list_ctx(request, inst->output_list);
 
                        fr_pair_list_afrom_box(ctx, &vps, request->dict, box);
-                       if (!fr_pair_list_empty(&vps)) fr_pair_list_move(output_pairs, &vps, T_OP_ADD_EQ);
+                       if (!fr_pair_list_empty(&vps)) fr_pair_list_move_op(output_pairs, &vps, T_OP_ADD_EQ);
 
                        fr_dlist_talloc_free(&m->box);  /* has been consumed */
                }
index 96d7a02672e55352392c761b6a3a61dec4d05155..71e8f79ea2516f464872f1b3cb9914c5e08d0141 100644 (file)
@@ -525,7 +525,7 @@ redo:
                /*
                 *      Move the control items over, too.
                 */
-               fr_pair_list_move(&request->control_pairs, &list, T_OP_ADD_EQ);
+               fr_pair_list_move_op(&request->control_pairs, &list, T_OP_ADD_EQ);
                fr_pair_list_free(&list);
 
                /* ctx may be reply */