25 RCSIDH(dict_ext_h,
"$Id: 46cd3c5e429a747fd89c6c658516a323ec15a0a1 $")
27 #include <freeradius-devel/util/dict.h>
28 #include <freeradius-devel/util/ext.h>
29 #include <freeradius-devel/util/hash.h>
58 typedef enum CC_HINT(flag_enum) {
70 #define fr_dict_attr_ref_is_unresolved(_type) ((_type) & FR_DICT_ATTR_REF_UNRESOLVED)
71 #define fr_dict_attr_ref_type(_type) ((_type) & ~FR_DICT_ATTR_REF_UNRESOLVED)
142 if (!da->ext[ext])
return NULL;
157 return (da->ext[ext] > 0);
172 if (!ext)
return NULL;
189 if (!ext)
return NULL;
219 if (!ext || !ext->
vendor)
return 0;
239 if (!ext)
return NULL;
fr_dict_attr_ext_t
Extension identifier.
@ FR_DICT_ATTR_EXT_DA_STACK
Cached da stack.
@ FR_DICT_ATTR_EXT_REF
Attribute references another attribute and/or dictionary.
@ FR_DICT_ATTR_EXT_VENDOR
Cached vendor pointer.
static fr_dict_attr_t const * fr_dict_vendor_da_by_da(fr_dict_attr_t const *da)
Return the vendor da for an attribute.
fr_ext_t const fr_dict_attr_ext_def
Holds additional information about extension structures.
size_t max_name_len
maximum length of a name
fr_ext_t const fr_dict_enum_ext_def
Holds additional information about extension structures.
fr_dict_attr_t const * vendor
ancestor which has type FR_TYPE_VENDOR
static void * fr_dict_attr_ext(fr_dict_attr_t const *da, fr_dict_attr_ext_t ext)
static fr_dict_attr_t const ** fr_dict_attr_da_stack(fr_dict_attr_t const *da)
Return the cached da stack (if any) associated with an attribute.
fr_dict_attr_ref_type_t type
The state of the reference.
fr_hash_table_t * name_by_value
Lookup a name by value.
fr_dict_attr_t const ** children
Children of this attribute.
static fr_dict_attr_t const * fr_dict_attr_ref(fr_dict_attr_t const *da)
Return the reference associated with a group type attribute.
#define fr_dict_attr_ref_is_unresolved(_type)
fr_hash_table_t * value_by_name
Lookup an enumeration value by name.
void fr_dict_attr_ext_debug(fr_dict_attr_t const *da)
fr_dict_attr_t const * da_stack[]
Stack of dictionary attributes.
fr_hash_table_t * child_by_name
Namespace at this level in the hierarchy.
bool unused
Zero length arrays are apparently GNU extensions and we're not allowed to have structs with a single ...
static bool fr_dict_attr_has_ext(fr_dict_attr_t const *da, fr_dict_attr_ext_t ext)
Return whether a da has a given extension or not.
fr_dict_attr_t const * union_ref
The union da this value points into.
@ FR_DICT_ATTR_REF_ENUM
The attribute is an enumeration value.
@ FR_DICT_ATTR_REF_ALIAS
The attribute is an alias for another attribute.
@ FR_DICT_ATTR_REF_CLONE
The attribute is a "copy" of another attribute.
@ FR_DICT_ATTR_REF_UNRESOLVED
This flag is combined with the other states to indicate that the reference is unresolved.
@ FR_DICT_ATTR_REF_NONE
No ref set.
static uint32_t fr_dict_vendor_num_by_da(fr_dict_attr_t const *da)
Return the vendor number for an attribute.
Attribute extension - Holds children for an attribute.
Attribute extension - Stack of dictionary attributes that describe the path back to the root of the d...
Attribute extension - Holds enumeration values.
Attribute extension - Holds a hash table with the names of all children of this attribute.
Attribute extension - Holds a reference to an attribute in another dictionary.
Attribute extension - Cached vendor pointer.
Enum extension - Sub-struct or union pointer.
static void * fr_ext_ptr(TALLOC_CTX const *chunk, size_t offset, bool has_hdr)
Return a pointer to an extension in a chunk.
bool has_hdr
Additional metadata should be allocated before the extension data to record the exact length of the e...
fr_ext_info_t const * info
Additional information about each extension.
Structure to define a set of extensions.
@ FR_TYPE_VENDOR
Attribute that represents a vendor in the attribute tree.