The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Loading...
Searching...
No Matches
trigger.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: e5b979bfcb0e198f66be7d69daee7c3dab59e4ad $
19 *
20 * @file trigger.c
21 * @brief Execute scripts when a server event occurs.
22 *
23 * @copyright 2015 The FreeRADIUS server project
24 */
25RCSID("$Id: e5b979bfcb0e198f66be7d69daee7c3dab59e4ad $")
26
27#include <freeradius-devel/protocol/freeradius/freeradius.internal.h>
28#include <freeradius-devel/server/cf_file.h>
29#include <freeradius-devel/server/cf_parse.h>
30#include <freeradius-devel/server/exec.h>
31#include <freeradius-devel/server/main_loop.h>
32#include <freeradius-devel/server/pair.h>
33#include <freeradius-devel/server/request_data.h>
34#include <freeradius-devel/server/trigger.h>
35#include <freeradius-devel/unlang/function.h>
36#include <freeradius-devel/unlang/subrequest.h>
37#include <freeradius-devel/unlang/xlat.h>
38#include <freeradius-devel/unlang/tmpl.h>
39
40
41#include <sys/wait.h>
42
43/** Whether triggers are enabled globally
44 *
45 */
49
50/** Describes a rate limiting entry for a trigger
51 *
52 */
53typedef struct {
54 fr_rb_node_t node; //!< Entry in the trigger last fired tree.
55 CONF_ITEM *ci; //!< Config item this rate limit counter is associated with.
56 fr_time_t last_fired; //!< When this trigger last fired.
58
62 { .out = &dict_freeradius, .proto = "freeradius" },
63 { NULL }
64};
65
69 { .out = &attr_trigger_name, .name = "Trigger-Name", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
70 { NULL }
71};
72
74{
76}
77
78/** Compares two last fired structures
79 *
80 * @param one first pointer to compare.
81 * @param two second pointer to compare.
82 * @return CMP(one, two)
83 */
84static int8_t _trigger_last_fired_cmp(void const *one, void const *two)
85{
86 trigger_last_fired_t const *a = one, *b = two;
87
88 return CMP(a->ci, b->ci);
89}
90
91/** Return whether triggers are enabled
92 *
93 */
95{
96 return (trigger_cs != NULL);
97}
98
99typedef struct {
100 fr_value_box_list_t out; //!< result of the xlap (which we ignore)
101 unlang_result_t result; //!< the result of expansion
102 tmpl_t *vpt; //!< the template to execute
103 int exec_status; //!< Result of the program (if the trigger is a tmpl)
105
106/** Execute a trigger - call an executable to process an event
107 *
108 * A trigger ties a state change (e.g. connection up) in a module to an action
109 * (e.g. send an SNMP trap) defined in raqddb/triggers.conf or in the trigger
110 * section of a module, and can be created with one call to trigger().
111 *
112 * The trigger function expands the configuration item, and runs the given
113 * function (exec, sql insert, etc.) asynchronously, allowing the server to
114 * keep processing packets while the action is being taken.
115 *
116 * The name of each trigger is based on the module or portion of the server
117 * which runs the trigger, and is usually taken from the state when the module
118 * has a state change.
119 *
120 * Triggers are separate from logs, because log messages are generally
121 * informational, are not time sensitive, and usually require log files to be
122 * parsed and filtered in order to find relevant information.
123 *
124 * In contrast, triggers are something specific which the administrator needs
125 * to be notified about immediately and can't wait to post-process a log file.
126 *
127 * @note Calls to this function will be ignored if #trigger_init has not been called.
128 *
129 * @param[in] intp Interpreter to run the trigger with. If this is NULL the
130 * trigger will be executed synchronously.
131 * @param[in] cs to search for triggers in.
132 * If cs is not NULL, the portion after the last '.' in name is used for the trigger.
133 * If cs is NULL, the entire name is used to find the trigger in the global trigger
134 * section.
135 * @param[in] name the path relative to the global trigger section ending in the trigger name
136 * e.g. module.ldap.pool.start.
137 * @param[in] rate_limit whether to rate limit triggers.
138 * @param[in] args to make available via the @verbatim %trigger(<arg>) @endverbatim xlat.
139 * @return
140 * - 0 on success.
141 * - -1 on failure.
142 */
144 CONF_SECTION const *cs, char const *name, bool rate_limit, fr_pair_list_t *args)
145{
146 CONF_ITEM *ci;
147 CONF_PAIR *cp;
148
149 char const *attr;
150 char const *value;
151
152 request_t *request;
154 ssize_t slen;
155
157 tmpl_rules_t t_rules;
158
159 /*
160 * noop if trigger_init was never called, or if
161 * we're just checking the configuration.
162 */
163 if (!trigger_cs || check_config) return 0;
164
165 /*
166 * A module can have a local "trigger" section. In which
167 * case that is used in preference to the global one.
168 *
169 * @todo - we should really allow triggers via @trigger,
170 * so that all of the triggers are in one location. And
171 * then we can have different triggers for different
172 * module instances.
173 */
174 if (cs) {
175 CONF_SECTION const *subcs;
176
177 subcs = cf_section_find(cs, "trigger", NULL);
178 if (!subcs) goto use_global;
179
180 /*
181 * If a local trigger{...} section exists, then
182 * use the local part of the name, rather than
183 * the full path.
184 */
185 attr = strrchr(name, '.');
186 if (attr) {
187 attr++;
188 } else {
189 attr = name;
190 }
191 } else {
192 use_global:
193 cs = trigger_cs;
194 attr = name;
195 }
196
197 /*
198 * Find the trigger. Note that we do NOT allow searching
199 * from the root of the tree. Triggers MUST be in a
200 * trigger{...} section.
201 */
202 ci = cf_reference_item(cs, cs, attr);
203 if (!ci) {
204 if (cs != trigger_cs) goto use_global; /* not found locally, try to find globally */
205
206 DEBUG3("Failed finding trigger '%s'", attr);
207 return -1;
208 }
209
210 if (!cf_item_is_pair(ci)) {
211 ERROR("Trigger is not a configuration variable: %s", attr);
212 return -1;
213 }
214
215 cp = cf_item_to_pair(ci);
216 if (!cp) return -1;
217
218 value = cf_pair_value(cp);
219 if (!value) {
220 DEBUG3("Trigger has no value: %s", name);
221 return -1;
222 }
223
224 /*
225 * Perform periodic rate_limiting.
226 */
227 if (rate_limit) {
228 trigger_last_fired_t find, *found;
229 fr_time_t now = fr_time();
230
231 find.ci = ci;
232
233 pthread_mutex_lock(trigger_mutex);
234
235 found = fr_rb_find(trigger_last_fired_tree, &find);
236 if (!found) {
237 MEM(found = talloc(NULL, trigger_last_fired_t));
238 found->ci = ci;
239 /*
240 * Initialise last_fired to 2 seconds ago so
241 * the trigger fires on the first occurrence
242 */
243 found->last_fired = fr_time_wrap(NSEC * -2);
244
246 }
247
248 pthread_mutex_unlock(trigger_mutex);
249
250 /*
251 * Send the rate_limited traps at most once per second.
252 *
253 * @todo - make this configurable for longer periods of time.
254 */
255 if (fr_time_to_sec(found->last_fired) == fr_time_to_sec(now)) return -1;
256 found->last_fired = now;
257 }
258
259 /*
260 * Allocate a request to run asynchronously in the interpreter.
261 */
262 request = request_local_alloc_internal(NULL, (&(request_init_args_t){ .detachable = true }));
263
264 if (args) {
265 fr_pair_t *vp;
266
267 if (fr_pair_list_copy(request->request_ctx, &request->request_pairs, args) < 0) {
268 PERROR("Failed copying trigger arguments");
269 talloc_free(request);
270 return -1;
271 }
272
273 /*
274 * Add the trigger name to the request data
275 */
278 }
279
280 MEM(trigger = talloc_zero(request, fr_trigger_t));
281 fr_value_box_list_init(&trigger->out);
282
284 if (!el) el = main_loop_event_list();
285
286 t_rules = (tmpl_rules_t) {
287 .attr = {
288 .dict_def = request->local_dict, /* we can use local attributes */
289 .list_def = request_attr_request,
290 },
291 .xlat = {
292 .runtime_el = el,
293 },
294 .at_runtime = true,
295 };
296
298 cf_pair_value_quote(cp), NULL, &t_rules);
299 if (slen <= 0) {
300 char *spaces, *text;
301
302 fr_canonicalize_error(trigger, &spaces, &text, slen, value);
303
304 cf_log_err(cp, "Failed parsing trigger expresion");
305 cf_log_err(cp, "%s", text);
306 cf_log_perr(cp, "%s^", spaces);
307
308 talloc_free(request);
310 talloc_free(text);
311 return -1;
312 }
313
314 if (!tmpl_is_exec(trigger->vpt) && !tmpl_is_xlat(trigger->vpt)) {
315 /*
316 * We only support exec and xlat templates.
317 * Anything else is an error.
318 */
319 cf_log_err(cp, "Trigger must be an \"expr\" or `exec`");
320 talloc_free(request);
321 return -1;
322 }
323
324 fr_assert(trigger->vpt != NULL);
325
326 if (unlang_tmpl_push(trigger, &trigger->result, &trigger->out, request, trigger->vpt,
328 .type = UNLANG_TMPL_ARGS_TYPE_EXEC,
329 .exec = {
330 .status_out = &trigger->exec_status,
331 .timeout = fr_time_delta_from_sec(5),
332 },
333 }) < 0) {
334 talloc_free(request);
335 }
336
337 /*
338 * An interpreter was passed in, we can run the expansion
339 * asynchronously in that interpreter. And then the
340 * worker cleans up the detached request.
341 */
342 if (intp) {
343 unlang_interpret_set(request, intp);
344
345 /*
346 * Don't allow the expansion to run for a long time.
347 *
348 * @todo - make the timeout configurable.
349 */
351 DEBUG("Failed setting timeout on trigger %s", value);
352 talloc_free(request);
353 return -1;
354 }
355
357 PERROR("Running trigger failed");
358 talloc_free(request);
359 return -1;
360 }
361 } else {
362 /*
363 * No interpreter, we MUST be running from the
364 * main loop. We then run the expansion
365 * synchronously. This allows the expansion /
366 * notification to finish before the server shuts
367 * down.
368 *
369 * If the expansion was async, then it may be
370 * possible for the server to exit before the
371 * expansion finishes. Arguably the worker
372 * thread should ensure that the server doesn't
373 * exit until all requests have acknowledged that
374 * they've exited.
375 *
376 * But those exits may be advisory. i.e. "please
377 * finish the request". This one here is
378 * mandatary to finish before the server exits.
379 */
380 unlang_interpret_synchronous(NULL, request);
381 talloc_free(request);
382 }
383
384 return 0;
385}
386
387/** Create trigger arguments to describe the server the pool connects to
388 *
389 * @note #trigger_init must be called before calling this function,
390 * else it will return NULL.
391 *
392 * @param[in] ctx to allocate fr_pair_t s in.
393 * @param[out] list to append Pool-Server and Pool-Port pairs to
394 * @param[in] server we're connecting to.
395 * @param[in] port on that server.
396 */
397void trigger_args_afrom_server(TALLOC_CTX *ctx, fr_pair_list_t *list, char const *server, uint16_t port)
398{
399 fr_dict_attr_t const *server_da;
400 fr_dict_attr_t const *port_da;
401 fr_pair_t *vp;
402
403 server_da = fr_dict_attr_child_by_num(fr_dict_root(fr_dict_internal()), FR_CONNECTION_POOL_SERVER);
404 if (!server_da) {
405 ERROR("Incomplete dictionary: Missing definition for \"Connection-Pool-Server\"");
406 return;
407 }
408
409 port_da = fr_dict_attr_child_by_num(fr_dict_root(fr_dict_internal()), FR_CONNECTION_POOL_PORT);
410 if (!port_da) {
411 ERROR("Incomplete dictionary: Missing definition for \"Connection-Pool-Port\"");
412 return;
413 }
414
415 MEM(vp = fr_pair_afrom_da(ctx, server_da));
416 fr_pair_value_strdup(vp, server, false);
417 fr_pair_append(list, vp);
418
419 MEM(vp = fr_pair_afrom_da(ctx, port_da));
420 vp->vp_uint16 = port;
421 fr_pair_append(list, vp);
422}
423
424static int _mutex_free(pthread_mutex_t *mutex)
425{
426 pthread_mutex_destroy(mutex);
427 return 0;
428}
429
430/** Free trigger resources
431 *
432 */
433static int _trigger_free(UNUSED void *uctx)
434{
436 TALLOC_FREE(trigger_last_fired_tree);
437 TALLOC_FREE(trigger_mutex);
438
439 return 0;
440}
441
442/** Set the global trigger section trigger will search in, and register xlats
443 *
444 * This function exists because triggers are used by the connection pool, which
445 * is used in the server library which may not have the mainconfig available.
446 * Additionally, utilities may want to set their own root config sections.
447 *
448 * We don't register the trigger xlat here, as we may inadvertently initialise
449 * the xlat code, which is annoying when this is called from a utility.
450 *
451 * @param[in] cs_arg to use as global trigger section.
452 * @return
453 * - 0 on success.
454 * - -1 on failure.
455 */
456static int _trigger_init(void *cs_arg)
457{
458 CONF_SECTION *cs;
459
461 PERROR("Failed loading trigger dictionaries");
462 return -1;
463 }
465 PERROR("Failed loading trigger attributes");
466 return -1;
467 }
468
469 cs = talloc_get_type_abort(cs_arg, CONF_SECTION);
470 if (!cs) {
471 ERROR("%s - Pointer to main_config was NULL", __FUNCTION__);
472 return -1;
473 }
474
475 trigger_cs = cf_section_find(cs, "trigger", NULL);
476 if (!trigger_cs) {
477 WARN("trigger { ... } subsection not found, triggers will be disabled");
478 return 0;
479 }
480
484
486 pthread_mutex_init(trigger_mutex, 0);
487 talloc_set_destructor(trigger_mutex, _mutex_free);
488
489 return 0;
490}
491
493{
494 int ret;
495
496 fr_atexit_global_once_ret(&ret, _trigger_init, _trigger_free, UNCONST(CONF_SECTION *, cs));
497
498 return ret;
499}
va_list args
Definition acutest.h:770
#define UNCONST(_type, _ptr)
Remove const qualification from a pointer.
Definition build.h:167
#define RCSID(id)
Definition build.h:485
#define CMP(_a, _b)
Same as CMP_PREFER_SMALLER use when you don't really care about ordering, you just want an ordering.
Definition build.h:112
#define unlikely(_x)
Definition build.h:383
#define UNUSED
Definition build.h:317
bool check_config
Definition cf_file.c:66
CONF_ITEM * cf_reference_item(CONF_SECTION const *parent_cs, CONF_SECTION const *outer_cs, char const *ptr)
Definition cf_file.c:3743
Common header for all CONF_* types.
Definition cf_priv.h:49
Configuration AVP similar to a fr_pair_t.
Definition cf_priv.h:70
A section grouping multiple CONF_PAIR.
Definition cf_priv.h:101
bool cf_item_is_pair(CONF_ITEM const *ci)
Determine if CONF_ITEM is a CONF_PAIR.
Definition cf_util.c:631
CONF_SECTION * cf_section_find(CONF_SECTION const *cs, char const *name1, char const *name2)
Find a CONF_SECTION with name1 and optionally name2.
Definition cf_util.c:1027
fr_token_t cf_pair_value_quote(CONF_PAIR const *pair)
Return the value (rhs) quoting of a pair.
Definition cf_util.c:1637
CONF_PAIR * cf_item_to_pair(CONF_ITEM const *ci)
Cast a CONF_ITEM to a CONF_PAIR.
Definition cf_util.c:663
char const * cf_pair_value(CONF_PAIR const *pair)
Return the value of a CONF_PAIR.
Definition cf_util.c:1593
#define cf_log_err(_cf, _fmt,...)
Definition cf_util.h:289
#define cf_log_perr(_cf, _fmt,...)
Definition cf_util.h:296
#define MEM(x)
Definition debug.h:36
static char const * spaces
Definition dependency.c:370
#define ERROR(fmt,...)
Definition dhcpclient.c:41
#define DEBUG(fmt,...)
Definition dhcpclient.c:39
#define fr_dict_autofree(_to_free)
Definition dict.h:870
fr_dict_attr_t const * fr_dict_root(fr_dict_t const *dict)
Return the root attribute of a dictionary.
Definition dict_util.c:2403
fr_dict_attr_t const ** out
Where to write a pointer to the resolved fr_dict_attr_t.
Definition dict.h:274
fr_dict_t const ** out
Where to write a pointer to the loaded/resolved fr_dict_t.
Definition dict.h:287
int fr_dict_attr_autoload(fr_dict_attr_autoload_t const *to_load)
Process a dict_attr_autoload element to load/verify a dictionary attribute.
Definition dict_util.c:4134
fr_dict_t const * fr_dict_internal(void)
Definition dict_util.c:4654
#define fr_dict_autoload(_to_load)
Definition dict.h:867
fr_dict_attr_t const * fr_dict_attr_child_by_num(fr_dict_attr_t const *parent, unsigned int attr)
Check if a child attribute exists in a parent using an attribute number.
Definition dict_util.c:3331
Specifies an attribute which must be present for the module to function.
Definition dict.h:273
Specifies a dictionary which must be loaded/loadable for the module to function.
Definition dict.h:286
Test enumeration values.
Definition dict_test.h:92
int unlang_interpret_set_timeout(request_t *request, fr_time_delta_t timeout)
Set a timeout for a request.
Definition interpret.c:1494
void unlang_interpret_set(request_t *request, unlang_interpret_t *intp)
Set a specific interpreter for a request.
Definition interpret.c:1988
fr_event_list_t * unlang_interpret_event_list(request_t *request)
Get the event list for the current interpreter.
Definition interpret.c:2007
rlm_rcode_t unlang_interpret_synchronous(fr_event_list_t *el, request_t *request)
Execute an unlang section synchronously.
#define PERROR(_fmt,...)
Definition log.h:228
#define DEBUG3(_fmt,...)
Definition log.h:266
talloc_free(reap)
Stores all information relating to an event list.
Definition event.c:377
void fr_canonicalize_error(TALLOC_CTX *ctx, char **sp, char **text, ssize_t slen, char const *fmt)
Canonicalize error strings, removing tabs, and generate spaces for error marker.
Definition log.c:87
fr_event_list_t * main_loop_event_list(void)
Return the main loop event list.
Definition main_loop.c:164
unsigned short uint16_t
@ FR_TYPE_STRING
String of printable characters.
long int ssize_t
int fr_pair_list_copy(TALLOC_CTX *ctx, fr_pair_list_t *to, fr_pair_list_t const *from)
Duplicate a list of pairs.
Definition pair.c:2320
int fr_pair_value_strdup(fr_pair_t *vp, char const *src, bool tainted)
Copy data into an "string" data type.
Definition pair.c:2636
int fr_pair_append(fr_pair_list_t *list, fr_pair_t *to_add)
Add a VP to the end of the list.
Definition pair.c:1342
fr_pair_t * fr_pair_afrom_da(TALLOC_CTX *ctx, fr_dict_attr_t const *da)
Dynamically allocate a new attribute and assign a fr_dict_attr_t.
Definition pair.c:287
#define fr_assert(_expr)
Definition rad_assert.h:38
#define WARN(fmt,...)
Definition radclient.h:47
void * fr_rb_find(fr_rb_tree_t const *tree, void const *data)
Find an element in the tree, returning the data, not the node.
Definition rb.c:577
bool fr_rb_insert(fr_rb_tree_t *tree, void const *data)
Insert data into a tree.
Definition rb.c:626
#define fr_rb_inline_talloc_alloc(_ctx, _type, _field, _data_cmp, _data_free)
Allocs a red black that verifies elements are of a specific talloc type.
Definition rb.h:246
The main red black tree structure.
Definition rb.h:73
fr_dict_attr_t const * request_attr_request
Definition request.c:43
#define request_local_alloc_internal(_ctx, _args)
Allocate a new internal request outside of the request pool.
Definition request.h:339
Optional arguments for initialising requests.
Definition request.h:283
static char const * name
#define FR_SBUFF_IN(_start, _len_or_end)
#define pair_append_request(_attr, _da)
Allocate and append a fr_pair_t to the request list.
Definition pair.h:37
#define tmpl_is_xlat(vpt)
Definition tmpl.h:210
#define tmpl_is_exec(vpt)
Definition tmpl.h:211
ssize_t tmpl_afrom_substr(TALLOC_CTX *ctx, tmpl_t **out, fr_sbuff_t *in, fr_token_t quote, fr_sbuff_parse_rules_t const *p_rules, tmpl_rules_t const *t_rules))
Convert an arbitrary string into a tmpl_t.
tmpl_attr_rules_t attr
Rules/data for parsing attribute references.
Definition tmpl.h:335
struct tmpl_rules_s tmpl_rules_t
Definition tmpl.h:233
Optional arguments passed to vp_tmpl functions.
Definition tmpl.h:332
fr_pair_t * vp
#define fr_time()
Allow us to arbitrarily manipulate time.
Definition state_test.c:8
fr_dict_t const * dict_def
Default dictionary to use with unqualified attribute references.
Definition tmpl.h:273
Stores an attribute, a value and various bits of other data.
Definition pair.h:68
int unlang_subrequest_child_push_and_detach(request_t *request)
Add a child request to the runnable queue.
Definition subrequest.c:488
void * talloc_null_ctx(void)
Retrieve the current talloc NULL ctx.
Definition talloc.c:49
static size_t talloc_strlen(char const *s)
Returns the length of a talloc array containing a string.
Definition talloc.h:294
static int64_t fr_time_to_sec(fr_time_t when)
Convert an fr_time_t (internal time) to number of sec since the unix epoch (wallclock time)
Definition time.h:731
static fr_time_delta_t fr_time_delta_from_sec(int64_t sec)
Definition time.h:590
#define fr_time_wrap(_time)
Definition time.h:145
#define NSEC
Definition time.h:379
"server local" time.
Definition time.h:69
int unlang_tmpl_push(TALLOC_CTX *ctx, unlang_result_t *p_result, fr_value_box_list_t *out, request_t *request, tmpl_t const *tmpl, unlang_tmpl_args_t *args)
Push a tmpl onto the stack for evaluation.
Definition tmpl.c:273
tmpl_t * vpt
the template to execute
Definition trigger.c:102
int exec_status
Result of the program (if the trigger is a tmpl)
Definition trigger.c:103
static fr_dict_attr_t const * attr_trigger_name
Definition trigger.c:66
static int _trigger_init(void *cs_arg)
Set the global trigger section trigger will search in, and register xlats.
Definition trigger.c:456
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:397
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
static int _mutex_free(pthread_mutex_t *mutex)
Definition trigger.c:424
static fr_dict_t const * dict_freeradius
Definition trigger.c:59
int trigger_init(CONF_SECTION const *cs)
Definition trigger.c:492
fr_dict_autoload_t trigger_dict[]
Definition trigger.c:61
fr_rb_node_t node
Entry in the trigger last fired tree.
Definition trigger.c:54
fr_value_box_list_t out
result of the xlap (which we ignore)
Definition trigger.c:100
fr_time_t last_fired
When this trigger last fired.
Definition trigger.c:56
static fr_rb_tree_t * trigger_last_fired_tree
Definition trigger.c:47
unlang_result_t result
the result of expansion
Definition trigger.c:101
CONF_ITEM * ci
Config item this rate limit counter is associated with.
Definition trigger.c:55
static pthread_mutex_t * trigger_mutex
Definition trigger.c:48
static int8_t _trigger_last_fired_cmp(void const *one, void const *two)
Compares two last fired structures.
Definition trigger.c:84
static CONF_SECTION const * trigger_cs
Whether triggers are enabled globally.
Definition trigger.c:46
static void _trigger_last_fired_free(void *data)
Definition trigger.c:73
bool trigger_enabled(void)
Return whether triggers are enabled.
Definition trigger.c:94
fr_dict_attr_autoload_t trigger_dict_attr[]
Definition trigger.c:68
static int _trigger_free(UNUSED void *uctx)
Free trigger resources.
Definition trigger.c:433
Describes a rate limiting entry for a trigger.
Definition trigger.c:53
static fr_event_list_t * el
Arguments for evaluating different types of tmpls.
Definition tmpl.h:48
static fr_slen_t data
Definition value.h:1288