The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
trigger.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: 5756656992b38b8e2fafae15a4c98e3fabf0d82f $
20  *
21  * @file lib/server/trigger.h
22  * @brief Execute scripts when a server event occurs.
23  *
24  * @copyright 2015 The FreeRADIUS server project
25  */
26 RCSIDH(trigger_h, "$Id: 5756656992b38b8e2fafae15a4c98e3fabf0d82f $")
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #include <freeradius-devel/server/cf_util.h>
33 #include <freeradius-devel/server/module.h>
34 #include <freeradius-devel/server/request.h>
35 #include <freeradius-devel/unlang/interpret.h>
36 #include <freeradius-devel/util/pair.h>
37 #include <freeradius-devel/util/talloc.h>
38 
40 
41 xlat_action_t trigger_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out,
42  UNUSED xlat_ctx_t const *xctx,
43  request_t *request, fr_value_box_list_t *in);
44 
45 int trigger_exec_init(CONF_SECTION const *cs);
46 
48  CONF_SECTION const *cs, char const *name, bool rate_limit, fr_pair_list_t *args)
49  CC_HINT(nonnull(3));
50 
51 bool trigger_enabled(void);
52 
53 void trigger_args_afrom_server(TALLOC_CTX *ctx, fr_pair_list_t *list, char const *server, uint16_t port);
54 
55 typedef int (*fr_trigger_worker_t)(request_t *request, module_method_t process, void *ctx);
56 
57 #ifdef __cplusplus
58 }
59 #endif
va_list args
Definition: acutest.h:770
#define RCSIDH(h, id)
Definition: build.h:482
#define UNUSED
Definition: build.h:313
A section grouping multiple CONF_PAIR.
Definition: cf_priv.h:101
static fr_slen_t in
Definition: dict.h:821
unsigned short uint16_t
Definition: merged_model.c:31
static char const * name
unlang_action_t(* module_method_t)(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
Module section callback.
Definition: module.h:68
void trigger_args_afrom_server(TALLOC_CTX *ctx, fr_pair_list_t *list, char const *server, uint16_t port)
Create trigger arguments to describe the server the pool connects to.
Definition: trigger.c:454
xlat_arg_parser_t const trigger_xlat_args[]
Definition: trigger.c:65
int trigger_exec_init(CONF_SECTION const *cs)
Definition: trigger.c:540
int trigger_exec(unlang_interpret_t *intp, CONF_SECTION const *cs, char const *name, bool rate_limit, fr_pair_list_t *args))
Execute a trigger - call an executable to process an event.
Definition: trigger.c:233
int(* fr_trigger_worker_t)(request_t *request, module_method_t process, void *ctx)
Definition: trigger.h:55
xlat_action_t trigger_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in)
Retrieve attributes from a special trigger list.
Definition: trigger.c:73
bool trigger_enabled(void)
Return whether triggers are enabled.
Definition: trigger.c:135
xlat_action_t
Definition: xlat.h:35
Definition for a single argument consumend by an xlat function.
Definition: xlat.h:145
int nonnull(2, 5))
static size_t char ** out
Definition: value.h:997
An xlat calling ctx.
Definition: xlat_ctx.h:49