Coverage Report

Created: 2026-05-11 06:44

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/freeradius-server/src/freeradius-devel/server/users_file.h
Line
Count
Source
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: 97ef9c4a8141adb2424fa6f3d0f1155553d3092e $
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: 97ef9c4a8141adb2424fa6f3d0f1155553d3092e $")
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
48
} PAIR_LIST;
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".
54
} PAIR_LIST_LIST;
55
56
int   pairlist_read(TALLOC_CTX *ctx, fr_dict_t const *dict, char const *file, PAIR_LIST_LIST *list, bool v3_compat);
57
58
static inline void pairlist_list_init(PAIR_LIST_LIST *list)
59
0
{
60
0
  fr_dlist_talloc_init(&list->head, PAIR_LIST, entry);
61
0
}
62
63
#ifdef __cplusplus
64
}
65
#endif