The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
dict_fixup_priv.h
Go to the documentation of this file.
1 #pragma once
2 /*
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
16  */
17 
18 /** Functions to finalise and fixup dictionaries
19  *
20  * @file src/lib/util/dict_fixup_priv.h
21  *
22  * @copyright 2020 The FreeRADIUS server project
23  * @copyright 2020 Arran Cudbard-Bell <a.cudbardb@freeradius.org>
24  */
25 RCSIDH(dict_fixup_priv_h, "$Id: 3afd1ba4a0ee002c02f908a190a720780497674c $")
26 
27 #include <freeradius-devel/util/dict_priv.h>
28 #include <freeradius-devel/util/dlist.h>
29 #include <freeradius-devel/util/talloc.h>
30 #include <freeradius-devel/util/value.h>
31 
32 typedef struct {
33  TALLOC_CTX *pool; //!< Temporary pool for fixups, reduces holes
34 
35  fr_dlist_head_t enumv; //!< Raw enumeration values to add.
36  fr_dlist_head_t group; //!< Group references to resolve.
37  fr_dlist_head_t clone; //!< Clone operation to apply.
39 
40 int dict_fixup_enumv(dict_fixup_ctx_t *fctx, char const *filename, int line,
41  char const *attr, size_t attr_len,
42  char const *name, size_t name_len,
43  char const *value, size_t value_len,
44  fr_dict_attr_t const *parent);
45 
46 int dict_fixup_group(dict_fixup_ctx_t *fctx, char const *filename, int line,
47  fr_dict_attr_t *da, char const *ref);
48 
49 int dict_fixup_clone(dict_fixup_ctx_t *fctx, char const *filename, int line,
51  char const *ref, size_t ref_len);
52 
53 int dict_fixup_init(TALLOC_CTX *ctx, dict_fixup_ctx_t *fctx);
54 
56 
int const char int line
Definition: acutest.h:702
static fr_dict_t * dict
Definition: fuzzer.c:46
#define RCSIDH(h, id)
Definition: build.h:445
int dict_fixup_apply(dict_fixup_ctx_t *fctx)
Apply all outstanding fixes to a set of dictionaries.
Definition: dict_fixup.c:614
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.
Definition: dict_fixup.c:209
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.
Definition: dict_fixup.c:127
fr_dlist_head_t group
Group references to resolve.
int dict_fixup_init(TALLOC_CTX *ctx, dict_fixup_ctx_t *fctx)
Initialise a fixup ctx.
Definition: dict_fixup.c:597
fr_dlist_head_t clone
Clone operation to apply.
fr_dlist_head_t enumv
Raw enumeration values to add.
TALLOC_CTX * pool
Temporary pool for fixups, reduces holes.
void dict_hash_tables_finalise(fr_dict_t *dict)
Walk a dictionary finalising the hash tables in all attributes with a distinct namespace.
Definition: dict_fixup.c:674
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.
Definition: dict_fixup.c:383
Test enumeration values.
Definition: dict_test.h:92
Head of a doubly linked list.
Definition: dlist.h:51
static char const * name
static fr_slen_t parent
Definition: pair.h:844