|  | 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> Include dependency graph for types.h:
 Include dependency graph for types.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. | |
| Enumerations | |
| enum | fr_type_t { FR_TYPE_NULL = 0 , FR_TYPE_STRING , FR_TYPE_OCTETS , FR_TYPE_IPV4_ADDR , FR_TYPE_IPV4_PREFIX , FR_TYPE_IPV6_ADDR , FR_TYPE_IPV6_PREFIX , FR_TYPE_IFID , FR_TYPE_COMBO_IP_ADDR , FR_TYPE_COMBO_IP_PREFIX , FR_TYPE_ETHERNET , FR_TYPE_BOOL , FR_TYPE_UINT8 , FR_TYPE_UINT16 , FR_TYPE_UINT32 , FR_TYPE_UINT64 , FR_TYPE_INT8 , FR_TYPE_INT16 , FR_TYPE_INT32 , FR_TYPE_INT64 , FR_TYPE_FLOAT32 , FR_TYPE_FLOAT64 , FR_TYPE_DATE , FR_TYPE_TIME_DELTA , FR_TYPE_SIZE , FR_TYPE_TLV , FR_TYPE_STRUCT , FR_TYPE_VSA , FR_TYPE_VENDOR , FR_TYPE_GROUP , FR_TYPE_UNION , FR_TYPE_VALUE_BOX , FR_TYPE_ATTR , FR_TYPE_VOID , FR_TYPE_VALUE_BOX_CURSOR , FR_TYPE_PAIR_CURSOR , FR_TYPE_MAX } | 
| Internal data types.  More... | |
| Functions | |
| void ** | fr_type_array_alloc (TALLOC_CTX *ctx, fr_type_t type, size_t count) | 
| Allocate an array of a given type. | |
| bool | fr_type_cast (fr_type_t dst, fr_type_t src) | 
| Return if we're allowed to cast the types. | |
| static fr_type_t | fr_type_from_str (char const *type) | 
| Return the constant value representing a type. | |
| fr_type_t | fr_type_promote (fr_type_t a, fr_type_t b) | 
| Return the promoted type. | |
| static char const * | fr_type_to_str (fr_type_t type) | 
| Return a static string containing the type name. | |
| Variables | |
| fr_table_num_ordered_t const | fr_type_table [] | 
| Map data types to names representing those types. | |
| size_t | fr_type_table_len | 
| Type grouping macros | |
| #define | FR_TYPE_FIXED_SIZE_DEF(_beg, _mid, _end) | 
| Match all fixed length types. | |
| #define | FR_TYPE_INTEGER_DEF(_beg, _mid, _end) | 
| Signed or unsigned integers. | |
| #define | FR_TYPE_INTEGER_EXCEPT_BOOL_DEF(_beg, _mid, _end) | 
| All integer types except bool. | |
| #define | FR_TYPE_INTERNAL_DEF(_beg, _mid, _end) | 
| Types which are internal, and should not be used for real data. | |
| #define | FR_TYPE_IP_DEF(_beg, _mid, _end) | 
| Types which can fit in an fr_ipaddr_t. | |
| #define | FR_TYPE_LEAF_DEF(_beg, _mid, _end) | 
| Types which represent concrete values. | |
| #define | FR_TYPE_NON_LEAF_DEF(_beg, _mid, _end) | 
| Types which do not represent leaf values. | |
| #define | FR_TYPE_NUMERIC_DEF(_beg, _mid, _end) | 
| Naturally numeric types. | |
| #define | FR_TYPE_QUOTED_DEF(_beg, _mid, _end) | 
| Types which should be wrapped in double quotes when printed. | |
| #define | FR_TYPE_SIGNED_DEF(_beg, _mid, _end) | 
| Signed values. | |
| #define | FR_TYPE_STRUCTURAL_DEF(_beg, _mid, _end) | 
| Match all non value types in case statements. | |
| #define | FR_TYPE_STRUCTURAL_EXCEPT_GROUP_DEF(_beg, _mid, _end) | 
| Hack for truthiness check. | |
| #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_DEF(_beg, _mid, _end) | 
| Match all variable length types. | |
| 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_INTERNAL FR_TYPE_INTERNAL_DEF(CASE_BEG, CASE_MID, CASE_END) | 
| #define FR_TYPE_INTERNAL_DEF | ( | _beg, | |
| _mid, | |||
| _end | |||
| ) | 
Types which are internal, and should not be used for real data.
| #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.
| Enumerator | |
|---|---|
| FR_TYPE_NULL | Invalid (uninitialised) attribute type. | 
| FR_TYPE_STRING | String of printable characters. | 
| FR_TYPE_OCTETS | Raw octets. | 
| FR_TYPE_IPV4_ADDR | 32 Bit IPv4 Address. | 
| FR_TYPE_IPV4_PREFIX | IPv4 Prefix. | 
| FR_TYPE_IPV6_ADDR | 128 Bit IPv6 Address. | 
| FR_TYPE_IPV6_PREFIX | IPv6 Prefix. | 
| FR_TYPE_IFID | Interface ID. | 
| FR_TYPE_COMBO_IP_ADDR | IPv4 or IPv6 address depending on length. | 
| FR_TYPE_COMBO_IP_PREFIX | IPv4 or IPv6 address prefix depending on length. | 
| FR_TYPE_ETHERNET | 48 Bit Mac-Address. | 
| FR_TYPE_BOOL | A truth value. | 
| FR_TYPE_UINT8 | 8 Bit unsigned integer. | 
| FR_TYPE_UINT16 | 16 Bit unsigned integer. | 
| FR_TYPE_UINT32 | 32 Bit unsigned integer. | 
| FR_TYPE_UINT64 | 64 Bit unsigned integer. | 
| FR_TYPE_INT8 | 8 Bit signed integer. | 
| FR_TYPE_INT16 | 16 Bit signed integer. | 
| FR_TYPE_INT32 | 32 Bit signed integer. | 
| FR_TYPE_INT64 | 64 Bit signed integer. | 
| FR_TYPE_FLOAT32 | Single precision floating point. | 
| FR_TYPE_FLOAT64 | Double precision floating point. | 
| FR_TYPE_DATE | Unix time stamp, always has value >2^31. | 
| FR_TYPE_TIME_DELTA | A period of time measured in nanoseconds. | 
| FR_TYPE_SIZE | Unsigned integer capable of representing any memory address on the local system. | 
| FR_TYPE_TLV | Contains nested attributes. | 
| FR_TYPE_STRUCT | like TLV, but without T or L, and fixed-width children | 
| FR_TYPE_VSA | Vendor-Specific, for RADIUS attribute 26. | 
| FR_TYPE_VENDOR | Attribute that represents a vendor in the attribute tree. | 
| FR_TYPE_GROUP | A grouping of other attributes. | 
| FR_TYPE_UNION | A union of limited children. | 
| FR_TYPE_VALUE_BOX | A boxed value. | 
| FR_TYPE_ATTR | A contains an attribute reference. | 
| FR_TYPE_VOID | User data. Should be a talloced chunk assigned to the ptr value of the union. | 
| FR_TYPE_VALUE_BOX_CURSOR | cursor over a fr_value_box_t | 
| FR_TYPE_PAIR_CURSOR | cursor over a fr_pair_t | 
| FR_TYPE_MAX | Number of defined 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 642 of file types.c.
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:| 
 | 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 583 of file types.c.
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:| 
 | inlinestatic | 
| 
 | extern | 
| 
 | extern | 
| 
 | extern | 
| 
 | extern | 
| 
 | extern | 
| 
 | extern | 
| 
 | extern | 
| 
 | extern | 
| 
 | extern | 
| 
 | extern | 
| 
 | extern | 
| 
 | extern | 
| 
 | extern | 
 1.9.8
 1.9.8