The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Loading...
Searching...
No Matches
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: de2c36ed9fefd90863c15814de366d55619fbb6d $
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 */
26RCSIDH(trigger_h, "$Id: de2c36ed9fefd90863c15814de366d55619fbb6d $")
27
28#ifdef __cplusplus
29extern "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
39int trigger_init(CONF_SECTION const *cs);
40
42 CONF_SECTION const *cs, char const *name, bool rate_limit, fr_pair_list_t *args)
43 CC_HINT(nonnull(3));
44
45bool trigger_enabled(void);
46
47void trigger_args_afrom_server(TALLOC_CTX *ctx, fr_pair_list_t *list, char const *server, uint16_t port);
48
49typedef int (*fr_trigger_worker_t)(request_t *request, module_method_t process, void *ctx);
50
51#ifdef __cplusplus
52}
53#endif
va_list args
Definition acutest.h:770
#define RCSIDH(h, id)
Definition build.h:486
A section grouping multiple CONF_PAIR.
Definition cf_priv.h:101
unsigned short uint16_t
static char const * name
unlang_action_t(* module_method_t)(unlang_result_t *p_result, module_ctx_t const *mctx, request_t *request)
Module section callback.
Definition module.h:69
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:398
int trigger(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:143
int trigger_init(CONF_SECTION const *cs)
Definition trigger.c:493
int(* fr_trigger_worker_t)(request_t *request, module_method_t process, void *ctx)
Definition trigger.h:49
bool trigger_enabled(void)
Return whether triggers are enabled.
Definition trigger.c:94
int nonnull(2, 5))