The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Functions | Variables
dict_test.c File Reference

Common functions for test files which need to programmatically create test dictionaries. More...

#include <freeradius-devel/util/dict.h>
#include <freeradius-devel/util/dict_priv.h>
#include "dict_test.h"
+ Include dependency graph for dict_test.c:

Go to the source code of this file.

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

static fr_value_box_t enum_test_0 = FR_VALUE_BOX_INITIALISER(enum_test_0, FR_TYPE_UINT32, .uint32, 123)
 
static fr_value_box_t enum_test_1 = FR_VALUE_BOX_INITIALISER(enum_test_1, FR_TYPE_UINT32, .uint32, 321)
 
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

Common functions for test files which need to programmatically create test dictionaries.

Definition in file dict_test.c.

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

◆ enum_test_0

fr_value_box_t enum_test_0 = FR_VALUE_BOX_INITIALISER(enum_test_0, FR_TYPE_UINT32, .uint32, 123)
static

Definition at line 83 of file dict_test.c.

◆ enum_test_1

fr_value_box_t enum_test_1 = FR_VALUE_BOX_INITIALISER(enum_test_1, FR_TYPE_UINT32, .uint32, 321)
static

Definition at line 84 of file dict_test.c.

◆ fr_dict_attr_test_bool

fr_dict_attr_t const* fr_dict_attr_test_bool

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

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

Definition at line 41 of file dict_test.c.

◆ fr_dict_attr_test_date

fr_dict_attr_t const* fr_dict_attr_test_date

Definition at line 58 of file dict_test.c.

◆ fr_dict_attr_test_enum

fr_dict_attr_t const* fr_dict_attr_test_enum

Definition at line 81 of file dict_test.c.

◆ fr_dict_attr_test_ethernet

fr_dict_attr_t const* fr_dict_attr_test_ethernet

Definition at line 42 of file dict_test.c.

◆ fr_dict_attr_test_float32

fr_dict_attr_t const* fr_dict_attr_test_float32

Definition at line 55 of file dict_test.c.

◆ fr_dict_attr_test_float64

fr_dict_attr_t const* fr_dict_attr_test_float64

Definition at line 56 of file dict_test.c.

◆ fr_dict_attr_test_group

fr_dict_attr_t const* fr_dict_attr_test_group

Definition at line 74 of file dict_test.c.

◆ fr_dict_attr_test_ifid

fr_dict_attr_t const* fr_dict_attr_test_ifid

Definition at line 39 of file dict_test.c.

◆ fr_dict_attr_test_int16

fr_dict_attr_t const* fr_dict_attr_test_int16

Definition at line 51 of file dict_test.c.

◆ fr_dict_attr_test_int32

fr_dict_attr_t const* fr_dict_attr_test_int32

Definition at line 52 of file dict_test.c.

◆ fr_dict_attr_test_int64

fr_dict_attr_t const* fr_dict_attr_test_int64

Definition at line 53 of file dict_test.c.

◆ fr_dict_attr_test_int8

fr_dict_attr_t const* fr_dict_attr_test_int8

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

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

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

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

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

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

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

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

Definition at line 76 of file dict_test.c.

◆ fr_dict_attr_test_octets

fr_dict_attr_t const* fr_dict_attr_test_octets

Definition at line 31 of file dict_test.c.

◆ fr_dict_attr_test_size

fr_dict_attr_t const* fr_dict_attr_test_size

Definition at line 62 of file dict_test.c.

◆ fr_dict_attr_test_string

fr_dict_attr_t const* fr_dict_attr_test_string

Definition at line 30 of file dict_test.c.

◆ fr_dict_attr_test_struct

fr_dict_attr_t const* fr_dict_attr_test_struct

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

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

Definition at line 60 of file dict_test.c.

◆ fr_dict_attr_test_tlv

fr_dict_attr_t const* fr_dict_attr_test_tlv

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

Definition at line 65 of file dict_test.c.

◆ fr_dict_attr_test_uint16

fr_dict_attr_t const* fr_dict_attr_test_uint16

Definition at line 46 of file dict_test.c.

◆ fr_dict_attr_test_uint32

fr_dict_attr_t const* fr_dict_attr_test_uint32

Definition at line 47 of file dict_test.c.

◆ fr_dict_attr_test_uint64

fr_dict_attr_t const* fr_dict_attr_test_uint64

Definition at line 48 of file dict_test.c.

◆ fr_dict_attr_test_uint8

fr_dict_attr_t const* fr_dict_attr_test_uint8

Definition at line 45 of file dict_test.c.

◆ fr_dict_attr_test_vendor

fr_dict_attr_t const* fr_dict_attr_test_vendor

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

Definition at line 72 of file dict_test.c.

◆ fr_dict_attr_test_vsa

fr_dict_attr_t const* fr_dict_attr_test_vsa

Definition at line 70 of file dict_test.c.

◆ fr_dict_test

fr_dict_t* fr_dict_test

Definition at line 28 of file dict_test.c.

◆ fr_dict_test_attrs

fr_dict_test_attr_t const fr_dict_test_attrs[]

Definition at line 86 of file dict_test.c.