From: Alan T. DeKok Date: Sun, 19 Dec 2021 19:18:00 +0000 (-0500) Subject: this function is only used by the xlat code X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fc5e63efb03392e88bc3ec72f47fb17cd9c2ecf;p=thirdparty%2Ffreeradius-server.git this function is only used by the xlat code so rename, it, and move the function prototype to a place which makes more sense. --- diff --git a/src/lib/io/pair.h b/src/lib/io/pair.h index a18696d378..f5b49e810f 100644 --- a/src/lib/io/pair.h +++ b/src/lib/io/pair.h @@ -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); diff --git a/src/lib/unlang/xlat_builtin.c b/src/lib/unlang/xlat_builtin.c index d5ab2e3606..b71221c1b6 100644 --- a/src/lib/unlang/xlat_builtin.c +++ b/src/lib/unlang/xlat_builtin.c @@ -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"); diff --git a/src/lib/unlang/xlat_pair.c b/src/lib/unlang/xlat_pair.c index e61a8018b2..04a2e9e1a5 100644 --- a/src/lib/unlang/xlat_pair.c +++ b/src/lib/unlang/xlat_pair.c @@ -24,7 +24,7 @@ */ RCSID("$Id$") -#include +#include /** 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; diff --git a/src/lib/unlang/xlat_priv.h b/src/lib/unlang/xlat_priv.h index 621a16f851..4e2e525e81 100644 --- a/src/lib/unlang/xlat_priv.h +++ b/src/lib/unlang/xlat_priv.h @@ -30,6 +30,8 @@ extern "C" { #endif +#include + #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