23 RCSID(
"$Id: 691c9659b38d8cfd2ebcdb7356625cd751f620a4 $")
25 #include <freeradius-devel/util/base16.h>
26 #define us(x) (uint8_t) x
127 fr_sbuff_terminate(&our_out);
157 if (a && !b && no_trailing) {
char const fr_base16_alphabet_encode_lc[UINT8_MAX+1]
lower case encode alphabet for base16
fr_slen_t fr_base16_encode_nstd(fr_sbuff_t *out, fr_dbuff_t *in, char const alphabet[static UINT8_MAX+1])
Convert binary data to a hex string.
#define us(x)
Encode/decode binary data using printable characters (base16 format - hex)
char const fr_base16_alphabet_encode_uc[UINT8_MAX+1]
lower case encode alphabet for base16
fr_slen_t fr_base16_decode_nstd(fr_sbuff_parse_error_t *err, fr_dbuff_t *out, fr_sbuff_t *in, bool no_trailing, uint8_t const alphabet[static UINT8_MAX+1])
Decode base16 encoded input.
uint8_t const fr_base16_alphabet_decode_mc[UINT8_MAX+1]
Mixed case decode alphabet for base16.
static bool fr_is_base16_nstd(char c, uint8_t const alphabet[static UINT8_MAX+1])
Check if char is in base16 alphabet.
#define F1(_idx, _val)
Fill macros for array initialisation.
#define fr_dbuff_advance(_dbuff_or_marker, _len)
Advance 'current' position in dbuff or marker by _len bytes.
#define fr_dbuff_current(_dbuff_or_marker)
Return the 'current' position of a dbuff or marker.
#define fr_dbuff_extend(_dbuff)
Extend if no space remains.
#define FR_DBUFF(_dbuff_or_marker)
Create a new dbuff pointing to the same underlying buffer.
#define FR_DBUFF_IN_BYTES_RETURN(_dbuff_or_marker,...)
Copy a byte sequence into a dbuff or marker returning if there's insufficient space.
@ FR_SBUFF_PARSE_OK
No error.
@ FR_SBUFF_PARSE_ERROR_TRAILING
Trailing characters found.
#define FR_SBUFF_IN_CHAR_RETURN(_sbuff,...)
#define fr_sbuff_set(_dst, _src)
#define fr_sbuff_current(_sbuff_or_marker)
#define FR_SBUFF_ERROR_RETURN(_sbuff_or_marker)
#define FR_SBUFF(_sbuff_or_marker)
#define fr_sbuff_advance(_sbuff_or_marker, _len)
#define fr_sbuff_extend_lowat(_status, _sbuff_or_marker, _lowat)
return fr_dbuff_set(dbuff, &our_dbuff)
FR_SBUFF_SET_RETURN(sbuff, &our_sbuff)
static size_t char ** out