#include <freeradius-devel/libradius.h>
#include <ctype.h>
Go to the source code of this file.
Macros | |
#define | CHECK(_type) |
#define | PW_TYPE_BOUNDED |
Match all fixed length types in case statements. More... | |
#define | PW_TYPE_UNBOUNDED |
Match all variable length types in case statements. More... | |
Functions | |
char * | value_data_asprint (TALLOC_CTX *ctx, PW_TYPE type, fr_dict_attr_t const *enumv, value_data_t const *data, char quote) |
Print one attribute value to a string. More... | |
int | value_data_cast (TALLOC_CTX *ctx, value_data_t *dst, PW_TYPE dst_type, fr_dict_attr_t const *dst_enumv, PW_TYPE src_type, fr_dict_attr_t const *src_enumv, value_data_t const *src) |
Convert one type of value_data_t to another. More... | |
static int | value_data_cidr_cmp_op (FR_TOKEN op, int bytes, uint8_t a_net, uint8_t const *a, uint8_t b_net, uint8_t const *b) |
int | value_data_cmp (PW_TYPE a_type, value_data_t const *a, PW_TYPE b_type, value_data_t const *b) |
Compare two values. More... | |
int | value_data_cmp_op (FR_TOKEN op, PW_TYPE a_type, value_data_t const *a, PW_TYPE b_type, value_data_t const *b) |
Compare two attributes using an operator. More... | |
int | value_data_copy (TALLOC_CTX *ctx, value_data_t *dst, PW_TYPE src_type, const value_data_t *src) |
Copy value data verbatim duplicating any buffers. More... | |
int | value_data_from_str (TALLOC_CTX *ctx, value_data_t *dst, PW_TYPE *src_type, fr_dict_attr_t const *src_enumv, char const *src, ssize_t src_len, char quote) |
Convert string value to a value_data_t type. More... | |
static void | value_data_hton (value_data_t *dst, PW_TYPE type, void const *src, size_t src_len) |
Performs byte order reversal for types that need it. More... | |
size_t | value_data_snprint (char *out, size_t outlen, PW_TYPE type, fr_dict_attr_t const *enumv, value_data_t const *data, char quote) |
Print the value of an attribute to a string. More... | |
int | value_data_steal (TALLOC_CTX *ctx, value_data_t *dst, PW_TYPE src_type, const value_data_t *src) |
Copy value data verbatim moving any buffers to the specified context. More... | |
Variables | |
static char const | hextab [] = "0123456789abcdef" |
#define CHECK | ( | _type | ) |
#define PW_TYPE_BOUNDED |
Match all fixed length types in case statements.
#define PW_TYPE_UNBOUNDED |
Match all variable length types in case statements.
char* value_data_asprint | ( | TALLOC_CTX * | ctx, |
PW_TYPE | type, | ||
fr_dict_attr_t const * | enumv, | ||
value_data_t const * | data, | ||
char | quote | ||
) |
int value_data_cast | ( | TALLOC_CTX * | ctx, |
value_data_t * | dst, | ||
PW_TYPE | dst_type, | ||
fr_dict_attr_t const * | dst_enumv, | ||
PW_TYPE | src_type, | ||
fr_dict_attr_t const * | src_enumv, | ||
value_data_t const * | src | ||
) |
Convert one type of value_data_t to another.
ctx | to allocate buffers in (usually the same as dst) |
dst | Where to write result of casting. |
dst_type | to cast to. |
dst_enumv | Enumerated values used to converts strings to integers. |
src_type | to cast from. |
src_enumv | Enumerated values used to convert integers to strings. |
src | Input data. |
Definition at line 1073 of file value.c.
|
static |
int value_data_cmp | ( | PW_TYPE | a_type, |
value_data_t const * | a, | ||
PW_TYPE | b_type, | ||
value_data_t const * | b | ||
) |
Compare two values.
[in] | a_type | of data to compare. |
[in] | a | Value to compare. |
[in] | b_type | of data to compare. |
[in] | b | Value to compare. |
Definition at line 40 of file value.c.
int value_data_cmp_op | ( | FR_TOKEN | op, |
PW_TYPE | a_type, | ||
value_data_t const * | a, | ||
PW_TYPE | b_type, | ||
value_data_t const * | b | ||
) |
Compare two attributes using an operator.
[in] | op | to use in comparison. |
[in] | a_type | of data to compare. |
[in] | a | Value to compare. |
[in] | b_type | of data to compare. |
[in] | b | Value to compare. |
Definition at line 299 of file value.c.
int value_data_copy | ( | TALLOC_CTX * | ctx, |
value_data_t * | dst, | ||
PW_TYPE | src_type, | ||
const value_data_t * | src | ||
) |
Copy value data verbatim duplicating any buffers.
ctx | To allocate buffers in. |
dst | Where to copy value_data to. |
src_type | Type of src. |
src | Where to copy value_data from. |
Definition at line 1479 of file value.c.
int value_data_from_str | ( | TALLOC_CTX * | ctx, |
value_data_t * | dst, | ||
PW_TYPE * | src_type, | ||
fr_dict_attr_t const * | src_enumv, | ||
char const * | src, | ||
ssize_t | src_len, | ||
char | quote | ||
) |
Convert string value to a value_data_t type.
[in] | ctx | to alloc strings in. |
[out] | dst | where to write parsed value. |
[in,out] | src_type | of value data to create/type of value created. |
[in] | src_enumv | fr_dict_attr_t with string aliases for integer values. |
[in] | src | String to convert. Binary safe for variable length values if len is provided. |
[in] | src_len | may be < 0 in which case strlen(len) is used to determine length, else src_len should be the length of the string or sub string to parse. |
[in] | quote | quotation character used to drive de-escaping |
Definition at line 455 of file value.c.
|
static |
size_t value_data_snprint | ( | char * | out, |
size_t | outlen, | ||
PW_TYPE | type, | ||
fr_dict_attr_t const * | enumv, | ||
value_data_t const * | data, | ||
char | quote | ||
) |
Print the value of an attribute to a string.
out | Where to write the printed version of the attribute value. |
outlen | Length of the output buffer. |
type | of data being printed. |
enumv | Enumerated string values for integer types. |
data | to print. |
quote | char to escape in string output. |
Definition at line 1727 of file value.c.
int value_data_steal | ( | TALLOC_CTX * | ctx, |
value_data_t * | dst, | ||
PW_TYPE | src_type, | ||
const value_data_t * | src | ||
) |
Copy value data verbatim moving any buffers to the specified context.
ctx | To allocate buffers in. |
dst | Where to copy value_data to. |
src_type | Type of src. |
src | Where to copy value_data from. |
Definition at line 1512 of file value.c.