The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Functions to finalise and fixup dictionaries. More...
#include <freeradius-devel/util/dict_priv.h>
#include <freeradius-devel/util/dlist.h>
#include <freeradius-devel/util/talloc.h>
#include <freeradius-devel/util/value.h>
Go to the source code of this file.
Data Structures | |
struct | dict_fixup_ctx_t |
Functions | |
int | dict_fixup_alias_enqueue (dict_fixup_ctx_t *fctx, char const *filename, int line, fr_dict_attr_t *alias_parent, char const *alias, fr_dict_attr_t *ref_parent, char const *ref) |
Resolve a group reference. More... | |
int | dict_fixup_apply (dict_fixup_ctx_t *fctx) |
Apply all outstanding fixes to a set of dictionaries. More... | |
int | dict_fixup_clone (fr_dict_attr_t **dst_p, fr_dict_attr_t const *src) |
Clone a dictionary attribute from a ref. More... | |
int | dict_fixup_clone_enqueue (dict_fixup_ctx_t *fctx, fr_dict_attr_t *da, char const *ref) |
Clone one area of a tree into another. More... | |
int | dict_fixup_clone_enum_enqueue (dict_fixup_ctx_t *fctx, fr_dict_attr_t *da, char const *ref) |
Clone enumeration values from one attribute to another. More... | |
int | dict_fixup_enumv_enqueue (dict_fixup_ctx_t *fctx, char const *filename, int line, char const *attr, size_t attr_len, char const *name, size_t name_len, char const *value, size_t value_len, fr_dict_attr_t const *parent) |
Add an enumeration value to an attribute which has not yet been defined. More... | |
int | dict_fixup_group_enqueue (dict_fixup_ctx_t *fctx, fr_dict_attr_t *da, char const *ref) |
Resolve a group reference. More... | |
int | dict_fixup_init (TALLOC_CTX *ctx, dict_fixup_ctx_t *fctx) |
Initialise a fixup ctx. More... | |
int | dict_fixup_vsa_enqueue (dict_fixup_ctx_t *fctx, fr_dict_attr_t *da) |
Push a fixup for a VSA. More... | |
void | dict_hash_tables_finalise (fr_dict_t *dict) |
Walk a dictionary finalising the hash tables in all attributes with a distinct namespace. More... | |
fr_dict_attr_t const * | dict_protocol_reference (fr_dict_attr_t const *root, char const *ref) |
Resolve a ref= or copy= value to a dictionary. More... | |
Functions to finalise and fixup dictionaries.
Definition in file dict_fixup_priv.h.
struct dict_fixup_ctx_t |
Definition at line 32 of file dict_fixup_priv.h.
Data Fields | ||
---|---|---|
fr_dlist_head_t | alias | Aliases that can't be resolved immediately. |
fr_dlist_head_t | clone | Clone operation to apply. |
fr_dlist_head_t | clone_enum | Clone enum operation to apply. |
fr_dlist_head_t | enumv | Raw enumeration values to add. |
fr_dlist_head_t | group | Group references to resolve. |
TALLOC_CTX * | pool | Temporary pool for fixups, reduces holes. |
fr_dlist_head_t | vsa | VSAs to add vendors for. |
int dict_fixup_alias_enqueue | ( | dict_fixup_ctx_t * | fctx, |
char const * | filename, | ||
int | line, | ||
fr_dict_attr_t * | alias_parent, | ||
char const * | alias, | ||
fr_dict_attr_t * | ref_parent, | ||
char const * | ref | ||
) |
Resolve a group reference.
This is required as the reference may point to another dictionary which hasn't been loaded yet.
[in] | fctx | Holds current dictionary parsing information. |
[in] | filename | this fixup relates to. |
[in] | line | this fixup relates to. |
[in] | alias_parent | where to add the alias. |
[in] | alias | alias to add. |
[in] | ref_parent | attribute that should contain the reference. |
[in] | ref | OID string representing what the group references. |
Definition at line 754 of file dict_fixup.c.
int dict_fixup_apply | ( | dict_fixup_ctx_t * | fctx | ) |
Apply all outstanding fixes to a set of dictionaries.
Definition at line 824 of file dict_fixup.c.
int dict_fixup_clone | ( | fr_dict_attr_t ** | dst_p, |
fr_dict_attr_t const * | src | ||
) |
Clone a dictionary attribute from a ref.
[in] | dst_p | will either be inserted directly, with fields from the clone, or will be cloned, and then inserted. In this case the original dst da will be freed and the new cloned attribute will be written back to dst_p. |
[in] | src | to clone. |
Definition at line 416 of file dict_fixup.c.
int dict_fixup_clone_enqueue | ( | dict_fixup_ctx_t * | fctx, |
fr_dict_attr_t * | da, | ||
char const * | ref | ||
) |
Clone one area of a tree into another.
These must be processed later to ensure that we've finished building an attribute by the time it has been cloned.
[in] | fctx | Holds current dictionary parsing information. |
[in] | da | The group dictionary attribute. |
[in] | ref | OID string representing what the group references.. |
Definition at line 383 of file dict_fixup.c.
int dict_fixup_clone_enum_enqueue | ( | dict_fixup_ctx_t * | fctx, |
fr_dict_attr_t * | da, | ||
char const * | ref | ||
) |
Clone enumeration values from one attribute to another.
These must be processed later to ensure that we've finished building an attribute by the time it has been cloned.
[in] | fctx | Holds current dictionary parsing information. |
[in] | da | The group dictionary attribute. |
[in] | ref | OID string representing what the group references.. |
Definition at line 592 of file dict_fixup.c.
int dict_fixup_enumv_enqueue | ( | dict_fixup_ctx_t * | fctx, |
char const * | filename, | ||
int | line, | ||
char const * | attr, | ||
size_t | attr_len, | ||
char const * | name, | ||
size_t | name_len, | ||
char const * | value, | ||
size_t | value_len, | ||
fr_dict_attr_t const * | parent | ||
) |
Add an enumeration value to an attribute which has not yet been defined.
[in] | fctx | Holds current dictionary parsing information. |
[in] | filename | this fixup relates to. |
[in] | line | this fixup relates to. |
[in] | attr | The OID string pointing to the attribute to add the enumeration value to. |
[in] | attr_len | The length of the attr string. |
[in] | name | The name of the enumv. |
[in] | name_len | Length of the name string. |
[in] | value | Value string. This is kept as a string until we know what type we want to transform it into. |
[in] | value_len | Length of the value string. |
[in] | parent | of this attribute. |
Definition at line 235 of file dict_fixup.c.
int dict_fixup_group_enqueue | ( | dict_fixup_ctx_t * | fctx, |
fr_dict_attr_t * | da, | ||
char const * | ref | ||
) |
Resolve a group reference.
This is required as the reference may point to another dictionary which hasn't been loaded yet.
[in] | fctx | Holds current dictionary parsing information. |
[in] | da | The group dictionary attribute. |
[in] | ref | OID string representing what the group references. |
Definition at line 319 of file dict_fixup.c.
int dict_fixup_init | ( | TALLOC_CTX * | ctx, |
dict_fixup_ctx_t * | fctx | ||
) |
Initialise a fixup ctx.
[in] | ctx | to allocate the fixup pool in. |
[in] | fctx | to initialise. |
Definition at line 805 of file dict_fixup.c.
int dict_fixup_vsa_enqueue | ( | dict_fixup_ctx_t * | fctx, |
fr_dict_attr_t * | da | ||
) |
Push a fixup for a VSA.
This is required so that we can define VENDORs for all VSAs, even if the dictionary doesn't contain VENDOR children for that VSA. This fixup means that we can define VENDORs elsewhere, and then use them in all VSA definitions. It means that we don't have to do these lookups at run-time.
[in] | fctx | Holds current dictionary parsing information. |
[in] | da | The group dictionary attribute. |
Definition at line 694 of file dict_fixup.c.
void dict_hash_tables_finalise | ( | fr_dict_t * | dict | ) |
Walk a dictionary finalising the hash tables in all attributes with a distinct namespace.
[in] | dict | to finalise namespaces for. |
Definition at line 891 of file dict_fixup.c.
fr_dict_attr_t const* dict_protocol_reference | ( | fr_dict_attr_t const * | root, |
char const * | ref | ||
) |
Resolve a ref= or copy= value to a dictionary.
Definition at line 130 of file dict_fixup.c.