![]() |
The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
|
Private Multi-protocol AVP dictionary API. More...
#include <freeradius-devel/protocol/base.h>#include <freeradius-devel/util/dict.h>#include <freeradius-devel/util/dict_ext_priv.h>#include <freeradius-devel/util/dl.h>#include <freeradius-devel/util/hash.h>#include <freeradius-devel/util/value.h>
Include dependency graph for dict_priv.h:Go to the source code of this file.
Data Structures | |
| struct | dict_attr_args_t |
| Optional arguments for initialising/allocating attributes. More... | |
| struct | fr_dict_dependent_t |
| Entry recording dictionary reference holders by file. More... | |
| struct | fr_dict_filename_src_t |
| One load or $INCLUDE of a dictionary file. More... | |
| struct | fr_dict_filename_t |
| Entry in the table of files associated with this dictionary. More... | |
| struct | fr_dict_gctx_s |
| struct | fr_dict_s |
| Vendors and attribute names. More... | |
Macros | |
| #define | _DICT_PRIVATE 1 |
| #define | DICT_FIXUP_POOL_SIZE (1024) |
| #define | DICT_POOL_SIZE (1024 * 1024 * 2) |
| #define | INTERNAL_IF_NULL(_dict, _ret) |
| Set the internal dictionary if none was provided. | |
Enumerations | |
| enum | fr_dict_protocol_id_t : uint8_t { FR_DICT_PROTO_RADIUS = 1 , FR_DICT_PROTO_DHCPv4 = 2 , FR_DICT_PROTO_DHCPv6 = 3 , FR_DICT_PROTO_ETHERNET = 4 , FR_DICT_PROTO_TACACS = 5 , FR_DICT_PROTO_VMPS = 6 , FR_DICT_PROTO_SNMP = 7 , FR_DICT_PROTO_ARP = 8 , FR_DICT_PROTO_TFTP = 9 , FR_DICT_PROTO_TLS = 10 , FR_DICT_PROTO_DNS = 11 , FR_DICT_PROTO_LDAP = 12 , FR_DICT_PROTO_BFD = 13 , FR_DICT_PROTO_CRL = 14 } |
Functions | |
| fr_dict_t * | dict_alloc (TALLOC_CTX *ctx, size_t pool_size) |
| 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 *new_name) |
| Copy a an existing attribute, possibly to a new location. | |
| int | dict_attr_acopy_aliases (fr_dict_attr_t *dst, fr_dict_attr_t const *src) |
| Copy aliases of an existing attribute to a new one. | |
| 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. | |
| int | dict_attr_alias_add (fr_dict_attr_t const *parent, char const *alias, fr_dict_attr_t const *ref, bool from_public) |
| Add an alias to an existing 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. | |
| int | dict_attr_enum_add_name (fr_dict_attr_t *da, char const *name, fr_value_box_t const *value, bool coerce, bool replace, fr_dict_attr_t const *child_struct) |
| bool | dict_attr_flags_valid (fr_dict_attr_t *da)) |
| Validate a set of flags. | |
| bool | dict_attr_valid (fr_dict_attr_t *da) |
| Validate a new attribute definition. | |
| 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) |
| bool | dict_has_dependents (fr_dict_t *dict) |
| Check if a dictionary still has dependents. | |
| int | dict_protocol_add (fr_dict_t *dict) |
| Add a protocol to the global protocol table. | |
| int | dict_vendor_add (fr_dict_t *dict, char const *name, unsigned int num) |
| Add a vendor to the dictionary. | |
| int | fr_dict_afrom_file (fr_dict_t **out, char const *dir, char const *filename)) |
| Load one dictionary file. | |
Variables | |
| fr_dict_gctx_t * | dict_gctx |
| Top level structure containing global dictionary state. | |
| 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 attr, dict_attr_args_t const *args)) |
| Allocate a dictionary root attribute on the heap. | |
| 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. | |
| #define | dict_attr_alloc(_ctx, _parent, _name, _attr, _type, _args) _dict_attr_alloc(__FILE__, __LINE__, _ctx, _parent, _name, _attr, _type, (_args)) |
| #define | dict_attr_alloc_root(_ctx, _dict, _name, _attr, _args) _dict_attr_alloc_root(__FILE__, __LINE__, _ctx, _dict, _name, _attr, _args) |
| #define | dict_attr_init(_da_p, _parent, _name, _attr, _type, _args) _dict_attr_init(__FILE__, __LINE__, _da_p, _parent, _name, _attr, _type, _args) |
| Full initialisation functions. | |
| #define | dict_attr_init_name_only(_da_p, _parent, _name, _type, _args) _dict_attr_init_name_only(__FILE__, __LINE__, _da_p, _parent, _name, _type, _args) |
| fr_dict_attr_t * | dict_attr_alloc_null (TALLOC_CTX *ctx, fr_dict_protocol_t const *dict) |
| Partial initialisation functions. | |
| int | dict_attr_finalise (fr_dict_attr_t **da_p, char const *name) |
| Set remaining fields in a dictionary attribute before insertion. | |
| void | dict_attr_location_init (fr_dict_t *dict, fr_dict_attr_t *da, char const *filename, int line) |
| Set where the dictionary attribute was defined. | |
| 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. | |
| int | dict_attr_type_init (fr_dict_attr_t **da_p, fr_type_t type) |
| Initialise type specific fields within the dictionary attribute. | |
| fr_dict_filename_t * | dict_filename_intern (fr_dict_t *dict, char const *filename) |
| Return the table entry for a filename, creating the entry if the filename is not in the table. | |
Private Multi-protocol AVP dictionary API.
Definition in file dict_priv.h.
| struct dict_attr_args_t |
Optional arguments for initialising/allocating attributes.
Definition at line 216 of file dict_priv.h.
Collaboration diagram for dict_attr_args_t:| Data Fields | ||
|---|---|---|
| fr_dict_attr_flags_t const * | flags | Any flags to assign to the attribute. |
| fr_dict_attr_t const * | ref | This attribute is a reference to another attribute. |
| struct fr_dict_dependent_t |
Entry recording dictionary reference holders by file.
Definition at line 58 of file dict_priv.h.
Collaboration diagram for fr_dict_dependent_t:| Data Fields | ||
|---|---|---|
| int | count |
How many references are held by this file. Signed to help figure out when things go wrong... |
| char const * | dependent | File holding the reference. |
| fr_rb_node_t | node | |
| struct fr_dict_filename_src_t |
One load or $INCLUDE of a dictionary file.
Definition at line 68 of file dict_priv.h.
Collaboration diagram for fr_dict_filename_src_t:| Data Fields | ||
|---|---|---|
| fr_dlist_t | entry | Entry in the file's list of sources. |
| char const * | src_file |
File which did the $INCLUDE. NULL for a top-level load. |
| int | src_line | Line of the $INCLUDE in src_file. |
| struct fr_dict_filename_t |
Entry in the table of files associated with this dictionary.
Mainly used for debugging.
Definition at line 80 of file dict_priv.h.
Collaboration diagram for fr_dict_filename_t:| Data Fields | ||
|---|---|---|
| char * | filename | Name of the file the dictionary was loaded from. |
| uint16_t | id |
Ordinal of this file within the dictionary. fr_dict_attr_t stores the id instead of a pointer, which keeps the attribute struct within one cache line. Id 0 is reserved for "no location recorded". |
| fr_dlist_head_t | sources | Each load or $INCLUDE of the file. |
| struct fr_dict_gctx_s |
Definition at line 149 of file dict_priv.h.
Collaboration diagram for fr_dict_gctx_s:| Data Fields | ||
|---|---|---|
| fr_dict_attr_t const * | attr_protocol_encapsulation | |
| char * | dict_dir_default | The default location for loading dictionaries if one wasn't provided. |
| dl_loader_t * | dict_loader | for protocol validation |
| bool | free_at_exit | This gctx will be freed on exit. |
| fr_dict_t * | internal |
Magic internal dictionary. Internal dictionary is checked in addition to the protocol dictionary when resolving attribute names. This is because internal attributes are valid for every protocol. |
| bool | perm_check | Whether we should check dictionary file permissions as they're loaded. |
| size_t | pool_size_min |
Smallest pool, in bytes, that dict_alloc() creates. dict_alloc() uses pool_size_min in place of any smaller pool= on a PROTOCOL line. |
| fr_hash_table_t * | protocol_by_name | Hash containing names of all the registered protocols. |
| fr_hash_table_t * | protocol_by_num | Hash containing numbers of all the registered protocols. |
| bool | read_only | |
| struct fr_dict_s |
Vendors and attribute names.
It's very likely that the same vendors will operate in multiple protocol spaces, but number their attributes differently, so we need per protocol dictionaries.
There would also be conflicts for DHCP(v6)/RADIUS attributes etc...
Definition at line 98 of file dict_priv.h.
Collaboration diagram for fr_dict_s:| Data Fields | ||
|---|---|---|
| fr_hash_table_t * | autoref | other dictionaries that we loaded via references |
| fr_rb_tree_t * | dependents | Which files are using this dictionary. |
| char const * | dir | where this protocol is located |
| dl_t * | dl | for validation |
| fr_dict_filename_t ** | filename_by_id | Files indexed by id - 1, for resolving attribute definition locations. |
| fr_hash_table_t * | filenames | Files that this dictionary was loaded from, keyed by filename. |
| fr_dict_attr_t ** | fixups | Attributes that need fixing up. |
| fr_dict_gctx_t * | gctx | Global dictionary context this dictionary was allocated in. |
| bool | in_protocol_by_name | Whether the dictionary has been inserted into the protocol_by_name hash. |
| bool | in_protocol_by_num | Whether the dictionary has been inserted into the protocol_by_num table. |
| bool | loaded | from fr_dict_protocol_afrom_file(); |
| bool | loading | from fr_dict_protocol_afrom_file(); |
| fr_dict_t const * | next | for attribute overloading |
| TALLOC_CTX * | pool |
Talloc memory pool to reduce allocs. in the dictionary. |
| size_t | pool_size |
Size of the talloc pool in bytes. talloc has no function that returns the size of a pool, so dict_alloc() records the size. |
| fr_dict_protocol_t const * | proto | protocol-specific validation functions |
| bool | read_only | If true, disallow modifications. |
| fr_dict_attr_t * | root | Root attribute of this dictionary. |
| bool | string_based | TACACS, etc. |
| fr_hash_table_t * | vendors_by_name | Lookup vendor by name. |
| fr_hash_table_t * | vendors_by_num | Lookup vendor by PEN. |
| unsigned int | vsa_parent | varies with different protocols. |
| #define _DICT_PRIVATE 1 |
Definition at line 28 of file dict_priv.h.
| #define dict_attr_alloc | ( | _ctx, | |
| _parent, | |||
| _name, | |||
| _attr, | |||
| _type, | |||
| _args | |||
| ) | _dict_attr_alloc(__FILE__, __LINE__, _ctx, _parent, _name, _attr, _type, (_args)) |
Definition at line 281 of file dict_priv.h.
| #define dict_attr_alloc_root | ( | _ctx, | |
| _dict, | |||
| _name, | |||
| _attr, | |||
| _args | |||
| ) | _dict_attr_alloc_root(__FILE__, __LINE__, _ctx, _dict, _name, _attr, _args) |
Definition at line 273 of file dict_priv.h.
| #define dict_attr_init | ( | _da_p, | |
| _parent, | |||
| _name, | |||
| _attr, | |||
| _type, | |||
| _args | |||
| ) | _dict_attr_init(__FILE__, __LINE__, _da_p, _parent, _name, _attr, _type, _args) |
Full initialisation functions.
These functions either initialise, or allocate and then initialise a complete dictionary attribute.
The output of these functions can be added into a dictionary immediately
Definition at line 257 of file dict_priv.h.
| #define dict_attr_init_name_only | ( | _da_p, | |
| _parent, | |||
| _name, | |||
| _type, | |||
| _args | |||
| ) | _dict_attr_init_name_only(__FILE__, __LINE__, _da_p, _parent, _name, _type, _args) |
Definition at line 265 of file dict_priv.h.
| #define DICT_FIXUP_POOL_SIZE (1024) |
Definition at line 38 of file dict_priv.h.
| #define DICT_POOL_SIZE (1024 * 1024 * 2) |
Definition at line 37 of file dict_priv.h.
| #define INTERNAL_IF_NULL | ( | _dict, | |
| _ret | |||
| ) |
Set the internal dictionary if none was provided.
| _dict | Dict pointer to check/set. |
| _ret | Value to return if no dictionaries are available. |
Definition at line 45 of file dict_priv.h.
| enum fr_dict_protocol_id_t : uint8_t |
Definition at line 184 of file dict_priv.h.
| 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 1113 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 1079 of file dict_util.c.
Here is the call 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 939 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 986 of file dict_util.c.
Here is the call graph for this function:Allocate a new dictionary.
| [in] | ctx | to allocate dictionary in. |
| [in] | pool_size | of the talloc pool that holds the dictionary's attributes, in bytes. |
Definition at line 4300 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 1142 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 | ( | 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 1372 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 1240 of file dict_util.c.
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 1337 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 1828 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, | ||
| bool | from_public | ||
| ) |
Add an alias to an existing attribute.
Definition at line 1453 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 | ||
| ) |
Partial initialisation functions.
These functions are used to initialise attributes in stages, i.e. when parsing a dictionary.
The finalise function must be called to complete the initialisation.
All functions must be called to fully initialise a dictionary attribute, except dict_attr_parent_init this is not necessary for root attributes.
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 1038 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 3554 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 1704 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 1729 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 3620 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 | replace, | ||
| fr_dict_attr_t const * | child_struct | ||
| ) |
Definition at line 2073 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 807 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| bool dict_attr_flags_valid | ( | fr_dict_attr_t * | da | ) |
Validate a set of flags.
| [in] | da | to check. |
Definition at line 35 of file dict_validate.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void dict_attr_location_init | ( | fr_dict_t * | dict, |
| fr_dict_attr_t * | da, | ||
| char const * | filename, | ||
| int | line | ||
| ) |
Set where the dictionary attribute was defined.
The dict may be NULL when the attribute has no dictionary yet, in which case no location is recorded, and fr_dict_attr_filename() returns "<unknown>" for the attribute.
Definition at line 774 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 690 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 708 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 608 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 523 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| bool dict_attr_valid | ( | fr_dict_attr_t * | da | ) |
Validate a new attribute definition.
| [in] | da | to validate. |
Definition at line 642 of file dict_validate.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 2865 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 2829 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 2847 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 2732 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 4059 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 4118 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 3968 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_dict_filename_t * dict_filename_intern | ( | fr_dict_t * | dict, |
| char const * | filename | ||
| ) |
Return the table entry for a filename, creating the entry if the filename is not in the table.
Definition at line 726 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 4150 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 1561 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 1634 of file dict_util.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int fr_dict_afrom_file | ( | fr_dict_t ** | out, |
| char const * | dir, | ||
| char const * | filename | ||
| ) |
Load one dictionary file.
| [out] | out | Where to write a pointer to the new dictionary. Will free existing dictionary if files have changed and *out is not NULL. |
| [in] | dir | directory |
| [in] | filename | file to load. |
Definition at line 4143 of file dict_tokenize.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
extern |
Top level structure containing global dictionary state.
Definition at line 41 of file dict_util.c.
1.9.8