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

Functions to create test dictionaries for unit tests. More...

#include <freeradius-devel/util/dict.h>
#include <freeradius-devel/util/value.h>
+ Include dependency graph for dict_test.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  fr_dict_test_attr_t
 Test enumeration attributes. More...
 
struct  value
 Test enumeration values. More...
 

Typedefs

typedef struct value fr_dict_test_attr_value_t
 Test enumeration values. More...
 

Enumerations

enum  fr_dict_test_attr_number_t {
  FR_TEST_ATTR_INVALID = -1 ,
  FR_TEST_ATTR_STRING = 1 ,
  FR_TEST_ATTR_OCTETS ,
  FR_TEST_ATTR_IPV4_ADDR ,
  FR_TEST_ATTR_IPV4_PREFIX ,
  FR_TEST_ATTR_IPV6_ADDR ,
  FR_TEST_ATTR_IPV6_PREFIX ,
  FR_TEST_ATTR_IFID ,
  FR_TEST_ATTR_COMBO_IP_ADDR ,
  FR_TEST_ATTR_COMBO_IP_PREFIX ,
  FR_TEST_ATTR_ETHERNET ,
  FR_TEST_ATTR_BOOL ,
  FR_TEST_ATTR_UINT8 ,
  FR_TEST_ATTR_UINT16 ,
  FR_TEST_ATTR_UINT32 ,
  FR_TEST_ATTR_UINT64 ,
  FR_TEST_ATTR_INT8 ,
  FR_TEST_ATTR_INT16 ,
  FR_TEST_ATTR_INT32 ,
  FR_TEST_ATTR_INT64 ,
  FR_TEST_ATTR_FLOAT32 ,
  FR_TEST_ATTR_FLOAT64 ,
  FR_TEST_ATTR_DATE ,
  FR_TEST_ATTR_TIME_DELTA ,
  FR_TEST_ATTR_SIZE ,
  FR_TEST_ATTR_TLV ,
  FR_TEST_ATTR_TLV_STRING ,
  FR_TEST_ATTR_STRUCT ,
  FR_TEST_ATTR_VSA ,
  FR_TEST_ATTR_VENDOR ,
  FR_TEST_ATTR_VENDOR_STRING ,
  FR_TEST_ATTR_GROUP ,
  FR_TEST_ATTR_NESTED_TOP_TLV ,
  FR_TEST_ATTR_NESTED_CHILD_TLV ,
  FR_TEST_ATTR_NESTED_LEAF_STRING ,
  FR_TEST_ATTR_NESTED_LEAF_INT32 ,
  FR_TEST_ATTR_ENUM
}
 Test attribute numbers. More...
 

Functions

int fr_dict_test_attrs_init (fr_dict_t *dict, fr_dict_test_attr_t const *test_defs, unsigned int base, int inst)
 Add our test attributes to our test dictionary. More...
 
int fr_dict_test_init (TALLOC_CTX *ctx, fr_dict_t **dict_p, fr_dict_test_attr_t const *test_defs)
 Initialise a test dictionary and add our test_defs to it. More...
 

Variables

fr_dict_attr_t const * fr_dict_attr_test_bool
 
fr_dict_attr_t const * fr_dict_attr_test_combo_ip_addr
 
fr_dict_attr_t const * fr_dict_attr_test_combo_ip_prefix
 
fr_dict_attr_t const * fr_dict_attr_test_date
 
fr_dict_attr_t const * fr_dict_attr_test_enum
 
fr_dict_attr_t const * fr_dict_attr_test_ethernet
 
fr_dict_attr_t const * fr_dict_attr_test_float32
 
fr_dict_attr_t const * fr_dict_attr_test_float64
 
fr_dict_attr_t const * fr_dict_attr_test_group
 
fr_dict_attr_t const * fr_dict_attr_test_ifid
 
fr_dict_attr_t const * fr_dict_attr_test_int16
 
fr_dict_attr_t const * fr_dict_attr_test_int32
 
fr_dict_attr_t const * fr_dict_attr_test_int64
 
fr_dict_attr_t const * fr_dict_attr_test_int8
 
fr_dict_attr_t const * fr_dict_attr_test_ipv4_addr
 
fr_dict_attr_t const * fr_dict_attr_test_ipv4_prefix
 
fr_dict_attr_t const * fr_dict_attr_test_ipv6_addr
 
fr_dict_attr_t const * fr_dict_attr_test_ipv6_prefix
 
fr_dict_attr_t const * fr_dict_attr_test_nested_child_tlv
 
fr_dict_attr_t const * fr_dict_attr_test_nested_leaf_int32
 
fr_dict_attr_t const * fr_dict_attr_test_nested_leaf_string
 
fr_dict_attr_t const * fr_dict_attr_test_nested_top_tlv
 
fr_dict_attr_t const * fr_dict_attr_test_octets
 
fr_dict_attr_t const * fr_dict_attr_test_size
 
fr_dict_attr_t const * fr_dict_attr_test_string
 
fr_dict_attr_t const * fr_dict_attr_test_struct
 
fr_dict_attr_t const * fr_dict_attr_test_struct_uint32
 
fr_dict_attr_t const * fr_dict_attr_test_time_delta
 
fr_dict_attr_t const * fr_dict_attr_test_tlv
 
fr_dict_attr_t const * fr_dict_attr_test_tlv_string
 
fr_dict_attr_t const * fr_dict_attr_test_uint16
 
fr_dict_attr_t const * fr_dict_attr_test_uint32
 
fr_dict_attr_t const * fr_dict_attr_test_uint64
 
fr_dict_attr_t const * fr_dict_attr_test_uint8
 
fr_dict_attr_t const * fr_dict_attr_test_vendor
 
fr_dict_attr_t const * fr_dict_attr_test_vendor_string
 
fr_dict_attr_t const * fr_dict_attr_test_vsa
 
fr_dict_tfr_dict_test
 
fr_dict_test_attr_t const fr_dict_test_attrs []
 

Detailed Description

Functions to create test dictionaries for unit tests.

Definition in file dict_test.h.


Data Structure Documentation

◆ fr_dict_test_attr_t

struct fr_dict_test_attr_t

Test enumeration attributes.

Definition at line 99 of file dict_test.h.

+ Collaboration diagram for fr_dict_test_attr_t:
Data Fields
fr_dict_test_attr_number_t attr Attribute number to create.
fr_dict_attr_t const ** da Where to write a pointer to this attribute.
char const * name What to call this attribute.
fr_dict_attr_t const ** parent The parent of this attribute.
fr_type_t type What type the attribute.
fr_dict_test_attr_value_t * values Array of enumeration values to add to this attribute.

◆ value

struct value

Test enumeration values.

Definition at line 92 of file dict_test.h.

+ Collaboration diagram for value:
Data Fields
char const * key Enumeration name.
fr_value_box_t * val Enumeration value.

Typedef Documentation

◆ fr_dict_test_attr_value_t

Test enumeration values.

Enumeration Type Documentation

◆ fr_dict_test_attr_number_t

Test attribute numbers.

Enumerator
FR_TEST_ATTR_INVALID 
FR_TEST_ATTR_STRING 
FR_TEST_ATTR_OCTETS 
FR_TEST_ATTR_IPV4_ADDR 
FR_TEST_ATTR_IPV4_PREFIX 
FR_TEST_ATTR_IPV6_ADDR 
FR_TEST_ATTR_IPV6_PREFIX 
FR_TEST_ATTR_IFID 
FR_TEST_ATTR_COMBO_IP_ADDR 
FR_TEST_ATTR_COMBO_IP_PREFIX 
FR_TEST_ATTR_ETHERNET 
FR_TEST_ATTR_BOOL 
FR_TEST_ATTR_UINT8 
FR_TEST_ATTR_UINT16 
FR_TEST_ATTR_UINT32 
FR_TEST_ATTR_UINT64 
FR_TEST_ATTR_INT8 
FR_TEST_ATTR_INT16 
FR_TEST_ATTR_INT32 
FR_TEST_ATTR_INT64 
FR_TEST_ATTR_FLOAT32 
FR_TEST_ATTR_FLOAT64 
FR_TEST_ATTR_DATE 
FR_TEST_ATTR_TIME_DELTA 
FR_TEST_ATTR_SIZE 
FR_TEST_ATTR_TLV 
FR_TEST_ATTR_TLV_STRING 
FR_TEST_ATTR_STRUCT 
FR_TEST_ATTR_VSA 
FR_TEST_ATTR_VENDOR 
FR_TEST_ATTR_VENDOR_STRING 
FR_TEST_ATTR_GROUP 
FR_TEST_ATTR_NESTED_TOP_TLV 
FR_TEST_ATTR_NESTED_CHILD_TLV 
FR_TEST_ATTR_NESTED_LEAF_STRING 
FR_TEST_ATTR_NESTED_LEAF_INT32 
FR_TEST_ATTR_ENUM 

Definition at line 35 of file dict_test.h.

Function Documentation

◆ fr_dict_test_attrs_init()

int fr_dict_test_attrs_init ( fr_dict_t dict,
fr_dict_test_attr_t const *  test_defs,
unsigned int  base,
int  inst 
)

Add our test attributes to our test dictionary.

Parameters
[in]dictTest dictionary to add.
[in]test_defsTest attribute definitions to add.
[in]baseto add to all attribute numbers.
[in]instnumber to add to test attribute. i.e. if the attribute name is "Foo" the instance number will be appended to create "Foo-<inst>"
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 176 of file dict_test.c.

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

◆ fr_dict_test_init()

int fr_dict_test_init ( TALLOC_CTX *  ctx,
fr_dict_t **  dict_p,
fr_dict_test_attr_t const *  test_defs 
)

Initialise a test dictionary and add our test_defs to it.

Parameters
[in]ctxto bind the global dictionary ctx lifetim to.
[out]dict_pWhere to write a pointer to our test dictionary. May be NULL.
[in]test_defsTest attributes. If NULL will default to the default test attributes.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 248 of file dict_test.c.

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

Variable Documentation

◆ fr_dict_attr_test_bool

fr_dict_attr_t const* fr_dict_attr_test_bool
extern

Definition at line 43 of file dict_test.c.

◆ fr_dict_attr_test_combo_ip_addr

fr_dict_attr_t const* fr_dict_attr_test_combo_ip_addr
extern

Definition at line 40 of file dict_test.c.

◆ fr_dict_attr_test_combo_ip_prefix

fr_dict_attr_t const* fr_dict_attr_test_combo_ip_prefix
extern

Definition at line 41 of file dict_test.c.

◆ fr_dict_attr_test_date

fr_dict_attr_t const* fr_dict_attr_test_date
extern

Definition at line 58 of file dict_test.c.

◆ fr_dict_attr_test_enum

fr_dict_attr_t const* fr_dict_attr_test_enum
extern

Definition at line 81 of file dict_test.c.

◆ fr_dict_attr_test_ethernet

fr_dict_attr_t const* fr_dict_attr_test_ethernet
extern

Definition at line 42 of file dict_test.c.

◆ fr_dict_attr_test_float32

fr_dict_attr_t const* fr_dict_attr_test_float32
extern

Definition at line 55 of file dict_test.c.

◆ fr_dict_attr_test_float64

fr_dict_attr_t const* fr_dict_attr_test_float64
extern

Definition at line 56 of file dict_test.c.

◆ fr_dict_attr_test_group

fr_dict_attr_t const* fr_dict_attr_test_group
extern

Definition at line 74 of file dict_test.c.

◆ fr_dict_attr_test_ifid

fr_dict_attr_t const* fr_dict_attr_test_ifid
extern

Definition at line 39 of file dict_test.c.

◆ fr_dict_attr_test_int16

fr_dict_attr_t const* fr_dict_attr_test_int16
extern

Definition at line 51 of file dict_test.c.

◆ fr_dict_attr_test_int32

fr_dict_attr_t const* fr_dict_attr_test_int32
extern

Definition at line 52 of file dict_test.c.

◆ fr_dict_attr_test_int64

fr_dict_attr_t const* fr_dict_attr_test_int64
extern

Definition at line 53 of file dict_test.c.

◆ fr_dict_attr_test_int8

fr_dict_attr_t const* fr_dict_attr_test_int8
extern

Definition at line 50 of file dict_test.c.

◆ fr_dict_attr_test_ipv4_addr

fr_dict_attr_t const* fr_dict_attr_test_ipv4_addr
extern

Definition at line 33 of file dict_test.c.

◆ fr_dict_attr_test_ipv4_prefix

fr_dict_attr_t const* fr_dict_attr_test_ipv4_prefix
extern

Definition at line 34 of file dict_test.c.

◆ fr_dict_attr_test_ipv6_addr

fr_dict_attr_t const* fr_dict_attr_test_ipv6_addr
extern

Definition at line 36 of file dict_test.c.

◆ fr_dict_attr_test_ipv6_prefix

fr_dict_attr_t const* fr_dict_attr_test_ipv6_prefix
extern

Definition at line 37 of file dict_test.c.

◆ fr_dict_attr_test_nested_child_tlv

fr_dict_attr_t const* fr_dict_attr_test_nested_child_tlv
extern

Definition at line 77 of file dict_test.c.

◆ fr_dict_attr_test_nested_leaf_int32

fr_dict_attr_t const* fr_dict_attr_test_nested_leaf_int32
extern

Definition at line 79 of file dict_test.c.

◆ fr_dict_attr_test_nested_leaf_string

fr_dict_attr_t const* fr_dict_attr_test_nested_leaf_string
extern

Definition at line 78 of file dict_test.c.

◆ fr_dict_attr_test_nested_top_tlv

fr_dict_attr_t const* fr_dict_attr_test_nested_top_tlv
extern

Definition at line 76 of file dict_test.c.

◆ fr_dict_attr_test_octets

fr_dict_attr_t const* fr_dict_attr_test_octets
extern

Definition at line 31 of file dict_test.c.

◆ fr_dict_attr_test_size

fr_dict_attr_t const* fr_dict_attr_test_size
extern

Definition at line 62 of file dict_test.c.

◆ fr_dict_attr_test_string

fr_dict_attr_t const* fr_dict_attr_test_string
extern

Definition at line 30 of file dict_test.c.

◆ fr_dict_attr_test_struct

fr_dict_attr_t const* fr_dict_attr_test_struct
extern

Definition at line 67 of file dict_test.c.

◆ fr_dict_attr_test_struct_uint32

fr_dict_attr_t const* fr_dict_attr_test_struct_uint32
extern

Definition at line 68 of file dict_test.c.

◆ fr_dict_attr_test_time_delta

fr_dict_attr_t const* fr_dict_attr_test_time_delta
extern

Definition at line 60 of file dict_test.c.

◆ fr_dict_attr_test_tlv

fr_dict_attr_t const* fr_dict_attr_test_tlv
extern

Definition at line 64 of file dict_test.c.

◆ fr_dict_attr_test_tlv_string

fr_dict_attr_t const* fr_dict_attr_test_tlv_string
extern

Definition at line 65 of file dict_test.c.

◆ fr_dict_attr_test_uint16

fr_dict_attr_t const* fr_dict_attr_test_uint16
extern

Definition at line 46 of file dict_test.c.

◆ fr_dict_attr_test_uint32

fr_dict_attr_t const* fr_dict_attr_test_uint32
extern

Definition at line 47 of file dict_test.c.

◆ fr_dict_attr_test_uint64

fr_dict_attr_t const* fr_dict_attr_test_uint64
extern

Definition at line 48 of file dict_test.c.

◆ fr_dict_attr_test_uint8

fr_dict_attr_t const* fr_dict_attr_test_uint8
extern

Definition at line 45 of file dict_test.c.

◆ fr_dict_attr_test_vendor

fr_dict_attr_t const* fr_dict_attr_test_vendor
extern

Definition at line 71 of file dict_test.c.

◆ fr_dict_attr_test_vendor_string

fr_dict_attr_t const* fr_dict_attr_test_vendor_string
extern

Definition at line 72 of file dict_test.c.

◆ fr_dict_attr_test_vsa

fr_dict_attr_t const* fr_dict_attr_test_vsa
extern

Definition at line 70 of file dict_test.c.

◆ fr_dict_test

fr_dict_t* fr_dict_test
extern

Definition at line 28 of file dict_test.c.

◆ fr_dict_test_attrs

fr_dict_test_attr_t const fr_dict_test_attrs[]
extern

Definition at line 86 of file dict_test.c.