static_assert(SIZEOF_MEMBER(fr_value_box_t, vb_float64) == 8,
"vb_float64 has unexpected length");
-static ssize_t fr_value_box_to_network_dbuff(size_t *need, fr_dbuff_t *dbuff, fr_value_box_t const *value);
/** Map data types to names representing those types
*/
return fr_value_box_to_network_dbuff(need, &FR_DBUFF_TMP(dst, dst_len), value);
}
-static ssize_t fr_value_box_to_network_dbuff(size_t *need, fr_dbuff_t *dbuff, fr_value_box_t const *value)
+ssize_t fr_value_box_to_network_dbuff(size_t *need, fr_dbuff_t *dbuff, fr_value_box_t const *value)
{
size_t min, max;
#include <freeradius-devel/build.h>
#include <freeradius-devel/missing.h>
+#include <freeradius-devel/util/dbuff.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/util/dict.h>
#include <freeradius-devel/util/inet.h>
ssize_t fr_value_box_to_network(size_t *need, uint8_t *out, size_t outlen, fr_value_box_t const *value);
+ssize_t fr_value_box_to_network_dbuff(size_t *need, fr_dbuff_t *dbuff, fr_value_box_t const *value);
+
/** Special value to indicate fr_value_box_from_network experienced a general error
*/
#define FR_VALUE_BOX_NET_ERROR SSIZE_MIN
#include <talloc.h>
-static ssize_t fr_value_box_to_network_dbuff(size_t *need, fr_dbuff_t *dbuff, fr_value_box_t const *value);
static ssize_t fr_internal_encode_pair_dbuff(fr_dbuff_t *dbuff, fr_cursor_t *cursor, void *encoder_ctx);
/** We use the same header for all types
return value_end - enc_field;
}
-/** Encode a single value box, serializing its contents in generic network format
- *
- * @note this is a dbuff-oriented layer around fr_value_box_to_network(); once
- * dbuffs become the convention, this layer should no longer be necessary.
- */
-static ssize_t fr_value_box_to_network_dbuff(size_t *need, fr_dbuff_t *dbuff, fr_value_box_t const *value)
-{
- ssize_t result;
-
- result = fr_value_box_to_network(need, dbuff->p, fr_dbuff_remaining(dbuff), value);
- if (result < 0) return result;
- fr_dbuff_advance(dbuff, result);
- return result;
-}
-
/** Encode a data structure into an internal attribute
*
* This will become the main entry point when we switch fully to dbuff.