The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
module_method.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 2 of the License, or
5  * (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
15  */
16 
17 /**
18  * $Id: 8c3c3e27faf209f710ec00315f482147013cbb49 $
19  *
20  * @file src/lib/server/module_method.c
21  * @brief Central module_method_name_t definitions
22  *
23  * This file contains common module_method_t structures which may be
24  * referenced within a #virtual_server_compile_t and a #module_t.
25  *
26  * This is partly for documentation, partly for boilerplate reducation
27  * and partly to minimise stupid typos and other screwups which'd lead
28  * to matches failing.
29  *
30  * Referencing the same #module_method_t in both the virtual server
31  * and the module allows for a potential fast path where we just compare
32  * the pointer values.
33  *
34  * @copyright 2022 Arran Cudbard-Bell (a.cudbardb@freeradius.org)
35  */
36 typedef struct {
37  fr_dict_t const **proto; //!< If none-null, restrict matches to this protocol.
38  ///< i.e. if both the virtual server module_method_name
39  ///< and the module method have non-null proto pointers
40  ///< then *proto must be equal for the method name to
41  ///< match.
42 
43  char const *name1; //!< module method name1 which is allowed in this section
44  char const *name2; //!< module method name2 which is allowed in this section
46 
48  .name1 = "ippool",
49  .name2 = "allocate"
50 };
51 
53  .name1 = "ippool",
54  .name2 = "extend"
55 };
56 
58  .name1 = "ippool",
59  .name2 = "mark"
60 };
61 
63  .name1 = "ippool",
64  .name2 = "release"
65 };
module_method_name_t module_method_ippool_mark
Definition: module_method.c:57
module_method_name_t module_method_ippool_release
Definition: module_method.c:62
module_method_name_t module_method_ippool_extend
Definition: module_method.c:52
module_method_name_t module_method_ippool_allocate
Definition: module_method.c:47
char const * name1
module method name1 which is allowed in this section
Definition: module_method.c:43
fr_dict_t const ** proto
If none-null, restrict matches to this protocol.
Definition: module_method.c:37
char const * name2
module method name2 which is allowed in this section
Definition: module_method.c:44
Specifies a module method identifier.
Definition: module_method.c:36
struct module_method_name_s module_method_name_t
Definition: module.h:42