The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
users_file.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 /**
19  * $Id: 84ce2a2b1de437b46c6dc4366c5f97bf91bed676 $
20  *
21  * @file lib/server/users_file.h
22  * @brief Support functions for users_file parsing.
23  *
24  * @copyright 2000,2006 The FreeRADIUS server project
25  * @copyright 2000 Miquel van Smoorenburg (miquels@cistron.nl)
26  * @copyright 2000 Alan DeKok (aland@freeradius.org)
27  */
28 RCSIDH(users_file_h, "$Id: 84ce2a2b1de437b46c6dc4366c5f97bf91bed676 $")
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 #include <freeradius-devel/server/map.h>
35 #include <freeradius-devel/util/pair.h>
36 #include <freeradius-devel/util/talloc.h>
37 
38 typedef struct pair_list {
39  char const *name; //!< Key for matching entry.
40  map_list_t check; //!< List of maps for comparison / modifying control list
41  map_list_t reply; //!< List of maps for modifying reply list
42  int order; //!< Sequence of entry in source file
43  bool fall_through; //!< go to the next one
44  bool next_shortest_prefix; //!< for prefix tries
45  char const *filename; //!< Filename entry read from
46  int lineno; //!< Line number entry read from
47  fr_dlist_t entry; //!< Entry in dlist of PAIR_LIST with matching name
49 
50 typedef struct pair_list_list {
51  fr_dlist_head_t head; //!< Head of the list of PAIR_LISTs.
52  char const *name; //!< name of the key used for matching entry.
53  fr_value_box_t *box; //!< parsed version of "name".
55 
56 /* users_file.c */
57 int pairlist_read(TALLOC_CTX *ctx, fr_dict_t const *dict, char const *file, PAIR_LIST_LIST *list);
58 
59 static inline void pairlist_list_init(PAIR_LIST_LIST *list)
60 {
61  fr_dlist_talloc_init(&list->head, PAIR_LIST, entry);
62 }
63 
64 #ifdef __cplusplus
65 }
66 #endif
int const char * file
Definition: acutest.h:702
static fr_dict_t * dict
Definition: fuzzer.c:46
#define RCSIDH(h, id)
Definition: build.h:445
#define fr_dlist_talloc_init(_head, _type, _field)
Initialise the head structure of a doubly linked list.
Definition: dlist.h:275
Head of a doubly linked list.
Definition: dlist.h:51
Entry in a doubly linked list.
Definition: dlist.h:41
fr_dlist_t entry
Entry in dlist of PAIR_LIST with matching name.
Definition: users_file.h:47
char const * name
Key for matching entry.
Definition: users_file.h:39
fr_dlist_head_t head
Head of the list of PAIR_LISTs.
Definition: users_file.h:51
struct pair_list PAIR_LIST
char const * filename
Filename entry read from.
Definition: users_file.h:45
int lineno
Line number entry read from.
Definition: users_file.h:46
char const * name
name of the key used for matching entry.
Definition: users_file.h:52
int pairlist_read(TALLOC_CTX *ctx, fr_dict_t const *dict, char const *file, PAIR_LIST_LIST *list)
Definition: users_file.c:235
bool fall_through
go to the next one
Definition: users_file.h:43
struct pair_list_list PAIR_LIST_LIST
static void pairlist_list_init(PAIR_LIST_LIST *list)
Definition: users_file.h:59
int order
Sequence of entry in source file.
Definition: users_file.h:42
map_list_t check
List of maps for comparison / modifying control list.
Definition: users_file.h:40
fr_value_box_t * box
parsed version of "name".
Definition: users_file.h:53
bool next_shortest_prefix
for prefix tries
Definition: users_file.h:44
map_list_t reply
List of maps for modifying reply list.
Definition: users_file.h:41