26 #include <freeradius-devel/util/dcursor.h>
27 #include <freeradius-devel/util/value.h>
28 #include <freeradius-devel/util/pair.h>
36 #define PAIR_ENCODE_FATAL_ERROR SSIZE_MIN
45 #define PAIR_DECODE_OOM FR_VALUE_BOX_NET_OOM
49 #define PAIR_DECODE_FATAL_ERROR FR_VALUE_BOX_NET_ERROR
59 if (slen > 0)
return slen;
67 return slen - (p - start);
83 #define FR_PAIR_ENCODE_HAVE_SPACE(_p, _end, _num) if (((_p) + (_num)) > (_end)) return (_end) - ((_p) + (_num));
130 uint8_t const *
data,
size_t data_len,
void *decode_ctx);
#define PAIR_DECODE_OOM
Fatal error - Out of memory.
#define PAIR_DECODE_FATAL_ERROR
Fatal error - Failed decoding the packet.
ssize_t(* fr_pair_encode_t)(fr_dbuff_t *out, fr_dcursor_t *cursor, void *encode_ctx)
Generic interface for encoding one or more fr_pair_ts.
ssize_t(* fr_pair_decode_t)(TALLOC_CTX *ctx, fr_pair_list_t *out, fr_dict_attr_t const *parent, uint8_t const *data, size_t data_len, void *decode_ctx)
A generic interface for decoding fr_pair_ts.
#define PAIR_ENCODE_FATAL_ERROR
Fatal encoding error.
static ssize_t fr_pair_decode_slen(ssize_t slen, uint8_t const *start, uint8_t const *p)
Return the correct adjusted slen for errors.
static bool fr_pair_encode_is_error(ssize_t slen)
Determine if the return code for an encoding function is a fatal error.
static fr_internal_encode_ctx_t encode_ctx
static size_t char ** out