All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
modcall.h
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 #ifndef _FR_MODCALL_H
17 #define _FR_MODCALL_H
18 /**
19  * $Id: 019d5fad50ee6c224a625332a7308c57444c2582 $
20  *
21  * @file include/modcall.h
22  * @brief API to the module-calling tree.
23  *
24  * Functions to build the tree from the config file, and to call it by
25  * feeding it REQUESTs.
26  *
27  * @copyright 2015 The FreeRADIUS server project
28  */
29 RCSIDH(modcall_h, "$Id: 019d5fad50ee6c224a625332a7308c57444c2582 $")
30 
31 #include <freeradius-devel/conffile.h> /* Need CONF_* definitions */
32 #include <freeradius-devel/modules.h>
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 /*
39  * For each authorize/authtype/etc, we have an ordered
40  * tree of instances to call. This data structure keeps track
41  * of that order.
42  */
43 typedef struct modcallable modcallable;
44 
45 int modcall_fixup_update(vp_map_t *map, void *ctx);
46 
47 int modcall(rlm_components_t component, modcallable *c, REQUEST *request);
48 
49 /* Parse a module-method's config section (e.g. authorize{}) into a tree that
50  * may be called with modcall() */
52  rlm_components_t component, CONF_SECTION *cs);
53 
54 /* Create a single modcallable node that references a module instance. This
55  * may be a CONF_SECTION containing action specifiers like "notfound = return"
56  * or a simple CONF_PAIR, in which case the default actions are used. */
57 modcallable *compile_modsingle(TALLOC_CTX *ctx, modcallable **parent, rlm_components_t component, CONF_ITEM *ci,
58  char const **modname);
59 
60 /*
61  * Do the second pass on compiling the modules.
62  */
63 bool modcall_pass2(modcallable *mc);
64 
65 /* Add an entry to the end of a modgroup */
67 
68 void modcall_debug(modcallable *mc, int depth);
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 #endif /* _FR_MODCALL_H */
#define RCSIDH(h, id)
Definition: build.h:136
bool modcall_pass2(modcallable *mc)
Definition: modcall.c:3814
modcallable * compile_modsingle(TALLOC_CTX *ctx, modcallable **parent, rlm_components_t component, CONF_ITEM *ci, char const **modname)
Definition: modcall.c:2953
static expr_map_t map[]
Definition: rlm_expr.c:169
void add_to_modcallable(modcallable *parent, modcallable *this)
Definition: modcall.c:3261
modcallable * compile_modgroup(modcallable *parent, rlm_components_t component, CONF_SECTION *cs)
Definition: modcall.c:3247
int modcall(rlm_components_t component, modcallable *c, REQUEST *request)
Call a module, iteratively, with a local stack, rather than recursively.
Definition: modcall.c:1161
int modcall_fixup_update(vp_map_t *map, void *ctx)
enum rlm_components rlm_components_t
The different section components of the server.
void modcall_debug(modcallable *mc, int depth)
Definition: modcall.c:4178
Value pair map.
Definition: map.h:46
modcallable * parent
Definition: modcall.c:75