]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
this function is only used by the xlat code
authorAlan T. DeKok <aland@freeradius.org>
Sun, 19 Dec 2021 19:18:00 +0000 (14:18 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 21 Dec 2021 17:22:15 +0000 (12:22 -0500)
so rename, it, and move the function prototype to a place which
makes more sense.

src/lib/io/pair.h
src/lib/unlang/xlat_builtin.c
src/lib/unlang/xlat_pair.c
src/lib/unlang/xlat_priv.h

index a18696d37821481593a97b2aa3a80639eb7a1a4a..f5b49e810f84dcf0d2a5abd5c3e8ad9a1d6ce235 100644 (file)
@@ -134,7 +134,3 @@ typedef ssize_t (*fr_pair_encode_t)(fr_dbuff_t *out, fr_dcursor_t *cursor, void
  */
 typedef ssize_t (*fr_pair_decode_t)(TALLOC_CTX *ctx, fr_pair_list_t *out, fr_dict_attr_t const *parent,
                                    uint8_t const *data, size_t data_len, void *decode_ctx);
-
-int fr_pair_decode_value_box_list(TALLOC_CTX *ctx, fr_pair_list_t *out,
-                                 request_t *request, void *decode_ctx, fr_pair_decode_t decode,
-                                 fr_value_box_list_t *in);
index d5ab2e360682feaaf0db9490415d56e74b8a3774..b71221c1b6d9bfcd5a150abda105364bc42a4177 100644 (file)
@@ -3336,8 +3336,8 @@ static xlat_action_t protocol_decode_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out,
                }
        }
 
-       decoded = fr_pair_decode_value_box_list(request->request_ctx, &request->request_pairs,
-                                               request, decode_ctx, tp_decode->func, in);
+       decoded = xlat_decode_value_box_list(request->request_ctx, &request->request_pairs,
+                                            request, decode_ctx, tp_decode->func, in);
        if (decoded <= 0) {
                talloc_free(decode_ctx);
                RPERROR("Protocol decoding failed");
index e61a8018b24f6814fd9e7437774222086b856caa..04a2e9e1a57cfcea69715c80431dfb1e925462aa 100644 (file)
@@ -24,7 +24,7 @@
  */
 RCSID("$Id$")
 
-#include <freeradius-devel/io/pair.h>
+#include <freeradius-devel/unlang/xlat_priv.h>
 
 /** Keep decoding pairs until all of the data has been used.
  *
@@ -87,9 +87,9 @@ static ssize_t fr_pair_decode_multi(TALLOC_CTX *ctx, fr_pair_list_t *out, fr_dic
  *     - <= 0 on error.  May be the offset (as a negative value) where the error occurred.
  *     - > 0 on success.  How many value boxes were decoded
  */
-int fr_pair_decode_value_box_list(TALLOC_CTX *ctx, fr_pair_list_t *out,
-                                 request_t *request, void *decode_ctx, fr_pair_decode_t decode,
-                                 fr_value_box_list_t *in)
+int xlat_decode_value_box_list(TALLOC_CTX *ctx, fr_pair_list_t *out,
+                              request_t *request, void *decode_ctx, fr_pair_decode_t decode,
+                              fr_value_box_list_t *in)
 {
        int             decoded = 0;
        fr_value_box_t  *vb = NULL;
index 621a16f8511e0bdc93e47ce5636ffa450bc905b9..4e2e525e81be988a0c19fffb83dda5cd22836d81 100644 (file)
@@ -30,6 +30,8 @@
 extern "C" {
 #endif
 
+#include <freeradius-devel/io/pair.h>
+
 #ifdef DEBUG_XLAT
 #  define XLAT_DEBUG RDEBUG3
 #else
@@ -201,6 +203,10 @@ void               xlat_eval_free(void);
 
 void           unlang_xlat_init(void);
 
+int xlat_decode_value_box_list(TALLOC_CTX *ctx, fr_pair_list_t *out,
+                              request_t *request, void *decode_ctx, fr_pair_decode_t decode,
+                              fr_value_box_list_t *in);
+
 #ifdef __cplusplus
 }
 #endif