]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
s/value_box_t/fr_value_box_t/
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 9 May 2017 16:31:38 +0000 (12:31 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 9 May 2017 16:31:38 +0000 (12:31 -0400)
40 files changed:
src/include/cursor.h
src/include/libradius.h
src/include/pair.h
src/include/tmpl.h
src/include/types.h
src/include/value.h
src/lib/ldap/libfreeradius-ldap.h
src/lib/util/dict.c
src/lib/util/filters.c
src/lib/util/pair.c
src/lib/util/print.c
src/lib/util/value.c
src/main/cond_eval.c
src/main/cond_tokenize.c
src/main/conf_file.c
src/main/exec.c
src/main/map.c
src/main/radsnmp.c
src/main/snmp.c
src/main/tmpl.c
src/main/unlang_compile.c
src/main/unlang_interpret.c
src/main/xlat_eval.c
src/main/xlat_func.c
src/modules/proto_ldap_sync/sync.c
src/modules/rlm_cache/drivers/rlm_cache_redis/rlm_cache_redis.c
src/modules/rlm_cache/rlm_cache.c
src/modules/rlm_cache/serialize.c
src/modules/rlm_eap/lib/sim/sim_proto.c
src/modules/rlm_expr/rlm_expr.c
src/modules/rlm_json/jpath.c
src/modules/rlm_json/json.c
src/modules/rlm_json/json.h
src/modules/rlm_json/rlm_json.c
src/modules/rlm_redis/redis.c
src/modules/rlm_redis/redis.h
src/modules/rlm_redis_ippool/rlm_redis_ippool.c
src/modules/rlm_rest/rest.c
src/modules/rlm_rest/rlm_rest.c
src/modules/rlm_sometimes/rlm_sometimes.c

index 7b03adcff8be16d7754b91897d9ee770acd396f4..7f1b48d96cca47a609f4477d9eff12df153e774a 100644 (file)
@@ -85,7 +85,7 @@ void fr_cursor_list_free(fr_cursor_t *cursor) CC_HINT(nonnull);
  * @param[in] _head    of item list.
  * @param[in] _iter    function.
  * @param[in] _ctx     _iter function _ctx.
- * @param[in] _type    Talloc type i.e. VALUE_PAIR or value_box_t.
+ * @param[in] _type    Talloc type i.e. VALUE_PAIR or fr_value_box_t.
  * @return
  *     - NULL if _head does not point to any items, or the iterator matches no items
  *       in the current list.
@@ -112,7 +112,7 @@ void fr_cursor_list_free(fr_cursor_t *cursor) CC_HINT(nonnull);
  *
  * @param[in] _cursor  to initialise.
  * @param[in] _head    of item list.
- * @param[in] _type    Talloc type i.e. VALUE_PAIR or value_box_t.
+ * @param[in] _type    Talloc type i.e. VALUE_PAIR or fr_value_box_t.
  * @return
  *     - NULL if _head does not point to any items.
  *     - The first item in the list.
index 719eb2830a9e731f6d8e09780c2aef97f3eb6f6e..8a45cc227270eb05830f281921f208a0d05def2f 100644 (file)
@@ -206,7 +206,7 @@ void                fr_talloc_verify_cb(const void *ptr, int depth,
 
 #ifdef WITH_ASCEND_BINARY
 /* filters.c */
-int            ascend_parse_filter(value_box_t *out, char const *value, size_t len);
+int            ascend_parse_filter(fr_value_box_t *out, char const *value, size_t len);
 void           print_abinary(char *out, size_t outlen, uint8_t const *data, size_t len, int8_t quote);
 #endif /*WITH_ASCEND_BINARY*/
 
index 7c8e44ded8707473ffb9841bfea2ec9506983345..9fa45fc7eb6300fc09f8999ca7b76ebdc58e74fd 100644 (file)
@@ -86,13 +86,13 @@ typedef struct value_pair {
        //      VALUE_SET       *set;                           //!< Set of child attributes.
        //      VALUE_LIST      *list;                          //!< List of values for
                                                                //!< multivalued attribute.
-       //      value_box_t     *data;                          //!< Value data for this attribute.
+       //      fr_value_box_t  *data;                          //!< Value data for this attribute.
 
                char const      *xlat;                          //!< Source string for xlat expansion.
        };
 
        value_type_t            type;                           //!< Type of pointer in value union.
-       value_box_t             data;
+       fr_value_box_t          data;
 } VALUE_PAIR;
 
 /** Abstraction to allow iterating over different configurations of VALUE_PAIRs
@@ -198,7 +198,7 @@ void                fr_pair_replace(VALUE_PAIR **head, VALUE_PAIR *add);
 
 int            fr_pair_update_by_num(TALLOC_CTX *ctx, VALUE_PAIR **list,
                                      unsigned int vendor, unsigned int attr, int8_t tag,
-                                     value_box_t *value);
+                                     fr_value_box_t *value);
 
 void           fr_pair_delete_by_num(VALUE_PAIR **head, unsigned int vendor, unsigned int attr, int8_t tag);
 
@@ -212,7 +212,7 @@ typedef             int8_t (*fr_cmp_t)(void const *a, void const *b);
  *     - 0 if not equal.
  *     - -1 on failure.
  */
-#define                fr_pair_cmp_op(_op, _a, _b)     value_box_cmp_op(_op, &_a->data, &_b->data)
+#define                fr_pair_cmp_op(_op, _a, _b)     fr_value_box_cmp_op(_op, &_a->data, &_b->data)
 int8_t         fr_pair_cmp_by_da_tag(void const *a, void const *b);
 int8_t         fr_pair_cmp_by_parent_num_tag(void const *a, void const *b);
 int            fr_pair_cmp(VALUE_PAIR *a, VALUE_PAIR *b);
index 349cf1ae1a7aca07977a3e1171654033b239ad88..83a478d9ccd75b21a9b76a1d663db26f1a9be9f0 100644 (file)
@@ -197,7 +197,7 @@ typedef struct vp_tmpl_t {
                /*
                 *  Attribute value. Typically used as the RHS of an update map.
                 */
-               value_box_t     literal;                         //!< Value data.
+               fr_value_box_t  literal;                         //!< Value data.
 
                xlat_exp_t      *xlat;   //!< pre-parsed xlat_exp_t
 
@@ -232,9 +232,9 @@ typedef struct vp_tmpl_t {
  * @{
  */
 #define tmpl_value_box         data.literal
-#define tmpl_value_box_datum   data.literal.datum
-#define tmpl_value_box_length  data.literal.datum.length
-#define tmpl_value_box_type    data.literal.type
+#define tmpl_fr_value_box_datum        data.literal.datum
+#define tmpl_fr_value_box_length       data.literal.datum.length
+#define tmpl_fr_value_box_type data.literal.type
 /* @} **/
 
 /** @name Field accessors for #TMPL_TYPE_REGEX_STRUCT and #TMPL_TYPE_REGEX
@@ -299,7 +299,7 @@ void tmpl_verify(char const *file, int line, vp_tmpl_t const *vpt);
  @code{.c}
    TALLOC_CTX *ctx;
    VALUE_PAIR **head;
-   value_box_t value;
+   fr_value_box_t value;
 
    RADIUS_LIST_AND_CTX(ctx, head, request, CURRENT_REQUEST, PAIR_LIST_REQUEST);
    if (!list) return -1; // error
@@ -384,7 +384,7 @@ vp_tmpl_t           *tmpl_alloc(TALLOC_CTX *ctx, tmpl_type_t type, char const *name,
 void                   tmpl_from_da(vp_tmpl_t *vpt, fr_dict_attr_t const *da, int8_t tag, int num,
                                     request_refs_t request, pair_lists_t list);
 
-int                    tmpl_afrom_value_box(TALLOC_CTX *ctx, vp_tmpl_t **out, value_box_t *data, bool steal);
+int                    tmpl_afrom_value_box(TALLOC_CTX *ctx, vp_tmpl_t **out, fr_value_box_t *data, bool steal);
 
 ssize_t                        tmpl_afrom_attr_substr(TALLOC_CTX *ctx, vp_tmpl_t **out, char const *name,
                                               request_refs_t request_def, pair_lists_t list_def,
index 3b675fee326f572f4b7ca977db76348a75d1b016..bbca1315c150a798266c61faf05e252bcd1a8ab7 100644 (file)
@@ -19,7 +19,7 @@
  * $Id$
  *
  * @file include/types.h
- * @brief #value_box_t types
+ * @brief #fr_value_box_t types
  *
  * @copyright 2017  The FreeRADIUS server project
  */
index 992a4e478b8080c2daa2290e3befd9ad9815066d..9846e55b5a3c015812903390f5e1b38b50c90ca0 100644 (file)
 #include <freeradius-devel/types.h>
 #include <freeradius-devel/dict.h>
 
-extern size_t const value_box_field_sizes[];
-extern size_t const value_box_offsets[];
+extern size_t const fr_value_box_field_sizes[];
+extern size_t const fr_value_box_offsets[];
 
-#define value_box_foreach(_v, _iv) for (value_box_t *_iv = v; _iv; _iv = _iv->next)
+#define fr_value_box_foreach(_v, _iv) for (fr_value_box_t *_iv = v; _iv; _iv = _iv->next)
 
 /** Union containing all data types supported by the server
  *
@@ -31,7 +31,7 @@ extern size_t const value_box_offsets[];
  *
  * fr_type_t should be an enumeration of the values in this union.
  */
-typedef struct value_box value_box_t;
+typedef struct value_box fr_value_box_t;
 struct value_box {
        union {
                /*
@@ -79,68 +79,68 @@ struct value_box {
 
        bool                            tainted;                //!< i.e. did it come from an untrusted source
 
-       value_box_t                     *next;                  //!< Next in a series of value_box.
+       fr_value_box_t                  *next;                  //!< Next in a series of value_box.
 };
 
 /*
  *     Allocation
  */
-value_box_t    *value_box_alloc(TALLOC_CTX *ctx, fr_type_t type);
+fr_value_box_t *fr_value_box_alloc(TALLOC_CTX *ctx, fr_type_t type);
 
-void           value_box_clear(value_box_t *data);
+void           fr_value_box_clear(fr_value_box_t *data);
 
 /*
  *     Comparison
  */
-int            value_box_cmp(value_box_t const *a, value_box_t const *b);
+int            fr_value_box_cmp(fr_value_box_t const *a, fr_value_box_t const *b);
 
-int            value_box_cmp_op(FR_TOKEN op, value_box_t const *a, value_box_t const *b);
+int            fr_value_box_cmp_op(FR_TOKEN op, fr_value_box_t const *a, fr_value_box_t const *b);
 
 /*
  *     Conversion
  */
 size_t         value_str_unescape(uint8_t *out, char const *in, size_t inlen, char quote);
 
-int            value_box_hton(value_box_t *dst, value_box_t const *src);
+int            fr_value_box_hton(fr_value_box_t *dst, fr_value_box_t const *src);
 
-int            value_box_cast(TALLOC_CTX *ctx, value_box_t *dst,
+int            fr_value_box_cast(TALLOC_CTX *ctx, fr_value_box_t *dst,
                               fr_type_t dst_type, fr_dict_attr_t const *dst_enumv,
-                              value_box_t const *src);
+                              fr_value_box_t const *src);
 
 /*
  *     Assignment
  */
-int            value_box_copy(TALLOC_CTX *ctx, value_box_t *dst,  const value_box_t *src);
-void           value_box_copy_shallow(TALLOC_CTX *ctx, value_box_t *dst, const value_box_t *src);
-int            value_box_steal(TALLOC_CTX *ctx, value_box_t *dst, value_box_t const *src);
-
-int            value_box_strdup(TALLOC_CTX *ctx, value_box_t *dst, char const *src, bool tainted);
-int            value_box_strdup_buffer(TALLOC_CTX *ctx, value_box_t *dst, char const *src, bool tainted);
-int            value_box_strsteal(TALLOC_CTX *ctx, value_box_t *dst, char *src, bool tainted);
-int            value_box_strdup_shallow(value_box_t *dst, char const *src, bool tainted);
-int            value_box_strdup_buffer_shallow(TALLOC_CTX *ctx, value_box_t *dst, char const *src, bool tainted);
-
-int            value_box_memdup(TALLOC_CTX *ctx, value_box_t *dst, uint8_t const *src, size_t len, bool tainted);
-int            value_box_memdup_buffer(TALLOC_CTX *ctx, value_box_t *dst, uint8_t *src, bool tainted);
-int            value_box_memsteal(TALLOC_CTX *ctx, value_box_t *dst, uint8_t const *src, bool tainted);
-int            value_box_memdup_shallow(value_box_t *dst, uint8_t *src, size_t len, bool tainted);
-int            value_box_memdup_buffer_shallow(TALLOC_CTX *ctx, value_box_t *dst, uint8_t *src, bool tainted);
+int            fr_value_box_copy(TALLOC_CTX *ctx, fr_value_box_t *dst,  const fr_value_box_t *src);
+void           fr_value_box_copy_shallow(TALLOC_CTX *ctx, fr_value_box_t *dst, const fr_value_box_t *src);
+int            fr_value_box_steal(TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_t const *src);
+
+int            fr_value_box_strdup(TALLOC_CTX *ctx, fr_value_box_t *dst, char const *src, bool tainted);
+int            fr_value_box_strdup_buffer(TALLOC_CTX *ctx, fr_value_box_t *dst, char const *src, bool tainted);
+int            fr_value_box_strsteal(TALLOC_CTX *ctx, fr_value_box_t *dst, char *src, bool tainted);
+int            fr_value_box_strdup_shallow(fr_value_box_t *dst, char const *src, bool tainted);
+int            fr_value_box_strdup_buffer_shallow(TALLOC_CTX *ctx, fr_value_box_t *dst, char const *src, bool tainted);
+
+int            fr_value_box_memdup(TALLOC_CTX *ctx, fr_value_box_t *dst, uint8_t const *src, size_t len, bool tainted);
+int            fr_value_box_memdup_buffer(TALLOC_CTX *ctx, fr_value_box_t *dst, uint8_t *src, bool tainted);
+int            fr_value_box_memsteal(TALLOC_CTX *ctx, fr_value_box_t *dst, uint8_t const *src, bool tainted);
+int            fr_value_box_memdup_shallow(fr_value_box_t *dst, uint8_t *src, size_t len, bool tainted);
+int            fr_value_box_memdup_buffer_shallow(TALLOC_CTX *ctx, fr_value_box_t *dst, uint8_t *src, bool tainted);
 
 /*
  *     Parsing
  */
-int            value_box_from_ipaddr(value_box_t *dst, fr_ipaddr_t const *ipaddr);
+int            fr_value_box_from_ipaddr(fr_value_box_t *dst, fr_ipaddr_t const *ipaddr);
 
-int            value_box_from_str(TALLOC_CTX *ctx, value_box_t *dst,
+int            fr_value_box_from_str(TALLOC_CTX *ctx, fr_value_box_t *dst,
                                   fr_type_t *src_type, fr_dict_attr_t const *src_enumv,
                                   char const *src, ssize_t src_len, char quote);
 
 /*
  *     Printing
  */
-size_t         value_box_network_length(value_box_t *value);
+size_t         fr_value_box_network_length(fr_value_box_t *value);
 
-char           *value_box_asprint(TALLOC_CTX *ctx, value_box_t const *data, char quote);
+char           *fr_value_box_asprint(TALLOC_CTX *ctx, fr_value_box_t const *data, char quote);
 
-size_t         value_box_snprint(char *out, size_t outlen, value_box_t const *data, char quote);
+size_t         fr_value_box_snprint(char *out, size_t outlen, fr_value_box_t const *data, char quote);
 #endif /* _FR_VALUE_H */
index 2f39bb928e1dfd4f366e374abe8c21b43f280fce..fe2a734f17cd282649cf4ce9812f52990644bf5d 100644 (file)
@@ -345,7 +345,7 @@ extern FR_NAME_NUMBER const fr_ldap_tls_require_cert[];
  * @param[out] value   to write berval values to.
  * @param[in] berval   to copy pointers/lengths from.
  */
-static inline void fr_ldap_berval_to_value(value_box_t *value, struct berval *berval)
+static inline void fr_ldap_berval_to_value(fr_value_box_t *value, struct berval *berval)
 {
        value->datum.ptr = berval->bv_val;
        value->datum.length = berval->bv_len;
index 9d11e09279528b465e5fa6adf8d007744953a39d..f4acef1bb2de082f3da33b2af37c7a570ce0ea3b 100644 (file)
@@ -216,7 +216,7 @@ bool const fr_dict_non_data_types[FR_TYPE_MAX + 1] = {
 
 /** Numeric dictionary types
  *
- * @note Must be updated to match the anonymous enum types union in value_box_t
+ * @note Must be updated to match the anonymous enum types union in fr_value_box_t
  */
 bool const fr_dict_enum_types[FR_TYPE_MAX + 1] = {
        [FR_TYPE_BYTE] = true,
index 3ee34967f46add839cca5b8b9ccb566b6d4bef3e..7c8cdc7c597d846298b4aedbb8c0e4fdc9dcfbf8 100644 (file)
@@ -952,7 +952,7 @@ static int ascend_parse_generic(int argc, char **argv,
  *     - 0 on success.
  *     - -1 on failure.
  */
-int ascend_parse_filter(value_box_t *out, char const *value, size_t len)
+int ascend_parse_filter(fr_value_box_t *out, char const *value, size_t len)
 {
        int             token, type;
        int             rcode;
index 4fb1dba5c35636ffb402737d476dedca3fe460a4..1af8da291ddab8bd4414a87eb9de935860995de2 100644 (file)
@@ -770,7 +770,7 @@ void fr_pair_replace(VALUE_PAIR **head, VALUE_PAIR *replace)
  */
 int fr_pair_update_by_num(TALLOC_CTX *ctx, VALUE_PAIR **list,
                          unsigned int vendor, unsigned int attr, int8_t tag,
-                         value_box_t *value)
+                         fr_value_box_t *value)
 {
        vp_cursor_t cursor;
        VALUE_PAIR *vp;
@@ -779,14 +779,14 @@ int fr_pair_update_by_num(TALLOC_CTX *ctx, VALUE_PAIR **list,
        vp = fr_pair_cursor_next_by_num(&cursor, vendor, attr, tag);
        if (vp) {
                VERIFY_VP(vp);
-               if (value_box_steal(vp, &vp->data, value) < 0) return -1;
+               if (fr_value_box_steal(vp, &vp->data, value) < 0) return -1;
                return 0;
        }
 
        vp = fr_pair_afrom_num(ctx, vendor, attr);
        if (!vp) return -1;
        vp->tag = tag;
-       if (value_box_steal(vp, &vp->data, value) < 0) return -1;
+       if (fr_value_box_steal(vp, &vp->data, value) < 0) return -1;
 
        fr_pair_cursor_append(&cursor, vp);
 
@@ -1066,7 +1066,7 @@ int fr_pair_list_cmp(VALUE_PAIR *a, VALUE_PAIR *b)
                        return 1;
                }
 
-               ret = value_box_cmp(&a_p->data, &b_p->data);
+               ret = fr_value_box_cmp(&a_p->data, &b_p->data);
                if (ret != 0) {
                        (void)fr_cond_assert(ret >= -1);        /* Comparison error */
                        return ret;
@@ -1977,7 +1977,7 @@ int fr_pair_value_from_str(VALUE_PAIR *vp, char const *value, size_t inlen)
         *      We presume that the input data is from a double quoted
         *      string, and needs escaping
         */
-       if (value_box_from_str(vp, &vp->data, &type, vp->da, value, inlen, '"') < 0) return -1;
+       if (fr_value_box_from_str(vp, &vp->data, &type, vp->da, value, inlen, '"') < 0) return -1;
 
        /*
         *      If we parsed to a different type than the DA associated with
@@ -2020,7 +2020,7 @@ void fr_pair_value_memcpy(VALUE_PAIR *vp, uint8_t const *src, size_t size)
        p = talloc_memdup(vp, src, size);
        if (!p) return;
 
-       value_box_clear(&vp->data);
+       fr_value_box_clear(&vp->data);
 
        vp->vp_octets = p;
        vp->vp_length = size;
@@ -2039,7 +2039,7 @@ void fr_pair_value_memcpy(VALUE_PAIR *vp, uint8_t const *src, size_t size)
  */
 void fr_pair_value_memsteal(VALUE_PAIR *vp, uint8_t const *src)
 {
-       value_box_clear(&vp->data);
+       fr_value_box_clear(&vp->data);
 
        vp->vp_octets = talloc_steal(vp, src);
        vp->vp_length = talloc_array_length(vp->vp_octets);
@@ -2060,7 +2060,7 @@ void fr_pair_value_strsteal(VALUE_PAIR *vp, char const *src)
 {
        if (!fr_cond_assert(vp->da->type == FR_TYPE_STRING)) return;
 
-       value_box_clear(&vp->data);
+       fr_value_box_clear(&vp->data);
 
        vp->vp_strvalue = talloc_steal(vp, src);
        vp->vp_length = talloc_array_length(vp->vp_strvalue) - 1;
@@ -2089,7 +2089,7 @@ void fr_pair_value_strnsteal(VALUE_PAIR *vp, char *src, size_t len)
 
        if (!fr_cond_assert(vp->da->type == FR_TYPE_STRING)) return;
 
-       value_box_clear(&vp->data);
+       fr_value_box_clear(&vp->data);
 
        buf_len = talloc_array_length(src);
        if (buf_len > (len + 1)) {
@@ -2125,7 +2125,7 @@ void fr_pair_value_strcpy(VALUE_PAIR *vp, char const *src)
        p = talloc_strdup(vp, src);
        if (!p) return;
 
-       value_box_clear(&vp->data);
+       fr_value_box_clear(&vp->data);
 
        vp->vp_strvalue = p;
        vp->type = VT_DATA;
@@ -2159,7 +2159,7 @@ void fr_pair_value_bstrncpy(VALUE_PAIR *vp, void const *src, size_t len)
        memcpy(p, src, len);    /* embdedded \0 safe */
        p[len] = '\0';
 
-       value_box_clear(&vp->data);
+       fr_value_box_clear(&vp->data);
 
        vp->vp_strvalue = p;
        vp->vp_length = len;
@@ -2190,7 +2190,7 @@ void fr_pair_value_snprintf(VALUE_PAIR *vp, char const *fmt, ...)
        va_end(ap);
        if (!p) return;
 
-       value_box_clear(&vp->data);
+       fr_value_box_clear(&vp->data);
 
        vp->vp_strvalue = p;
        vp->vp_length = talloc_array_length(vp->vp_strvalue) - 1;
@@ -2219,7 +2219,7 @@ size_t fr_pair_value_snprint(char *out, size_t outlen, VALUE_PAIR const *vp, cha
 
        if (vp->type == VT_XLAT) return snprintf(out, outlen, "%c%s%c", quote, vp->xlat, quote);
 
-       return value_box_snprint(out, outlen, &vp->data, quote);
+       return fr_value_box_snprint(out, outlen, &vp->data, quote);
 }
 
 /** Print one attribute value to a string
@@ -2235,7 +2235,7 @@ char *fr_pair_value_asprint(TALLOC_CTX *ctx, VALUE_PAIR const *vp, char quote)
 
        if (vp->type == VT_XLAT) return fr_asprint(ctx, vp->xlat, talloc_array_length(vp->xlat) - 1, quote);
 
-       return value_box_asprint(ctx, &vp->data, quote);
+       return fr_value_box_asprint(ctx, &vp->data, quote);
 }
 
 /** Return a const buffer for an enum type attribute
index 62b4410ab9739ed6aab8916f5c50d25b5da74b04..884b9fc014f66ca25cbd6636e0c933d70378d5e1 100644 (file)
@@ -606,14 +606,14 @@ char *fr_vasprintf(TALLOC_CTX *ctx, char const *fmt, va_list ap)
                        switch (*(p + 1)) {
                        case 'V':
                        {
-                               value_box_t const *in = va_arg(ap_q, value_box_t const *);
+                               fr_value_box_t const *in = va_arg(ap_q, fr_value_box_t const *);
 
                                /*
                                 *      Allocations that are not part of the output
                                 *      string need to occur in the NULL ctx so we don't fragment
                                 *      any pool associated with it.
                                 */
-                               subst = value_box_asprint(NULL, in, '"');
+                               subst = fr_value_box_asprint(NULL, in, '"');
                                if (!subst) {
                                        talloc_free(out);
                                        va_end(ap_p);
index cb9b83f53e2a936fd99255735beb0e6c421cab25..234a60c51cf51536d82c1faee014cd287e2bc949 100644 (file)
  *
  * There are three notional data formats used in the server:
  *
- * - #value_box_t are the INTERNAL format.  This is usually close to the in-memory representation
+ * - #fr_value_box_t are the INTERNAL format.  This is usually close to the in-memory representation
  *   of the data, though integers and IPs are always converted to/from octets with BIG ENDIAN
  *   byte ordering for consistency.
- *   - #value_box_cast is used to convert (cast) #value_box_t between INTERNAL formats.
- *   - #value_box_strdup* is used to ingest nul terminated strings into the INTERNAL format.
- *   - #value_box_memdup* is used to ingest binary data into the INTERNAL format.
+ *   - #fr_value_box_cast is used to convert (cast) #fr_value_box_t between INTERNAL formats.
+ *   - #fr_value_box_strdup* is used to ingest nul terminated strings into the INTERNAL format.
+ *   - #fr_value_box_memdup* is used to ingest binary data into the INTERNAL format.
  *
  * - NETWORK format is the format we send/receive on the wire.  It is not a perfect representation
  *   of data packing for all protocols, so you will likely need to overload conversion for some types.
- *   - value_box_to_network is used to covert INTERNAL format data to generic NETWORK format data.
+ *   - fr_value_box_to_network is used to covert INTERNAL format data to generic NETWORK format data.
  *     For integers, IP addresses etc... This means BIG ENDIAN byte ordering.
- *   - value_box_from_network is used to convert packet buffer fragments in NETWORK format to
+ *   - fr_value_box_from_network is used to convert packet buffer fragments in NETWORK format to
  *     INTERNAL format.
  *
  * - PRESENTATION format is what we print to the screen, and what we get from the user, databases
  *   and configuration files.
- *   - #value_box_asprint is used to convert INTERNAL format PRESENTATION format.
- *   - #value_box_from_str is used to convert from INTERNAL to PRESENTATION format.
+ *   - #fr_value_box_asprint is used to convert INTERNAL format PRESENTATION format.
+ *   - #fr_value_box_from_str is used to convert from INTERNAL to PRESENTATION format.
  *
  * @copyright 2014-2017 The FreeRADIUS server project
  * @copyright 2017 Arran Cudbard-Bell <a.cudbardb@freeradius.org>
@@ -49,17 +49,17 @@ RCSID("$Id$")
 #include <freeradius-devel/rad_assert.h>
 #include <ctype.h>
 
-/** How many bytes on-the-wire would a #value_box_t value consume
+/** How many bytes on-the-wire would a #fr_value_box_t value consume
  *
  * This is for the generic NETWORK format.  For field sizes in the in-memory
- * structure use #value_box_field_sizes.
+ * structure use #fr_value_box_field_sizes.
  *
  * @note Don't use this array directly when determining the length
  *      that would be consumed by the on-the-wire representation.
- *      Use #value_box_network_length instead, as that deals with variable
+ *      Use #fr_value_box_network_length instead, as that deals with variable
  *      length attributes too.
  */
-static size_t const value_box_network_sizes[FR_TYPE_MAX + 1][2] = {
+static size_t const fr_value_box_network_sizes[FR_TYPE_MAX + 1][2] = {
        [FR_TYPE_INVALID]       = {~0, 0},
 
        [FR_TYPE_STRING]        = {0, ~0},
@@ -86,90 +86,90 @@ static size_t const value_box_network_sizes[FR_TYPE_MAX + 1][2] = {
        [FR_TYPE_MAX]           = {~0, 0}               //!< Ensure array covers all types.
 };
 
-static_assert(SIZEOF_MEMBER(value_box_t, datum.ip.addr.v4.s_addr) == 4,
+static_assert(SIZEOF_MEMBER(fr_value_box_t, datum.ip.addr.v4.s_addr) == 4,
              "in_addr.s_addr has unexpected length");
-static_assert(SIZEOF_MEMBER(value_box_t, datum.ip.addr.v6.s6_addr) == 16,
+static_assert(SIZEOF_MEMBER(fr_value_box_t, datum.ip.addr.v6.s6_addr) == 16,
              "in6_addr.s6_addr has unexpected length");
-static_assert(SIZEOF_MEMBER(value_box_t, datum.ifid) == 8,
+static_assert(SIZEOF_MEMBER(fr_value_box_t, datum.ifid) == 8,
              "datum.ifid has unexpected length");
-static_assert(SIZEOF_MEMBER(value_box_t, datum.ether) == 6,
+static_assert(SIZEOF_MEMBER(fr_value_box_t, datum.ether) == 6,
              "datum.ether has unexpected length");
-static_assert(SIZEOF_MEMBER(value_box_t, datum.boolean) == 1,
+static_assert(SIZEOF_MEMBER(fr_value_box_t, datum.boolean) == 1,
              "datum.boolean has unexpected length");
-static_assert(SIZEOF_MEMBER(value_box_t, datum.byte) == 1,
+static_assert(SIZEOF_MEMBER(fr_value_box_t, datum.byte) == 1,
              "datum.byte has unexpected length");
-static_assert(SIZEOF_MEMBER(value_box_t, datum.ushort) == 2,
+static_assert(SIZEOF_MEMBER(fr_value_box_t, datum.ushort) == 2,
              "datum.ushort has unexpected length");
-static_assert(SIZEOF_MEMBER(value_box_t, datum.integer) == 4,
+static_assert(SIZEOF_MEMBER(fr_value_box_t, datum.integer) == 4,
              "datum.integer has unexpected length");
-static_assert(SIZEOF_MEMBER(value_box_t, datum.integer64) == 8,
+static_assert(SIZEOF_MEMBER(fr_value_box_t, datum.integer64) == 8,
              "datum.integer64 has unexpected length");
-static_assert(SIZEOF_MEMBER(value_box_t, datum.sinteger) == 4,
+static_assert(SIZEOF_MEMBER(fr_value_box_t, datum.sinteger) == 4,
              "datum.sinteger has unexpected length");
 
 
 /** How many bytes wide each of the value data fields are
  *
- * This is useful when copying a value from a value_box_t to a memory
+ * This is useful when copying a value from a fr_value_box_t to a memory
  * location passed as a void *.
  */
-size_t const value_box_field_sizes[] = {
-       [FR_TYPE_STRING]                        = SIZEOF_MEMBER(value_box_t, datum.strvalue),
-       [FR_TYPE_OCTETS]                        = SIZEOF_MEMBER(value_box_t, datum.octets),
-
-       [FR_TYPE_IPV4_ADDR]                     = SIZEOF_MEMBER(value_box_t, datum.ip),
-       [FR_TYPE_IPV4_PREFIX]                   = SIZEOF_MEMBER(value_box_t, datum.ip),
-       [FR_TYPE_IPV6_ADDR]                     = SIZEOF_MEMBER(value_box_t, datum.ip),
-       [FR_TYPE_IPV6_PREFIX]                   = SIZEOF_MEMBER(value_box_t, datum.ip),
-       [FR_TYPE_IFID]                          = SIZEOF_MEMBER(value_box_t, datum.ifid),
-       [FR_TYPE_ETHERNET]                      = SIZEOF_MEMBER(value_box_t, datum.ether),
-
-       [FR_TYPE_BOOLEAN]                       = SIZEOF_MEMBER(value_box_t, datum.boolean),
-       [FR_TYPE_BYTE]                          = SIZEOF_MEMBER(value_box_t, datum.byte),
-       [FR_TYPE_SHORT]                         = SIZEOF_MEMBER(value_box_t, datum.ushort),
-       [FR_TYPE_INTEGER]                       = SIZEOF_MEMBER(value_box_t, datum.integer),
-       [FR_TYPE_INTEGER64]                     = SIZEOF_MEMBER(value_box_t, datum.integer64),
-       [FR_TYPE_SIZE]                          = SIZEOF_MEMBER(value_box_t, datum.size),
-
-       [FR_TYPE_SIGNED]                        = SIZEOF_MEMBER(value_box_t, datum.sinteger),
-
-       [FR_TYPE_TIMEVAL]                       = SIZEOF_MEMBER(value_box_t, datum.timeval),
-       [FR_TYPE_DECIMAL]                       = SIZEOF_MEMBER(value_box_t, datum.decimal),
-       [FR_TYPE_DATE]                          = SIZEOF_MEMBER(value_box_t, datum.date),
-
-       [FR_TYPE_ABINARY]                       = SIZEOF_MEMBER(value_box_t, datum.filter),
+size_t const fr_value_box_field_sizes[] = {
+       [FR_TYPE_STRING]                        = SIZEOF_MEMBER(fr_value_box_t, datum.strvalue),
+       [FR_TYPE_OCTETS]                        = SIZEOF_MEMBER(fr_value_box_t, datum.octets),
+
+       [FR_TYPE_IPV4_ADDR]                     = SIZEOF_MEMBER(fr_value_box_t, datum.ip),
+       [FR_TYPE_IPV4_PREFIX]                   = SIZEOF_MEMBER(fr_value_box_t, datum.ip),
+       [FR_TYPE_IPV6_ADDR]                     = SIZEOF_MEMBER(fr_value_box_t, datum.ip),
+       [FR_TYPE_IPV6_PREFIX]                   = SIZEOF_MEMBER(fr_value_box_t, datum.ip),
+       [FR_TYPE_IFID]                          = SIZEOF_MEMBER(fr_value_box_t, datum.ifid),
+       [FR_TYPE_ETHERNET]                      = SIZEOF_MEMBER(fr_value_box_t, datum.ether),
+
+       [FR_TYPE_BOOLEAN]                       = SIZEOF_MEMBER(fr_value_box_t, datum.boolean),
+       [FR_TYPE_BYTE]                          = SIZEOF_MEMBER(fr_value_box_t, datum.byte),
+       [FR_TYPE_SHORT]                         = SIZEOF_MEMBER(fr_value_box_t, datum.ushort),
+       [FR_TYPE_INTEGER]                       = SIZEOF_MEMBER(fr_value_box_t, datum.integer),
+       [FR_TYPE_INTEGER64]                     = SIZEOF_MEMBER(fr_value_box_t, datum.integer64),
+       [FR_TYPE_SIZE]                          = SIZEOF_MEMBER(fr_value_box_t, datum.size),
+
+       [FR_TYPE_SIGNED]                        = SIZEOF_MEMBER(fr_value_box_t, datum.sinteger),
+
+       [FR_TYPE_TIMEVAL]                       = SIZEOF_MEMBER(fr_value_box_t, datum.timeval),
+       [FR_TYPE_DECIMAL]                       = SIZEOF_MEMBER(fr_value_box_t, datum.decimal),
+       [FR_TYPE_DATE]                          = SIZEOF_MEMBER(fr_value_box_t, datum.date),
+
+       [FR_TYPE_ABINARY]                       = SIZEOF_MEMBER(fr_value_box_t, datum.filter),
        [FR_TYPE_MAX]                           = 0     //!< Ensure array covers all types.
 };
 
-/** Where the value starts in the #value_box_t
+/** Where the value starts in the #fr_value_box_t
  *
  */
-size_t const value_box_offsets[] = {
-       [FR_TYPE_STRING]                        = offsetof(value_box_t, datum.strvalue),
-       [FR_TYPE_OCTETS]                        = offsetof(value_box_t, datum.octets),
+size_t const fr_value_box_offsets[] = {
+       [FR_TYPE_STRING]                        = offsetof(fr_value_box_t, datum.strvalue),
+       [FR_TYPE_OCTETS]                        = offsetof(fr_value_box_t, datum.octets),
 
-       [FR_TYPE_IPV4_ADDR]                     = offsetof(value_box_t, datum.ip),
-       [FR_TYPE_IPV4_PREFIX]                   = offsetof(value_box_t, datum.ip),
-       [FR_TYPE_IPV6_ADDR]                     = offsetof(value_box_t, datum.ip),
-       [FR_TYPE_IPV6_PREFIX]                   = offsetof(value_box_t, datum.ip),
-       [FR_TYPE_IFID]                          = offsetof(value_box_t, datum.ifid),
-       [FR_TYPE_ETHERNET]                      = offsetof(value_box_t, datum.ether),
+       [FR_TYPE_IPV4_ADDR]                     = offsetof(fr_value_box_t, datum.ip),
+       [FR_TYPE_IPV4_PREFIX]                   = offsetof(fr_value_box_t, datum.ip),
+       [FR_TYPE_IPV6_ADDR]                     = offsetof(fr_value_box_t, datum.ip),
+       [FR_TYPE_IPV6_PREFIX]                   = offsetof(fr_value_box_t, datum.ip),
+       [FR_TYPE_IFID]                          = offsetof(fr_value_box_t, datum.ifid),
+       [FR_TYPE_ETHERNET]                      = offsetof(fr_value_box_t, datum.ether),
 
-       [FR_TYPE_BOOLEAN]                       = offsetof(value_box_t, datum.boolean),
-       [FR_TYPE_BYTE]                          = offsetof(value_box_t, datum.byte),
-       [FR_TYPE_SHORT]                         = offsetof(value_box_t, datum.ushort),
-       [FR_TYPE_INTEGER]                       = offsetof(value_box_t, datum.integer),
-       [FR_TYPE_INTEGER64]                     = offsetof(value_box_t, datum.integer64),
-       [FR_TYPE_SIZE]                          = offsetof(value_box_t, datum.size),
+       [FR_TYPE_BOOLEAN]                       = offsetof(fr_value_box_t, datum.boolean),
+       [FR_TYPE_BYTE]                          = offsetof(fr_value_box_t, datum.byte),
+       [FR_TYPE_SHORT]                         = offsetof(fr_value_box_t, datum.ushort),
+       [FR_TYPE_INTEGER]                       = offsetof(fr_value_box_t, datum.integer),
+       [FR_TYPE_INTEGER64]                     = offsetof(fr_value_box_t, datum.integer64),
+       [FR_TYPE_SIZE]                          = offsetof(fr_value_box_t, datum.size),
 
-       [FR_TYPE_SIGNED]                        = offsetof(value_box_t, datum.sinteger),
+       [FR_TYPE_SIGNED]                        = offsetof(fr_value_box_t, datum.sinteger),
 
-       [FR_TYPE_TIMEVAL]                       = offsetof(value_box_t, datum.timeval),
-       [FR_TYPE_DECIMAL]                       = offsetof(value_box_t, datum.decimal),
+       [FR_TYPE_TIMEVAL]                       = offsetof(fr_value_box_t, datum.timeval),
+       [FR_TYPE_DECIMAL]                       = offsetof(fr_value_box_t, datum.decimal),
 
-       [FR_TYPE_DATE]                          = offsetof(value_box_t, datum.date),
+       [FR_TYPE_DATE]                          = offsetof(fr_value_box_t, datum.date),
 
-       [FR_TYPE_ABINARY]                       = offsetof(value_box_t, datum.filter),
+       [FR_TYPE_ABINARY]                       = offsetof(fr_value_box_t, datum.filter),
        [FR_TYPE_MAX]                           = 0     //!< Ensure array covers all types.
 };
 
@@ -181,14 +181,14 @@ size_t const value_box_offsets[] = {
  * @param[in] ctx      to allocate the value_box in.
  * @param[in] type     of value.
  * @return
- *     - A new value_box_t.
+ *     - A new fr_value_box_t.
  *     - NULL on error.
  */
-value_box_t *value_box_alloc(TALLOC_CTX *ctx, fr_type_t type)
+fr_value_box_t *fr_value_box_alloc(TALLOC_CTX *ctx, fr_type_t type)
 {
-       value_box_t *value;
+       fr_value_box_t *value;
 
-       value = talloc_zero(ctx, value_box_t);
+       value = talloc_zero(ctx, fr_value_box_t);
        if (!value) return NULL;
        value->type = type;
 
@@ -201,7 +201,7 @@ value_box_t *value_box_alloc(TALLOC_CTX *ctx, fr_type_t type)
  *
  * @param[in] data to clear.
  */
-inline void value_box_clear(value_box_t *data)
+inline void fr_value_box_clear(fr_value_box_t *data)
 {
        switch (data->type) {
        case FR_TYPE_OCTETS:
@@ -230,7 +230,7 @@ inline void value_box_clear(value_box_t *data)
  * @param[in] dst to copy flags to
  * @param[in] src of data.
  */
-static inline void value_box_copy_meta(value_box_t *dst, value_box_t const *src)
+static inline void fr_value_box_copy_meta(fr_value_box_t *dst, fr_value_box_t const *src)
 {
        switch (src->type) {
        case FR_TYPE_VARIABLE_SIZE:
@@ -256,7 +256,7 @@ static inline void value_box_copy_meta(value_box_t *dst, value_box_t const *src)
  *     - 1 if a is more than b.
  *     - < -1 on failure.
  */
-int value_box_cmp(value_box_t const *a, value_box_t const *b)
+int fr_value_box_cmp(fr_value_box_t const *a, fr_value_box_t const *b)
 {
        int compare = 0;
 
@@ -383,7 +383,7 @@ int value_box_cmp(value_box_t const *a, value_box_t const *b)
  *
  *     reserved, prefix-len, data...
  */
-static int value_box_cidr_cmp_op(FR_TOKEN op, int bytes,
+static int fr_value_box_cidr_cmp_op(FR_TOKEN op, int bytes,
                                 uint8_t a_net, uint8_t const *a,
                                 uint8_t b_net, uint8_t const *b)
 {
@@ -500,7 +500,7 @@ static int value_box_cidr_cmp_op(FR_TOKEN op, int bytes,
  *     - 0 if false
  *     - -1 on failure.
  */
-int value_box_cmp_op(FR_TOKEN op, value_box_t const *a, value_box_t const *b)
+int fr_value_box_cmp_op(FR_TOKEN op, fr_value_box_t const *a, fr_value_box_t const *b)
 {
        int compare = 0;
 
@@ -516,7 +516,7 @@ int value_box_cmp_op(FR_TOKEN op, value_box_t const *a, value_box_t const *b)
                        goto cmp;
 
                case FR_TYPE_IPV4_PREFIX:       /* IPv4 and IPv4 Prefix */
-                       return value_box_cidr_cmp_op(op, 4, 32, (uint8_t const *) &a->datum.ip.addr.v4.s_addr,
+                       return fr_value_box_cidr_cmp_op(op, 4, 32, (uint8_t const *) &a->datum.ip.addr.v4.s_addr,
                                                     b->datum.ip.prefix, (uint8_t const *) &b->datum.ip.addr.v4.s_addr);
 
                default:
@@ -527,12 +527,12 @@ int value_box_cmp_op(FR_TOKEN op, value_box_t const *a, value_box_t const *b)
        case FR_TYPE_IPV4_PREFIX:               /* IPv4 and IPv4 Prefix */
                switch (b->type) {
                case FR_TYPE_IPV4_ADDR:
-                       return value_box_cidr_cmp_op(op, 4, a->datum.ip.prefix,
+                       return fr_value_box_cidr_cmp_op(op, 4, a->datum.ip.prefix,
                                                     (uint8_t const *) &a->datum.ip.addr.v4.s_addr,
                                                     32, (uint8_t const *) &b->datum.ip.addr.v4);
 
                case FR_TYPE_IPV4_PREFIX:       /* IPv4 Prefix and IPv4 Prefix */
-                       return value_box_cidr_cmp_op(op, 4, a->datum.ip.prefix,
+                       return fr_value_box_cidr_cmp_op(op, 4, a->datum.ip.prefix,
                                                     (uint8_t const *) &a->datum.ip.addr.v4.s_addr,
                                                     b->datum.ip.prefix, (uint8_t const *) &b->datum.ip.addr.v4.s_addr);
 
@@ -547,7 +547,7 @@ int value_box_cmp_op(FR_TOKEN op, value_box_t const *a, value_box_t const *b)
                        goto cmp;
 
                case FR_TYPE_IPV6_PREFIX:       /* IPv6 and IPv6 Preifx */
-                       return value_box_cidr_cmp_op(op, 16, 128, (uint8_t const *) &a->datum.ip.addr.v6,
+                       return fr_value_box_cidr_cmp_op(op, 16, 128, (uint8_t const *) &a->datum.ip.addr.v6,
                                                     b->datum.ip.prefix, (uint8_t const *) &b->datum.ip.addr.v6);
 
                default:
@@ -558,12 +558,12 @@ int value_box_cmp_op(FR_TOKEN op, value_box_t const *a, value_box_t const *b)
        case FR_TYPE_IPV6_PREFIX:
                switch (b->type) {
                case FR_TYPE_IPV6_ADDR:         /* IPv6 Prefix and IPv6 */
-                       return value_box_cidr_cmp_op(op, 16, a->datum.ip.prefix,
+                       return fr_value_box_cidr_cmp_op(op, 16, a->datum.ip.prefix,
                                                     (uint8_t const *) &a->datum.ip.addr.v6,
                                                     128, (uint8_t const *) &b->datum.ip.addr.v6);
 
                case FR_TYPE_IPV6_PREFIX:       /* IPv6 Prefix and IPv6 */
-                       return value_box_cidr_cmp_op(op, 16, a->datum.ip.prefix,
+                       return fr_value_box_cidr_cmp_op(op, 16, a->datum.ip.prefix,
                                                     (uint8_t const *) &a->datum.ip.addr.v6,
                                                     b->datum.ip.prefix, (uint8_t const *) &b->datum.ip.addr.v6);
 
@@ -574,7 +574,7 @@ int value_box_cmp_op(FR_TOKEN op, value_box_t const *a, value_box_t const *b)
 
        default:
        cmp:
-               compare = value_box_cmp(a, b);
+               compare = fr_value_box_cmp(a, b);
                if (compare < -1) {     /* comparison error */
                        return -1;
                }
@@ -791,12 +791,12 @@ size_t value_str_unescape(uint8_t *out, char const *in, size_t inlen, char quote
 /** Performs byte order reversal for types that need it
  *
  * @param[in] dst      Where to write the result.  May be the same as src.
- * @param[in] src      #value_box_t containing an integer value.
+ * @param[in] src      #fr_value_box_t containing an integer value.
  * @return
  *     - 0 on success.
  *     - -1 on failure.
  */
-int value_box_hton(value_box_t *dst, value_box_t const *src)
+int fr_value_box_hton(fr_value_box_t *dst, fr_value_box_t const *src)
 {
        if (!fr_cond_assert(src->type != FR_TYPE_INVALID)) return -1;
 
@@ -804,7 +804,7 @@ int value_box_hton(value_box_t *dst, value_box_t const *src)
        switch (src->type) {
        case FR_TYPE_INTEGER64:
                dst->datum.integer64 = htonll(src->datum.integer64);
-               value_box_copy_meta(dst, src);
+               fr_value_box_copy_meta(dst, src);
                break;
 
        /* 4 byte integers */
@@ -812,13 +812,13 @@ int value_box_hton(value_box_t *dst, value_box_t const *src)
        case FR_TYPE_DATE:
        case FR_TYPE_SIGNED:
                dst->datum.integer = htonl(src->datum.integer);
-               value_box_copy_meta(dst, src);
+               fr_value_box_copy_meta(dst, src);
                break;
 
        /* 2 byte integers */
        case FR_TYPE_SHORT:
                dst->datum.ushort = htons(src->datum.ushort);
-               value_box_copy_meta(dst, src);
+               fr_value_box_copy_meta(dst, src);
                break;
 
        case FR_TYPE_OCTETS:
@@ -826,7 +826,7 @@ int value_box_hton(value_box_t *dst, value_box_t const *src)
                if (!fr_cond_assert(0)) return -1; /* shouldn't happen */
 
        default:
-               value_box_copy(NULL, dst, src);
+               fr_value_box_copy(NULL, dst, src);
                break;
        }
 
@@ -850,9 +850,9 @@ static uint8_t const v4_v6_map[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  * @param dst_enumv    unused.
  * @param src          Input data.
  */
-static inline int value_box_cast_to_strvalue(TALLOC_CTX *ctx, value_box_t *dst,
+static inline int fr_value_box_cast_to_strvalue(TALLOC_CTX *ctx, fr_value_box_t *dst,
                                             fr_type_t dst_type, UNUSED fr_dict_attr_t const *dst_enumv,
-                                            value_box_t const *src)
+                                            fr_value_box_t const *src)
 {
        if (!fr_cond_assert(dst_type == FR_TYPE_STRING)) return -1;
 
@@ -870,7 +870,7 @@ static inline int value_box_cast_to_strvalue(TALLOC_CTX *ctx, value_box_t *dst,
         *      Get the presentation format
         */
        default:
-               dst->datum.strvalue = value_box_asprint(ctx, src, '\0');
+               dst->datum.strvalue = fr_value_box_asprint(ctx, src, '\0');
                dst->datum.length = talloc_array_length(dst->datum.strvalue) - 1;
                break;
        }
@@ -891,9 +891,9 @@ static inline int value_box_cast_to_strvalue(TALLOC_CTX *ctx, value_box_t *dst,
  * @param dst_enumv    unused.
  * @param src          Input data.
  */
-static inline int value_box_cast_to_octets(TALLOC_CTX *ctx, value_box_t *dst,
+static inline int fr_value_box_cast_to_octets(TALLOC_CTX *ctx, fr_value_box_t *dst,
                                           fr_type_t dst_type, UNUSED fr_dict_attr_t const *dst_enumv,
-                                          value_box_t const *src)
+                                          fr_value_box_t const *src)
 {
        uint8_t *bin;
 
@@ -947,16 +947,16 @@ static inline int value_box_cast_to_octets(TALLOC_CTX *ctx, value_box_t *dst,
         *      Get the raw binary in memory representation
         */
        default:
-               value_box_hton(dst, src);       /* Flip any integer representations */
-               bin = talloc_memdup(ctx, ((uint8_t *)&dst->datum) + value_box_offsets[src->type],
-                                   value_box_field_sizes[src->type]);
+               fr_value_box_hton(dst, src);    /* Flip any integer representations */
+               bin = talloc_memdup(ctx, ((uint8_t *)&dst->datum) + fr_value_box_offsets[src->type],
+                                   fr_value_box_field_sizes[src->type]);
                break;
        }
 
        if (!bin) return -1;
 
        talloc_set_type(bin, uint8_t);
-       value_box_memsteal(ctx, dst, bin, src->tainted);
+       fr_value_box_memsteal(ctx, dst, bin, src->tainted);
        dst->type = FR_TYPE_OCTETS;
 
        return 0;
@@ -977,9 +977,9 @@ static inline int value_box_cast_to_octets(TALLOC_CTX *ctx, value_box_t *dst,
  * @param dst_enumv    unused.
  * @param src          Input data.
  */
-static inline int value_box_cast_to_ipv4addr(TALLOC_CTX *ctx, value_box_t *dst,
+static inline int fr_value_box_cast_to_ipv4addr(TALLOC_CTX *ctx, fr_value_box_t *dst,
                                             fr_type_t dst_type, fr_dict_attr_t const *dst_enumv,
-                                            value_box_t const *src)
+                                            fr_value_box_t const *src)
 {
        if (!fr_cond_assert(dst_type == FR_TYPE_IPV4_ADDR)) return -1;
 
@@ -1025,7 +1025,7 @@ static inline int value_box_cast_to_ipv4addr(TALLOC_CTX *ctx, value_box_t *dst,
                break;
 
        case FR_TYPE_STRING:
-               if (value_box_from_str(ctx, dst, &dst_type, dst_enumv,
+               if (fr_value_box_from_str(ctx, dst, &dst_type, dst_enumv,
                                       src->datum.strvalue, src->datum.length, '\0') < 0) return -1;
                break;
 
@@ -1079,9 +1079,9 @@ static inline int value_box_cast_to_ipv4addr(TALLOC_CTX *ctx, value_box_t *dst,
  * @param dst_enumv    unused.
  * @param src          Input data.
  */
-static inline int value_box_cast_to_ipv4prefix(TALLOC_CTX *ctx, value_box_t *dst,
+static inline int fr_value_box_cast_to_ipv4prefix(TALLOC_CTX *ctx, fr_value_box_t *dst,
                                               fr_type_t dst_type, fr_dict_attr_t const *dst_enumv,
-                                              value_box_t const *src)
+                                              fr_value_box_t const *src)
 {
        if (!fr_cond_assert(dst_type == FR_TYPE_IPV4_PREFIX)) return -1;
 
@@ -1126,7 +1126,7 @@ static inline int value_box_cast_to_ipv4prefix(TALLOC_CTX *ctx, value_box_t *dst
                break;
 
        case FR_TYPE_STRING:
-               if (value_box_from_str(ctx, dst, &dst_type, dst_enumv,
+               if (fr_value_box_from_str(ctx, dst, &dst_type, dst_enumv,
                                       src->datum.strvalue, src->datum.length, '\0') < 0) return -1;
                break;
 
@@ -1178,9 +1178,9 @@ static inline int value_box_cast_to_ipv4prefix(TALLOC_CTX *ctx, value_box_t *dst
  * @param dst_enumv    unused.
  * @param src          Input data.
  */
-static inline int value_box_cast_to_ipv6addr(TALLOC_CTX *ctx, value_box_t *dst,
+static inline int fr_value_box_cast_to_ipv6addr(TALLOC_CTX *ctx, fr_value_box_t *dst,
                                             fr_type_t dst_type, fr_dict_attr_t const *dst_enumv,
-                                            value_box_t const *src)
+                                            fr_value_box_t const *src)
 {
        if (!fr_cond_assert(dst_type == FR_TYPE_IPV6_ADDR)) return -1;
 
@@ -1236,7 +1236,7 @@ static inline int value_box_cast_to_ipv6addr(TALLOC_CTX *ctx, value_box_t *dst,
                break;
 
        case FR_TYPE_STRING:
-               if (value_box_from_str(ctx, dst, &dst_type, dst_enumv,
+               if (fr_value_box_from_str(ctx, dst, &dst_type, dst_enumv,
                                       src->datum.strvalue, src->datum.length, '\0') < 0) return -1;
                break;
 
@@ -1280,9 +1280,9 @@ static inline int value_box_cast_to_ipv6addr(TALLOC_CTX *ctx, value_box_t *dst,
  * @param dst_enumv    unused.
  * @param src          Input data.
  */
-static inline int value_box_cast_to_ipv6prefix(TALLOC_CTX *ctx, value_box_t *dst,
+static inline int fr_value_box_cast_to_ipv6prefix(TALLOC_CTX *ctx, fr_value_box_t *dst,
                                               fr_type_t dst_type, fr_dict_attr_t const *dst_enumv,
-                                              value_box_t const *src)
+                                              fr_value_box_t const *src)
 {
        switch (src->type) {
        case FR_TYPE_IPV4_ADDR:
@@ -1319,7 +1319,7 @@ static inline int value_box_cast_to_ipv6prefix(TALLOC_CTX *ctx, value_box_t *dst
                break;
 
        case FR_TYPE_STRING:
-               if (value_box_from_str(ctx, dst, &dst_type, dst_enumv,
+               if (fr_value_box_from_str(ctx, dst, &dst_type, dst_enumv,
                                       src->datum.strvalue, src->datum.length, '\0') < 0) return -1;
                break;
 
@@ -1347,11 +1347,11 @@ static inline int value_box_cast_to_ipv6prefix(TALLOC_CTX *ctx, value_box_t *dst
        return 0;
 }
 
-/** Convert one type of value_box_t to another
+/** Convert one type of fr_value_box_t to another
  *
  * This should be the canonical function used to convert between INTERNAL data formats.
  *
- * - If you want to convert from PRESENTATION format, use #value_box_from_str.
+ * - If you want to convert from PRESENTATION format, use #fr_value_box_from_str.
 
  *
  * @param ctx          to allocate buffers in (usually the same as dst)
@@ -1363,9 +1363,9 @@ static inline int value_box_cast_to_ipv6prefix(TALLOC_CTX *ctx, value_box_t *dst
  *     - 0 on success.
  *     - -1 on failure.
  */
-int value_box_cast(TALLOC_CTX *ctx, value_box_t *dst,
+int fr_value_box_cast(TALLOC_CTX *ctx, fr_value_box_t *dst,
                   fr_type_t dst_type, fr_dict_attr_t const *dst_enumv,
-                  value_box_t const *src)
+                  fr_value_box_t const *src)
 {
        if (!fr_cond_assert(dst_type != FR_TYPE_INVALID)) return -1;
        if (!fr_cond_assert(src->type != FR_TYPE_INVALID)) return -1;
@@ -1380,7 +1380,7 @@ int value_box_cast(TALLOC_CTX *ctx, value_box_t *dst,
        /*
         *      If it's the same type, copy.
         */
-       if (dst_type == src->type) return value_box_copy(ctx, dst, src);
+       if (dst_type == src->type) return fr_value_box_copy(ctx, dst, src);
 
        /*
         *      Initialise dst
@@ -1392,22 +1392,22 @@ int value_box_cast(TALLOC_CTX *ctx, value_box_t *dst,
         */
        switch (dst_type) {
        case FR_TYPE_STRING:
-               return value_box_cast_to_strvalue(ctx, dst, dst_type, dst_enumv, src);
+               return fr_value_box_cast_to_strvalue(ctx, dst, dst_type, dst_enumv, src);
 
        case FR_TYPE_OCTETS:
-               return value_box_cast_to_octets(ctx, dst, dst_type, dst_enumv, src);
+               return fr_value_box_cast_to_octets(ctx, dst, dst_type, dst_enumv, src);
 
        case FR_TYPE_IPV4_ADDR:
-               return value_box_cast_to_ipv4addr(ctx, dst, dst_type, dst_enumv, src);
+               return fr_value_box_cast_to_ipv4addr(ctx, dst, dst_type, dst_enumv, src);
 
        case FR_TYPE_IPV4_PREFIX:
-               return value_box_cast_to_ipv4prefix(ctx, dst, dst_type, dst_enumv, src);
+               return fr_value_box_cast_to_ipv4prefix(ctx, dst, dst_type, dst_enumv, src);
 
        case FR_TYPE_IPV6_ADDR:
-               return value_box_cast_to_ipv6addr(ctx, dst, dst_type, dst_enumv, src);
+               return fr_value_box_cast_to_ipv6addr(ctx, dst, dst_type, dst_enumv, src);
 
        case FR_TYPE_IPV6_PREFIX:
-               return value_box_cast_to_ipv6prefix(ctx, dst, dst_type, dst_enumv, src);
+               return fr_value_box_cast_to_ipv6prefix(ctx, dst, dst_type, dst_enumv, src);
 
        /*
         *      Need func
@@ -1439,9 +1439,9 @@ int value_box_cast(TALLOC_CTX *ctx, value_box_t *dst,
        }
 
        /*
-        *      Deserialise a value_box_t
+        *      Deserialise a fr_value_box_t
         */
-       if (src->type == FR_TYPE_STRING) return value_box_from_str(ctx, dst, &dst_type, dst_enumv,
+       if (src->type == FR_TYPE_STRING) return fr_value_box_from_str(ctx, dst, &dst_type, dst_enumv,
                                                                   src->datum.strvalue, src->datum.length, '\0');
 
        if ((src->type == FR_TYPE_IFID) &&
@@ -1632,26 +1632,26 @@ int value_box_cast(TALLOC_CTX *ctx, value_box_t *dst,
        }
 
        if (src->type == FR_TYPE_OCTETS) {
-               value_box_t tmp;
+               fr_value_box_t tmp;
 
        do_octets:
-               if (src->datum.length < value_box_network_sizes[dst_type][0]) {
+               if (src->datum.length < fr_value_box_network_sizes[dst_type][0]) {
                        fr_strerror_printf("Invalid cast from %s to %s.  Source is length %zd is smaller than "
                                           "destination type size %zd",
                                           fr_int2str(dict_attr_types, src->type, "<INVALID>"),
                                           fr_int2str(dict_attr_types, dst_type, "<INVALID>"),
                                           src->datum.length,
-                                          value_box_network_sizes[dst_type][0]);
+                                          fr_value_box_network_sizes[dst_type][0]);
                        return -1;
                }
 
-               if (src->datum.length > value_box_network_sizes[dst_type][1]) {
+               if (src->datum.length > fr_value_box_network_sizes[dst_type][1]) {
                        fr_strerror_printf("Invalid cast from %s to %s.  Source length %zd is greater than "
                                           "destination type size %zd",
                                           fr_int2str(dict_attr_types, src->type, "<INVALID>"),
                                           fr_int2str(dict_attr_types, dst_type, "<INVALID>"),
                                           src->datum.length,
-                                          value_box_network_sizes[dst_type][1]);
+                                          fr_value_box_network_sizes[dst_type][1]);
                        return -1;
                }
 
@@ -1659,11 +1659,11 @@ int value_box_cast(TALLOC_CTX *ctx, value_box_t *dst,
                 *      Copy the raw octets into the datum of a value_box
                 *      inverting bytesex for integers (if LE).
                 */
-               memcpy(&tmp.datum, src->datum.octets, value_box_field_sizes[dst_type]);
+               memcpy(&tmp.datum, src->datum.octets, fr_value_box_field_sizes[dst_type]);
                tmp.type = dst_type;
                if (fr_dict_enum_types[dst_type]) dst->datum.enumv = dst_enumv;
 
-               value_box_hton(dst, &tmp);
+               fr_value_box_hton(dst, &tmp);
 
                /*
                 *      Fixup IP addresses.
@@ -1707,7 +1707,7 @@ int value_box_cast(TALLOC_CTX *ctx, value_box_t *dst,
                dst->datum.integer = htonl(src->datum.ip.addr.v4.s_addr);
 
        } else {                /* they're of the same byte order */
-               memcpy(&dst->datum, &src->datum, value_box_field_sizes[src->type]);
+               memcpy(&dst->datum, &src->datum, fr_value_box_field_sizes[src->type]);
        }
 
        dst->type = dst_type;
@@ -1718,7 +1718,7 @@ int value_box_cast(TALLOC_CTX *ctx, value_box_t *dst,
 
 /** Copy value data verbatim duplicating any buffers
  *
- * @note Will free any exiting buffers associated with the dst #value_box_t.
+ * @note Will free any exiting buffers associated with the dst #fr_value_box_t.
  *
  * @param ctx To allocate buffers in.
  * @param dst Where to copy value_box to.
@@ -1727,15 +1727,15 @@ int value_box_cast(TALLOC_CTX *ctx, value_box_t *dst,
  *     - 0 on success.
  *     - -1 on failure.
  */
-int value_box_copy(TALLOC_CTX *ctx, value_box_t *dst, const value_box_t *src)
+int fr_value_box_copy(TALLOC_CTX *ctx, fr_value_box_t *dst, const fr_value_box_t *src)
 {
        if (!fr_cond_assert(src->type != FR_TYPE_INVALID)) return -1;
 
        switch (src->type) {
        default:
-               memcpy(((uint8_t *)dst) + value_box_offsets[src->type],
-                      ((uint8_t const *)src) + value_box_offsets[src->type],
-                      value_box_field_sizes[src->type]);
+               memcpy(((uint8_t *)dst) + fr_value_box_offsets[src->type],
+                      ((uint8_t const *)src) + fr_value_box_offsets[src->type],
+                      fr_value_box_field_sizes[src->type]);
                break;
 
        case FR_TYPE_STRING:
@@ -1771,42 +1771,42 @@ int value_box_copy(TALLOC_CTX *ctx, value_box_t *dst, const value_box_t *src)
                break;
        }
 
-       value_box_copy_meta(dst, src);
+       fr_value_box_copy_meta(dst, src);
 
        return 0;
 }
 
 /** Perform a shallow copy of a value_box
  *
- * Like #value_box_copy, but does not duplicate the buffers of the src value_box.
+ * Like #fr_value_box_copy, but does not duplicate the buffers of the src value_box.
  *
  * For #FR_TYPE_STRING and #FR_TYPE_OCTETS adds a reference from ctx so that the
  * buffer cannot be freed until the ctx is freed.
  *
- * @note Will free any exiting buffers associated with the dst #value_box_t.
+ * @note Will free any exiting buffers associated with the dst #fr_value_box_t.
  *
  * @param[in] ctx      to add reference from.  If NULL no reference will be added.
  * @param[in] dst      to copy value to.
  * @param[in] src      to copy value from.
  */
-void value_box_copy_shallow(TALLOC_CTX *ctx, value_box_t *dst, value_box_t const *src)
+void fr_value_box_copy_shallow(TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_t const *src)
 {
        switch (src->type) {
        default:
-               value_box_copy(ctx, dst, src);
+               fr_value_box_copy(ctx, dst, src);
                break;
 
        case FR_TYPE_STRING:
        case FR_TYPE_OCTETS:
                dst->datum.ptr = ctx ? talloc_reference(ctx, src->datum.ptr) : src->datum.ptr;
-               value_box_copy_meta(dst, src);
+               fr_value_box_copy_meta(dst, src);
                break;
        }
 }
 
 /** Copy value data verbatim moving any buffers to the specified context
  *
- * @note Will free any exiting buffers associated with the dst #value_box_t.
+ * @note Will free any exiting buffers associated with the dst #fr_value_box_t.
  *
  * @param[in] ctx      to allocate any new buffers in.
  * @param[in] dst      to copy value to.
@@ -1815,13 +1815,13 @@ void value_box_copy_shallow(TALLOC_CTX *ctx, value_box_t *dst, value_box_t const
  *     - 0 on success.
  *     - -1 on failure.
  */
-int value_box_steal(TALLOC_CTX *ctx, value_box_t *dst, value_box_t const *src)
+int fr_value_box_steal(TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_t const *src)
 {
        if (!fr_cond_assert(src->type != FR_TYPE_INVALID)) return -1;
 
        switch (src->type) {
        default:
-               return value_box_copy(ctx, dst, src);
+               return fr_value_box_copy(ctx, dst, src);
 
        case FR_TYPE_STRING:
        {
@@ -1833,7 +1833,7 @@ int value_box_steal(TALLOC_CTX *ctx, value_box_t *dst, value_box_t const *src)
                        return -1;
                }
                dst->datum.strvalue = str;
-               value_box_copy_meta(dst, src);
+               fr_value_box_copy_meta(dst, src);
        }
                return 0;
 
@@ -1847,22 +1847,22 @@ int value_box_steal(TALLOC_CTX *ctx, value_box_t *dst, value_box_t const *src)
                        return -1;
                }
                dst->datum.octets = bin;
-               value_box_copy_meta(dst, src);
+               fr_value_box_copy_meta(dst, src);
        }
                return 0;
        }
 }
 
-/** Copy a nul terminated string to a #value_box_t
+/** Copy a nul terminated string to a #fr_value_box_t
  *
- * @note Will free any exiting buffers associated with the dst #value_box_t.
+ * @note Will free any exiting buffers associated with the dst #fr_value_box_t.
  *
  * @param[in] ctx      to allocate any new buffers in.
  * @param[in] dst      to assign new buffer to.
  * @param[in] src      a nul terminated buffer.
  * @param[in] tainted  Whether the value came from a trusted source.
  */
-int value_box_strdup(TALLOC_CTX *ctx, value_box_t *dst, char const *src, bool tainted)
+int fr_value_box_strdup(TALLOC_CTX *ctx, fr_value_box_t *dst, char const *src, bool tainted)
 {
        char const      *str;
 
@@ -1880,7 +1880,7 @@ int value_box_strdup(TALLOC_CTX *ctx, value_box_t *dst, char const *src, bool ta
        return 0;
 }
 
-/** Copy a nul terminated talloced buffer to a #value_box_t
+/** Copy a nul terminated talloced buffer to a #fr_value_box_t
  *
  * Copy a talloced nul terminated buffer, setting fields in the dst value box appropriately.
  *
@@ -1894,7 +1894,7 @@ int value_box_strdup(TALLOC_CTX *ctx, value_box_t *dst, char const *src, bool ta
  *     - 0 on success.
  *     - -1 on failure.
  */
-int value_box_strdup_buffer(TALLOC_CTX *ctx, value_box_t *dst, char const *src, bool tainted)
+int fr_value_box_strdup_buffer(TALLOC_CTX *ctx, fr_value_box_t *dst, char const *src, bool tainted)
 {
        char    *str;
        size_t  len;
@@ -1919,7 +1919,7 @@ int value_box_strdup_buffer(TALLOC_CTX *ctx, value_box_t *dst, char const *src,
        return 0;
 }
 
-/** Steal a nul terminated talloced buffer into a specified ctx, and assign to a #value_box_t
+/** Steal a nul terminated talloced buffer into a specified ctx, and assign to a #fr_value_box_t
  *
  * Steal a talloced nul terminated buffer, setting fields in the dst value box appropriately.
  *
@@ -1933,7 +1933,7 @@ int value_box_strdup_buffer(TALLOC_CTX *ctx, value_box_t *dst, char const *src,
  *     - 0 on success.
  *     - -1 on failure.
  */
-int value_box_strsteal(TALLOC_CTX *ctx, value_box_t *dst, char *src, bool tainted)
+int fr_value_box_strsteal(TALLOC_CTX *ctx, fr_value_box_t *dst, char *src, bool tainted)
 {
        size_t  len;
        char    *str;
@@ -1967,7 +1967,7 @@ int value_box_strsteal(TALLOC_CTX *ctx, value_box_t *dst, char *src, bool tainte
  *     - 0 on success.
  *     - -1 on failure.
  */
-int value_box_strdup_shallow(value_box_t *dst, char const *src, bool tainted)
+int fr_value_box_strdup_shallow(fr_value_box_t *dst, char const *src, bool tainted)
 {
        dst->type = FR_TYPE_STRING;
        dst->tainted = tainted;
@@ -1989,7 +1989,7 @@ int value_box_strdup_shallow(value_box_t *dst, char const *src, bool tainted)
  *     - 0 on success.
  *     - -1 on failure.
  */
-int value_box_strdup_buffer_shallow(TALLOC_CTX *ctx, value_box_t *dst, char const *src, bool tainted)
+int fr_value_box_strdup_buffer_shallow(TALLOC_CTX *ctx, fr_value_box_t *dst, char const *src, bool tainted)
 {
        size_t  len;
 
@@ -2009,7 +2009,7 @@ int value_box_strdup_buffer_shallow(TALLOC_CTX *ctx, value_box_t *dst, char cons
        return 0;
 }
 
-/** Copy a buffer to a value_box_t
+/** Copy a buffer to a fr_value_box_t
  *
  * Copy a buffer containing binary data, setting fields in the dst value box appropriately.
  *
@@ -2024,7 +2024,7 @@ int value_box_strdup_buffer_shallow(TALLOC_CTX *ctx, value_box_t *dst, char cons
  *     - 0 on success.
  *     - -1 on failure.
  */
-int value_box_memdup(TALLOC_CTX *ctx, value_box_t *dst, uint8_t const *src, size_t len, bool tainted)
+int fr_value_box_memdup(TALLOC_CTX *ctx, fr_value_box_t *dst, uint8_t const *src, size_t len, bool tainted)
 {
        uint8_t *bin;
 
@@ -2042,7 +2042,7 @@ int value_box_memdup(TALLOC_CTX *ctx, value_box_t *dst, uint8_t const *src, size
        return 0;
 }
 
-/** Copy a talloced buffer to a value_box_t
+/** Copy a talloced buffer to a fr_value_box_t
  *
  * Copy a buffer containing binary data, setting fields in the dst value box appropriately.
  *
@@ -2054,14 +2054,14 @@ int value_box_memdup(TALLOC_CTX *ctx, value_box_t *dst, uint8_t const *src, size
  *     - 0 on success.
  *     - -1 on failure.
  */
-int value_box_memdup_buffer(TALLOC_CTX *ctx, value_box_t *dst, uint8_t *src, bool tainted)
+int fr_value_box_memdup_buffer(TALLOC_CTX *ctx, fr_value_box_t *dst, uint8_t *src, bool tainted)
 {
        (void) talloc_get_type_abort(src, uint8_t);
 
-       return value_box_memdup(ctx, dst, src, talloc_array_length(src), tainted);
+       return fr_value_box_memdup(ctx, dst, src, talloc_array_length(src), tainted);
 }
 
-/** Steal a talloced buffer into a specified ctx, and assign to a #value_box_t
+/** Steal a talloced buffer into a specified ctx, and assign to a #fr_value_box_t
  *
  * Steal a talloced buffer, setting fields in the dst value box appropriately.
  *
@@ -2073,7 +2073,7 @@ int value_box_memdup_buffer(TALLOC_CTX *ctx, value_box_t *dst, uint8_t *src, boo
  *     - 0 on success.
  *     - -1 on failure.
  */
-int value_box_memsteal(TALLOC_CTX *ctx, value_box_t *dst, uint8_t const *src, bool tainted)
+int fr_value_box_memsteal(TALLOC_CTX *ctx, fr_value_box_t *dst, uint8_t const *src, bool tainted)
 {
        uint8_t const   *bin;
 
@@ -2109,7 +2109,7 @@ int value_box_memsteal(TALLOC_CTX *ctx, value_box_t *dst, uint8_t const *src, bo
  *     - 0 on success.
  *     - -1 on failure.
  */
-int value_box_memdup_shallow(value_box_t *dst, uint8_t *src, size_t len, bool tainted)
+int fr_value_box_memdup_shallow(fr_value_box_t *dst, uint8_t *src, size_t len, bool tainted)
 {
        dst->type = FR_TYPE_OCTETS;
        dst->tainted = tainted;
@@ -2131,7 +2131,7 @@ int value_box_memdup_shallow(value_box_t *dst, uint8_t *src, size_t len, bool ta
  *     - 0 on success.
  *     - -1 on failure.
  */
-int value_box_memdup_buffer_shallow(TALLOC_CTX *ctx, value_box_t *dst, uint8_t *src, bool tainted)
+int fr_value_box_memdup_buffer_shallow(TALLOC_CTX *ctx, fr_value_box_t *dst, uint8_t *src, bool tainted)
 {
        (void) talloc_get_type_abort(src, uint8_t);
 
@@ -2143,7 +2143,7 @@ int value_box_memdup_buffer_shallow(TALLOC_CTX *ctx, value_box_t *dst, uint8_t *
        return 0;
 }
 
-/** Assign a #value_box_t value from an #fr_ipaddr_t
+/** Assign a #fr_value_box_t value from an #fr_ipaddr_t
  *
  * Automatically determines the type of the value box from the ipaddr address family
  * and the length of the prefix field.
@@ -2154,7 +2154,7 @@ int value_box_memdup_buffer_shallow(TALLOC_CTX *ctx, value_box_t *dst, uint8_t *
  *     - 0 on success.
  *     - -1 on failure.
  */
-int value_box_from_ipaddr(value_box_t *dst, fr_ipaddr_t const *ipaddr)
+int fr_value_box_from_ipaddr(fr_value_box_t *dst, fr_ipaddr_t const *ipaddr)
 {
        fr_type_t type;
 
@@ -2197,7 +2197,7 @@ int value_box_from_ipaddr(value_box_t *dst, fr_ipaddr_t const *ipaddr)
        return 0;
 }
 
-/** Convert string value to a value_box_t type
+/** Convert string value to a fr_value_box_t type
  *
  * @todo Should take taint param.
  *
@@ -2215,7 +2215,7 @@ int value_box_from_ipaddr(value_box_t *dst, fr_ipaddr_t const *ipaddr)
  *     - 0 on success.
  *     - -1 on parse error.
  */
-int value_box_from_str(TALLOC_CTX *ctx, value_box_t *dst,
+int fr_value_box_from_str(TALLOC_CTX *ctx, fr_value_box_t *dst,
                       fr_type_t *dst_type, fr_dict_attr_t const *dst_enumv,
                       char const *in, ssize_t inlen, char quote)
 {
@@ -2731,25 +2731,25 @@ finish:
        return 0;
 }
 
-/** Get the size of the value held by the value_box_t
+/** Get the size of the value held by the fr_value_box_t
  *
  * This is the length of the NETWORK presentation
  */
-size_t value_box_network_length(value_box_t *value)
+size_t fr_value_box_network_length(fr_value_box_t *value)
 {
        switch (value->type) {
        case FR_TYPE_VARIABLE_SIZE:
                return value->datum.length;
 
        default:
-               return value_box_network_sizes[value->type][0];
+               return fr_value_box_network_sizes[value->type][0];
        }
 }
 
 /** Print one attribute value to a string
  *
  */
-char *value_box_asprint(TALLOC_CTX *ctx, value_box_t const *data, char quote)
+char *fr_value_box_asprint(TALLOC_CTX *ctx, fr_value_box_t const *data, char quote)
 {
        char *p = NULL;
 
@@ -2757,9 +2757,9 @@ char *value_box_asprint(TALLOC_CTX *ctx, value_box_t const *data, char quote)
 
        if (fr_dict_enum_types[data->type] && data->datum.enumv) {
                fr_dict_enum_t const    *dv;
-               value_box_t             tmp;
+               fr_value_box_t          tmp;
 
-               value_box_cast(ctx, &tmp, FR_TYPE_INTEGER, NULL, data);
+               fr_value_box_cast(ctx, &tmp, FR_TYPE_INTEGER, NULL, data);
 
                dv = fr_dict_enum_by_da(NULL, data->datum.enumv, tmp.datum.integer);
                if (dv) return talloc_typed_strdup(ctx, dv->name);
@@ -2813,7 +2813,7 @@ char *value_box_asprint(TALLOC_CTX *ctx, value_box_t const *data, char quote)
                char buff[INET_ADDRSTRLEN  + 4]; // + /prefix
 
                buff[0] = '\0';
-               value_box_snprint(buff, sizeof(buff), data, '\0');
+               fr_value_box_snprint(buff, sizeof(buff), data, '\0');
 
                p = talloc_typed_strdup(ctx, buff);
        }
@@ -2825,7 +2825,7 @@ char *value_box_asprint(TALLOC_CTX *ctx, value_box_t const *data, char quote)
                char buff[INET6_ADDRSTRLEN + 4]; // + /prefix
 
                buff[0] = '\0';
-               value_box_snprint(buff, sizeof(buff), data, '\0');
+               fr_value_box_snprint(buff, sizeof(buff), data, '\0');
 
                p = talloc_typed_strdup(ctx, buff);
        }
@@ -2933,7 +2933,7 @@ char *value_box_asprint(TALLOC_CTX *ctx, value_box_t const *data, char quote)
  *     - The number of bytes written to the out buffer.
  *     - A number >= outlen if truncation has occurred.
  */
-size_t value_box_snprint(char *out, size_t outlen, value_box_t const *data, char quote)
+size_t fr_value_box_snprint(char *out, size_t outlen, fr_value_box_t const *data, char quote)
 {
        char            buf[1024];      /* Interim buffer to use with poorly behaved printing functions */
        char const      *a = NULL;
@@ -2954,9 +2954,9 @@ size_t value_box_snprint(char *out, size_t outlen, value_box_t const *data, char
 
        if (fr_dict_enum_types[data->type] && data->datum.enumv) {
                fr_dict_enum_t const    *dv;
-               value_box_t             tmp;
+               fr_value_box_t          tmp;
 
-               value_box_cast(NULL, &tmp, FR_TYPE_INTEGER, NULL, data);
+               fr_value_box_cast(NULL, &tmp, FR_TYPE_INTEGER, NULL, data);
 
                dv = fr_dict_enum_by_da(NULL, data->datum.enumv, tmp.datum.integer);
                if (dv) return strlcpy(out, dv->name, outlen);
index bf0162c92f485877a24d919b09c19779f7335e74..5923e140508fac74cee44ea0cdb8ce322f6d1649 100644 (file)
@@ -83,7 +83,7 @@ int cond_eval_tmpl(REQUEST *request, int modreturn, UNUSED int depth, vp_tmpl_t
 {
        int rcode;
        int modcode;
-       value_box_t data;
+       fr_value_box_t data;
 
        switch (vpt->type) {
        case TMPL_TYPE_UNPARSED:
@@ -158,8 +158,8 @@ int cond_eval_tmpl(REQUEST *request, int modreturn, UNUSED int depth, vp_tmpl_t
  *     - 1 for "match".
  */
 static int cond_do_regex(REQUEST *request, fr_cond_t const *c,
-                        value_box_t const *lhs,
-                        value_box_t const *rhs)
+                        fr_value_box_t const *lhs,
+                        fr_value_box_t const *rhs)
 {
        vp_map_t const *map = c->data.map;
 
@@ -225,7 +225,7 @@ static int cond_do_regex(REQUEST *request, fr_cond_t const *c,
 #endif
 
 #ifdef WITH_EVAL_DEBUG
-static void cond_print_operands(value_box_t const *lhs, value_box_t const *rhs)
+static void cond_print_operands(fr_value_box_t const *lhs, fr_value_box_t const *rhs)
 {
        if (lhs) {
                if (lhs->type == FR_TYPE_STRING) {
@@ -259,7 +259,7 @@ static void cond_print_operands(value_box_t const *lhs, value_box_t const *rhs)
  *     - 0 for "no match".
  *     - 1 for "match".
  */
-static int cond_cmp_values(REQUEST *request, fr_cond_t const *c, value_box_t const *lhs, value_box_t const *rhs)
+static int cond_cmp_values(REQUEST *request, fr_cond_t const *c, fr_value_box_t const *lhs, fr_value_box_t const *rhs)
 {
        vp_map_t const *map = c->data.map;
        int rcode;
@@ -290,7 +290,7 @@ static int cond_cmp_values(REQUEST *request, fr_cond_t const *c, value_box_t con
                vp = fr_pair_afrom_da(request, map->lhs->tmpl_da);
                vp->op = c->data.map->op;
 
-               value_box_copy(vp, &vp->data, rhs);
+               fr_value_box_copy(vp, &vp->data, rhs);
 
                rcode = paircompare(request, request->packet->vps, vp, NULL);
                rcode = (rcode == 0) ? 1 : 0;
@@ -299,7 +299,7 @@ static int cond_cmp_values(REQUEST *request, fr_cond_t const *c, value_box_t con
        }
 
        EVAL_DEBUG("CMP WITH VALUE DATA");
-       rcode = value_box_cmp_op(map->op, lhs, rhs);
+       rcode = fr_value_box_cmp_op(map->op, lhs, rhs);
 finish:
        switch (rcode) {
        case 0:
@@ -363,18 +363,18 @@ done:
  *     - 0 for "no match".
  *     - 1 for "match".
  */
-static int cond_normalise_and_cmp(REQUEST *request, fr_cond_t const *c, value_box_t const *lhs)
+static int cond_normalise_and_cmp(REQUEST *request, fr_cond_t const *c, fr_value_box_t const *lhs)
 {
        vp_map_t const          *map = c->data.map;
 
        int                     rcode;
 
-       value_box_t             *rhs = NULL;
+       fr_value_box_t          *rhs = NULL;
 
        fr_dict_attr_t const    *cast = NULL;
        fr_type_t                       cast_type = FR_TYPE_INVALID;
 
-       value_box_t             lhs_cast, rhs_cast;
+       fr_value_box_t          lhs_cast, rhs_cast;
        void                    *lhs_cast_buff = NULL, *rhs_cast_buff = NULL;
 
        xlat_escape_t           escape = NULL;
@@ -393,7 +393,7 @@ do {\
                EVAL_DEBUG("CASTING " #_s " FROM %s TO %s",\
                           fr_int2str(dict_attr_types, _s->type, "<INVALID>"),\
                           fr_int2str(dict_attr_types, cast_type, "<INVALID>"));\
-               if (value_box_cast(request, &_s ## _cast, cast_type, cast, _s) < 0) {\
+               if (fr_value_box_cast(request, &_s ## _cast, cast_type, cast, _s) < 0) {\
                        REDEBUG("Failed casting " #_s " operand: %s", fr_strerror());\
                        rcode = -1;\
                        goto finish;\
@@ -459,11 +459,11 @@ do {\
                EVAL_DEBUG("NORMALISATION TYPE %s (IMPLICIT FROM RHS REF)",
                           fr_int2str(dict_attr_types, cast->type, "<INVALID>"));
        } else if (map->lhs->type == TMPL_TYPE_DATA) {
-               cast_type = map->lhs->tmpl_value_box_type;
+               cast_type = map->lhs->tmpl_fr_value_box_type;
                EVAL_DEBUG("NORMALISATION TYPE %s (IMPLICIT FROM LHS DATA)",
                           fr_int2str(dict_attr_types, cast_type, "<INVALID>"));
        } else if (map->rhs->type == TMPL_TYPE_DATA) {
-               cast_type = map->rhs->tmpl_value_box_type;
+               cast_type = map->rhs->tmpl_fr_value_box_type;
                EVAL_DEBUG("NORMALISATION TYPE %s (IMPLICIT FROM RHS DATA)",
                           fr_int2str(dict_attr_types, cast_type, "<INVALID>"));
        }
@@ -513,7 +513,7 @@ do {\
        case TMPL_TYPE_XLAT_STRUCT:
        {
                ssize_t ret;
-               value_box_t data;
+               fr_value_box_t data;
 
                if (map->rhs->type != TMPL_TYPE_UNPARSED) {
                        char *p;
@@ -643,7 +643,7 @@ int cond_eval_map(REQUEST *request, UNUSED int modreturn, UNUSED int depth, fr_c
        {
                char *p = NULL;
                ssize_t ret;
-               value_box_t data;
+               fr_value_box_t data;
 
                if (map->lhs->type != TMPL_TYPE_UNPARSED) {
                        ret = tmpl_aexpand(request, &p, request, map->lhs, NULL, NULL);
index 00a79012d4f1640cf87dc02bdb5cfb14ce40b2be..dfa21e6f1e5dacd190e43e5692f7c1bbea08b8a9 100644 (file)
@@ -178,7 +178,7 @@ static ssize_t cond_tokenize_string(TALLOC_CTX *ctx, char **out,  char const **e
                        /*
                         *      Call the STANDARD parse function to figure out what the string is.
                         */
-                       value_box_t data;
+                       fr_value_box_t data;
                        char quote = *start;
                        fr_type_t src_type = FR_TYPE_STRING;
 
@@ -187,7 +187,7 @@ static ssize_t cond_tokenize_string(TALLOC_CTX *ctx, char **out,  char const **e
                         */
                        if (quote == '/') quote = '\0';
 
-                       if (value_box_from_str(ctx, &data, &src_type, NULL, start + 1, p - (start + 1), quote) < 0) {
+                       if (fr_value_box_from_str(ctx, &data, &src_type, NULL, start + 1, p - (start + 1), quote) < 0) {
                                *error = "error parsing string";
                                return -1;
                        }
@@ -1113,7 +1113,7 @@ static ssize_t cond_tokenize(TALLOC_CTX *ctx, CONF_ITEM *ci, char const *start,
                                                fr_dict_attr_t const *da;
 
                                                da = fr_dict_attr_by_type(c->data.map->lhs->tmpl_da,
-                                                                         c->data.map->rhs->tmpl_value_box_type);
+                                                                         c->data.map->rhs->tmpl_fr_value_box_type);
                                                if (!da) {
                                                        return_rhs("Cannot find type for attribute");
                                                }
index 88b592908837f3c145374278116850baf4e770b5..ca61299a611207a4ee05b7578311eef9d73ae02e 100644 (file)
@@ -2031,7 +2031,7 @@ static int cf_pair_default(CONF_PAIR **out, CONF_SECTION *cs, char const *name,
  * Takes fields from a #CONF_PARSER struct and uses them to parse the string value
  * of a #CONF_PAIR into a C data type matching the type argument.
  *
- * The format of the types are the same as #value_box_t types.
+ * The format of the types are the same as #fr_value_box_t types.
  *
  * @note The dflt value will only be used if no matching #CONF_PAIR is found. Empty strings will not
  *      result in the dflt value being used.
index bc6c5006f0b86499946f107288ff073cf88c237d..a9d8edb5b535ffed9ae78bce0c708349f9a75ad0 100644 (file)
@@ -632,7 +632,7 @@ wait:
 
        if (child_pid == pid) {
                if (WIFEXITED(status)) {
-                       value_box_t boxed_answer = {
+                       fr_value_box_t boxed_answer = {
                                .datum.strvalue = answer,
                                .datum.length = len,
                                .type = FR_TYPE_STRING
index a26908829ffd292ccf8331a86848903724ebeaad..518f2529581d34fe4a34edcb73fd38cf82d5baaa 100644 (file)
@@ -64,7 +64,7 @@ bool map_cast_from_hex(vp_map_t *map, FR_TOKEN rhs_type, char const *rhs)
        fr_dict_attr_t const    *da;
        VALUE_PAIR              *vp = NULL;
        vp_tmpl_t               *vpt;
-       value_box_t             bin = { .type = FR_TYPE_STRING }, cast;
+       fr_value_box_t          bin = { .type = FR_TYPE_STRING }, cast;
 
        rad_assert(map != NULL);
 
@@ -104,18 +104,18 @@ bool map_cast_from_hex(vp_map_t *map, FR_TOKEN rhs_type, char const *rhs)
        /*
         *      Assign but don't dup.
         */
-       value_box_memdup_buffer_shallow(NULL, &bin, ptr, false);
+       fr_value_box_memdup_buffer_shallow(NULL, &bin, ptr, false);
 
        /*
         *      Convert to da->type (if possible);
         */
-       if (value_box_cast(map, &cast, da->type, da, &bin) < 0) {
+       if (fr_value_box_cast(map, &cast, da->type, da, &bin) < 0) {
                talloc_free(bin.datum.ptr);
                return false;
        }
 
        /*
-        *      Package the #value_box_t as a #vp_tmpl_t
+        *      Package the #fr_value_box_t as a #vp_tmpl_t
         */
        if (tmpl_afrom_value_box(map, &map->rhs, &cast, true) < 0) {
                talloc_free(bin.datum.ptr);
@@ -860,7 +860,7 @@ int map_to_vp(TALLOC_CTX *ctx, VALUE_PAIR **out, REQUEST *request, vp_map_t cons
                                n = fr_pair_afrom_da(ctx, map->lhs->tmpl_da);
                                if (!n) return -1;
 
-                               if (value_box_cast(n, &n->data,
+                               if (fr_value_box_cast(n, &n->data,
                                                   map->lhs->tmpl_da->type, map->lhs->tmpl_da, &vp->data) < 0) {
                                        RPEDEBUG("Attribute conversion failed");
                                        fr_pair_list_free(&found);
@@ -899,13 +899,13 @@ int map_to_vp(TALLOC_CTX *ctx, VALUE_PAIR **out, REQUEST *request, vp_map_t cons
                n = fr_pair_afrom_da(ctx, map->lhs->tmpl_da);
                if (!n) return -1;
 
-               if (map->lhs->tmpl_da->type == map->rhs->tmpl_value_box_type) {
-                       if (value_box_copy(n, &n->data, &map->rhs->tmpl_value_box) < 0) {
+               if (map->lhs->tmpl_da->type == map->rhs->tmpl_fr_value_box_type) {
+                       if (fr_value_box_copy(n, &n->data, &map->rhs->tmpl_value_box) < 0) {
                                rcode = -1;
                                goto error;
                        }
                } else {
-                       if (value_box_cast(n, &n->data, n->vp_type, n->da,
+                       if (fr_value_box_cast(n, &n->data, n->vp_type, n->da,
                                           &map->rhs->tmpl_value_box) < 0) {
                                RPEDEBUG("Implicit cast failed");
                                rcode = -1;
@@ -1361,7 +1361,7 @@ int map_to_request(REQUEST *request, vp_map_t const *map, radius_map_getvalue_t
                                if (cmp > 0) break;
                                else if (cmp < 0) continue;
 
-                               cmp = (value_box_cmp_op(map->op, &a->data, &b->data) == 0);
+                               cmp = (fr_value_box_cmp_op(map->op, &a->data, &b->data) == 0);
                                if (cmp != 0) {
                                        a = fr_pair_cursor_remove(&dst_list);
                                        talloc_free(a);
index bf21c8877eda3d067333ffc664292ef7b0b9763e..49aa8f888728a89c72d6e1004eb20c7673c1bb0e 100644 (file)
@@ -501,11 +501,11 @@ static int radsnmp_get_response(int fd,
 
                default:
                        /*
-                        *      We call value_box_snprint with a NULL da pointer
+                        *      We call fr_value_box_snprint with a NULL da pointer
                         *      because we always need return integer values not
                         *      value aliases.
                         */
-                       len = value_box_snprint(value_buff, sizeof(value_buff), &vp->data, '\0');
+                       len = fr_value_box_snprint(value_buff, sizeof(value_buff), &vp->data, '\0');
                        if (is_truncated(len, sizeof(value_buff))) {
                                fr_strerror_printf("Insufficient fixed value buffer");
                                return -1;
index acdf53aae5ff8bfbf4e91825b60121422a4ba379..b7a618b93c24aefcbe7683dfa2a5c041dffc2dcd 100644 (file)
@@ -37,8 +37,8 @@ RCSID("$Id$")
 
 typedef struct fr_snmp_map fr_snmp_map_t;
 
-typedef int (*fr_snmp_get_func_t)(TALLOC_CTX *ctx, value_box_t *out, fr_snmp_map_t const *map, void *snmp_ctx);
-typedef int (*fr_snmp_set_func_t)(fr_snmp_map_t const *map, void *snmp_ctx, value_box_t *data);
+typedef int (*fr_snmp_get_func_t)(TALLOC_CTX *ctx, fr_value_box_t *out, fr_snmp_map_t const *map, void *snmp_ctx);
+typedef int (*fr_snmp_set_func_t)(fr_snmp_map_t const *map, void *snmp_ctx, fr_value_box_t *data);
 typedef int (*fr_snmp_index_func_t)(TALLOC_CTX *ctx, void **snmp_ctx_out,
                                    fr_snmp_map_t const *map, void const *snmp_ctx_in, uint32_t index);
 
@@ -79,7 +79,7 @@ static struct timeval uptime;
 static struct timeval reset_time;
 static int reset_state = PW_RADIUS_AUTH_SERV_CONFIG_RESET_VALUE_RUNNING;
 
-static int snmp_value_serv_ident_get(TALLOC_CTX *ctx, value_box_t *out, NDEBUG_UNUSED fr_snmp_map_t const *map,
+static int snmp_value_serv_ident_get(TALLOC_CTX *ctx, fr_value_box_t *out, NDEBUG_UNUSED fr_snmp_map_t const *map,
                                     UNUSED void *snmp_ctx)
 {
        rad_assert(map->da->type == FR_TYPE_STRING);
@@ -89,7 +89,7 @@ static int snmp_value_serv_ident_get(TALLOC_CTX *ctx, value_box_t *out, NDEBUG_U
        return 0;
 }
 
-static int snmp_value_uptime_get(UNUSED TALLOC_CTX *ctx, value_box_t *out, NDEBUG_UNUSED fr_snmp_map_t const *map,
+static int snmp_value_uptime_get(UNUSED TALLOC_CTX *ctx, fr_value_box_t *out, NDEBUG_UNUSED fr_snmp_map_t const *map,
                                 UNUSED void *snmp_ctx)
 {
        struct timeval now;
@@ -106,7 +106,7 @@ static int snmp_value_uptime_get(UNUSED TALLOC_CTX *ctx, value_box_t *out, NDEBU
        return 0;
 }
 
-static int snmp_config_reset_time_get(UNUSED TALLOC_CTX *ctx, value_box_t *out, NDEBUG_UNUSED fr_snmp_map_t const *map,
+static int snmp_config_reset_time_get(UNUSED TALLOC_CTX *ctx, fr_value_box_t *out, NDEBUG_UNUSED fr_snmp_map_t const *map,
                                      UNUSED void *snmp_ctx)
 {
        struct timeval now;
@@ -123,7 +123,7 @@ static int snmp_config_reset_time_get(UNUSED TALLOC_CTX *ctx, value_box_t *out,
        return 0;
 }
 
-static int snmp_config_reset_get(UNUSED TALLOC_CTX *ctx, value_box_t *out, NDEBUG_UNUSED fr_snmp_map_t const *map,
+static int snmp_config_reset_get(UNUSED TALLOC_CTX *ctx, fr_value_box_t *out, NDEBUG_UNUSED fr_snmp_map_t const *map,
                                 UNUSED void *snmp_ctx)
 {
        rad_assert(map->da->type == FR_TYPE_INTEGER);
@@ -133,7 +133,7 @@ static int snmp_config_reset_get(UNUSED TALLOC_CTX *ctx, value_box_t *out, NDEBU
        return 0;
 }
 
-static int snmp_config_reset_set(NDEBUG_UNUSED fr_snmp_map_t const *map, UNUSED void *snmp_ctx, value_box_t *in)
+static int snmp_config_reset_set(NDEBUG_UNUSED fr_snmp_map_t const *map, UNUSED void *snmp_ctx, fr_value_box_t *in)
 {
        rad_assert(map->da->type == FR_TYPE_INTEGER);
 
@@ -149,7 +149,7 @@ static int snmp_config_reset_set(NDEBUG_UNUSED fr_snmp_map_t const *map, UNUSED
 
 }
 
-static int snmp_auth_stats_offset_get(UNUSED TALLOC_CTX *ctx, value_box_t *out,
+static int snmp_auth_stats_offset_get(UNUSED TALLOC_CTX *ctx, fr_value_box_t *out,
                                      fr_snmp_map_t const *map, UNUSED void *snmp_ctx)
 {
        rad_assert(map->da->type == FR_TYPE_INTEGER);
@@ -175,7 +175,7 @@ static int snmp_client_index(UNUSED TALLOC_CTX *ctx, void **snmp_ctx_out,
        return 0;
 }
 
-static int snmp_client_index_get(UNUSED TALLOC_CTX *ctx, value_box_t *out,
+static int snmp_client_index_get(UNUSED TALLOC_CTX *ctx, fr_value_box_t *out,
                                 UNUSED fr_snmp_map_t const *map, void *snmp_ctx)
 {
        RADCLIENT *client = snmp_ctx;
@@ -187,7 +187,7 @@ static int snmp_client_index_get(UNUSED TALLOC_CTX *ctx, value_box_t *out,
        return 0;
 }
 
-static int snmp_client_ipv4addr_get(UNUSED TALLOC_CTX *ctx, value_box_t *out,
+static int snmp_client_ipv4addr_get(UNUSED TALLOC_CTX *ctx, fr_value_box_t *out,
                                    NDEBUG_UNUSED fr_snmp_map_t const *map, void *snmp_ctx)
 {
        RADCLIENT *client = snmp_ctx;
@@ -208,7 +208,7 @@ static int snmp_client_ipv4addr_get(UNUSED TALLOC_CTX *ctx, value_box_t *out,
        return 0;
 }
 
-static int snmp_client_id_get(TALLOC_CTX *ctx, value_box_t *out,
+static int snmp_client_id_get(TALLOC_CTX *ctx, fr_value_box_t *out,
                              NDEBUG_UNUSED fr_snmp_map_t const *map, void *snmp_ctx)
 {
        RADCLIENT *client = snmp_ctx;
@@ -225,7 +225,7 @@ static int snmp_client_id_get(TALLOC_CTX *ctx, value_box_t *out,
        return 0;
 }
 
-static int snmp_auth_client_stats_offset_get(UNUSED TALLOC_CTX *ctx, value_box_t *out,
+static int snmp_auth_client_stats_offset_get(UNUSED TALLOC_CTX *ctx, fr_value_box_t *out,
                                             fr_snmp_map_t const *map, void *snmp_ctx)
 {
        RADCLIENT *client = snmp_ctx;
@@ -743,7 +743,7 @@ static ssize_t snmp_process_leaf(vp_cursor_t *out, REQUEST *request,
 
        case PW_FREERADIUS_SNMP_OPERATION_VALUE_GET:
        {
-               value_box_t data;
+               fr_value_box_t data;
 
                memset(&data, 0, sizeof(data));
 
@@ -765,13 +765,13 @@ static ssize_t snmp_process_leaf(vp_cursor_t *out, REQUEST *request,
                 *      attribute.  To reduce boilerplate code
                 *      in callbacks, we handled allocating and
                 *      inserting VALUE_PAIRs, and pass in a
-                *      value_box_t struct for the callback
+                *      fr_value_box_t struct for the callback
                 *      to complete.
                 */
                if (map_p->get(request->reply, &data, map_p, snmp_ctx) < 0) goto error;
 
                vp = fr_pair_afrom_da(request->reply, map_p->da);
-               value_box_steal(vp, &vp->data, &data);
+               fr_value_box_steal(vp, &vp->data, &data);
                fr_pair_cursor_append(out, vp);
 
                vp = fr_pair_afrom_da(request->reply, fr_snmp_type);
index dfdc52534a427f04e3f1500b512ae174e4ae6e98..b25f75cd46decaeaf2ad81070de2841b8d609ac9 100644 (file)
@@ -594,7 +594,7 @@ void tmpl_from_da(vp_tmpl_t *vpt, fr_dict_attr_t const *da, int8_t tag, int num,
        vpt->tmpl_num = num;
 }
 
-/** Create a #vp_tmpl_t from a #value_box_t
+/** Create a #vp_tmpl_t from a #fr_value_box_t
  *
  * @param[in,out] ctx to allocate #vp_tmpl_t in.
  * @param[out] out Where to write pointer to new #vp_tmpl_t.
@@ -604,23 +604,23 @@ void tmpl_from_da(vp_tmpl_t *vpt, fr_dict_attr_t const *da, int8_t tag, int num,
  *     - 0 on success.
  *     - -1 on failure.
  */
-int tmpl_afrom_value_box(TALLOC_CTX *ctx, vp_tmpl_t **out, value_box_t *data, bool steal)
+int tmpl_afrom_value_box(TALLOC_CTX *ctx, vp_tmpl_t **out, fr_value_box_t *data, bool steal)
 {
        char const *name;
        vp_tmpl_t *vpt;
 
        vpt = talloc(ctx, vp_tmpl_t);
-       name = value_box_asprint(vpt, data, '\0');
+       name = fr_value_box_asprint(vpt, data, '\0');
        tmpl_init(vpt, TMPL_TYPE_DATA, name, talloc_array_length(name),
                  (data->type == FR_TYPE_STRING) ? T_SINGLE_QUOTED_STRING : T_BARE_WORD);
 
        if (steal) {
-               if (value_box_steal(vpt, &vpt->tmpl_value_box, data) < 0) {
+               if (fr_value_box_steal(vpt, &vpt->tmpl_value_box, data) < 0) {
                        talloc_free(vpt);
                        return -1;
                }
        } else {
-               if (value_box_copy(vpt, &vpt->tmpl_value_box, data) < 0) {
+               if (fr_value_box_copy(vpt, &vpt->tmpl_value_box, data) < 0) {
                        talloc_free(vpt);
                        return -1;
                }
@@ -956,7 +956,7 @@ ssize_t tmpl_afrom_str(TALLOC_CTX *ctx, vp_tmpl_t **out, char const *in, size_t
        ssize_t slen;
        fr_type_t data_type = FR_TYPE_STRING;
        vp_tmpl_t *vpt = NULL;
-       value_box_t data;
+       fr_value_box_t data;
 
        switch (type) {
        case T_BARE_WORD:
@@ -983,11 +983,11 @@ ssize_t tmpl_afrom_str(TALLOC_CTX *ctx, vp_tmpl_t **out, char const *in, size_t
                        binlen = (inlen - 2) / 2;
 
                        vpt = tmpl_alloc(ctx, TMPL_TYPE_DATA, in, inlen, type);
-                       vpt->tmpl_value_box_datum.ptr = talloc_array(vpt, uint8_t, binlen);
-                       vpt->tmpl_value_box_length = binlen;
-                       vpt->tmpl_value_box_type = FR_TYPE_OCTETS;
+                       vpt->tmpl_fr_value_box_datum.ptr = talloc_array(vpt, uint8_t, binlen);
+                       vpt->tmpl_fr_value_box_length = binlen;
+                       vpt->tmpl_fr_value_box_type = FR_TYPE_OCTETS;
 
-                       len = fr_hex2bin(vpt->tmpl_value_box_datum.ptr, binlen, in + 2, inlen - 2);
+                       len = fr_hex2bin(vpt->tmpl_fr_value_box_datum.ptr, binlen, in + 2, inlen - 2);
                        if (len != binlen) {
                                fr_strerror_printf("Hex string contains none hex char");
                                talloc_free(vpt);
@@ -1013,7 +1013,7 @@ ssize_t tmpl_afrom_str(TALLOC_CTX *ctx, vp_tmpl_t **out, char const *in, size_t
 
        parse:
                if (do_unescape) {
-                       if (value_box_from_str(ctx, &data, &data_type, NULL, in, inlen, quote) < 0) return 0;
+                       if (fr_value_box_from_str(ctx, &data, &data_type, NULL, in, inlen, quote) < 0) return 0;
 
                        vpt = tmpl_alloc(ctx, TMPL_TYPE_UNPARSED, data.datum.strvalue, talloc_array_length(data.datum.strvalue) - 1, type);
                        talloc_free(data.datum.ptr);
@@ -1051,7 +1051,7 @@ ssize_t tmpl_afrom_str(TALLOC_CTX *ctx, vp_tmpl_t **out, char const *in, size_t
                 *      literal.
                 */
                if (do_unescape) {
-                       if (value_box_from_str(ctx, &data, &data_type, NULL, in,
+                       if (fr_value_box_from_str(ctx, &data, &data_type, NULL, in,
                                                inlen, fr_token_quote[type]) < 0) return -1;
                        if (do_xlat) {
                                vpt = tmpl_alloc(ctx, TMPL_TYPE_XLAT, data.datum.strvalue,
@@ -1075,7 +1075,7 @@ ssize_t tmpl_afrom_str(TALLOC_CTX *ctx, vp_tmpl_t **out, char const *in, size_t
 
        case T_BACK_QUOTED_STRING:
                if (do_unescape) {
-                       if (value_box_from_str(ctx, &data, &data_type, NULL, in,
+                       if (fr_value_box_from_str(ctx, &data, &data_type, NULL, in,
                                                inlen, fr_token_quote[type]) < 0) return -1;
 
                        vpt = tmpl_alloc(ctx, TMPL_TYPE_EXEC, data.datum.strvalue, talloc_array_length(data.datum.strvalue) - 1, type);
@@ -1148,38 +1148,38 @@ int tmpl_cast_in_place(vp_tmpl_t *vpt, fr_type_t type, fr_dict_attr_t const *enu
 
        switch (vpt->type) {
        case TMPL_TYPE_UNPARSED:
-               vpt->tmpl_value_box_type = type;
+               vpt->tmpl_fr_value_box_type = type;
 
                /*
                 *      Why do we pass a pointer to the tmpl type? Goddamn WiMAX.
                 */
-               if (value_box_from_str(vpt, &vpt->tmpl_value_box, &vpt->tmpl_value_box_type,
+               if (fr_value_box_from_str(vpt, &vpt->tmpl_value_box, &vpt->tmpl_fr_value_box_type,
                                       enumv, vpt->name, vpt->len, '\0') < 0) return -1;
                vpt->type = TMPL_TYPE_DATA;
                break;
 
        case TMPL_TYPE_DATA:
        {
-               value_box_t new;
+               fr_value_box_t new;
 
-               if (type == vpt->tmpl_value_box_type) return 0; /* noop */
+               if (type == vpt->tmpl_fr_value_box_type) return 0;      /* noop */
 
-               if (value_box_cast(vpt, &new, type, enumv, &vpt->tmpl_value_box) < 0) return -1;
+               if (fr_value_box_cast(vpt, &new, type, enumv, &vpt->tmpl_value_box) < 0) return -1;
 
                /*
                 *      Free old value buffers
                 */
-               switch (vpt->tmpl_value_box_type) {
+               switch (vpt->tmpl_fr_value_box_type) {
                case FR_TYPE_STRING:
                case FR_TYPE_OCTETS:
-                       talloc_free(vpt->tmpl_value_box_datum.ptr);
+                       talloc_free(vpt->tmpl_fr_value_box_datum.ptr);
                        break;
 
                default:
                        break;
                }
 
-               value_box_copy(vpt, &vpt->tmpl_value_box, &new);
+               fr_value_box_copy(vpt, &vpt->tmpl_value_box, &new);
        }
                break;
 
@@ -1203,12 +1203,12 @@ void tmpl_cast_in_place_str(vp_tmpl_t *vpt)
        rad_assert(vpt != NULL);
        rad_assert(vpt->type == TMPL_TYPE_UNPARSED);
 
-       vpt->tmpl_value_box_datum.strvalue = talloc_typed_strdup(vpt, vpt->name);
-       rad_assert(vpt->tmpl_value_box_datum.strvalue != NULL);
+       vpt->tmpl_fr_value_box_datum.strvalue = talloc_typed_strdup(vpt, vpt->name);
+       rad_assert(vpt->tmpl_fr_value_box_datum.strvalue != NULL);
 
        vpt->type = TMPL_TYPE_DATA;
-       vpt->tmpl_value_box_type = FR_TYPE_STRING;
-       vpt->tmpl_value_box_length = talloc_array_length(vpt->tmpl_value_box_datum.strvalue) - 1;
+       vpt->tmpl_fr_value_box_type = FR_TYPE_STRING;
+       vpt->tmpl_fr_value_box_length = talloc_array_length(vpt->tmpl_fr_value_box_datum.strvalue) - 1;
 }
 
 /** Expand a #vp_tmpl_t to a string, parse it as an attribute of type cast, create a #VALUE_PAIR from the result
@@ -1234,7 +1234,7 @@ int tmpl_cast_to_vp(VALUE_PAIR **out, REQUEST *request,
 {
        int             rcode;
        VALUE_PAIR      *vp;
-       value_box_t     data;
+       fr_value_box_t  data;
        char            *p;
 
        VERIFY_TMPL(vpt);
@@ -1246,9 +1246,9 @@ int tmpl_cast_to_vp(VALUE_PAIR **out, REQUEST *request,
 
        if (vpt->type == TMPL_TYPE_DATA) {
                VERIFY_VP(vp);
-               rad_assert(vp->vp_type == vpt->tmpl_value_box_type);
+               rad_assert(vp->vp_type == vpt->tmpl_fr_value_box_type);
 
-               value_box_copy(vp, &vp->data, &vpt->tmpl_value_box);
+               fr_value_box_copy(vp, &vp->data, &vpt->tmpl_value_box);
                *out = vp;
                return 0;
        }
@@ -1386,7 +1386,7 @@ int tmpl_define_undefined_attr(vp_tmpl_t *vpt, fr_type_t type, fr_dict_attr_flag
  *
  * @param[out] out             Where to write a pointer to the string buffer. On return may
  *                             point to buff if buff was used to store the value. Otherwise will
- *                             point to a #value_box_t buffer, or the name of the template.
+ *                             point to a #fr_value_box_t buffer, or the name of the template.
  *                             Must not be NULL.
  * @param[out] buff            Expansion buffer, may be NULL except for the following types:
  *                             - #TMPL_TYPE_EXEC
@@ -1415,10 +1415,10 @@ ssize_t _tmpl_to_type(void *out,
                      xlat_escape_t escape, void const *escape_ctx,
                      fr_type_t dst_type)
 {
-       value_box_t             value_to_cast;
-       value_box_t             value_from_cast;
-       value_box_t const       *to_cast = &value_to_cast;
-       value_box_t const       *from_cast = &value_from_cast;
+       fr_value_box_t          value_to_cast;
+       fr_value_box_t          value_from_cast;
+       fr_value_box_t const    *to_cast = &value_to_cast;
+       fr_value_box_t const    *from_cast = &value_from_cast;
 
        VALUE_PAIR              *vp = NULL;
 
@@ -1522,7 +1522,7 @@ ssize_t _tmpl_to_type(void *out,
                if (ret < 0) return -2;
 
                to_cast = &vpt->tmpl_value_box;
-               src_type = vpt->tmpl_value_box_type;
+               src_type = vpt->tmpl_fr_value_box_type;
        }
                break;
 
@@ -1610,13 +1610,13 @@ ssize_t _tmpl_to_type(void *out,
                /*
                 *      Data type conversion...
                 */
-               ret = value_box_cast(ctx, &value_from_cast, dst_type, NULL, to_cast);
+               ret = fr_value_box_cast(ctx, &value_from_cast, dst_type, NULL, to_cast);
                if (ret < 0) return -1;
 
 
                /*
                 *      For the dynamic types we need to copy the output
-                *      to the buffer.  Really we need a version of value_box_cast
+                *      to the buffer.  Really we need a version of fr_value_box_cast
                 *      that works with buffers, but it's not a high priority...
                 */
                switch (dst_type) {
@@ -1661,9 +1661,9 @@ ssize_t _tmpl_to_type(void *out,
        }
 
        RDEBUG4("Copying %zu bytes to %p from offset %zu",
-               value_box_field_sizes[dst_type], *((void **)out), value_box_offsets[dst_type]);
+               fr_value_box_field_sizes[dst_type], *((void **)out), fr_value_box_offsets[dst_type]);
 
-       memcpy(out, ((uint8_t const *) from_cast) + value_box_offsets[dst_type], value_box_field_sizes[dst_type]);
+       memcpy(out, ((uint8_t const *) from_cast) + fr_value_box_offsets[dst_type], fr_value_box_field_sizes[dst_type]);
 
        return from_cast->datum.length;
 }
@@ -1709,11 +1709,11 @@ ssize_t _tmpl_to_atype(TALLOC_CTX *ctx, void *out,
                       xlat_escape_t escape, void const *escape_ctx,
                       fr_type_t dst_type)
 {
-       value_box_t const       *to_cast = NULL;
-       value_box_t             from_cast;
+       fr_value_box_t const    *to_cast = NULL;
+       fr_value_box_t          from_cast;
 
        VALUE_PAIR              *vp = NULL;
-       value_box_t             value;
+       fr_value_box_t          value;
        bool                    needs_dup = false;
 
        ssize_t                 slen = -1;
@@ -1755,7 +1755,7 @@ ssize_t _tmpl_to_atype(TALLOC_CTX *ctx, void *out,
 
        case TMPL_TYPE_XLAT:
        {
-               value_box_t     tmp;
+               fr_value_box_t  tmp;
                fr_type_t               src_type = FR_TYPE_STRING;
 
                RDEBUG4("EXPAND TMPL XLAT");
@@ -1771,7 +1771,7 @@ ssize_t _tmpl_to_atype(TALLOC_CTX *ctx, void *out,
                 *
                 *      @fixme We need a way of signalling xlat not to escape things.
                 */
-               ret = value_box_from_str(tmp_ctx, &tmp, &src_type, NULL, value.datum.strvalue, value.datum.length, '"');
+               ret = fr_value_box_from_str(tmp_ctx, &tmp, &src_type, NULL, value.datum.strvalue, value.datum.length, '"');
                if (ret < 0) goto error;
 
                value.datum.strvalue = tmp.datum.strvalue;
@@ -1783,7 +1783,7 @@ ssize_t _tmpl_to_atype(TALLOC_CTX *ctx, void *out,
 
        case TMPL_TYPE_XLAT_STRUCT:
        {
-               value_box_t     tmp;
+               fr_value_box_t  tmp;
                fr_type_t               src_type = FR_TYPE_STRING;
 
                RDEBUG4("EXPAND TMPL XLAT STRUCT");
@@ -1801,7 +1801,7 @@ ssize_t _tmpl_to_atype(TALLOC_CTX *ctx, void *out,
                 *
                 *      @fixme We need a way of signalling xlat not to escape things.
                 */
-               ret = value_box_from_str(tmp_ctx, &tmp, &src_type, NULL,
+               ret = fr_value_box_from_str(tmp_ctx, &tmp, &src_type, NULL,
                                         value.datum.strvalue, value.datum.length, '"');
                if (ret < 0) goto error;
 
@@ -1870,7 +1870,7 @@ ssize_t _tmpl_to_atype(TALLOC_CTX *ctx, void *out,
         *      Don't dup the buffers unless we need to.
         */
        if ((to_cast->type != dst_type) || needs_dup) {
-               ret = value_box_cast(ctx, &from_cast, dst_type, NULL, to_cast);
+               ret = fr_value_box_cast(ctx, &from_cast, dst_type, NULL, to_cast);
                if (ret < 0) goto error;
        } else {
                switch (to_cast->type) {
@@ -1892,9 +1892,9 @@ ssize_t _tmpl_to_atype(TALLOC_CTX *ctx, void *out,
        }
 
        RDEBUG4("Copying %zu bytes to %p from offset %zu",
-               value_box_field_sizes[dst_type], *((void **)out), value_box_offsets[dst_type]);
+               fr_value_box_field_sizes[dst_type], *((void **)out), fr_value_box_offsets[dst_type]);
 
-       memcpy(out, ((uint8_t *)&from_cast) + value_box_offsets[dst_type], value_box_field_sizes[dst_type]);
+       memcpy(out, ((uint8_t *)&from_cast) + fr_value_box_offsets[dst_type], fr_value_box_field_sizes[dst_type]);
 
        /*
         *      Frees any memory allocated for temporary buffers
@@ -2051,7 +2051,7 @@ do_literal:
                break;
 
        case TMPL_TYPE_DATA:
-               return value_box_snprint(out, outlen, &vpt->tmpl_value_box, fr_token_quote[vpt->quote]);
+               return fr_value_box_snprint(out, outlen, &vpt->tmpl_value_box, fr_token_quote[vpt->quote]);
 
        default:
                goto empty;
@@ -2577,24 +2577,24 @@ void tmpl_verify(char const *file, int line, vp_tmpl_t const *vpt)
                        if (!fr_cond_assert(0)) fr_exit_now(1);
                }
 
-               if (vpt->tmpl_value_box_type == FR_TYPE_INVALID) {
+               if (vpt->tmpl_fr_value_box_type == FR_TYPE_INVALID) {
                        FR_FAULT_LOG("CONSISTENCY CHECK FAILED %s[%u]: TMPL_TYPE_DATA type was "
                                     "FR_TYPE_INVALID (uninitialised)", file, line);
                        if (!fr_cond_assert(0)) fr_exit_now(1);
                }
 
-               if (vpt->tmpl_value_box_type >= FR_TYPE_MAX) {
+               if (vpt->tmpl_fr_value_box_type >= FR_TYPE_MAX) {
                        FR_FAULT_LOG("CONSISTENCY CHECK FAILED %s[%u]: TMPL_TYPE_DATA type was "
-                                    "%i (outside the range of fr_type_ts)", file, line, vpt->tmpl_value_box_type);
+                                    "%i (outside the range of fr_type_ts)", file, line, vpt->tmpl_fr_value_box_type);
                        if (!fr_cond_assert(0)) fr_exit_now(1);
                }
                /*
                 *      Unlike VALUE_PAIRs we can't guarantee that VALUE_PAIR_TMPL buffers will
                 *      be talloced. They may be allocated on the stack or in global variables.
                 */
-               switch (vpt->tmpl_value_box_type) {
+               switch (vpt->tmpl_fr_value_box_type) {
                case FR_TYPE_STRING:
-                       if (vpt->tmpl_value_box_datum.strvalue[vpt->tmpl_value_box_length] != '\0') {
+                       if (vpt->tmpl_fr_value_box_datum.strvalue[vpt->tmpl_fr_value_box_length] != '\0') {
                                FR_FAULT_LOG("CONSISTENCY CHECK FAILED %s[%u]: TMPL_TYPE_DATA char buffer not \\0 "
                                             "terminated", file, line);
                                if (!fr_cond_assert(0)) fr_exit_now(1);
index 2d772ed55e61277702726e867ccd6972c99ffa79..d83c26186b21e928702977fac03ab0dd9a33f8bd 100644 (file)
@@ -1273,13 +1273,13 @@ int unlang_fixup_update(vp_map_t *map, UNUSED void *ctx)
                 *      Fixup LHS da if it doesn't match the type
                 *      of the RHS.
                 */
-               if (map->lhs->tmpl_da->type != map->rhs->tmpl_value_box_type) {
+               if (map->lhs->tmpl_da->type != map->rhs->tmpl_fr_value_box_type) {
                        fr_dict_attr_t const *da;
 
-                       da = fr_dict_attr_by_type(map->lhs->tmpl_da, map->rhs->tmpl_value_box_type);
+                       da = fr_dict_attr_by_type(map->lhs->tmpl_da, map->rhs->tmpl_fr_value_box_type);
                        if (!da) {
                                fr_strerror_printf("Cannot find %s variant of attribute \"%s\"",
-                                                  fr_int2str(dict_attr_types, map->rhs->tmpl_value_box_type,
+                                                  fr_int2str(dict_attr_types, map->rhs->tmpl_fr_value_box_type,
                                                   "<INVALID>"), map->lhs->tmpl_da->name);
                                return -1;
                        }
index de9306879caed1b450b451c2dfa64e8411be26f1..7ecad4f1c7c0b4b86883733a191810ce682ed339 100644 (file)
@@ -617,7 +617,7 @@ static unlang_action_t unlang_switch(REQUEST *request, unlang_stack_t *stack,
        unlang_t                *this, *found, *null_case;
        unlang_group_t  *g, *h;
        fr_cond_t               cond;
-       value_box_t             data;
+       fr_value_box_t          data;
        vp_map_t                map;
        vp_tmpl_t               vpt;
 
index eeab86374d847e86c520d57a8a636a394eb7bb69..62737fba0dc0793ac298a0a0904153a045d97594 100644 (file)
@@ -509,10 +509,10 @@ static char *xlat_aprint(TALLOC_CTX *ctx, REQUEST *request, xlat_exp_t const * c
                 */
                if (*child) {
                        fr_type_t type;
-                       value_box_t data;
+                       fr_value_box_t data;
 
                        type = FR_TYPE_STRING;
-                       if (value_box_from_str(ctx, &data, &type, NULL, child,
+                       if (fr_value_box_from_str(ctx, &data, &type, NULL, child,
                                                talloc_array_length(child) - 1, '"') < 0) {
                                talloc_free(child);
                                return NULL;
index 8359d9ec94a0eb59c57df0ade05d9af4b679e50b..30d3ba8af09c1f0f46c962b54f0477c0e67bae19 100644 (file)
@@ -76,7 +76,7 @@ static ssize_t xlat_length(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen,
 
        if ((radius_get_vp(&vp, request, fmt) < 0) || !vp) return 0;
 
-       snprintf(*out, outlen, "%zu", value_box_network_length(&vp->data));
+       snprintf(*out, outlen, "%zu", fr_value_box_network_length(&vp->data));
        return strlen(*out);
 }
 
@@ -169,7 +169,7 @@ static ssize_t xlat_hex(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen,
        VALUE_PAIR *vp;
        uint8_t const *p;
        size_t  len;
-       value_box_t dst;
+       fr_value_box_t dst;
        uint8_t const *buff = NULL;
 
        while (isspace((int) *fmt)) fmt++;
@@ -186,11 +186,11 @@ static ssize_t xlat_hex(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen,
                p = vp->vp_octets;
                len = vp->vp_length;
        /*
-        *      Cast the value_box_t of the VP to an octets string and
+        *      Cast the fr_value_box_t of the VP to an octets string and
         *      print that as hex.
         */
        } else {
-               if (value_box_cast(request, &dst, FR_TYPE_OCTETS, NULL, &vp->data) < 0) {
+               if (fr_value_box_cast(request, &dst, FR_TYPE_OCTETS, NULL, &vp->data) < 0) {
                        REDEBUG("%s", fr_strerror());
                        goto error;
                }
@@ -383,7 +383,7 @@ static ssize_t xlat_debug_attr(UNUSED TALLOC_CTX *ctx, UNUSED char **out, UNUSED
                while (type->name) {
                        int pad;
 
-                       value_box_t *dst = NULL;
+                       fr_value_box_t *dst = NULL;
 
                        if ((fr_type_t) type->number == vp->vp_type) goto next_type;
 
@@ -400,13 +400,13 @@ static ssize_t xlat_debug_attr(UNUSED TALLOC_CTX *ctx, UNUSED char **out, UNUSED
                                break;
                        }
 
-                       dst = talloc_zero(vp, value_box_t);
+                       dst = talloc_zero(vp, fr_value_box_t);
                        /* We expect some to fail */
-                       if (value_box_cast(dst, dst, type->number, NULL, &vp->data) < 0) {
+                       if (fr_value_box_cast(dst, dst, type->number, NULL, &vp->data) < 0) {
                                goto next_type;
                        }
 
-                       value = value_box_asprint(dst, dst, '\'');
+                       value = fr_value_box_asprint(dst, dst, '\'');
                        if (!value) goto next_type;
 
                        if ((pad = (11 - strlen(type->name))) < 0) {
index ce564a44b54abd54e39005f80175235d840c7083..7a7f061017f8721a68610d12a3f5e0f9684d9cc9 100644 (file)
@@ -274,7 +274,7 @@ static int sync_search_entry_or_refrence(sync_state_t *sync, LDAPMessage *msg, L
 
        if (DEBUG_ENABLED3) {
                char            *entry_dn;
-               value_box_t     uuid_box;
+               fr_value_box_t  uuid_box;
 
                entry_dn = ldap_get_dn(sync->conn->handle, msg);
                fr_ldap_berval_to_value(&uuid_box, &entry_uuid);
index cae75992abdf9a5ccd8391e2f48c96d50163a34f..d88f9fcad2cd28bc53670fdfbca1e39f5ea98cb5 100644 (file)
@@ -209,7 +209,7 @@ static cache_status_t cache_entry_find(rlm_cache_entry_t **out,
        if ((head->lhs->tmpl_da->vendor == 0) && (head->lhs->tmpl_da->attr == PW_CACHE_CREATED)) {
                vp_map_t *map;
 
-               c->created = head->rhs->tmpl_value_box_datum.date;
+               c->created = head->rhs->tmpl_fr_value_box_datum.date;
 
                map = head;
                head = head->next;
@@ -222,7 +222,7 @@ static cache_status_t cache_entry_find(rlm_cache_entry_t **out,
        if ((head->lhs->tmpl_da->vendor == 0) && (head->lhs->tmpl_da->attr == PW_CACHE_EXPIRES)) {
                vp_map_t *map;
 
-               c->expires = head->rhs->tmpl_value_box_datum.date;
+               c->expires = head->rhs->tmpl_fr_value_box_datum.date;
 
                map = head;
                head = head->next;
@@ -288,8 +288,8 @@ static cache_status_t cache_entry_insert(UNUSED rlm_cache_config_t const *config
         *      Encode the entry created date
         */
        tmpl_init(&created_value, TMPL_TYPE_DATA, "<TEMP>", 6, T_BARE_WORD);
-       created_value.tmpl_value_box_type = FR_TYPE_DATE;
-       created_value.tmpl_value_box_datum.date = c->created;
+       created_value.tmpl_fr_value_box_type = FR_TYPE_DATE;
+       created_value.tmpl_fr_value_box_datum.date = c->created;
 
        /*
         *      Encode the entry expiry time
@@ -298,8 +298,8 @@ static cache_status_t cache_entry_insert(UNUSED rlm_cache_config_t const *config
         *      to ignore entries that were created before the last epoch.
         */
        tmpl_init(&expires_value, TMPL_TYPE_DATA, "<TEMP>", 6, T_BARE_WORD);
-       expires_value.tmpl_value_box_type = FR_TYPE_DATE;
-       expires_value.tmpl_value_box_datum.date = c->expires;
+       expires_value.tmpl_fr_value_box_type = FR_TYPE_DATE;
+       expires_value.tmpl_fr_value_box_datum.date = c->expires;
        expires.next = c->maps; /* Head of the list */
 
        for (cnt = 0, map = &created; map; cnt++, map = map->next);
index f87c2c5ddb0c7ba2b24a2da7736a667d9ccca18b..c305e314d367a734547e63e3571759a231996698 100644 (file)
@@ -368,21 +368,21 @@ static rlm_rcode_t cache_insert(rlm_cache_t const *inst, REQUEST *request, rlm_c
                        switch (map->lhs->type) {
                        /*
                         *      Attributes are easy, reuse the LHS, and create a new
-                        *      RHS with the value_box_t from the VALUE_PAIR.
+                        *      RHS with the fr_value_box_t from the VALUE_PAIR.
                         */
                        case TMPL_TYPE_ATTR:
                                c_map->lhs = map->lhs;  /* lhs shouldn't be touched, so this is ok */
                        do_rhs:
                                MEM(c_map->rhs = tmpl_init(talloc(c_map, vp_tmpl_t),
                                                           TMPL_TYPE_DATA, map->rhs->name, map->rhs->len, T_BARE_WORD));
-                               if (value_box_copy(c_map->rhs, &c_map->rhs->tmpl_value_box, &vp->data) < 0) {
+                               if (fr_value_box_copy(c_map->rhs, &c_map->rhs->tmpl_value_box, &vp->data) < 0) {
                                        REDEBUG("Failed copying attribute value");
                                error:
                                        talloc_free(pool);
                                        talloc_free(c);
                                        return RLM_MODULE_FAIL;
                                }
-                               c_map->rhs->tmpl_value_box_type = vp->vp_type;
+                               c_map->rhs->tmpl_fr_value_box_type = vp->vp_type;
                                if (vp->vp_type == FR_TYPE_STRING) {
                                        c_map->rhs->quote = is_printable(vp->vp_strvalue, vp->vp_length) ?
                                                T_SINGLE_QUOTED_STRING : T_DOUBLE_QUOTED_STRING;
@@ -837,7 +837,7 @@ static ssize_t cache_xlat(TALLOC_CTX *ctx, char **out, UNUSED size_t freespace,
                    (map->lhs->tmpl_tag != target->tmpl_tag) ||
                    (map->lhs->tmpl_list != target->tmpl_list)) continue;
 
-               *out = value_box_asprint(request, &map->rhs->tmpl_value_box, '\0');
+               *out = fr_value_box_asprint(request, &map->rhs->tmpl_value_box, '\0');
                ret = talloc_array_length(*out) - 1;
                break;
        }
index 7bcf06299a29b60903119b721d057c1b0f0d6b7f..af7109a9b8cd383c0e417e25ff2706024987e0c3 100644 (file)
@@ -74,7 +74,7 @@ int cache_serialize(TALLOC_CTX *ctx, char **out, rlm_cache_entry_t const *c)
                        goto error;
                }
 
-               value = value_box_asprint(value_pool, &map->rhs->tmpl_value_box, '\'');
+               value = fr_value_box_asprint(value_pool, &map->rhs->tmpl_value_box, '\'');
                if (!value) goto error;
 
                to_store = talloc_asprintf_append_buffer(to_store, "%s %s %s\n", attr,
@@ -149,12 +149,12 @@ int cache_deserialize(rlm_cache_entry_t *c, char *in, ssize_t inlen)
                 */
                if (map->lhs->tmpl_da->vendor == 0) switch (map->lhs->tmpl_da->attr) {
                case PW_CACHE_CREATED:
-                       c->created = map->rhs->tmpl_value_box_datum.date;
+                       c->created = map->rhs->tmpl_fr_value_box_datum.date;
                        talloc_free(map);
                        goto next;
 
                case PW_CACHE_EXPIRES:
-                       c->expires = map->rhs->tmpl_value_box_datum.date;
+                       c->expires = map->rhs->tmpl_fr_value_box_datum.date;
                        talloc_free(map);
                        goto next;
 
index 6d91460782a139d372a5bc7a10983b4ec01520a1..dd6639bb724a39bcf494b1096318ff7d22528518 100644 (file)
@@ -933,9 +933,9 @@ ssize_t fr_sim_encode(REQUEST *request, fr_dict_attr_t const *parent, uint8_t ty
                case FR_TYPE_INTEGER64:                 //!< 64 Bit unsigned integer.
                case FR_TYPE_SIGNED:                    //!< 32 Bit signed integer.
                {
-                       value_box_t data;
+                       fr_value_box_t data;
 
-                       value_box_hton(&data, &vp->data);
+                       fr_value_box_hton(&data, &vp->data);
                        memcpy(&p[2], &data.datum, vp->vp_length);
                }
 
index 64e82886ff057dfe13a631a585347742a38de89b..a5903b69c4b43a7665ca259e567778cc1a9cbb5e 100644 (file)
@@ -258,9 +258,9 @@ static bool get_number(REQUEST *request, char const **string, int64_t *answer)
                        int64_t y;
 
                        if (vp->vp_type != FR_TYPE_INTEGER64) {
-                               value_box_t     value;
+                               fr_value_box_t  value;
 
-                               if (value_box_cast(vp, &value, FR_TYPE_INTEGER64, NULL, &vp->data) < 0) {
+                               if (fr_value_box_cast(vp, &value, FR_TYPE_INTEGER64, NULL, &vp->data) < 0) {
                                        REDEBUG("Failed converting &%.*s to an integer value: %s", (int) vpt->len,
                                                vpt->name, fr_strerror());
                                        return false;
@@ -970,7 +970,7 @@ static ssize_t toupper_xlat(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen,
  * This needs to die, and hopefully will die, when xlat functions accept
  * xlat node structures.
  *
- * @param out          value_box_t containing a shallow copy of the attribute,
+ * @param out          fr_value_box_t containing a shallow copy of the attribute,
  *                     or the fmt string.
  * @param request      current request.
  * @param fmt          string.
@@ -978,7 +978,7 @@ static ssize_t toupper_xlat(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen,
  *     - The length of the data.
  *     - -1 on failure.
  */
-static int value_box_from_fmt(value_box_t *out, REQUEST *request, char const *fmt)
+static int fr_value_box_from_fmt(fr_value_box_t *out, REQUEST *request, char const *fmt)
 {
        VALUE_PAIR *vp;
 
@@ -1006,14 +1006,14 @@ static int value_box_from_fmt(value_box_t *out, REQUEST *request, char const *fm
         *      These are large types.  Return pointers to the
         *      data instead of copying the data.
         */
-       value_box_copy_shallow(NULL, out, &vp->data);
+       fr_value_box_copy_shallow(NULL, out, &vp->data);
 
        return 0;
 }
 
-static int value_box_to_bin(TALLOC_CTX *ctx, REQUEST *request, uint8_t **out, size_t *outlen, value_box_t const *in)
+static int fr_value_box_to_bin(TALLOC_CTX *ctx, REQUEST *request, uint8_t **out, size_t *outlen, fr_value_box_t const *in)
 {
-       value_box_t bin;
+       fr_value_box_t bin;
 
        switch (in->type) {
        case FR_TYPE_STRING:
@@ -1023,7 +1023,7 @@ static int value_box_to_bin(TALLOC_CTX *ctx, REQUEST *request, uint8_t **out, si
                return 0;
 
        default:
-               if (value_box_cast(ctx, &bin, FR_TYPE_OCTETS, NULL, in) < 0) {
+               if (fr_value_box_cast(ctx, &bin, FR_TYPE_OCTETS, NULL, in) < 0) {
                        RPERROR("Failed casting xlat input to 'octets'");
                        return -1;
                }
@@ -1034,10 +1034,10 @@ static int value_box_to_bin(TALLOC_CTX *ctx, REQUEST *request, uint8_t **out, si
 }
 
 #define VALUE_FROM_FMT(_tmp_ctx, _p, _len, _request, _fmt) \
-       value_box_t _value; \
-       if (value_box_from_fmt(&_value, _request, _fmt) < 0) return -1; \
+       fr_value_box_t _value; \
+       if (fr_value_box_from_fmt(&_value, _request, _fmt) < 0) return -1; \
        if (!_tmp_ctx) _tmp_ctx = talloc_new(_request); \
-       if (value_box_to_bin(_tmp_ctx, _request, &_p, &_len, &_value) < 0) { \
+       if (fr_value_box_to_bin(_tmp_ctx, _request, &_p, &_len, &_value) < 0) { \
                talloc_free(_tmp_ctx); \
                return -1; \
        }
index 4a5ad2cc2b749476c379b1da48b820f1aefebd5e..a442416cda6f2d75dc26413d88ab04cdaab7ad1b 100644 (file)
@@ -131,8 +131,8 @@ size_t fr_jpath_escape_func(UNUSED REQUEST *request, char *out, size_t outlen, c
 
 /** Recursive function for jpath_expr_evaluate
  *
- * @param[in,out] ctx to allocate value_box_t in.
- * @param[out] tail Where to write value_box_t (**).
+ * @param[in,out] ctx to allocate fr_value_box_t in.
+ * @param[out] tail Where to write fr_value_box_t (**).
  * @param[in] dst_type FreeRADIUS type to convert to.
  * @param[in] dst_enumv Enumeration values to allow string to integer conversions.
  * @param[in] object current node in the json tree.
@@ -142,11 +142,11 @@ size_t fr_jpath_escape_func(UNUSED REQUEST *request, char *out, size_t outlen, c
  *     - 0 on no match.
  *     - -1 on error.
  */
-static int jpath_evaluate(TALLOC_CTX *ctx, value_box_t ***tail,
+static int jpath_evaluate(TALLOC_CTX *ctx, fr_value_box_t ***tail,
                          fr_type_t dst_type, fr_dict_attr_t const *dst_enumv,
                          json_object *object, fr_jpath_node_t const *jpath)
 {
-       value_box_t             *value;
+       fr_value_box_t          *value;
        fr_jpath_node_t const   *node;
        jpath_selector_t const  *selector;
        bool                    child_matched = false;
@@ -350,7 +350,7 @@ static int jpath_evaluate(TALLOC_CTX *ctx, value_box_t ***tail,
         *      we now attempt conversion of the leaf to
         *      the specified value.
         */
-       value = talloc_zero(ctx, value_box_t);
+       value = talloc_zero(ctx, fr_value_box_t);
        if (fr_json_object_to_value_box(value, value, object, dst_type, dst_enumv) < 0) {
                talloc_free(value);
                return -1;
@@ -362,11 +362,11 @@ static int jpath_evaluate(TALLOC_CTX *ctx, value_box_t ***tail,
 
 /** Evaluate a parsed jpath expression against a json-c tree
  *
- * Will produce one or more value_box_t structures of the desired type,
+ * Will produce one or more fr_value_box_t structures of the desired type,
  * or error out if the conversion between types fails.
  *
- * @param[in,out] ctx to allocate value_box_t in.
- * @param[out] out Where to write value_box_t.
+ * @param[in,out] ctx to allocate fr_value_box_t in.
+ * @param[out] out Where to write fr_value_box_t.
  * @param[in] dst_type FreeRADIUS type to convert to.
  * @param[in] dst_enumv Enumeration values to allow string to integer conversions.
  * @param[in] root of the json-c tree.
@@ -376,11 +376,11 @@ static int jpath_evaluate(TALLOC_CTX *ctx, value_box_t ***tail,
  *     - 0 on no match.
  *     - -1 on error.
  */
-int fr_jpath_evaluate_leaf(TALLOC_CTX *ctx, value_box_t **out,
+int fr_jpath_evaluate_leaf(TALLOC_CTX *ctx, fr_value_box_t **out,
                           fr_type_t dst_type, fr_dict_attr_t const *dst_enumv,
                           json_object *root, fr_jpath_node_t const *jpath)
 {
-       value_box_t **tail = out;
+       fr_value_box_t **tail = out;
 
        *tail = NULL;
 
index 7a1542d9ff68449735ef63f93dcdfc3a191f2d36..d4533d3080ff8e8f5c9d85e630613f3008d22ca1 100644 (file)
@@ -28,7 +28,7 @@
 #include <freeradius-devel/rad_assert.h>
 #include "json.h"
 
-/** Convert json object to value_box_t
+/** Convert json object to fr_value_box_t
  *
  * @param[in] ctx      to allocate any value buffers in (should usually be the same as out).
  * @param[in] out      Where to write value_box.
  *     - 0 on success.
  *     - -1 on failure.
  */
-int fr_json_object_to_value_box(TALLOC_CTX *ctx, value_box_t *out, json_object *object,
+int fr_json_object_to_value_box(TALLOC_CTX *ctx, fr_value_box_t *out, json_object *object,
                                fr_type_t dst_type, fr_dict_attr_t const *dst_enumv)
 {
-       value_box_t in;
+       fr_value_box_t in;
 
        memset(&in, 0, sizeof(in));
 
@@ -116,7 +116,7 @@ int fr_json_object_to_value_box(TALLOC_CTX *ctx, value_box_t *out, json_object *
                break;
        }
 
-       if (value_box_cast(ctx, out, dst_type, dst_enumv, &in) < 0) return -1;
+       if (fr_value_box_cast(ctx, out, dst_type, dst_enumv, &in) < 0) return -1;
 
        return 0;
 }
@@ -126,7 +126,7 @@ int fr_json_object_to_value_box(TALLOC_CTX *ctx, value_box_t *out, json_object *
  * @param[in] ctx      to allocate temporary buffers in
  * @param[in] data     to convert.
  */
-json_object *json_object_from_value_box(TALLOC_CTX *ctx, value_box_t const *data)
+json_object *json_object_from_value_box(TALLOC_CTX *ctx, fr_value_box_t const *data)
 {
        switch (data->type) {
        default:
@@ -135,7 +135,7 @@ json_object *json_object_from_value_box(TALLOC_CTX *ctx, value_box_t const *data
                char            *p;
                json_object     *obj;
 
-               p = value_box_asprint(ctx, data, '\0');
+               p = fr_value_box_asprint(ctx, data, '\0');
                if (!p) return NULL;
 
                obj = json_object_new_string(p);
index b0a5011cf534e19ab8ee58e1cf4ea010720a96cc..d9ab8d211ece0abb16cb6702e03549c44be4b6c0 100644 (file)
@@ -49,7 +49,7 @@ typedef struct fr_jpath_node fr_jpath_node_t;
 size_t         fr_jpath_escape_func(UNUSED REQUEST *request, char *out, size_t outlen,
                                     char const *in, UNUSED void *arg);
 
-int            fr_jpath_evaluate_leaf(TALLOC_CTX *ctx, value_box_t **out,
+int            fr_jpath_evaluate_leaf(TALLOC_CTX *ctx, fr_value_box_t **out,
                                       fr_type_t dst_type, fr_dict_attr_t const *dst_enumv,
                                       json_object *root, fr_jpath_node_t const *jpath);
 
@@ -58,10 +58,10 @@ char                *fr_jpath_asprint(TALLOC_CTX *ctx, fr_jpath_node_t const *head);
 ssize_t                fr_jpath_parse(TALLOC_CTX *ctx, fr_jpath_node_t **head, char const *in, size_t inlen);
 
 /* json.c */
-int            fr_json_object_to_value_box(TALLOC_CTX *ctx, value_box_t *out, json_object *object,
+int            fr_json_object_to_value_box(TALLOC_CTX *ctx, fr_value_box_t *out, json_object *object,
                                            fr_type_t dst_type, fr_dict_attr_t const *dst_enumv);
 
-json_object    *json_object_from_value_box(TALLOC_CTX *ctx, value_box_t const *data);
+json_object    *json_object_from_value_box(TALLOC_CTX *ctx, fr_value_box_t const *data);
 
 char           *fr_json_from_string(TALLOC_CTX *ctx, char const *s, bool include_quotes);
 
index fb80015a30975a5afb2a00738b168d86941999fd..3cccf9423ad440df611600c86a928c777706dffa 100644 (file)
@@ -163,12 +163,12 @@ static int mod_map_proc_instantiate(CONF_SECTION *cs, UNUSED void *mod_inst, voi
                        break;
 
                case TMPL_TYPE_DATA:
-                       if (map->rhs->tmpl_value_box_type != FR_TYPE_STRING) {
+                       if (map->rhs->tmpl_fr_value_box_type != FR_TYPE_STRING) {
                                cf_log_err_cp(cp, "Right side of map must be a string");
                                return -1;
                        }
-                       p = map->rhs->tmpl_value_box_datum.strvalue;
-                       slen = fr_jpath_parse(cache, &cache->jpath, p, map->rhs->tmpl_value_box_length);
+                       p = map->rhs->tmpl_fr_value_box_datum.strvalue;
+                       slen = fr_jpath_parse(cache, &cache->jpath, p, map->rhs->tmpl_fr_value_box_length);
                        if (slen <= 0) goto error;
                        break;
 
@@ -207,7 +207,7 @@ static int _json_map_proc_get_value(TALLOC_CTX *ctx, VALUE_PAIR **out, REQUEST *
        VALUE_PAIR                      *vp;
        vp_cursor_t                     cursor;
        rlm_json_jpath_to_eval_t        *to_eval = uctx;
-       value_box_t                     *head, *value;
+       fr_value_box_t                  *head, *value;
        int                             ret;
 
        *out = NULL;
@@ -232,7 +232,7 @@ static int _json_map_proc_get_value(TALLOC_CTX *ctx, VALUE_PAIR **out, REQUEST *
                }
                vp->op = map->op;
 
-               if (value_box_steal(vp, &vp->data, value) < 0) {
+               if (fr_value_box_steal(vp, &vp->data, value) < 0) {
                        RPEDEBUG("Copying data to attribute failed");
                        talloc_free(vp);
                        goto error;
index 9cbb8f96d245b591c132f455c317964144d89faa..6ad716a4a7d77d5a0e79720bf2cb839199cc5028 100644 (file)
@@ -168,7 +168,7 @@ void fr_redis_reply_print(log_lvl_t lvl, redisReply *reply, REQUEST *request, in
        }
 }
 
-/** Convert a string or integer type to #value_box_t of specified type
+/** Convert a string or integer type to #fr_value_box_t of specified type
  *
  * Will work with REDIS_REPLY_STRING (which is converted to #FR_TYPE_STRING
  * then cast to dst_type), or REDIS_REPLY_INTEGER (which is converted to
@@ -188,10 +188,10 @@ void fr_redis_reply_print(log_lvl_t lvl, redisReply *reply, REQUEST *request, in
  *     - 0 on success.
  *     - -1 on cast or parse failure.
  */
-int fr_redis_reply_to_value_box(TALLOC_CTX *ctx, value_box_t *out, redisReply *reply,
+int fr_redis_reply_to_value_box(TALLOC_CTX *ctx, fr_value_box_t *out, redisReply *reply,
                                 fr_type_t dst_type, fr_dict_attr_t const *dst_enumv)
 {
-       value_box_t     in;
+       fr_value_box_t  in;
 
        memset(&in, 0, sizeof(in));
 
@@ -243,7 +243,7 @@ int fr_redis_reply_to_value_box(TALLOC_CTX *ctx, value_box_t *out, redisReply *r
                rad_assert(0);
        }
 
-       if (value_box_cast(ctx, out, dst_type, dst_enumv, &in) < 0) return -1;
+       if (fr_value_box_cast(ctx, out, dst_type, dst_enumv, &in) < 0) return -1;
 
        return 0;
 }
@@ -312,7 +312,7 @@ int fr_redis_reply_to_map(TALLOC_CTX *ctx, vp_map_t **out, REQUEST *request,
        case REDIS_REPLY_STRING:
        case REDIS_REPLY_INTEGER:
        {
-               value_box_t vpt;
+               fr_value_box_t vpt;
 
                /* Logs own errors */
                if (fr_redis_reply_to_value_box(map, &vpt, value,
@@ -378,11 +378,11 @@ int fr_redis_tuple_from_map(TALLOC_CTX *pool, char const *out[], size_t out_len[
        key = talloc_bstrndup(pool, key_buf, key_len);
        if (!key) return -1;
 
-       switch (map->rhs->tmpl_value_box_type) {
+       switch (map->rhs->tmpl_fr_value_box_type) {
        case FR_TYPE_STRING:
        case FR_TYPE_OCTETS:
-               out[2] = map->rhs->tmpl_value_box_datum.ptr;
-               out_len[2] = map->rhs->tmpl_value_box_length;
+               out[2] = map->rhs->tmpl_fr_value_box_datum.ptr;
+               out_len[2] = map->rhs->tmpl_fr_value_box_length;
                break;
 
        /*
@@ -393,7 +393,7 @@ int fr_redis_tuple_from_map(TALLOC_CTX *pool, char const *out[], size_t out_len[
                char    value[256];
                size_t  len;
 
-               len = value_box_snprint(value, sizeof(value), &map->rhs->tmpl_value_box, '\0');
+               len = fr_value_box_snprint(value, sizeof(value), &map->rhs->tmpl_value_box, '\0');
                new = talloc_bstrndup(pool, value, len);
                if (!new) {
                        talloc_free(key);
index 5b013bb1195b2df7b9b7d7e56d6c8adc752f767d..adefc67951385740389a9146b9410b0a735a9b80 100644 (file)
@@ -119,7 +119,7 @@ fr_redis_rcode_t    fr_redis_command_status(fr_redis_conn_t *conn, redisReply *repl
 
 void                   fr_redis_reply_print(log_lvl_t lvl, redisReply *reply, REQUEST *request, int idx);
 
-int                    fr_redis_reply_to_value_box(TALLOC_CTX *ctx, value_box_t *out, redisReply *reply,
+int                    fr_redis_reply_to_value_box(TALLOC_CTX *ctx, fr_value_box_t *out, redisReply *reply,
                                                    fr_type_t dst_type, fr_dict_attr_t const *dst_enumv);
 
 int                    fr_redis_reply_to_map(TALLOC_CTX *ctx, vp_map_t **out,
index 18699f49e989bffdd7575aeef334943b1510c933..cc2b5b21a67d30756a0da1c17dbb4a614a482fd0 100644 (file)
@@ -619,7 +619,7 @@ static ippool_rcode_t redis_ippool_allocate(rlm_redis_ippool_t const *inst, REQU
        if (reply->elements > 1) {
                vp_tmpl_t ip_rhs = {
                        .type = TMPL_TYPE_DATA,
-                       .tmpl_value_box_type = FR_TYPE_STRING
+                       .tmpl_fr_value_box_type = FR_TYPE_STRING
                };
                vp_map_t ip_map = {
                        .lhs = inst->allocated_address_attr,
@@ -637,30 +637,30 @@ static ippool_rcode_t redis_ippool_allocate(rlm_redis_ippool_t const *inst, REQU
                case REDIS_REPLY_INTEGER:
                {
                        if (ip_map.lhs->tmpl_da->type != FR_TYPE_IPV4_ADDR) {
-                               value_box_t tmp;
+                               fr_value_box_t tmp;
 
                                memset(&tmp, 0, sizeof(tmp));
 
                                tmp.datum.integer = ntohl((uint32_t)reply->element[1]->integer);
                                tmp.type = FR_TYPE_INTEGER;
 
-                               if (value_box_cast(NULL, &ip_map.rhs->tmpl_value_box, FR_TYPE_IPV4_ADDR,
+                               if (fr_value_box_cast(NULL, &ip_map.rhs->tmpl_value_box, FR_TYPE_IPV4_ADDR,
                                                    NULL, &tmp)) {
                                        RPEDEBUG("Failed converting integer to IPv4 address");
                                        ret = IPPOOL_RCODE_FAIL;
                                        goto finish;
                                }
                        } else {
-                               ip_map.rhs->tmpl_value_box_datum.integer = ntohl((uint32_t)reply->element[1]->integer);
-                               ip_map.rhs->tmpl_value_box_type = FR_TYPE_INTEGER;
+                               ip_map.rhs->tmpl_fr_value_box_datum.integer = ntohl((uint32_t)reply->element[1]->integer);
+                               ip_map.rhs->tmpl_fr_value_box_type = FR_TYPE_INTEGER;
                        }
                }
                        goto do_ip_map;
 
                case REDIS_REPLY_STRING:
-                       ip_map.rhs->tmpl_value_box_datum.strvalue = reply->element[1]->str;
-                       ip_map.rhs->tmpl_value_box_length = reply->element[1]->len;
-                       ip_map.rhs->tmpl_value_box_type = FR_TYPE_STRING;
+                       ip_map.rhs->tmpl_fr_value_box_datum.strvalue = reply->element[1]->str;
+                       ip_map.rhs->tmpl_fr_value_box_length = reply->element[1]->len;
+                       ip_map.rhs->tmpl_fr_value_box_type = FR_TYPE_STRING;
 
                do_ip_map:
                        if (map_to_request(request, &ip_map, map_to_vp, NULL) < 0) {
@@ -690,7 +690,7 @@ static ippool_rcode_t redis_ippool_allocate(rlm_redis_ippool_t const *inst, REQU
                        vp_tmpl_t range_rhs = {
                                .name = "",
                                .type = TMPL_TYPE_DATA,
-                               .tmpl_value_box_type = FR_TYPE_STRING,
+                               .tmpl_fr_value_box_type = FR_TYPE_STRING,
                                .quote = T_DOUBLE_QUOTED_STRING
                        };
                        vp_map_t range_map = {
@@ -699,9 +699,9 @@ static ippool_rcode_t redis_ippool_allocate(rlm_redis_ippool_t const *inst, REQU
                                .rhs = &range_rhs
                        };
 
-                       range_map.rhs->tmpl_value_box_datum.strvalue = reply->element[2]->str;
-                       range_map.rhs->tmpl_value_box_length = reply->element[2]->len;
-                       range_map.rhs->tmpl_value_box_type = FR_TYPE_STRING;
+                       range_map.rhs->tmpl_fr_value_box_datum.strvalue = reply->element[2]->str;
+                       range_map.rhs->tmpl_fr_value_box_length = reply->element[2]->len;
+                       range_map.rhs->tmpl_fr_value_box_type = FR_TYPE_STRING;
                        if (map_to_request(request, &range_map, map_to_vp, NULL) < 0) {
                                ret = IPPOOL_RCODE_FAIL;
                                goto finish;
@@ -727,7 +727,7 @@ static ippool_rcode_t redis_ippool_allocate(rlm_redis_ippool_t const *inst, REQU
                vp_tmpl_t expiry_rhs = {
                        .name = "",
                        .type = TMPL_TYPE_DATA,
-                       .tmpl_value_box_type = FR_TYPE_STRING,
+                       .tmpl_fr_value_box_type = FR_TYPE_STRING,
                        .quote = T_DOUBLE_QUOTED_STRING
                };
                vp_map_t expiry_map = {
@@ -743,8 +743,8 @@ static ippool_rcode_t redis_ippool_allocate(rlm_redis_ippool_t const *inst, REQU
                        goto finish;
                }
 
-               expiry_map.rhs->tmpl_value_box_datum.integer = reply->element[3]->integer;
-               expiry_map.rhs->tmpl_value_box_type = FR_TYPE_INTEGER;
+               expiry_map.rhs->tmpl_fr_value_box_datum.integer = reply->element[3]->integer;
+               expiry_map.rhs->tmpl_fr_value_box_type = FR_TYPE_INTEGER;
                if (map_to_request(request, &expiry_map, map_to_vp, NULL) < 0) {
                        ret = IPPOOL_RCODE_FAIL;
                        goto finish;
@@ -771,7 +771,7 @@ static ippool_rcode_t redis_ippool_update(rlm_redis_ippool_t const *inst, REQUES
        fr_redis_rcode_t        status;
        ippool_rcode_t          ret = IPPOOL_RCODE_SUCCESS;
 
-       vp_tmpl_t               range_rhs = { .name = "", .type = TMPL_TYPE_DATA, .tmpl_value_box_type = FR_TYPE_STRING, .quote = T_DOUBLE_QUOTED_STRING };
+       vp_tmpl_t               range_rhs = { .name = "", .type = TMPL_TYPE_DATA, .tmpl_fr_value_box_type = FR_TYPE_STRING, .quote = T_DOUBLE_QUOTED_STRING };
        vp_map_t                range_map = { .lhs = inst->range_attr, .op = T_OP_SET, .rhs = &range_rhs };
 
        gettimeofday(&now, NULL);
@@ -849,9 +849,9 @@ static ippool_rcode_t redis_ippool_update(rlm_redis_ippool_t const *inst, REQUES
                 *      Add range ID to request
                 */
                case REDIS_REPLY_STRING:
-                       range_map.rhs->tmpl_value_box_datum.strvalue = reply->element[1]->str;
-                       range_map.rhs->tmpl_value_box_length = reply->element[1]->len;
-                       range_map.rhs->tmpl_value_box_type = FR_TYPE_STRING;
+                       range_map.rhs->tmpl_fr_value_box_datum.strvalue = reply->element[1]->str;
+                       range_map.rhs->tmpl_fr_value_box_length = reply->element[1]->len;
+                       range_map.rhs->tmpl_fr_value_box_type = FR_TYPE_STRING;
                        if (map_to_request(request, &range_map, map_to_vp, NULL) < 0) {
                                ret = IPPOOL_RCODE_FAIL;
                                goto finish;
@@ -876,7 +876,7 @@ static ippool_rcode_t redis_ippool_update(rlm_redis_ippool_t const *inst, REQUES
                vp_tmpl_t expiry_rhs = {
                        .name = "",
                        .type = TMPL_TYPE_DATA,
-                       .tmpl_value_box_type = FR_TYPE_STRING,
+                       .tmpl_fr_value_box_type = FR_TYPE_STRING,
                        .quote = T_DOUBLE_QUOTED_STRING
                };
                vp_map_t expiry_map = {
@@ -885,8 +885,8 @@ static ippool_rcode_t redis_ippool_update(rlm_redis_ippool_t const *inst, REQUES
                        .rhs = &expiry_rhs
                };
 
-               expiry_map.rhs->tmpl_value_box_datum.integer = expires;
-               expiry_map.rhs->tmpl_value_box_type = FR_TYPE_INTEGER;
+               expiry_map.rhs->tmpl_fr_value_box_datum.integer = expires;
+               expiry_map.rhs->tmpl_fr_value_box_type = FR_TYPE_INTEGER;
                if (map_to_request(request, &expiry_map, map_to_vp, NULL) < 0) {
                        ret = IPPOOL_RCODE_FAIL;
                        goto finish;
@@ -1142,9 +1142,9 @@ static rlm_rcode_t mod_action(rlm_redis_ippool_t const *inst, REQUEST *request,
                                        .rhs = &ip_rhs
                                };
 
-                               ip_rhs.tmpl_value_box_length = strlen(ip_str);
-                               ip_rhs.tmpl_value_box_datum.strvalue = ip_str;
-                               ip_rhs.tmpl_value_box_type = FR_TYPE_STRING;
+                               ip_rhs.tmpl_fr_value_box_length = strlen(ip_str);
+                               ip_rhs.tmpl_fr_value_box_datum.strvalue = ip_str;
+                               ip_rhs.tmpl_fr_value_box_type = FR_TYPE_STRING;
 
                                if (map_to_request(request, &ip_map, map_to_vp, NULL) < 0) return RLM_MODULE_FAIL;
                        }
index 64b755aa5f7e227e5c481d9b876420999f800f86..ac8e92c22868b8e0e3673bc6613dadba6cf5c95c 100644 (file)
@@ -899,7 +899,7 @@ static VALUE_PAIR *json_pair_make_leaf(UNUSED rlm_rest_t const *instance, UNUSED
 
        VALUE_PAIR      *vp;
 
-       value_box_t     src;
+       fr_value_box_t  src;
 
        if (fr_json_object_is_type(leaf, json_type_null)) {
                RDEBUG3("Got null value for attribute \"%s\", skipping...", da->name);
@@ -961,7 +961,7 @@ static VALUE_PAIR *json_pair_make_leaf(UNUSED rlm_rest_t const *instance, UNUSED
                src.datum.length = strlen(src.datum.strvalue);
        }
 
-       ret = value_box_cast(vp, &vp->data, da->type, da, &src);
+       ret = fr_value_box_cast(vp, &vp->data, da->type, da, &src);
        talloc_free(expanded);
        if (ret < 0) {
                RWDEBUG("Failed parsing value for attribute \"%s\" (skipping): %s", da->name, fr_strerror());
index 191c17b822536c144f3873f21efbd1d21f938b29..51e5f4303843bd85a7e2397bc52cd82bff9a8981 100644 (file)
@@ -107,7 +107,7 @@ static int rlm_rest_status_update(REQUEST *request,  void *handle)
        TALLOC_CTX      *ctx;
        VALUE_PAIR      **list;
        int             code;
-       value_box_t     value;
+       fr_value_box_t  value;
 
        code = rest_get_handle_code(handle);
 
index f94de20351060d96749afcdc447ee05d25eadd02..70c94568c4feaa57d1b23d38eea5ea0be27c4c39 100644 (file)
@@ -98,7 +98,7 @@ static rlm_rcode_t sometimes_return(void const *instance, REQUEST *request, RADI
                return RLM_MODULE_FAIL;
 
        default:
-               hash = fr_hash(&vp->data.datum, value_box_field_sizes[vp->vp_type]);
+               hash = fr_hash(&vp->data.datum, fr_value_box_field_sizes[vp->vp_type]);
                break;
        }
        hash &= 0xff;           /* ensure it's 0..255 */