The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Macros | Enumerations | 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...
 
union  fr_dict_attr_ext_ref_t.__unnamed118__
 
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...
 

Macros

#define fr_dict_attr_ref_is_unresolved(_type)   ((_type) & FR_DICT_ATTR_REF_UNRESOLVED)
 
#define fr_dict_attr_ref_type(_type)   ((_type) & ~FR_DICT_ATTR_REF_UNRESOLVED)
 

Enumerations

enum  fr_dict_attr_ref_type_t {
  FR_DICT_ATTR_REF_NONE = 0x00 ,
  FR_DICT_ATTR_REF_ALIAS = 0x01 ,
  FR_DICT_ATTR_REF_CLONE = 0x02 ,
  FR_DICT_ATTR_REF_ENUM = 0x04 ,
  FR_DICT_ATTR_REF_UNRESOLVED = 0x10
}
 

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 94 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 107 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 116 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 76 of file dict_ext.h.

Data Fields
union fr_dict_attr_ext_ref_t __unnamed__
fr_dict_attr_ref_type_t type The state of the reference.

◆ fr_dict_attr_ext_ref_t.__unnamed118__

union fr_dict_attr_ext_ref_t.__unnamed118__

Definition at line 78 of file dict_ext.h.

Data Fields
fr_dict_attr_t const * ref A resolved pointer to the referenced attribute.
char * unresolved An unresolved reference (will need resolving later).

◆ fr_dict_attr_ext_vendor_t

struct fr_dict_attr_ext_vendor_t

Attribute extension - Cached vendor pointer.

Definition at line 87 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 123 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.

Macro Definition Documentation

◆ fr_dict_attr_ref_is_unresolved

#define fr_dict_attr_ref_is_unresolved (   _type)    ((_type) & FR_DICT_ATTR_REF_UNRESOLVED)

Definition at line 70 of file dict_ext.h.

◆ fr_dict_attr_ref_type

#define fr_dict_attr_ref_type (   _type)    ((_type) & ~FR_DICT_ATTR_REF_UNRESOLVED)

Definition at line 71 of file dict_ext.h.

Enumeration Type Documentation

◆ fr_dict_attr_ref_type_t

Enumerator
FR_DICT_ATTR_REF_NONE 

No ref set.

FR_DICT_ATTR_REF_ALIAS 

The attribute is an alias for another attribute.

Either a straight ALIAS, or a reference into another dictionary.

FR_DICT_ATTR_REF_CLONE 

The attribute is a "copy" of another attribute.

FR_DICT_ATTR_REF_ENUM 

The attribute is an enumeration value.

FR_DICT_ATTR_REF_UNRESOLVED 

This flag is combined with the other states to indicate that the reference is unresolved.

Definition at line 58 of file dict_ext.h.

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 167 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 140 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 267 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 155 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 184 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 232 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 212 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 213 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 275 of file dict_ext.c.