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

Multi-protocol AVP dictionary API. More...

#include <freeradius-devel/util/dict.h>
#include <freeradius-devel/util/ext.h>
#include <freeradius-devel/util/hash.h>
#include <limits.h>
+ Include dependency graph for dict_ext.h:

Go to the source code of this file.

Data Structures

struct  fr_dict_attr_ext_children_t
 Attribute extension - Holds children for an attribute. More...
 
struct  fr_dict_attr_ext_da_stack_t
 Attribute extension - Stack of dictionary attributes that describe the path back to the root of the dictionary. More...
 
struct  fr_dict_attr_ext_enumv_t
 Attribute extension - Holds enumeration values. More...
 
struct  fr_dict_attr_ext_namespace_t
 Attribute extension - Holds a hash table with the names of all children of this attribute. More...
 
struct  fr_dict_attr_ext_ref_t
 Attribute extension - Holds a reference to an attribute in another dictionary. More...
 
struct  fr_dict_attr_ext_vendor_t
 Attribute extension - Cached vendor pointer. More...
 
struct  fr_dict_enum_ext_union_ref_t
 Enum extension - Sub-struct or union pointer. More...
 

Functions

void fr_dict_attr_ext_debug (fr_dict_attr_t const *da)
 

Variables

fr_ext_t const fr_dict_attr_ext_def
 Holds additional information about extension structures. More...
 
fr_ext_t const fr_dict_enum_ext_def
 Holds additional information about extension structures. More...
 

Add extension structures to attributes

static fr_dict_attr_t const ** fr_dict_attr_da_stack (fr_dict_attr_t const *da)
 Return the cached da stack (if any) associated with an attribute. More...
 
static void * fr_dict_attr_ext (fr_dict_attr_t const *da, fr_dict_attr_ext_t ext)
 
static bool fr_dict_attr_has_ext (fr_dict_attr_t const *da, fr_dict_attr_ext_t ext)
 Return whether a da has a given extension or not. More...
 
static fr_dict_attr_t const * fr_dict_attr_ref (fr_dict_attr_t const *da)
 Return the reference associated with a group type attribute. More...
 
static fr_dict_attr_t const * fr_dict_vendor_da_by_da (fr_dict_attr_t const *da)
 Return the vendor da for an attribute. More...
 
static uint32_t fr_dict_vendor_num_by_da (fr_dict_attr_t const *da)
 Return the vendor number for an attribute. More...
 

Detailed Description

Multi-protocol AVP dictionary API.

Definition in file dict_ext.h.


Data Structure Documentation

◆ fr_dict_attr_ext_children_t

struct fr_dict_attr_ext_children_t

Attribute extension - Holds children for an attribute.

Children are possible for:

FR_TYPE_TLV, FR_TYPE_VENDOR, FR_TYPE_VSA, FR_TYPE_STRUCT

or where the parent->parent->type is FR_TYPE_STRUCT, and "parent" is a "key" field. Note that these attributes therefore cannot have VALUEs, as the child defines their VALUE. See dict_attr_can_have_children() for details.

Definition at line 52 of file dict_ext.h.

+ Collaboration diagram for fr_dict_attr_ext_children_t:
Data Fields
fr_hash_table_t * child_by_name Namespace at this level in the hierarchy.
fr_dict_attr_t const ** children Children of this attribute.

◆ fr_dict_attr_ext_da_stack_t

struct fr_dict_attr_ext_da_stack_t

Attribute extension - Stack of dictionary attributes that describe the path back to the root of the dictionary.

Definition at line 74 of file dict_ext.h.

+ Collaboration diagram for fr_dict_attr_ext_da_stack_t:
Data Fields
fr_dict_attr_t const * da_stack[] Stack of dictionary attributes.
bool unused Zero length arrays are apparently GNU extensions and we're not allowed to have structs with a single variable array as its member.

We'll likely want to store something else here at some point, so we just have a dummy field to avoid changing all the code.

◆ fr_dict_attr_ext_enumv_t

struct fr_dict_attr_ext_enumv_t

Attribute extension - Holds enumeration values.

Definition at line 87 of file dict_ext.h.

+ Collaboration diagram for fr_dict_attr_ext_enumv_t:
Data Fields
size_t max_name_len maximum length of a name
fr_hash_table_t * name_by_value Lookup a name by value.
fr_hash_table_t * value_by_name Lookup an enumeration value by name.

◆ fr_dict_attr_ext_namespace_t

struct fr_dict_attr_ext_namespace_t

Attribute extension - Holds a hash table with the names of all children of this attribute.

Definition at line 96 of file dict_ext.h.

◆ fr_dict_attr_ext_ref_t

struct fr_dict_attr_ext_ref_t

Attribute extension - Holds a reference to an attribute in another dictionary.

Definition at line 60 of file dict_ext.h.

+ Collaboration diagram for fr_dict_attr_ext_ref_t:
Data Fields
fr_dict_attr_t const * ref reference, only for FR_TYPE_GROUP

◆ fr_dict_attr_ext_vendor_t

struct fr_dict_attr_ext_vendor_t

Attribute extension - Cached vendor pointer.

Definition at line 67 of file dict_ext.h.

+ Collaboration diagram for fr_dict_attr_ext_vendor_t:
Data Fields
fr_dict_attr_t const * vendor ancestor which has type FR_TYPE_VENDOR

◆ fr_dict_enum_ext_union_ref_t

struct fr_dict_enum_ext_union_ref_t

Enum extension - Sub-struct or union pointer.

Definition at line 103 of file dict_ext.h.

+ Collaboration diagram for fr_dict_enum_ext_union_ref_t:
Data Fields
fr_dict_attr_t const * union_ref The union da this value points into.

Function Documentation

◆ fr_dict_attr_da_stack()

static fr_dict_attr_t const** fr_dict_attr_da_stack ( fr_dict_attr_t const *  da)
inlinestatic

Return the cached da stack (if any) associated with an attribute.

Parameters
[in]dato return cached da stack for.
Returns
  • NULL if no da stack available.
  • The cached da stack on success.

Definition at line 147 of file dict_ext.h.

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

◆ fr_dict_attr_ext()

static void* fr_dict_attr_ext ( fr_dict_attr_t const *  da,
fr_dict_attr_ext_t  ext 
)
inlinestatic

Definition at line 120 of file dict_ext.h.

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

◆ fr_dict_attr_ext_debug()

void fr_dict_attr_ext_debug ( fr_dict_attr_t const *  da)

Definition at line 213 of file dict_ext.c.

+ Here is the call graph for this function:

◆ fr_dict_attr_has_ext()

static bool fr_dict_attr_has_ext ( fr_dict_attr_t const *  da,
fr_dict_attr_ext_t  ext 
)
inlinestatic

Return whether a da has a given extension or not.

Parameters
[in]dato check for extensions.
[in]extto check.
Returns
  • true if the da has the specified extension.
  • false if the da does not have the specified extension

Definition at line 135 of file dict_ext.h.

+ Here is the caller graph for this function:

◆ fr_dict_attr_ref()

static fr_dict_attr_t const* fr_dict_attr_ref ( fr_dict_attr_t const *  da)
inlinestatic

Return the reference associated with a group type attribute.

Parameters
[in]dato return the reference for.
Returns
  • NULL if no reference available.
  • A pointer to the attribute being referenced.

Definition at line 164 of file dict_ext.h.

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

◆ fr_dict_vendor_da_by_da()

static fr_dict_attr_t const* fr_dict_vendor_da_by_da ( fr_dict_attr_t const *  da)
inlinestatic

Return the vendor da for an attribute.

Parameters
[in]daThe dictionary attribute to find the vendor for.
Returns
  • 0 this isn't a vendor specific attribute.
  • The vendor PEN.

Definition at line 202 of file dict_ext.h.

+ Here is the call graph for this function:

◆ fr_dict_vendor_num_by_da()

static uint32_t fr_dict_vendor_num_by_da ( fr_dict_attr_t const *  da)
inlinestatic

Return the vendor number for an attribute.

Parameters
[in]daThe dictionary attribute to find the vendor for.
Returns
  • 0 this isn't a vendor specific attribute.
  • The vendor PEN.

Definition at line 182 of file dict_ext.h.

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

Variable Documentation

◆ fr_dict_attr_ext_def

fr_ext_t const fr_dict_attr_ext_def
extern

Holds additional information about extension structures.

Definition at line 160 of file dict_ext.c.

◆ fr_dict_enum_ext_def

fr_ext_t const fr_dict_enum_ext_def
extern

Holds additional information about extension structures.

Definition at line 221 of file dict_ext.c.