]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove %pack()
authorAlan T. DeKok <aland@freeradius.org>
Mon, 30 Oct 2023 17:52:06 +0000 (13:52 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 30 Oct 2023 18:10:49 +0000 (14:10 -0400)
src/lib/unlang/xlat_builtin.c
src/tests/keywords/pack

index c28e75d9037cd7944d7bbb6f0ec5e65e81cc8654..619746f90717d0d6d1338d56eb2c4bbfaa40e33b 100644 (file)
@@ -2253,37 +2253,6 @@ static xlat_action_t xlat_func_md5(TALLOC_CTX *ctx, fr_dcursor_t *out,
 }
 
 
-static xlat_arg_parser_t const xlat_func_pack_arg[] = {
-       { .required = true, .concat = true, .type = FR_TYPE_OCTETS },
-       XLAT_ARG_PARSER_TERMINATOR
-};
-
-/** Pack multiple things together
- *
- * Example:
-@verbatim
-%pack(%{Attr-Foo}%{Attr-bar}) == packed hex values of the attributes
-@endverbatim
- *
- * @ingroup xlat_functions
- */
-static xlat_action_t xlat_func_pack(UNUSED TALLOC_CTX *ctx, fr_dcursor_t *out,
-                                   UNUSED xlat_ctx_t const *xctx,
-                                   UNUSED request_t *request, fr_value_box_list_t *in)
-{
-       fr_value_box_t  *vb;
-
-       /*
-        *      Input boxes are already cast to FR_TYPE_OCTETS and concatenated
-        *      by the input argument parser - so simply move to the output
-        */
-       vb = fr_value_box_list_pop_head(in);
-       fr_dcursor_append(out, vb);
-
-       return XLAT_ACTION_DONE;
-}
-
-
 static xlat_arg_parser_t const xlat_func_pairs_args[] = {
        { .required = true, .single = true, .type = FR_TYPE_STRING },
        XLAT_ARG_PARSER_TERMINATOR
@@ -3746,7 +3715,6 @@ do { \
        XLAT_REGISTER_MONO("map", xlat_func_map, FR_TYPE_INT8, xlat_func_map_arg);
        XLAT_REGISTER_MONO("md4", xlat_func_md4, FR_TYPE_OCTETS, xlat_func_md4_arg);
        XLAT_REGISTER_MONO("md5", xlat_func_md5, FR_TYPE_OCTETS, xlat_func_md5_arg);
-       XLAT_REGISTER_MONO("pack", xlat_func_pack, FR_TYPE_OCTETS, xlat_func_pack_arg);
 #if defined(HAVE_REGEX_PCRE) || defined(HAVE_REGEX_PCRE2)
        if (unlikely((xlat = xlat_func_register(ctx, "regex", xlat_func_regex, FR_TYPE_STRING)) == NULL)) return -1;
        xlat_func_flags_set(xlat, XLAT_FUNC_FLAG_INTERNAL);
index ad98f3aa2e0c8b5c6fdf0c84a9b6f29a8a3b12e7..72bcdfa662ca66afaf1474b240a5de6c7099f558 100644 (file)
@@ -8,7 +8,7 @@
 }
 
 
-&Tmp-Octets-0 := %pack(%{Framed-IP-Address}%{NAS-Port}%{NAS-IP-Address})
+&Tmp-Octets-0 := (octets) &Framed-IP-Address + (octets) &NAS-Port + (octets) &NAS-IP-Address
 
 if (!(&Tmp-Octets-0 == 0x7f000001000008407f000002)) {
        test_fail