![]() |
The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Multi-protocol AVP dictionary API. More...
#include <freeradius-devel/util/atexit.h>#include <freeradius-devel/util/conf.h>#include <freeradius-devel/util/dict.h>#include <freeradius-devel/util/dict_ext_priv.h>#include <freeradius-devel/util/dict_fixup_priv.h>#include <freeradius-devel/util/hash.h>#include <freeradius-devel/util/proto.h>#include <freeradius-devel/util/rand.h>#include <freeradius-devel/util/syserror.h>
Include dependency graph for dict_util.c:Go to the source code of this file.
Data Structures | |
| struct | fr_dict_autoload_talloc_s |
| Structure used to managed the lifetime of a dictionary. More... | |
Macros | |
| #define | _DICT_PRIVATE 1 |
| #define | DICT_ATTR_ALLOWED_CHARS |
| #define | DICT_NAME_APPEND(_in, _dict) |
| #define | FNV_MAGIC_INIT (0x811c9dc5) |
| #define | FNV_MAGIC_PRIME (0x01000193) |
Typedefs | |
| typedef fr_slen_t(* | dict_attr_resolve_func_t) (fr_dict_attr_err_t *err, fr_dict_attr_t const **out, fr_dict_attr_t const *parent, fr_sbuff_t *in, fr_sbuff_term_t const *tt) |
| Callback function for resolving dictionary attributes. | |
Functions | |
| fr_dict_attr_t * | _dict_attr_alloc (char const *filename, int line, TALLOC_CTX *ctx, fr_dict_attr_t const *parent, char const *name, int attr, fr_type_t type, dict_attr_args_t const *args) |
| Allocate a dictionary attribute on the heap. | |
| fr_dict_attr_t * | _dict_attr_alloc_root (char const *filename, int line, TALLOC_CTX *ctx, fr_dict_t const *dict, char const *name, int proto_number, dict_attr_args_t const *args) |
| Allocate a dictionary root attribute on the heap. | |
| static int | _dict_attr_free (fr_dict_attr_t *da) |
| int | _dict_attr_init (char const *filename, int line, fr_dict_attr_t **da_p, fr_dict_attr_t const *parent, char const *name, unsigned int attr, fr_type_t type, dict_attr_args_t const *args) |
| Initialise fields in a dictionary attribute structure. | |
| int | _dict_attr_init_name_only (char const *filename, int line, fr_dict_attr_t **da_p, fr_dict_attr_t const *parent, char const *name, fr_type_t type, dict_attr_args_t const *args) |
| Initialise fields in a dictionary attribute structure. | |
| static int8_t | _dict_dependent_cmp (void const *a, void const *b) |
| Find a dependent in the tree of dependents. | |
| static int | _dict_free (fr_dict_t *dict) |
| static int | _dict_global_free (fr_dict_gctx_t *gctx) |
| static int | _dict_global_free_at_exit (void *uctx) |
| int | _fr_dict_autofree (fr_dict_autoload_t const *to_free, char const *dependent) |
| Decrement the reference count on a previously loaded dictionary. | |
| int | _fr_dict_autoload (fr_dict_autoload_t const *to_load, char const *dependent) |
| Process a dict_autoload element to load a protocol. | |
| fr_dict_autoload_talloc_t * | _fr_dict_autoload_talloc (TALLOC_CTX *ctx, fr_dict_t const **out, char const *proto, char const *dependent) |
| Autoload a dictionary and bind the lifetime to a talloc chunk. | |
| static int | _fr_dict_autoload_talloc_free (fr_dict_autoload_talloc_t const *to_free) |
| Talloc destructor to automatically free dictionaries. | |
| static void | dependent_debug (fr_dict_t *dict) |
| fr_dict_t * | dict_alloc (TALLOC_CTX *ctx) |
| Allocate a new dictionary. | |
| fr_dict_attr_t * | dict_attr_acopy (TALLOC_CTX *ctx, fr_dict_attr_t const *parent, fr_dict_attr_t const *in, char const *name) |
| Copy a an existing attribute, possibly to a new location. | |
| int | dict_attr_acopy_aliases (UNUSED fr_dict_attr_t *dst, fr_dict_attr_t const *src) |
| Copy aliases of an existing attribute to a new one. | |
| static int | dict_attr_acopy_child (fr_dict_t *dict, fr_dict_attr_t *dst, fr_dict_attr_t const *src, fr_dict_attr_t const *child) |
| int | dict_attr_acopy_children (fr_dict_t *dict, fr_dict_attr_t *dst, fr_dict_attr_t const *src) |
| Copy the children of an existing attribute. | |
| int | dict_attr_acopy_enumv (fr_dict_attr_t *dst, fr_dict_attr_t const *src) |
| Copy the VALUEs of an existing attribute, by casting them. | |
| int | dict_attr_add_to_namespace (fr_dict_attr_t const *parent, fr_dict_attr_t *da) |
| Add an attribute to the name table for an attribute. | |
| static fr_dict_attr_t const * | dict_attr_alias (fr_dict_attr_err_t *err, fr_dict_attr_t const *da) |
| Resolve an alias attribute to the concrete attribute it points to. | |
| int | dict_attr_alias_add (fr_dict_attr_t const *parent, char const *alias, fr_dict_attr_t const *ref) |
| Add an alias to an existing attribute. | |
| fr_dict_attr_t * | dict_attr_alloc_null (TALLOC_CTX *ctx, fr_dict_protocol_t const *proto) |
| Allocate a partially completed attribute. | |
| fr_dict_attr_t * | dict_attr_by_name (fr_dict_attr_err_t *err, fr_dict_attr_t const *parent, char const *name) |
| bool | dict_attr_can_have_children (fr_dict_attr_t const *da) |
| See if a fr_dict_attr_t can have children. | |
| int | dict_attr_child_add (fr_dict_attr_t *parent, fr_dict_attr_t *child) |
| Add a child to a parent. | |
| fr_dict_attr_t * | dict_attr_child_by_num (fr_dict_attr_t const *parent, unsigned int attr) |
| Internal version of fr_dict_attr_child_by_num. | |
| static int | dict_attr_children_init (fr_dict_attr_t **da_p) |
| Add a child/nesting extension to an attribute. | |
| int | dict_attr_enum_add_name (fr_dict_attr_t *da, char const *name, fr_value_box_t const *value, bool coerce, bool takes_precedence, fr_dict_attr_t const *key_child_ref) |
| static int | dict_attr_enumv_init (fr_dict_attr_t **da_p) |
| Initialise a per-attribute enumeration table. | |
| int | dict_attr_finalise (fr_dict_attr_t **da_p, char const *name) |
| Set remaining fields in a dictionary attribute before insertion. | |
| static int | dict_attr_init_common (char const *filename, int line, fr_dict_attr_t **da_p, fr_dict_attr_t const *parent, fr_type_t type, dict_attr_args_t const *args) |
| void | dict_attr_location_init (fr_dict_attr_t *da, char const *filename, int line) |
| Set where the dictionary attribute was defined. | |
| static int8_t | dict_attr_name_cmp (void const *one, void const *two) |
| Compare two attribute names. | |
| static uint32_t | dict_attr_name_hash (void const *data) |
| Wrap name hash function for fr_dict_attr_t. | |
| static int | dict_attr_name_set (fr_dict_attr_t **da_p, char const *name) |
| Set a dictionary attribute's name. | |
| static int | dict_attr_namespace_init (fr_dict_attr_t **da_p) |
| Initialise a per-attribute namespace. | |
| int | dict_attr_num_init (fr_dict_attr_t *da, unsigned int num) |
| Set the attribute number (if any) | |
| int | dict_attr_num_init_name_only (fr_dict_attr_t *da) |
| Set the attribute number (if any) | |
| int | dict_attr_parent_init (fr_dict_attr_t **da_p, fr_dict_attr_t const *parent) |
| Initialise fields which depend on a parent attribute. | |
| static fr_slen_t | dict_attr_search (fr_dict_attr_err_t *err, fr_dict_attr_t const **out, fr_dict_t const *dict_def, fr_sbuff_t *in, fr_sbuff_term_t const *tt, bool internal, bool foreign, dict_attr_resolve_func_t func) |
| Internal function for searching for attributes in multiple dictionaries. | |
| static fr_slen_t | dict_attr_search_qualified (fr_dict_attr_err_t *err, fr_dict_attr_t const **out, fr_dict_t const *dict_def, fr_sbuff_t *in, fr_sbuff_term_t const *tt, bool internal, bool foreign, dict_attr_resolve_func_t func) |
| Internal function for searching for attributes in multiple dictionaries. | |
| int | dict_attr_type_init (fr_dict_attr_t **da_p, fr_type_t type) |
| Initialise type specific fields within the dictionary attribute. | |
| static int | dict_attr_vendor_set (fr_dict_attr_t **da_p, fr_dict_attr_t const *vendor) |
| Cache the vendor pointer for an attribute. | |
| static int | dict_autoref_free (fr_dict_t *dict) |
| fr_dict_t * | dict_by_da (fr_dict_attr_t const *da) |
| Internal version of fr_dict_by_da. | |
| fr_dict_t * | dict_by_protocol_name (char const *name) |
| Internal version of fr_dict_by_protocol_name. | |
| fr_dict_t * | dict_by_protocol_num (unsigned int num) |
| Internal version of fr_dict_by_protocol_num. | |
| fr_slen_t | dict_by_protocol_substr (fr_dict_attr_err_t *err, fr_dict_t **out, fr_sbuff_t *name, fr_dict_t const *dict_def) |
| int | dict_dependent_add (fr_dict_t *dict, char const *dependent) |
| Record a new dependency on a dictionary. | |
| int | dict_dependent_remove (fr_dict_t *dict, char const *dependent) |
| Decrement ref count for a dependent in a dictionary. | |
| int | dict_dlopen (fr_dict_t *dict, char const *name) |
| static int8_t | dict_enum_name_cmp (void const *one, void const *two) |
| Compare two dictionary attribute enum values. | |
| static uint32_t | dict_enum_name_hash (void const *data) |
| Hash a enumeration name. | |
| static int8_t | dict_enum_value_cmp (void const *one, void const *two) |
| Compare two dictionary enum values. | |
| static uint32_t | dict_enum_value_hash (void const *data) |
| Hash a dictionary enum value. | |
| bool | dict_has_dependents (fr_dict_t *dict) |
| Check if a dictionary still has dependents. | |
| static uint32_t | dict_hash_name (char const *name, size_t len) |
| Apply a simple (case insensitive) hashing function to the name of an attribute, vendor or protocol. | |
| int | dict_protocol_add (fr_dict_t *dict) |
| Add a protocol to the global protocol table. | |
| static int8_t | dict_protocol_name_cmp (void const *one, void const *two) |
| Compare two protocol names. | |
| static uint32_t | dict_protocol_name_hash (void const *data) |
| Wrap name hash function for fr_dict_protocol_t. | |
| static int8_t | dict_protocol_num_cmp (void const *one, void const *two) |
| Compare two protocol numbers. | |
| static uint32_t | dict_protocol_num_hash (void const *data) |
| Hash a protocol number. | |
| int | dict_vendor_add (fr_dict_t *dict, char const *name, unsigned int num) |
| Add a vendor to the dictionary. | |
| static int8_t | dict_vendor_name_cmp (void const *one, void const *two) |
| Compare two attribute names. | |
| static uint32_t | dict_vendor_name_hash (void const *data) |
| Wrap name hash function for fr_dict_vendor_t. | |
| static int8_t | dict_vendor_pen_cmp (void const *one, void const *two) |
| Compare two vendor numbers. | |
| static uint32_t | dict_vendor_pen_hash (void const *data) |
| Hash a vendor number. | |
| static int | dict_walk (fr_dict_attr_t const *da, fr_dict_walk_t callback, void *uctx) |
| Call the specified callback for da and then for all its children. | |
| int | fr_dict_attr_acopy_local (fr_dict_attr_t const *dst, fr_dict_attr_t const *src) |
| int | fr_dict_attr_add (fr_dict_t *dict, fr_dict_attr_t const *parent, char const *name, unsigned int attr, fr_type_t type, fr_dict_attr_flags_t const *flags) |
| Add an attribute to the dictionary. | |
| int | fr_dict_attr_add_initialised (fr_dict_attr_t *da) |
| A variant of fr_dict_attr_t that allows a pre-allocated, populated fr_dict_attr_t to be added. | |
| int | fr_dict_attr_add_name_only (fr_dict_t *dict, fr_dict_attr_t const *parent, char const *name, fr_type_t type, fr_dict_attr_flags_t const *flags) |
| Add an attribute to the dictionary. | |
| int | fr_dict_attr_autoload (fr_dict_attr_autoload_t const *to_load) |
| Process a dict_attr_autoload element to load/verify a dictionary attribute. | |
| fr_dict_attr_t const * | fr_dict_attr_by_name (fr_dict_attr_err_t *err, fr_dict_attr_t const *parent, char const *name) |
| Locate a fr_dict_attr_t by its name. | |
| fr_slen_t | fr_dict_attr_by_name_substr (fr_dict_attr_err_t *err, fr_dict_attr_t const **out, fr_dict_attr_t const *parent, fr_sbuff_t *name, UNUSED fr_sbuff_term_t const *tt) |
| Look up a dictionary attribute by a name embedded in another string. | |
| fr_dict_attr_t const * | fr_dict_attr_by_oid (fr_dict_attr_err_t *err, fr_dict_attr_t const *parent, char const *oid) |
| Resolve an attribute using an OID string. | |
| ssize_t | fr_dict_attr_by_oid_legacy (fr_dict_t const *dict, fr_dict_attr_t const **parent, unsigned int *attr, char const *oid) |
| Get the leaf attribute of an OID string. | |
| fr_slen_t | fr_dict_attr_by_oid_substr (fr_dict_attr_err_t *err, fr_dict_attr_t const **out, fr_dict_attr_t const *parent, fr_sbuff_t *in, fr_sbuff_term_t const *tt) |
| Resolve an attribute using an OID string. | |
| bool | fr_dict_attr_can_contain (fr_dict_attr_t const *parent, fr_dict_attr_t const *child) |
| See if a structural da is allowed to contain another da. | |
| fr_dict_attr_t const * | fr_dict_attr_child_by_num (fr_dict_attr_t const *parent, unsigned int attr) |
| Check if a child attribute exists in a parent using an attribute number. | |
| fr_dict_attr_t const * | fr_dict_attr_common_parent (fr_dict_attr_t const *a, fr_dict_attr_t const *b, bool is_ancestor) |
| Find a common ancestor that two TLV type attributes share. | |
| fr_dict_attr_t const * | fr_dict_attr_iterate_children (fr_dict_attr_t const *parent, fr_dict_attr_t const **prev) |
| Iterate over children of a DA. | |
| int8_t | fr_dict_attr_ordered_cmp (fr_dict_attr_t const *a, fr_dict_attr_t const *b) |
| Compare two attributes by total order. | |
| fr_slen_t | fr_dict_attr_search_by_name_substr (fr_dict_attr_err_t *err, fr_dict_attr_t const **out, fr_dict_t const *dict_def, fr_sbuff_t *name, fr_sbuff_term_t const *tt, bool internal, bool foreign) |
| Locate a fr_dict_attr_t by its name in the top level namespace of a dictionary. | |
| fr_slen_t | fr_dict_attr_search_by_oid_substr (fr_dict_attr_err_t *err, fr_dict_attr_t const **out, fr_dict_t const *dict_def, fr_sbuff_t *in, fr_sbuff_term_t const *tt, bool internal, bool foreign) |
| Locate a qualified fr_dict_attr_t by a dictionary using a non-qualified OID string. | |
| fr_slen_t | fr_dict_attr_search_by_qualified_name_substr (fr_dict_attr_err_t *err, fr_dict_attr_t const **out, fr_dict_t const *dict_def, fr_sbuff_t *name, fr_sbuff_term_t const *tt, bool internal, bool foreign) |
| Locate a qualified fr_dict_attr_t by its name and a dictionary qualifier. | |
| fr_dict_attr_t const * | fr_dict_attr_search_by_qualified_oid (fr_dict_attr_err_t *err, fr_dict_t const *dict_def, char const *name, bool internal, bool foreign) |
| Locate a qualified fr_dict_attr_t by its name and a dictionary qualifier. | |
| fr_slen_t | fr_dict_attr_search_by_qualified_oid_substr (fr_dict_attr_err_t *err, fr_dict_attr_t const **out, fr_dict_t const *dict_def, fr_sbuff_t *in, fr_sbuff_term_t const *tt, bool internal, bool foreign) |
| Locate a qualified fr_dict_attr_t by a dictionary qualified OID string. | |
| int | fr_dict_attr_set_group (fr_dict_attr_t **da_p, fr_dict_attr_t const *ref) |
| fr_dict_attr_t * | fr_dict_attr_unconst (fr_dict_attr_t const *da) |
| Coerce to non-const. | |
| void | fr_dict_attr_verify (char const *file, int line, fr_dict_attr_t const *da) |
| fr_dict_t const * | fr_dict_by_da (fr_dict_attr_t const *da) |
| Attempt to locate the protocol dictionary containing an attribute. | |
| fr_dict_t const * | fr_dict_by_protocol_name (char const *name) |
| Lookup a protocol by its name. | |
| fr_dict_t const * | fr_dict_by_protocol_num (unsigned int num) |
| Lookup a protocol by its number. | |
| fr_slen_t | fr_dict_by_protocol_substr (fr_dict_attr_err_t *err, fr_dict_t const **out, fr_sbuff_t *name, fr_dict_t const *dict_def) |
| Look up a protocol name embedded in another string. | |
| bool | fr_dict_compatible (fr_dict_t const *dict1, fr_dict_t const *dict2) |
| See if two dictionaries have the same end parent. | |
| int | fr_dict_const_free (fr_dict_t const **dict, char const *dependent) |
| Decrement the reference count on a previously loaded dictionary. | |
| int | fr_dict_dependent_add (fr_dict_t const *dict, char const *dependent) |
| Manually increase the reference count for a dictionary. | |
| dl_t * | fr_dict_dl (fr_dict_t const *dict) |
| int | fr_dict_enum_add_name (fr_dict_attr_t *da, char const *name, fr_value_box_t const *value, bool coerce, bool takes_precedence) |
| Add a value name. | |
| int | fr_dict_enum_add_name_next (fr_dict_attr_t *da, char const *name) |
| Add an name to an integer attribute hashing the name for the integer value. | |
| int | fr_dict_enum_autoload (fr_dict_enum_autoload_t const *to_load) |
| Process a dict_attr_autoload element to load/verify a dictionary attribute. | |
| fr_dict_enum_value_t const * | fr_dict_enum_by_name (fr_dict_attr_t const *da, char const *name, ssize_t len) |
| fr_slen_t | fr_dict_enum_by_name_substr (fr_dict_enum_value_t **out, fr_dict_attr_t const *da, fr_sbuff_t *in) |
| fr_dict_enum_value_t const * | fr_dict_enum_by_value (fr_dict_attr_t const *da, fr_value_box_t const *value) |
| Lookup the structure representing an enum value in a fr_dict_attr_t. | |
| fr_dict_enum_value_t const * | fr_dict_enum_iter_init (fr_dict_attr_t const *da, fr_dict_enum_iter_t *iter) |
| Iterate over all enumeration values for an attribute. | |
| fr_dict_enum_value_t const * | fr_dict_enum_iter_next (fr_dict_attr_t const *da, fr_dict_enum_iter_t *iter) |
| char const * | fr_dict_enum_name_by_value (fr_dict_attr_t const *da, fr_value_box_t const *value) |
| Lookup the name of an enum value in a fr_dict_attr_t. | |
| fr_slen_t | fr_dict_enum_name_from_substr (fr_sbuff_t *out, fr_sbuff_parse_error_t *err, fr_sbuff_t *in, fr_sbuff_term_t const *tt) |
| Extract an enumeration name from a string. | |
| int | fr_dict_free (fr_dict_t **dict, char const *dependent) |
| Decrement the reference count on a previously loaded dictionary. | |
| void | fr_dict_gctx_debug (FILE *fp, fr_dict_gctx_t const *gctx) |
| Dump information about currently loaded dictionaries. | |
| char const * | fr_dict_global_ctx_dir (void) |
| int | fr_dict_global_ctx_dir_set (char const *dict_dir) |
| Allow the default dict dir to be changed after initialisation. | |
| int | fr_dict_global_ctx_free (fr_dict_gctx_t const *gctx) |
| Explicitly free all data associated with a global dictionary context. | |
| fr_dict_gctx_t * | fr_dict_global_ctx_init (TALLOC_CTX *ctx, bool free_at_exit, char const *dict_dir) |
| Initialise the global protocol hashes. | |
| fr_dict_t * | fr_dict_global_ctx_iter_init (fr_dict_global_ctx_iter_t *iter) |
| Iterate protocols by name. | |
| fr_dict_t * | fr_dict_global_ctx_iter_next (fr_dict_global_ctx_iter_t *iter) |
| void | fr_dict_global_ctx_perm_check (fr_dict_gctx_t *gctx, bool enable) |
| Set whether we check dictionary file permissions. | |
| void | fr_dict_global_ctx_read_only (void) |
| Mark all dictionaries and the global dictionary ctx as read only. | |
| void | fr_dict_global_ctx_set (fr_dict_gctx_t const *gctx) |
| Set a new, active, global dictionary context. | |
| fr_dict_t const * | fr_dict_internal (void) |
| bool | fr_dict_is_read_only (fr_dict_t const *dict) |
| fr_slen_t | fr_dict_oid_component (fr_dict_attr_err_t *err, fr_dict_attr_t const **out, fr_dict_attr_t const *parent, fr_sbuff_t *in, fr_sbuff_term_t const *tt) |
| Parse an OID component, resolving it to a defined attribute. | |
| int | fr_dict_oid_component_legacy (unsigned int *out, char const **oid) |
| Process a single OID component. | |
| fr_dict_t const * | fr_dict_proto_dict (fr_dict_t const *dict) |
| fr_dict_protocol_t const * | fr_dict_protocol (fr_dict_t const *dict) |
| Return the protocol descriptor for the dictionary. | |
| fr_dict_t * | fr_dict_protocol_alloc (fr_dict_t const *parent) |
| Allocate a new local dictionary. | |
| fr_dict_attr_t const * | fr_dict_root (fr_dict_t const *dict) |
| Return the root attribute of a dictionary. | |
| fr_dict_t * | fr_dict_unconst (fr_dict_t const *dict) |
| Coerce to non-const. | |
| fr_dict_attr_t const * | fr_dict_unlocal (fr_dict_attr_t const *da) |
| ssize_t | fr_dict_valid_name (char const *name, ssize_t len) |
| ssize_t | fr_dict_valid_oid_str (char const *name, ssize_t len) |
| fr_dict_vendor_t const * | fr_dict_vendor_by_da (fr_dict_attr_t const *da) |
| Look up a vendor by one of its child attributes. | |
| fr_dict_vendor_t const * | fr_dict_vendor_by_name (fr_dict_t const *dict, char const *name) |
| Look up a vendor by its name. | |
| fr_dict_vendor_t const * | fr_dict_vendor_by_num (fr_dict_t const *dict, uint32_t vendor_pen) |
| Look up a vendor by its PEN. | |
| fr_dict_attr_t const * | fr_dict_vendor_da_by_num (fr_dict_attr_t const *vendor_root, uint32_t vendor_pen) |
| Return vendor attribute for the specified dictionary and pen. | |
| int | fr_dict_walk (fr_dict_attr_t const *da, fr_dict_walk_t callback, void *uctx) |
| int | fr_dl_dict_attr_autoload (UNUSED dl_t const *module, void *symbol, UNUSED void *user_ctx) |
| Callback to automatically resolve attributes and check the types are correct. | |
| void | fr_dl_dict_autofree (UNUSED dl_t const *module, void *symbol, UNUSED void *user_ctx) |
| Callback to automatically free a dictionary when the module is unloaded. | |
| int | fr_dl_dict_autoload (UNUSED dl_t const *module, void *symbol, UNUSED void *user_ctx) |
| Callback to automatically load dictionaries required by modules. | |
| int | fr_dl_dict_enum_autoload (UNUSED dl_t const *module, void *symbol, UNUSED void *user_ctx) |
| Callback to automatically resolve enum values. | |
| static void | hash_pool_free (void *to_free) |
Variables | |
| fr_dict_gctx_t * | dict_gctx = NULL |
| Top level structure containing global dictionary state. | |
| static fr_dict_protocol_t | dict_proto_default |
| Default protocol rules set for every dictionary. | |
| bool const | fr_dict_attr_allowed_chars [UINT8_MAX+1] |
| Characters allowed in a single dictionary attribute name. | |
| bool const | fr_dict_attr_nested_allowed_chars [UINT8_MAX+1] |
| Characters allowed in a nested dictionary attribute name. | |
| bool const | fr_dict_enum_allowed_chars [UINT8_MAX+1] |
| Characters allowed in enumeration value names. | |
Multi-protocol AVP dictionary API.
Definition in file dict_util.c.
| struct fr_dict_autoload_talloc_s |
Structure used to managed the lifetime of a dictionary.
This should only be used when dictionaries are being dynamically loaded during compilation. It should not be used to load dictionaries at runtime, or if modules need to load dictionaries (use static fr_dict_autoload_t defs).
Definition at line 4522 of file dict_util.c.
Collaboration diagram for fr_dict_autoload_talloc_s:| Data Fields | ||
|---|---|---|
| char const * | dependent | Dependent that loaded the dictionary. |
| fr_dict_autoload_t | load[2] | Autoloader def. |
| #define _DICT_PRIVATE 1 |
Definition at line 26 of file dict_util.c.
| #define DICT_ATTR_ALLOWED_CHARS |
Definition at line 44 of file dict_util.c.
| #define DICT_NAME_APPEND | ( | _in, | |
| _dict | |||
| ) |
| #define FNV_MAGIC_INIT (0x811c9dc5) |
Definition at line 114 of file dict_util.c.
| #define FNV_MAGIC_PRIME (0x01000193) |
Definition at line 115 of file dict_util.c.
| typedef fr_slen_t(* dict_attr_resolve_func_t) (fr_dict_attr_err_t *err, fr_dict_attr_t const **out, fr_dict_attr_t const *parent, fr_sbuff_t *in, fr_sbuff_term_t const *tt) |
Callback function for resolving dictionary attributes.
| [out] | err | Where to write error codes. Any error other than FR_DICT_ATTR_NOTFOUND will prevent resolution from continuing. |
| [out] | out | Where to write resolved DA. |
| [in] | parent | The dictionary root or other attribute to search from. |
| [in] | in | Contains the string to resolve. |
| [in] | tt | Terminal sequences to use to determine the portion of in to search. |
Definition at line 3009 of file dict_util.c.
| fr_dict_attr_t * _dict_attr_alloc | ( | char const * | filename, |
| int | line, | ||
| TALLOC_CTX * | ctx, | ||
| fr_dict_attr_t const * | parent, | ||
| char const * | name, | ||
| int | attr, | ||
| fr_type_t | type, | ||
| dict_attr_args_t const * | args | ||
| ) |
Allocate a dictionary attribute on the heap.
| [in] | filename | file. |
| [in] | line | number. |
| [in] | ctx | to allocate the attribute in. |
| [in] | parent | of the attribute. |
| [in] | name | of the attribute. If NULL an OID string will be created and set as the name. |
| [in] | attr | number. |
| [in] | type | of the attribute. |
| [in] | args | optional initialisation arguments. |
Definition at line 1069 of file dict_util.c.
Here is the call graph for this function:| fr_dict_attr_t * _dict_attr_alloc_root | ( | char const * | filename, |
| int | line, | ||
| TALLOC_CTX * | ctx, | ||
| fr_dict_t const * | dict, | ||
| char const * | name, | ||
| int | proto_number, | ||
| dict_attr_args_t const * | args | ||
| ) |
Allocate a dictionary root attribute on the heap.
| [in] | filename | file. |
| [in] | line | number. |
| [in] | ctx | to allocate the attribute in. |
| [in] | dict | the attribute will be used in. |
| [in] | name | of the attribute. If NULL an OID string will be created and set as the name. |
| [in] | proto_number | number. This should be |
| [in] | args | optional initialisation arguments. |
Definition at line 1035 of file dict_util.c.
Here is the call graph for this function:
|
static |
Definition at line 960 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int _dict_attr_init | ( | char const * | filename, |
| int | line, | ||
| fr_dict_attr_t ** | da_p, | ||
| fr_dict_attr_t const * | parent, | ||
| char const * | name, | ||
| unsigned int | attr, | ||
| fr_type_t | type, | ||
| dict_attr_args_t const * | args | ||
| ) |
Initialise fields in a dictionary attribute structure.
This function is a wrapper around the other initialisation functions.
The reason for the separation, is that sometimes we're initialising a dictionary attribute by parsing an actual dictionary file, and other times we're copying attribute, or initialising them programatically.
This function should only be used for the second case, where we have a complet attribute definition already.
| [in] | filename | file. |
| [in] | line | number. |
| [in] | da_p | to initialise. |
| [in] | parent | of the attribute, if none, this attribute will be initialised as a dictionary root. |
| [in] | name | of attribute. Pass NULL for auto-generated name. |
| [in] | attr | number. |
| [in] | type | of the attribute. |
| [in] | args | optional initialisation arguments. |
Definition at line 895 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int _dict_attr_init_name_only | ( | char const * | filename, |
| int | line, | ||
| fr_dict_attr_t ** | da_p, | ||
| fr_dict_attr_t const * | parent, | ||
| char const * | name, | ||
| fr_type_t | type, | ||
| dict_attr_args_t const * | args | ||
| ) |
Initialise fields in a dictionary attribute structure.
This function is a wrapper around the other initialisation functions.
The reason for the separation, is that sometimes we're initialising a dictionary attribute by parsing an actual dictionary file, and other times we're copying attribute, or initialising them programatically.
This function should only be used for the second case, where we have a complet attribute definition already.
| [in] | filename | file. |
| [in] | line | number. |
| [in] | da_p | to initialise. |
| [in] | parent | of the attribute, if none, this attribute will be initialised as a dictionary root. |
| [in] | name | of attribute. Pass NULL for auto-generated name. automatically generated. |
| [in] | type | of the attribute. |
| [in] | args | optional initialisation arguments. |
Definition at line 942 of file dict_util.c.
Here is the call graph for this function:
|
static |
Find a dependent in the tree of dependents.
Definition at line 3937 of file dict_util.c.
Here is the caller graph for this function:
|
static |
Definition at line 4099 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 4642 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 4637 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int _fr_dict_autofree | ( | fr_dict_autoload_t const * | to_free, |
| char const * | dependent | ||
| ) |
Decrement the reference count on a previously loaded dictionary.
| [in] | to_free | previously loaded dictionary to free. |
| [in] | dependent | that originally allocated this dictionary |
Definition at line 4498 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int _fr_dict_autoload | ( | fr_dict_autoload_t const * | to_load, |
| char const * | dependent | ||
| ) |
Process a dict_autoload element to load a protocol.
| [in] | to_load | dictionary definition. |
| [in] | dependent | that is loading this dictionary. |
Definition at line 4465 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_autoload_talloc_t * _fr_dict_autoload_talloc | ( | TALLOC_CTX * | ctx, |
| fr_dict_t const ** | out, | ||
| char const * | proto, | ||
| char const * | dependent | ||
| ) |
Autoload a dictionary and bind the lifetime to a talloc chunk.
Mainly useful for resolving "forward" references from unlang immediately.
| [in] | ctx | to bind the dictionary lifetime to. |
| [out] | out | pointer to the loaded dictionary. |
| [in] | proto | to load. |
| [in] | dependent | to register this reference to. Will be dupd. |
Definition at line 4549 of file dict_util.c.
Here is the call graph for this function:
|
static |
Talloc destructor to automatically free dictionaries.
| [in] | to_free | dictionary autoloader definition describing the dictionary to free. |
Definition at line 4531 of file dict_util.c.
Here is the call graph for this function:
|
static |
| fr_dict_t * dict_alloc | ( | TALLOC_CTX * | ctx | ) |
Allocate a new dictionary.
| [in] | ctx | to allocate dictionary in. |
Definition at line 4182 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_attr_t * dict_attr_acopy | ( | TALLOC_CTX * | ctx, |
| fr_dict_attr_t const * | parent, | ||
| fr_dict_attr_t const * | in, | ||
| char const * | name | ||
| ) |
Copy a an existing attribute, possibly to a new location.
| [in] | ctx | to allocate new attribute in. |
| [in] | parent | where to parent the copy from. If NULL, in->parent is used. |
| [in] | in | attribute to copy. |
| [in] | name | to assign to the attribute. If NULL, in->name is used. |
Definition at line 1098 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int dict_attr_acopy_aliases | ( | UNUSED fr_dict_attr_t * | dst, |
| fr_dict_attr_t const * | src | ||
| ) |
Copy aliases of an existing attribute to a new one.
| [in] | dst | where to copy the children to |
| [in] | src | where to copy the children from |
Definition at line 1328 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 1158 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int dict_attr_acopy_children | ( | fr_dict_t * | dict, |
| fr_dict_attr_t * | dst, | ||
| fr_dict_attr_t const * | src | ||
| ) |
Copy the children of an existing attribute.
| [in] | dict | to allocate the children in |
| [in] | dst | where to copy the children to |
| [in] | src | where to copy the children from |
Definition at line 1196 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int dict_attr_acopy_enumv | ( | fr_dict_attr_t * | dst, |
| fr_dict_attr_t const * | src | ||
| ) |
Copy the VALUEs of an existing attribute, by casting them.
| [in] | dst | where to cast the VALUEs to |
| [in] | src | where to cast the VALUEs from |
Definition at line 1293 of file dict_util.c.
Here is the call graph for this function:| int dict_attr_add_to_namespace | ( | fr_dict_attr_t const * | parent, |
| fr_dict_attr_t * | da | ||
| ) |
Add an attribute to the name table for an attribute.
| [in] | parent | containing the namespace to add this attribute to. |
| [in] | da | to add to the name lookup tables. |
Definition at line 1781 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Resolve an alias attribute to the concrete attribute it points to.
| [out] | err | where to write the error (if any). |
| [in] | da | to resolve. |
Definition at line 390 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int dict_attr_alias_add | ( | fr_dict_attr_t const * | parent, |
| char const * | alias, | ||
| fr_dict_attr_t const * | ref | ||
| ) |
Add an alias to an existing attribute.
Definition at line 1409 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_attr_t * dict_attr_alloc_null | ( | TALLOC_CTX * | ctx, |
| fr_dict_protocol_t const * | proto | ||
| ) |
Allocate a partially completed attribute.
Partial initialisation functions.
This is useful in some instances where we need to pre-allocate the attribute for talloc hierarchy reasons, but want to finish initialising it with dict_attr_init later.
| [in] | ctx | to allocate attribute in. |
| [in] | proto | protocol specific extensions. |
Definition at line 994 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_attr_t * dict_attr_by_name | ( | fr_dict_attr_err_t * | err, |
| fr_dict_attr_t const * | parent, | ||
| char const * | name | ||
| ) |
Definition at line 3486 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| bool dict_attr_can_have_children | ( | fr_dict_attr_t const * | da | ) |
See if a fr_dict_attr_t can have children.
| da | the dictionary attribute to check. |
Definition at line 1657 of file dict_util.c.
Here is the caller graph for this function:| int dict_attr_child_add | ( | fr_dict_attr_t * | parent, |
| fr_dict_attr_t * | child | ||
| ) |
Add a child to a parent.
| [in] | parent | we're adding a child to. |
| [in] | child | to add to parent. |
Definition at line 1682 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_attr_t * dict_attr_child_by_num | ( | fr_dict_attr_t const * | parent, |
| unsigned int | attr | ||
| ) |
Internal version of fr_dict_attr_child_by_num.
Definition at line 3550 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Add a child/nesting extension to an attribute.
| [in] | da_p | to set a group reference for. |
Definition at line 468 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int dict_attr_enum_add_name | ( | fr_dict_attr_t * | da, |
| char const * | name, | ||
| fr_value_box_t const * | value, | ||
| bool | coerce, | ||
| bool | takes_precedence, | ||
| fr_dict_attr_t const * | key_child_ref | ||
| ) |
Definition at line 2022 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Initialise a per-attribute enumeration table.
| [in] | da_p | to set a group reference for. |
Definition at line 503 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int dict_attr_finalise | ( | fr_dict_attr_t ** | da_p, |
| char const * | name | ||
| ) |
Set remaining fields in a dictionary attribute before insertion.
| [in] | da_p | to finalise. |
| [in] | name | of the attribute. |
Definition at line 763 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Definition at line 834 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void dict_attr_location_init | ( | fr_dict_attr_t * | da, |
| char const * | filename, | ||
| int | line | ||
| ) |
Set where the dictionary attribute was defined.
Definition at line 749 of file dict_util.c.
Here is the caller graph for this function:
|
static |
Compare two attribute names.
Definition at line 211 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Wrap name hash function for fr_dict_attr_t.
| data | fr_dict_attr_t to hash. |
Definition at line 199 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Set a dictionary attribute's name.
| [in] | da_p | to set name for. |
| [in] | name | to set. If NULL a name will be automatically generated. |
Definition at line 415 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Initialise a per-attribute namespace.
| [in] | da_p | to set a group reference for. |
Definition at line 519 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int dict_attr_num_init | ( | fr_dict_attr_t * | da, |
| unsigned int | num | ||
| ) |
Set the attribute number (if any)
| [in] | da | to set the attribute number for. |
| [in] | num | to set. |
Definition at line 719 of file dict_util.c.
Here is the caller graph for this function:| int dict_attr_num_init_name_only | ( | fr_dict_attr_t * | da | ) |
Set the attribute number (if any)
| [in] | da | to set the attribute number for. |
Definition at line 737 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int dict_attr_parent_init | ( | fr_dict_attr_t ** | da_p, |
| fr_dict_attr_t const * | parent | ||
| ) |
Initialise fields which depend on a parent attribute.
| [in,out] | da_p | to initialise. |
| [in] | parent | of the attribute. |
Definition at line 643 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Internal function for searching for attributes in multiple dictionaries.
| [out] | err | Any errors that occurred searching. |
| [out] | out | The attribute we found. |
| [in] | dict_def | The default dictionary to search in. |
| [in] | in | string to resolve to an attribute. |
| [in] | tt | terminals that indicate the end of the string. |
| [in] | internal | Resolve the attribute in the internal dictionary. |
| [in] | foreign | Resolve attribute in a foreign dictionary, i.e. one other than dict_def. |
| [in] | func | to use for resolution. |
Definition at line 3029 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Internal function for searching for attributes in multiple dictionaries.
Unlike dict_attr_search this function searches for a protocol name preceding the attribute identifier.
Definition at line 3177 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int dict_attr_type_init | ( | fr_dict_attr_t ** | da_p, |
| fr_type_t | type | ||
| ) |
Initialise type specific fields within the dictionary attribute.
Call when the type of the attribute is known.
| [in,out] | da_p | to set the type for. |
| [in] | type | to set. |
Definition at line 556 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Cache the vendor pointer for an attribute.
| [in] | da_p | to set a group reference for. |
| [in] | vendor | to set. |
Definition at line 485 of file dict_util.c.
Here is the call graph for this function:
|
static |
Definition at line 4072 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_t * dict_by_da | ( | fr_dict_attr_t const * | da | ) |
Internal version of fr_dict_by_da.
Attempt to locate the protocol dictionary containing an attribute.
Definition at line 2805 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_t * dict_by_protocol_name | ( | char const * | name | ) |
Internal version of fr_dict_by_protocol_name.
Lookup a protocol by its name.
Definition at line 2777 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_t * dict_by_protocol_num | ( | unsigned int | num | ) |
Internal version of fr_dict_by_protocol_num.
Lookup a protocol by its number.
Definition at line 2791 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_slen_t dict_by_protocol_substr | ( | fr_dict_attr_err_t * | err, |
| fr_dict_t ** | out, | ||
| fr_sbuff_t * | name, | ||
| fr_dict_t const * | dict_def | ||
| ) |
Definition at line 2684 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int dict_dependent_add | ( | fr_dict_t * | dict, |
| char const * | dependent | ||
| ) |
Record a new dependency on a dictionary.
These are used to determine what is currently depending on a dictionary.
| [in] | dict | to record dependency on. |
| [in] | dependent | Either C src file, or another dictionary. |
Definition at line 3957 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int dict_dependent_remove | ( | fr_dict_t * | dict, |
| char const * | dependent | ||
| ) |
Decrement ref count for a dependent in a dictionary.
| [in] | dict | to remove dependency from. |
| [in] | dependent | Either C src, or another dictionary dependent. What depends on this dictionary. |
Definition at line 4016 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int dict_dlopen | ( | fr_dict_t * | dict, |
| char const * | name | ||
| ) |
Definition at line 3865 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Compare two dictionary attribute enum values.
Definition at line 342 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Hash a enumeration name.
Definition at line 332 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Compare two dictionary enum values.
Definition at line 372 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Hash a dictionary enum value.
Definition at line 362 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:Check if a dictionary still has dependents.
| [in] | dict | to check |
Definition at line 4048 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:Apply a simple (case insensitive) hashing function to the name of an attribute, vendor or protocol.
| [in] | name | of the attribute, vendor or protocol. |
| [in] | len | length of the input string. |
Definition at line 129 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int dict_protocol_add | ( | fr_dict_t * | dict | ) |
Add a protocol to the global protocol table.
Inserts a protocol into the global protocol table. Uses the root attributes of the dictionary for comparisons.
| [in] | dict | of protocol we're inserting. |
Definition at line 1514 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Compare two protocol names.
Definition at line 165 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Wrap name hash function for fr_dict_protocol_t.
| [in] | data | fr_dict_attr_t to hash. |
Definition at line 153 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Compare two protocol numbers.
Definition at line 186 of file dict_util.c.
Here is the caller graph for this function:
|
static |
Hash a protocol number.
Definition at line 178 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int dict_vendor_add | ( | fr_dict_t * | dict, |
| char const * | name, | ||
| unsigned int | num | ||
| ) |
Add a vendor to the dictionary.
Inserts a vendor entry into the vendor hash table. This must be done before adding attributes under a VSA.
| [in] | dict | of protocol context we're operating in. If NULL the internal dictionary will be used. |
| [in] | name | of the vendor. |
| [in] | num | Vendor's Private Enterprise Number. |
Definition at line 1587 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Compare two attribute names.
Definition at line 299 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Wrap name hash function for fr_dict_vendor_t.
| data | fr_dict_vendor_t to hash. |
Definition at line 287 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Compare two vendor numbers.
Definition at line 321 of file dict_util.c.
Here is the caller graph for this function:
|
static |
Hash a vendor number.
Definition at line 312 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Call the specified callback for da and then for all its children.
Definition at line 5080 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int fr_dict_attr_acopy_local | ( | fr_dict_attr_t const * | dst, |
| fr_dict_attr_t const * | src | ||
| ) |
Definition at line 1134 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int fr_dict_attr_add | ( | fr_dict_t * | dict, |
| fr_dict_attr_t const * | parent, | ||
| char const * | name, | ||
| unsigned int | attr, | ||
| fr_type_t | type, | ||
| fr_dict_attr_flags_t const * | flags | ||
| ) |
Add an attribute to the dictionary.
| [in] | dict | of protocol context we're operating in. If NULL the internal dictionary will be used. |
| [in] | parent | to add attribute under. |
| [in] | name | of the attribute. |
| [in] | attr | number. |
| [in] | type | of attribute. |
| [in] | flags | to set in the attribute. |
Definition at line 1969 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int fr_dict_attr_add_initialised | ( | fr_dict_attr_t * | da | ) |
A variant of fr_dict_attr_t that allows a pre-allocated, populated fr_dict_attr_t to be added.
Definition at line 1847 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int fr_dict_attr_add_name_only | ( | fr_dict_t * | dict, |
| fr_dict_attr_t const * | parent, | ||
| char const * | name, | ||
| fr_type_t | type, | ||
| fr_dict_attr_flags_t const * | flags | ||
| ) |
Add an attribute to the dictionary.
| [in] | dict | of protocol context we're operating in. If NULL the internal dictionary will be used. |
| [in] | parent | to add attribute under. |
| [in] | name | of the attribute. |
| [in] | type | of attribute. |
| [in] | flags | to set in the attribute. |
Definition at line 2008 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int fr_dict_attr_autoload | ( | fr_dict_attr_autoload_t const * | to_load | ) |
Process a dict_attr_autoload element to load/verify a dictionary attribute.
| [in] | to_load | attribute definition |
Definition at line 4400 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_attr_t const * fr_dict_attr_by_name | ( | fr_dict_attr_err_t * | err, |
| fr_dict_attr_t const * | parent, | ||
| char const * | name | ||
| ) |
Locate a fr_dict_attr_t by its name.
| [out] | err | Why the lookup failed. May be NULL. |
| [in] | parent | containing the namespace we're searching in. |
| [in] | name | of the attribute to locate. |
Definition at line 3532 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_slen_t fr_dict_attr_by_name_substr | ( | fr_dict_attr_err_t * | err, |
| fr_dict_attr_t const ** | out, | ||
| fr_dict_attr_t const * | parent, | ||
| fr_sbuff_t * | name, | ||
| UNUSED fr_sbuff_term_t const * | tt | ||
| ) |
Look up a dictionary attribute by a name embedded in another string.
Find the first invalid attribute name char in the string pointed to by name.
Copy the characters between the start of the name string and the first none fr_dict_attr_allowed_chars char to a buffer and perform a dictionary lookup using that value.
If the attribute exists, advance the pointer pointed to by name to the first none fr_dict_attr_allowed_chars char, and return the DA.
If the attribute does not exist, don't advance the pointer and return NULL.
| [out] | err | Why parsing failed. May be NULL. |
| [out] | out | Where to store the resolve attribute. |
| [in] | parent | containing the namespace to search in. |
| [in] | name | string start. |
| [in] | tt | Terminal sequences to use to determine the portion of in to search. |
Definition at line 3401 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_attr_t const * fr_dict_attr_by_oid | ( | fr_dict_attr_err_t * | err, |
| fr_dict_attr_t const * | parent, | ||
| char const * | oid | ||
| ) |
Resolve an attribute using an OID string.
| [out] | err | The parsing error that occurred. |
| [in] | parent | Where to resolve relative attributes from. |
| [in] | oid | string to parse. |
Definition at line 2642 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| ssize_t fr_dict_attr_by_oid_legacy | ( | fr_dict_t const * | dict, |
| fr_dict_attr_t const ** | parent, | ||
| unsigned int * | attr, | ||
| char const * | oid | ||
| ) |
Get the leaf attribute of an OID string.
| [in] | dict | of protocol context we're operating in. If NULL the internal dictionary will be used. |
| [out] | attr | Number we parsed. |
| [in,out] | parent | attribute (or root of dictionary). Will be updated to the parent directly beneath the leaf. |
| [in] | oid | string to parse. |
Definition at line 2403 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_slen_t fr_dict_attr_by_oid_substr | ( | fr_dict_attr_err_t * | err, |
| fr_dict_attr_t const ** | out, | ||
| fr_dict_attr_t const * | parent, | ||
| fr_sbuff_t * | in, | ||
| fr_sbuff_term_t const * | tt | ||
| ) |
Resolve an attribute using an OID string.
| [out] | err | The parsing error that occurred. |
| [out] | out | The deepest attribute we resolved. |
| [in] | parent | Where to resolve relative attributes from. |
| [in] | in | string to parse. |
| [in] | tt | Terminal strings. |
Definition at line 2593 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| bool fr_dict_attr_can_contain | ( | fr_dict_attr_t const * | parent, |
| fr_dict_attr_t const * | child | ||
| ) |
See if a structural da is allowed to contain another da.
We have some complex rules with different structural types, different protocol dictionaries, references to other protocols, etc.
| [in] | parent | The parent da, must be structural |
| [in] | child | The alleged child |
Definition at line 5203 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_attr_t const * fr_dict_attr_child_by_num | ( | fr_dict_attr_t const * | parent, |
| unsigned int | attr | ||
| ) |
Check if a child attribute exists in a parent using an attribute number.
| [in] | parent | to check for child in. |
| [in] | attr | number to look for. |
Definition at line 3597 of file dict_util.c.
Here is the call graph for this function:| fr_dict_attr_t const * fr_dict_attr_common_parent | ( | fr_dict_attr_t const * | a, |
| fr_dict_attr_t const * | b, | ||
| bool | is_ancestor | ||
| ) |
Find a common ancestor that two TLV type attributes share.
| [in] | a | first TLV attribute. |
| [in] | b | second TLV attribute. |
| [in] | is_ancestor | Enforce a->b relationship (a is parent or ancestor of b). |
Definition at line 2315 of file dict_util.c.
Here is the caller graph for this function:| fr_dict_attr_t const * fr_dict_attr_iterate_children | ( | fr_dict_attr_t const * | parent, |
| fr_dict_attr_t const ** | prev | ||
| ) |
Iterate over children of a DA.
| [in] | parent | the parent da to iterate over |
| [in,out] | prev | pointer to NULL to start, otherwise pointer to the previously returned child |
Definition at line 5024 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int8_t fr_dict_attr_ordered_cmp | ( | fr_dict_attr_t const * | a, |
| fr_dict_attr_t const * | b | ||
| ) |
Compare two attributes by total order.
This function is safe / ordered even when the attributes are in different dictionaries. This allows it to work for local variables, as those are in a different dictionary from the protocol ones.
This function orders parents first, then their children.
Definition at line 229 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_slen_t fr_dict_attr_search_by_name_substr | ( | fr_dict_attr_err_t * | err, |
| fr_dict_attr_t const ** | out, | ||
| fr_dict_t const * | dict_def, | ||
| fr_sbuff_t * | name, | ||
| fr_sbuff_term_t const * | tt, | ||
| bool | internal, | ||
| bool | foreign | ||
| ) |
Locate a fr_dict_attr_t by its name in the top level namespace of a dictionary.
This function will search through all loaded dictionaries, or a subset of loaded dictionaries, for a matching attribute in the top level namespace.
| [out] | err | Why parsing failed. May be NULL. |
| [out] | out | Dictionary found attribute. |
| [in] | dict_def | Default dictionary for non-qualified dictionaries. |
| [in] | name | Dictionary/Attribute name. |
| [in] | tt | Terminal strings. |
| [in] | internal | If true, fallback to the internal dictionary. |
| [in] | foreign | If true, fallback to foreign dictionaries. |
Definition at line 3273 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_slen_t fr_dict_attr_search_by_oid_substr | ( | fr_dict_attr_err_t * | err, |
| fr_dict_attr_t const ** | out, | ||
| fr_dict_t const * | dict_def, | ||
| fr_sbuff_t * | in, | ||
| fr_sbuff_term_t const * | tt, | ||
| bool | internal, | ||
| bool | foreign | ||
| ) |
Locate a qualified fr_dict_attr_t by a dictionary using a non-qualified OID string.
This function will search through all loaded dictionaries, or a subset of loaded dictionaries, for a matching attribute.
| [out] | err | Why parsing failed. May be NULL. |
| [out] | out | Dictionary found attribute. |
| [in] | dict_def | Default dictionary for non-qualified dictionaries. |
| [in] | in | Dictionary/Attribute name. |
| [in] | tt | Terminal strings. |
| [in] | internal | If true, fallback to the internal dictionary. |
| [in] | foreign | If true, fallback to foreign dictionaries. |
Definition at line 3331 of file dict_util.c.
Here is the call graph for this function:| fr_slen_t fr_dict_attr_search_by_qualified_name_substr | ( | fr_dict_attr_err_t * | err, |
| fr_dict_attr_t const ** | out, | ||
| fr_dict_t const * | dict_def, | ||
| fr_sbuff_t * | name, | ||
| fr_sbuff_term_t const * | tt, | ||
| bool | internal, | ||
| bool | foreign | ||
| ) |
Locate a qualified fr_dict_attr_t by its name and a dictionary qualifier.
This function will search through all loaded dictionaries, or a subset of loaded dictionaries, for a matching attribute in the top level namespace.
This attribute may be qualified with <protocol>. to selection an attribute in a specific case.
| [out] | err | Why parsing failed. May be NULL. |
| [out] | out | Dictionary found attribute. |
| [in] | dict_def | Default dictionary for non-qualified dictionaries. |
| [in] | name | Dictionary/Attribute name. |
| [in] | tt | Terminal strings. |
| [in] | internal | If true, fallback to the internal dictionary. |
| [in] | foreign | If true, fallback to foreign dictionaries. |
Definition at line 3244 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_attr_t const * fr_dict_attr_search_by_qualified_oid | ( | fr_dict_attr_err_t * | err, |
| fr_dict_t const * | dict_def, | ||
| char const * | name, | ||
| bool | internal, | ||
| bool | foreign | ||
| ) |
Locate a qualified fr_dict_attr_t by its name and a dictionary qualifier.
| [out] | err | Why parsing failed. May be NULL. |
| [in] | dict_def | Default dictionary for non-qualified dictionaries. |
| [in] | name | Dictionary/Attribute name. |
| [in] | internal | If true, fallback to the internal dictionary. |
| [in] | foreign | If true, fallback to foreign dictionaries. |
Definition at line 3350 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_slen_t fr_dict_attr_search_by_qualified_oid_substr | ( | fr_dict_attr_err_t * | err, |
| fr_dict_attr_t const ** | out, | ||
| fr_dict_t const * | dict_def, | ||
| fr_sbuff_t * | in, | ||
| fr_sbuff_term_t const * | tt, | ||
| bool | internal, | ||
| bool | foreign | ||
| ) |
Locate a qualified fr_dict_attr_t by a dictionary qualified OID string.
This function will search through all loaded dictionaries, or a subset of loaded dictionaries, for a matching attribute.
| [out] | err | Why parsing failed. May be NULL. |
| [out] | out | Dictionary found attribute. |
| [in] | dict_def | Default dictionary for non-qualified dictionaries. |
| [in] | in | Dictionary/Attribute name. |
| [in] | tt | Terminal strings. |
| [in] | internal | If true, fallback to the internal dictionary. |
| [in] | foreign | If true, fallback to foreign dictionaries. |
Definition at line 3302 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int fr_dict_attr_set_group | ( | fr_dict_attr_t ** | da_p, |
| fr_dict_attr_t const * | ref | ||
| ) |
Definition at line 5297 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_attr_t * fr_dict_attr_unconst | ( | fr_dict_attr_t const * | da | ) |
Coerce to non-const.
Definition at line 4925 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void fr_dict_attr_verify | ( | char const * | file, |
| int | line, | ||
| fr_dict_attr_t const * | da | ||
| ) |
| fr_dict_t const * fr_dict_by_da | ( | fr_dict_attr_t const * | da | ) |
Attempt to locate the protocol dictionary containing an attribute.
| [in] | da | To get the containing dictionary for. |
Definition at line 2875 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_t const * fr_dict_by_protocol_name | ( | char const * | name | ) |
Lookup a protocol by its name.
| [in] | name | of the protocol to locate. |
Definition at line 2846 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_t const * fr_dict_by_protocol_num | ( | unsigned int | num | ) |
Lookup a protocol by its number.
Returns the fr_dict_t belonging to the protocol with the specified number if any have been registered.
| [in] | num | to search for. |
Definition at line 2859 of file dict_util.c.
Here is the call graph for this function:| fr_slen_t fr_dict_by_protocol_substr | ( | fr_dict_attr_err_t * | err, |
| fr_dict_t const ** | out, | ||
| fr_sbuff_t * | name, | ||
| fr_dict_t const * | dict_def | ||
| ) |
Look up a protocol name embedded in another string.
| [out] | err | Parsing error. |
| [out] | out | the resolve dictionary or NULL if the dictionary couldn't be resolved. |
| [in] | name | string start. |
| [in] | dict_def | The dictionary to return if no dictionary qualifier was found. |
Definition at line 2766 of file dict_util.c.
Here is the call graph for this function:See if two dictionaries have the same end parent.
| [in] | dict1 | one dictionary |
| [in] | dict2 | two dictionary |
Definition at line 2888 of file dict_util.c.
Here is the caller graph for this function:| int fr_dict_const_free | ( | fr_dict_t const ** | dict, |
| char const * | dependent | ||
| ) |
Decrement the reference count on a previously loaded dictionary.
| [in] | dict | to free. |
| [in] | dependent | that originally allocated this dictionary. |
Definition at line 4318 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int fr_dict_dependent_add | ( | fr_dict_t const * | dict, |
| char const * | dependent | ||
| ) |
Manually increase the reference count for a dictionary.
This is useful if a previously loaded dictionary needs to be bound to the lifetime of an additional object.
| [in] | dict | to increase the reference count for. |
| [in] | dependent | requesting the loading of the dictionary. |
Definition at line 4001 of file dict_util.c.
Here is the call graph for this function:| int fr_dict_enum_add_name | ( | fr_dict_attr_t * | da, |
| char const * | name, | ||
| fr_value_box_t const * | value, | ||
| bool | coerce, | ||
| bool | takes_precedence | ||
| ) |
Add a value name.
Aliases are textual (string) names for a given value.
Value names are not limited to integers, and may be added for any non-structural attribute type.
| [in] | da | to add enumeration value to. |
| [in] | name | Name of value name. |
| [in] | value | to associate with name. |
| [in] | coerce | if the type of the value does not match the type of the da, attempt to cast it to match the type of the da. If this is false and there's a type mismatch, we fail. We also fail if the value cannot be coerced to the attribute type. |
| [in] | takes_precedence | This name should take precedence over previous names for the same value, when resolving value to name. |
Definition at line 2219 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int fr_dict_enum_add_name_next | ( | fr_dict_attr_t * | da, |
| char const * | name | ||
| ) |
Add an name to an integer attribute hashing the name for the integer value.
If the integer value conflicts with an existing name, it's incremented until we find a free value.
Definition at line 2231 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int fr_dict_enum_autoload | ( | fr_dict_enum_autoload_t const * | to_load | ) |
Process a dict_attr_autoload element to load/verify a dictionary attribute.
| [in] | to_load | attribute definition |
Definition at line 4361 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_enum_value_t const * fr_dict_enum_by_name | ( | fr_dict_attr_t const * | da, |
| char const * | name, | ||
| ssize_t | len | ||
| ) |
Definition at line 3705 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_slen_t fr_dict_enum_by_name_substr | ( | fr_dict_enum_value_t ** | out, |
| fr_dict_attr_t const * | da, | ||
| fr_sbuff_t * | in | ||
| ) |
| fr_dict_enum_value_t const * fr_dict_enum_by_value | ( | fr_dict_attr_t const * | da, |
| fr_value_box_t const * | value | ||
| ) |
Lookup the structure representing an enum value in a fr_dict_attr_t.
| [in] | da | to search in. |
| [in] | value | to search for. |
Definition at line 3659 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_enum_value_t const * fr_dict_enum_iter_init | ( | fr_dict_attr_t const * | da, |
| fr_dict_enum_iter_t * | iter | ||
| ) |
Iterate over all enumeration values for an attribute.
| [in] | da | to iterate over. |
| [in] | iter | to use for iteration. |
Definition at line 3618 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_enum_value_t const * fr_dict_enum_iter_next | ( | fr_dict_attr_t const * | da, |
| fr_dict_enum_iter_t * | iter | ||
| ) |
Definition at line 3639 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| char const * fr_dict_enum_name_by_value | ( | fr_dict_attr_t const * | da, |
| fr_value_box_t const * | value | ||
| ) |
Lookup the name of an enum value in a fr_dict_attr_t.
| [in] | da | to search in. |
| [in] | value | number to search for. |
Definition at line 3692 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_slen_t fr_dict_enum_name_from_substr | ( | fr_sbuff_t * | out, |
| fr_sbuff_parse_error_t * | err, | ||
| fr_sbuff_t * | in, | ||
| fr_sbuff_term_t const * | tt | ||
| ) |
Extract an enumeration name from a string.
This function defines the canonical format for an enumeration name.
An enumeration name is made up of one or more fr_dict_attr_allowed_chars with at least one character in the sequence not being a special character i.e. [-+/_] or a number.
This disambiguates enumeration identifiers from mathematical expressions.
If we allowed enumeration names consisting of sequences of numbers separated by special characters it would not be possible to determine if the special character were an operator in a subexpression.
For example take:
&My-Enum-Attr == 01234-5678
Without having access to the enumeration values of My-Enum-Attr (which we might not have during tokenisation), we cannot tell if this is:
(&My-Enum-Attr == 01234-5678)
OR
((&My-Enum-Attr == 01234) - 5678)
If an alpha character occurs anywhere in the string i.e:
(&My-Enum-Attr == 01234-A5678)
we know 01234-A5678 can't be a mathematical sub-expression because the second potential operand can no longer be parsed as an integer constant.
| [out] | out | The name string we managed to extract. May be NULL in which case only the length of the name will be returned. |
| [out] | err | Type of parsing error which occurred. May be NULL. |
| [in] | in | The string containing the enum identifier. |
| [in] | tt | If non-null verify that a terminal sequence occurs after the enumeration name. |
Definition at line 3825 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int fr_dict_free | ( | fr_dict_t ** | dict, |
| char const * | dependent | ||
| ) |
Decrement the reference count on a previously loaded dictionary.
| [in] | dict | to free. |
| [in] | dependent | that originally allocated this dictionary. |
Definition at line 4334 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void fr_dict_gctx_debug | ( | FILE * | fp, |
| fr_dict_gctx_t const * | gctx | ||
| ) |
Dump information about currently loaded dictionaries.
Intended to be called from a debugger
Definition at line 4856 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| char const * fr_dict_global_ctx_dir | ( | void | ) |
| int fr_dict_global_ctx_dir_set | ( | char const * | dict_dir | ) |
Allow the default dict dir to be changed after initialisation.
| [in] | dict_dir | New default dict dir to use. |
Definition at line 4809 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int fr_dict_global_ctx_free | ( | fr_dict_gctx_t const * | gctx | ) |
Explicitly free all data associated with a global dictionary context.
| [in] | gctx | To set. |
Definition at line 4795 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_gctx_t * fr_dict_global_ctx_init | ( | TALLOC_CTX * | ctx, |
| bool | free_at_exit, | ||
| char const * | dict_dir | ||
| ) |
Initialise the global protocol hashes.
| [in] | ctx | to allocate global resources in. |
| [in] | free_at_exit | Install an at_exit handler to free the global ctx. This is useful when dictionaries are held by other libraries which free them using atexit handlers. |
| [in] | dict_dir | the default location for the dictionaries. |
Definition at line 4718 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_t * fr_dict_global_ctx_iter_init | ( | fr_dict_global_ctx_iter_t * | iter | ) |
Iterate protocols by name.
Definition at line 4895 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_t * fr_dict_global_ctx_iter_next | ( | fr_dict_global_ctx_iter_t * | iter | ) |
Definition at line 4902 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void fr_dict_global_ctx_perm_check | ( | fr_dict_gctx_t * | gctx, |
| bool | enable | ||
| ) |
Set whether we check dictionary file permissions.
| [in] | gctx | to alter. |
| [in] | enable | Whether we should check file permissions as they're loaded. |
Definition at line 4770 of file dict_util.c.
| void fr_dict_global_ctx_read_only | ( | void | ) |
Mark all dictionaries and the global dictionary ctx as read only.
Any attempts to add new attributes will now fail.
Definition at line 4829 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void fr_dict_global_ctx_set | ( | fr_dict_gctx_t const * | gctx | ) |
Set a new, active, global dictionary context.
| [in] | gctx | To set. |
Definition at line 4779 of file dict_util.c.
Here is the caller graph for this function:| fr_dict_t const * fr_dict_internal | ( | void | ) |
| fr_slen_t fr_dict_oid_component | ( | fr_dict_attr_err_t * | err, |
| fr_dict_attr_t const ** | out, | ||
| fr_dict_attr_t const * | parent, | ||
| fr_sbuff_t * | in, | ||
| fr_sbuff_term_t const * | tt | ||
| ) |
Parse an OID component, resolving it to a defined attribute.
| [out] | err | The parsing error that occurred. |
| [out] | out | The deepest attribute we resolved. |
| [in] | parent | Where to resolve relative attributes from. |
| [in] | in | string to parse. |
| [in] | tt | Terminal strings. |
Definition at line 2494 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int fr_dict_oid_component_legacy | ( | unsigned int * | out, |
| char const ** | oid | ||
| ) |
Process a single OID component.
| [out] | out | Value of component. |
| [in] | oid | string to parse. |
Definition at line 2358 of file dict_util.c.
Here is the caller graph for this function:| fr_dict_protocol_t const * fr_dict_protocol | ( | fr_dict_t const * | dict | ) |
Return the protocol descriptor for the dictionary.
Definition at line 5266 of file dict_util.c.
Here is the caller graph for this function:Allocate a new local dictionary.
| [in] | parent | parent dictionary and talloc ctx |
This dictionary cannot define vendors, or inter-dictionary dependencies. However, we initialize the relevant fields just in case. We should arguably just skip initializing those fields, and just allow the server to crash if programmers do something stupid with it.
Definition at line 4271 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_attr_t const * fr_dict_root | ( | fr_dict_t const * | dict | ) |
Return the root attribute of a dictionary.
| dict | to return root for. |
Definition at line 2669 of file dict_util.c.
Coerce to non-const.
Definition at line 4913 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_attr_t const * fr_dict_unlocal | ( | fr_dict_attr_t const * | da | ) |
Definition at line 5274 of file dict_util.c.
| fr_dict_vendor_t const * fr_dict_vendor_by_da | ( | fr_dict_attr_t const * | da | ) |
Look up a vendor by one of its child attributes.
| [in] | da | The vendor attribute. |
Definition at line 2904 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_vendor_t const * fr_dict_vendor_by_name | ( | fr_dict_t const * | dict, |
| char const * | name | ||
| ) |
Look up a vendor by its name.
| [in] | dict | of protocol context we're operating in. If NULL the internal dictionary will be used. |
| [in] | name | to search for. |
Definition at line 2926 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_vendor_t const * fr_dict_vendor_by_num | ( | fr_dict_t const * | dict, |
| uint32_t | vendor_pen | ||
| ) |
Look up a vendor by its PEN.
| [in] | dict | of protocol context we're operating in. If NULL the internal dictionary will be used. |
| [in] | vendor_pen | to search for. |
Definition at line 2949 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_attr_t const * fr_dict_vendor_da_by_num | ( | fr_dict_attr_t const * | vendor_root, |
| uint32_t | vendor_pen | ||
| ) |
Return vendor attribute for the specified dictionary and pen.
| [in] | vendor_root | of the vendor root attribute. Could be 26 (for example) in RADIUS. |
| [in] | vendor_pen | to find. |
Definition at line 2964 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int fr_dict_walk | ( | fr_dict_attr_t const * | da, |
| fr_dict_walk_t | callback, | ||
| void * | uctx | ||
| ) |
Definition at line 5105 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:Callback to automatically resolve attributes and check the types are correct.
| [in] | module | being loaded. |
| [in] | symbol | An array of fr_dict_attr_autoload_t to load. |
| [in] | user_ctx | unused. |
Definition at line 4603 of file dict_util.c.
Here is the call graph for this function:Callback to automatically free a dictionary when the module is unloaded.
| [in] | module | being loaded. |
| [in] | symbol | An array of fr_dict_autoload_t to load. |
| [in] | user_ctx | unused. |
Definition at line 4632 of file dict_util.c.
Callback to automatically load dictionaries required by modules.
| [in] | module | being loaded. |
| [in] | symbol | An array of fr_dict_autoload_t to load. |
| [in] | user_ctx | unused. |
Definition at line 4619 of file dict_util.c.
Callback to automatically resolve enum values.
| [in] | module | being loaded. |
| [in] | symbol | An array of fr_dict_enum_autoload_t to load. |
| [in] | user_ctx | unused. |
Definition at line 4587 of file dict_util.c.
Here is the call graph for this function:
|
static |
Definition at line 117 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_gctx_t* dict_gctx = NULL |
Top level structure containing global dictionary state.
Definition at line 42 of file dict_util.c.
|
static |
Default protocol rules set for every dictionary.
This is usually overriden by the public symbol from the protocol library associated with the dictionary e.g. libfreeradius-dhcpv6.so -> libfreeradius_dhcpv6_dict_protocol.
Definition at line 103 of file dict_util.c.
Characters allowed in a single dictionary attribute name.
Definition at line 64 of file dict_util.c.
Characters allowed in a nested dictionary attribute name.
Definition at line 71 of file dict_util.c.
Characters allowed in enumeration value names.
Characters that are allowed in dictionary enumeration value names.
Definition at line 79 of file dict_util.c.
1.9.8