The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Code to apply fctx and finalisation steps to a dictionary. More...
#include <freeradius-devel/util/talloc.h>
#include <freeradius-devel/util/file.h>
#include "dict_fixup_priv.h"
Go to the source code of this file.
Data Structures | |
struct | dict_fixup_clone_t |
Clone operation from one tree node to another. More... | |
struct | dict_fixup_common_t |
Common fields for every fixup structure. More... | |
struct | dict_fixup_enumv_t |
Add an enumeration value to an attribute that wasn't defined at the time the value was parsed. More... | |
struct | dict_fixup_group_t |
Resolve a group reference. More... | |
struct | dict_fixup_hash_t |
Dictionary attribute namespaces need their hash tables finalised. More... | |
Macros | |
#define | APPLY_FIXUP(_fctx, _list, _func, _type) |
Functions | |
static int | _dict_attr_fixup_hash_tables (fr_dict_attr_t const *da, UNUSED void *uctx) |
Fixup all hash tables in the dictionary so they're suitable for threaded access. More... | |
int | dict_fixup_apply (dict_fixup_ctx_t *fctx) |
Apply all outstanding fixes to a set of dictionaries. More... | |
int | dict_fixup_clone (dict_fixup_ctx_t *fctx, char const *filename, int line, fr_dict_attr_t *parent, fr_dict_attr_t *da, char const *ref, size_t ref_len) |
Clone one area of a tree into another. More... | |
static int | dict_fixup_clone_apply (UNUSED dict_fixup_ctx_t *fctx, dict_fixup_clone_t *fixup) |
Clone one are of a tree into another. More... | |
static int | dict_fixup_common (char const *filename, int line, fr_dlist_head_t *fixup_list, dict_fixup_common_t *common) |
Initialise common fields in fixup struct, and add it to a fixup list. More... | |
int | dict_fixup_enumv (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... | |
static int | dict_fixup_enumv_apply (UNUSED dict_fixup_ctx_t *fctx, dict_fixup_enumv_t *fixup) |
Add a previously defined enumeration value to an existing attribute. More... | |
int | dict_fixup_group (dict_fixup_ctx_t *fctx, char const *filename, int line, fr_dict_attr_t *da, char const *ref) |
Resolve a group reference. More... | |
static int | dict_fixup_group_apply (UNUSED dict_fixup_ctx_t *fctx, dict_fixup_group_t *fixup) |
Resolve a group reference. More... | |
int | dict_fixup_init (TALLOC_CTX *ctx, dict_fixup_ctx_t *fctx) |
Initialise a fixup ctx. 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... | |
static fr_dict_attr_t const * | dict_protocol_reference (fr_dict_t **dict_def, char const *ref, char const *filename, int line) |
Code to apply fctx and finalisation steps to a dictionary.
Definition in file dict_fixup.c.
struct dict_fixup_clone_t |
Clone operation from one tree node to another.
Definition at line 67 of file dict_fixup.c.
Data Fields | ||
---|---|---|
dict_fixup_common_t | common | Common fields. |
fr_dict_attr_t * | da | FR_TYPE_TLV to clone. |
fr_dict_attr_t * | parent | parent where we add the clone |
char * | ref | the target attribute to clone |
struct dict_fixup_common_t |
Common fields for every fixup structure.
Definition at line 33 of file dict_fixup.c.
Data Fields | ||
---|---|---|
fr_dlist_t | entry | Entry in linked list of fctx. |
char * | filename | where the line being fixed up. |
int | line | ditto. |
struct dict_fixup_enumv_t |
Add an enumeration value to an attribute that wasn't defined at the time the value was parsed.
Definition at line 43 of file dict_fixup.c.
Data Fields | ||
---|---|---|
char * | attribute | we couldn't find (and will need to resolve later). |
dict_fixup_common_t | common | Common fields. |
char * | name | Raw enum name. |
fr_dict_attr_t const * | parent | Parent attribute to resolve the 'attribute' string in. |
char * | value |
Raw enum value. We can't do anything with this until we know the attribute type, which we only find out later. |
struct dict_fixup_group_t |
Resolve a group reference.
Definition at line 57 of file dict_fixup.c.
Data Fields | ||
---|---|---|
dict_fixup_common_t | common | Common fields. |
fr_dict_attr_t * | da | FR_TYPE_GROUP to fix. |
char * | ref | the reference name |
struct dict_fixup_hash_t |
Dictionary attribute namespaces need their hash tables finalised.
Definition at line 78 of file dict_fixup.c.
Data Fields | ||
---|---|---|
dict_fixup_common_t | common | Common fields. |
fr_hash_table_t * | hash | We need to finalise. |
#define APPLY_FIXUP | ( | _fctx, | |
_list, | |||
_func, | |||
_type | |||
) |
|
static |
Fixup all hash tables in the dictionary so they're suitable for threaded access.
Definition at line 648 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 614 of file dict_fixup.c.
int dict_fixup_clone | ( | dict_fixup_ctx_t * | fctx, |
char const * | filename, | ||
int | line, | ||
fr_dict_attr_t * | parent, | ||
fr_dict_attr_t * | da, | ||
char const * | ref, | ||
size_t | ref_len | ||
) |
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] | filename | this fixup relates to. |
[in] | line | this fixup relates to. |
[in] | parent | for the cloned attribute. |
[in] | da | The group dictionary attribute. |
[in] | ref | OID string representing what the group references. |
[in] | ref_len | Length of the reference string. |
Definition at line 383 of file dict_fixup.c.
|
inlinestatic |
Clone one are of a tree into another.
[in] | fctx | Holds current dictionary parsing information. |
[in] | fixup | Containing source/destination of the clone. |
Definition at line 417 of file dict_fixup.c.
|
inlinestatic |
Initialise common fields in fixup struct, and add it to a fixup list.
[in] | filename | this fixup relates to. |
[in] | line | this fixup relates to. |
[in] | fixup_list | to add fixup to. |
[in] | common | common header to populate. |
Definition at line 94 of file dict_fixup.c.
int dict_fixup_enumv | ( | 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 127 of file dict_fixup.c.
|
inlinestatic |
Add a previously defined enumeration value to an existing attribute.
[in] | fctx | Holds current dictionary parsing information. |
[in] | fixup | Hash table to fill. |
Definition at line 160 of file dict_fixup.c.
int dict_fixup_group | ( | dict_fixup_ctx_t * | fctx, |
char const * | filename, | ||
int | line, | ||
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] | filename | this fixup relates to. |
[in] | line | this fixup relates to. |
[in] | da | The group dictionary attribute. |
[in] | ref | OID string representing what the group references. |
Definition at line 209 of file dict_fixup.c.
|
inlinestatic |
Resolve a group reference.
[in] | fctx | Holds current dictionary parsing information. |
[in] | fixup | Hash table to fill. |
Definition at line 327 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 597 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 674 of file dict_fixup.c.
|
static |
Definition at line 227 of file dict_fixup.c.