The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Functions
dict_fixup_priv.h File Reference

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>
+ Include dependency graph for dict_fixup_priv.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dict_fixup_ctx_t
 

Functions

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...
 
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...
 
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...
 
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...
 

Detailed Description

Functions to finalise and fixup dictionaries.

Definition in file dict_fixup_priv.h.


Data Structure Documentation

◆ dict_fixup_ctx_t

struct dict_fixup_ctx_t

Definition at line 32 of file dict_fixup_priv.h.

+ Collaboration diagram for dict_fixup_ctx_t:
Data Fields
fr_dlist_head_t clone Clone 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.

Function Documentation

◆ dict_fixup_apply()

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.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dict_fixup_clone()

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.

Parameters
[in]fctxHolds current dictionary parsing information.
[in]filenamethis fixup relates to.
[in]linethis fixup relates to.
[in]parentfor the cloned attribute.
[in]daThe group dictionary attribute.
[in]refOID string representing what the group references.
[in]ref_lenLength of the reference string.
Returns
  • 0 on success.
  • -1 on out of memory.

Definition at line 383 of file dict_fixup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dict_fixup_enumv()

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.

Parameters
[in]fctxHolds current dictionary parsing information.
[in]filenamethis fixup relates to.
[in]linethis fixup relates to.
[in]attrThe OID string pointing to the attribute to add the enumeration value to.
[in]attr_lenThe length of the attr string.
[in]nameThe name of the enumv.
[in]name_lenLength of the name string.
[in]valueValue string. This is kept as a string until we know what type we want to transform it into.
[in]value_lenLength of the value string.
[in]parentof this attribute.
Returns
  • 0 on success.
  • -1 on out of memory.

Definition at line 127 of file dict_fixup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dict_fixup_group()

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.

Parameters
[in]fctxHolds current dictionary parsing information.
[in]filenamethis fixup relates to.
[in]linethis fixup relates to.
[in]daThe group dictionary attribute.
[in]refOID string representing what the group references.
Returns
  • 0 on success.
  • -1 on out of memory.

Definition at line 209 of file dict_fixup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dict_fixup_init()

int dict_fixup_init ( TALLOC_CTX *  ctx,
dict_fixup_ctx_t fctx 
)

Initialise a fixup ctx.

Parameters
[in]ctxto allocate the fixup pool in.
[in]fctxto initialise.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 597 of file dict_fixup.c.

+ Here is the caller graph for this function:

◆ dict_hash_tables_finalise()

void dict_hash_tables_finalise ( fr_dict_t dict)

Walk a dictionary finalising the hash tables in all attributes with a distinct namespace.

Parameters
[in]dictto finalise namespaces for.

Definition at line 674 of file dict_fixup.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: