25 #include <freeradius-devel/util/value.h>
26 #include <freeradius-devel/unlang/xlat.h>
27 #include <freeradius-devel/curl/base.h>
28 #include <freeradius-devel/curl/xlat.h>
47 fr_value_box_list_t *
in)
52 escaped = curl_easy_escape(
fr_curl_tmp_handle(), to_escape->vb_strvalue, to_escape->vb_length);
58 if (strlen(escaped) == to_escape->vb_length)
goto done;
66 fr_value_box_list_remove(
in, to_escape);
77 fr_value_box_list_t *
in)
83 fr_value_box_list_remove(
in, to_unescape);
85 unescaped = curl_easy_unescape(
fr_curl_tmp_handle(), to_unescape->vb_strvalue, to_unescape->vb_length, &unescaped_len);
94 if ((
size_t)unescaped_len == to_unescape->vb_length) {
101 fr_value_box_bstrndup(to_unescape, to_unescape, NULL, unescaped, unescaped_len, to_unescape->tainted);
102 curl_free(unescaped);
xlat_action_t fr_curl_xlat_uri_escape(UNUSED TALLOC_CTX *ctx, fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, UNUSED request_t *request, fr_value_box_list_t *in)
xlat function to escape URI encoded strings
xlat_arg_parser_t const fr_curl_xlat_uri_args[]
xlat_action_t fr_curl_xlat_uri_unescape(UNUSED TALLOC_CTX *ctx, fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, UNUSED request_t *request, fr_value_box_list_t *in)
xlat function to unescape URI encoded strings
xlat_arg_parser_t const fr_curl_xlat_safe_args[]
static int fr_dcursor_insert(fr_dcursor_t *cursor, void *v)
Insert directly after the current item.
CURL * fr_curl_tmp_handle(void)
Return a thread local curl easy handle.
@ FR_TYPE_STRING
String of printable characters.
bool required
Argument must be present, and non-empty.
#define XLAT_ARG_PARSER_TERMINATOR
@ XLAT_ACTION_FAIL
An xlat function failed.
@ XLAT_ACTION_DONE
We're done evaluating this level of nesting.
Definition for a single argument consumend by an xlat function.
Master include file to access all functions and structures in the library.
void fr_value_box_clear_value(fr_value_box_t *data)
Clear/free any existing value.
int fr_value_box_strdup(TALLOC_CTX *ctx, fr_value_box_t *dst, fr_dict_attr_t const *enumv, char const *src, bool tainted)
Copy a nul terminated string to a fr_value_box_t.
int fr_value_box_bstrndup(TALLOC_CTX *ctx, fr_value_box_t *dst, fr_dict_attr_t const *enumv, char const *src, size_t len, bool tainted)
Copy a string to to a fr_value_box_t.
static size_t char ** out