The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Types of values contained within an fr_value_box_t. More...
#include <freeradius-devel/util/table.h>
#include <freeradius-devel/util/talloc.h>
#include <stdbool.h>
Go to the source code of this file.
Macros | |
#define | FR_CTYPE_TO_TYPE(_ct) |
Given a variable, return the equivalent FR_TYPE_* value. More... | |
Functions | |
void ** | fr_type_array_alloc (TALLOC_CTX *ctx, fr_type_t type, size_t count) |
Allocate an array of a given type. More... | |
bool | fr_type_cast (fr_type_t dst, fr_type_t src) |
Return if we're allowed to cast the types. More... | |
static fr_type_t | fr_type_from_str (char const *type) |
Return the constant value representing a type. More... | |
fr_type_t | fr_type_promote (fr_type_t a, fr_type_t b) |
Return the promoted type. More... | |
static char const * | fr_type_to_str (fr_type_t type) |
Return a static string containing the type name. More... | |
Variables | |
fr_table_num_ordered_t const | fr_type_table [] |
Map data types to names representing those types. More... | |
size_t | fr_type_table_len |
Type grouping macros | |
#define | FR_TYPE_FIXED_SIZE_DEF(_beg, _mid, _end) |
Match all fixed length types. More... | |
#define | FR_TYPE_INTEGER_DEF(_beg, _mid, _end) |
Signed or unsigned integers. More... | |
#define | FR_TYPE_INTEGER_EXCEPT_BOOL_DEF(_beg, _mid, _end) |
All integer types except bool. More... | |
#define | FR_TYPE_IP_DEF(_beg, _mid, _end) |
Types which can fit in an fr_ipaddr_t. More... | |
#define | FR_TYPE_LEAF_DEF(_beg, _mid, _end) |
Types which represent concrete values. More... | |
#define | FR_TYPE_NON_LEAF_DEF(_beg, _mid, _end) |
Types which do not represent leaf values. More... | |
#define | FR_TYPE_NUMERIC_DEF(_beg, _mid, _end) |
Naturally numeric types. More... | |
#define | FR_TYPE_QUOTED_DEF(_beg, _mid, _end) |
Types which should be wrapped in double quotes when printed. More... | |
#define | FR_TYPE_SIGNED_DEF(_beg, _mid, _end) |
Signed values. More... | |
#define | FR_TYPE_STRUCTURAL_DEF(_beg, _mid, _end) |
Match all non value types in case statements. More... | |
#define | FR_TYPE_STRUCTURAL_EXCEPT_GROUP_DEF(_beg, _mid, _end) |
Hack for truthiness check. More... | |
#define | FR_TYPE_STRUCTURAL_EXCEPT_VSA_DEF(_beg, _mid, _end) |
Stupid hack for things which produce special error messages for VSAs. More... | |
#define | FR_TYPE_VARIABLE_SIZE_DEF(_beg, _mid, _end) |
Match all variable length types. More... | |
Bool arrays that group types | |
bool const | fr_type_fixed_size [FR_TYPE_MAX+1] |
bool const | fr_type_integer [FR_TYPE_MAX+1] |
bool const | fr_type_integer_except_bool [FR_TYPE_MAX+1] |
bool const | fr_type_ip [FR_TYPE_MAX+1] |
bool const | fr_type_leaf [FR_TYPE_MAX+1] |
bool const | fr_type_non_leaf [FR_TYPE_MAX+1] |
bool const | fr_type_numeric [FR_TYPE_MAX+1] |
bool const | fr_type_quoted [FR_TYPE_MAX+1] |
bool const | fr_type_signed [FR_TYPE_MAX+1] |
bool const | fr_type_structural [FR_TYPE_MAX+1] |
bool const | fr_type_structural_except_vsa [FR_TYPE_MAX+1] |
bool const | fr_type_variable_size [FR_TYPE_MAX+1] |
Types of values contained within an fr_value_box_t.
Definition in file types.h.
#define FR_CTYPE_TO_TYPE | ( | _ct | ) |
Given a variable, return the equivalent FR_TYPE_* value.
[in] | _ct | variable to translate. |
#define FR_TYPE_FIXED_SIZE FR_TYPE_FIXED_SIZE_DEF(CASE_BEG, CASE_MID, CASE_END) |
#define FR_TYPE_FIXED_SIZE_DEF | ( | _beg, | |
_mid, | |||
_end | |||
) |
Match all fixed length types.
#define FR_TYPE_INTEGER FR_TYPE_INTEGER_DEF(CASE_BEG, CASE_MID, CASE_END) |
#define FR_TYPE_INTEGER_DEF | ( | _beg, | |
_mid, | |||
_end | |||
) |
Signed or unsigned integers.
#define FR_TYPE_INTEGER_EXCEPT_BOOL FR_TYPE_INTEGER_EXCEPT_BOOL_DEF(CASE_BEG, CASE_MID, CASE_END) |
#define FR_TYPE_INTEGER_EXCEPT_BOOL_DEF | ( | _beg, | |
_mid, | |||
_end | |||
) |
All integer types except bool.
#define FR_TYPE_IP FR_TYPE_IP_DEF(CASE_BEG, CASE_MID, CASE_END) |
#define FR_TYPE_IP_DEF | ( | _beg, | |
_mid, | |||
_end | |||
) |
Types which can fit in an fr_ipaddr_t.
#define fr_type_is_bool | ( | _x | ) | ((_x) == FR_TYPE_BOOL) |
#define fr_type_is_combo_ipaddr | ( | _x | ) | ((_x) == FR_TYPE_COMBO_IP_ADDR) |
#define fr_type_is_combo_ipprefix | ( | _x | ) | ((_x) == FR_TYPE_COMBO_IP_PREFIX) |
#define fr_type_is_date | ( | _x | ) | ((_x) == FR_TYPE_DATE) |
#define fr_type_is_ethernet | ( | _x | ) | ((_x) == FR_TYPE_ETHERNET) |
#define fr_type_is_fixed_size | ( | _x | ) | (fr_type_fixed_size[_x]) |
#define fr_type_is_float32 | ( | _x | ) | ((_x) == FR_TYPE_FLOAT32) |
#define fr_type_is_float64 | ( | _x | ) | ((_x) == FR_TYPE_FLOAT64) |
#define fr_type_is_group | ( | _x | ) | ((_x) == FR_TYPE_GROUP) |
#define fr_type_is_ifid | ( | _x | ) | ((_x) == FR_TYPE_IFID) |
#define fr_type_is_int16 | ( | _x | ) | ((_x) == FR_TYPE_INT16) |
#define fr_type_is_int32 | ( | _x | ) | ((_x) == FR_TYPE_INT32) |
#define fr_type_is_int64 | ( | _x | ) | ((_x) == FR_TYPE_INT64) |
#define fr_type_is_int8 | ( | _x | ) | ((_x) == FR_TYPE_INT8) |
#define fr_type_is_integer | ( | _x | ) | (fr_type_integer[_x]) |
#define fr_type_is_integer_except_bool | ( | _x | ) | (fr_type_integer_except_bool[_x]) |
#define fr_type_is_ip | ( | _x | ) | (fr_type_ip[_x]) |
#define fr_type_is_ipv4addr | ( | _x | ) | ((_x) == FR_TYPE_IPV4_ADDR) |
#define fr_type_is_ipv4prefix | ( | _x | ) | ((_x) == FR_TYPE_IPV4_PREFIX) |
#define fr_type_is_ipv6addr | ( | _x | ) | ((_x) == FR_TYPE_IPV6_ADDR) |
#define fr_type_is_ipv6prefix | ( | _x | ) | ((_x) == FR_TYPE_IPV6_PREFIX) |
#define fr_type_is_leaf | ( | _x | ) | (fr_type_leaf[_x]) |
#define fr_type_is_non_leaf | ( | _x | ) | (fr_type_non_leaf[_x]) |
#define fr_type_is_null | ( | _x | ) | ((_x) == FR_TYPE_NULL) |
#define fr_type_is_numeric | ( | _x | ) | (fr_type_numeric[_x]) |
#define fr_type_is_octets | ( | _x | ) | ((_x) == FR_TYPE_OCTETS) |
#define fr_type_is_quoted | ( | _x | ) | (fr_type_quoted[_x]) |
#define fr_type_is_signed | ( | _x | ) | (fr_type_signed[_x]) |
#define fr_type_is_size | ( | _x | ) | ((_x) == FR_TYPE_SIZE) |
#define fr_type_is_string | ( | _x | ) | ((_x) == FR_TYPE_STRING) |
#define fr_type_is_struct | ( | _x | ) | ((_x) == FR_TYPE_STRUCT) |
#define fr_type_is_structural | ( | _x | ) | (fr_type_structural[_x]) |
#define fr_type_is_structural_except_vsa | ( | _x | ) | (fr_type_structural_except_vsa[_x]) |
#define fr_type_is_time_delta | ( | _x | ) | ((_x) == FR_TYPE_TIME_DELTA) |
#define fr_type_is_tlv | ( | _x | ) | ((_x) == FR_TYPE_TLV) |
#define fr_type_is_uint16 | ( | _x | ) | ((_x) == FR_TYPE_UINT16) |
#define fr_type_is_uint32 | ( | _x | ) | ((_x) == FR_TYPE_UINT32) |
#define fr_type_is_uint64 | ( | _x | ) | ((_x) == FR_TYPE_UINT64) |
#define fr_type_is_uint8 | ( | _x | ) | ((_x) == FR_TYPE_UINT8) |
#define fr_type_is_value_box | ( | _x | ) | ((_x) == FR_TYPE_VALUE_BOX) |
#define fr_type_is_variable_size | ( | _x | ) | (fr_type_variable_size[_x]) |
#define fr_type_is_vendor | ( | _x | ) | ((_x) == FR_TYPE_VENDOR) |
#define fr_type_is_void | ( | _x | ) | ((_x) == FR_TYPE_VOID) |
#define fr_type_is_vsa | ( | _x | ) | ((_x) == FR_TYPE_VSA) |
#define FR_TYPE_LEAF FR_TYPE_LEAF_DEF(CASE_BEG, CASE_MID, CASE_END) |
#define FR_TYPE_LEAF_DEF | ( | _beg, | |
_mid, | |||
_end | |||
) |
Types which represent concrete values.
#define FR_TYPE_NON_LEAF FR_TYPE_NON_LEAF_DEF(CASE_BEG, CASE_MID, CASE_END) |
#define FR_TYPE_NON_LEAF_DEF | ( | _beg, | |
_mid, | |||
_end | |||
) |
Types which do not represent leaf values.
#define FR_TYPE_NUMERIC FR_TYPE_NUMERIC_DEF(CASE_BEG, CASE_MID, CASE_END) |
#define FR_TYPE_NUMERIC_DEF | ( | _beg, | |
_mid, | |||
_end | |||
) |
Naturally numeric types.
#define FR_TYPE_QUOTED FR_TYPE_QUOTED_DEF(CASE_BEG, CASE_MID, CASE_END) |
#define FR_TYPE_QUOTED_DEF | ( | _beg, | |
_mid, | |||
_end | |||
) |
Types which should be wrapped in double quotes when printed.
#define FR_TYPE_SIGNED FR_TYPE_SIGNED_DEF(CASE_BEG, CASE_MID, CASE_END) |
#define FR_TYPE_SIGNED_DEF | ( | _beg, | |
_mid, | |||
_end | |||
) |
Signed values.
#define FR_TYPE_STRUCTURAL FR_TYPE_STRUCTURAL_DEF(CASE_BEG, CASE_MID, CASE_END) |
#define FR_TYPE_STRUCTURAL_DEF | ( | _beg, | |
_mid, | |||
_end | |||
) |
Match all non value types in case statements.
#define FR_TYPE_STRUCTURAL_EXCEPT_GROUP FR_TYPE_STRUCTURAL_EXCEPT_GROUP_DEF(CASE_BEG, CASE_MID, CASE_END) |
#define FR_TYPE_STRUCTURAL_EXCEPT_GROUP_DEF | ( | _beg, | |
_mid, | |||
_end | |||
) |
Hack for truthiness check.
#define FR_TYPE_STRUCTURAL_EXCEPT_VSA FR_TYPE_STRUCTURAL_EXCEPT_VSA_DEF(CASE_BEG, CASE_MID, CASE_END) |
#define FR_TYPE_STRUCTURAL_EXCEPT_VSA_DEF | ( | _beg, | |
_mid, | |||
_end | |||
) |
Stupid hack for things which produce special error messages for VSAs.
#define FR_TYPE_VARIABLE_SIZE FR_TYPE_VARIABLE_SIZE_DEF(CASE_BEG, CASE_MID, CASE_END) |
#define FR_TYPE_VARIABLE_SIZE_DEF | ( | _beg, | |
_mid, | |||
_end | |||
) |
Match all variable length types.
enum fr_type_t |
Internal data types.
Allocate an array of a given type.
[in] | ctx | to allocate array in. |
[in] | type | array to allocate. |
[in] | count | The number of elements to allocate. |
Definition at line 631 of file types.c.
|
inlinestatic |
Return the promoted type.
We presume that the two types are compatible, as checked by calling fr_type_cast(). The main difference here is that the two types don't have any src / dst relationship. Instead, we just pick one which best suits any value-box comparisons
Note that this function can return a type which is not a or b.
a | type one |
b | type two |
Definition at line 572 of file types.c.
|
inlinestatic |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |