syslog-ng source
pdb-action.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2002-2013, 2015 Balabit
3  * Copyright (c) 1998-2013, 2015 Balázs Scheidler
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 2 as published
7  * by the Free Software Foundation, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  *
18  * As an additional exemption you are allowed to compile & link against the
19  * OpenSSL libraries as published by the OpenSSL project. See the file
20  * COPYING for details.
21  *
22  */
23 #ifndef CORRELATION_PDB_ACTION_H_INCLUDED
24 #define CORRELATION_PDB_ACTION_H_INCLUDED
25 
26 #include "syslog-ng.h"
27 #include "synthetic-message.h"
28 #include "synthetic-context.h"
29 #include "filter/filter-expr.h"
30 
31 /* rule action triggers */
32 typedef enum
33 {
34  RAT_MATCH = 1,
37 
38 /* action content*/
39 typedef enum
40 {
45 
46 /* a rule may contain one or more actions to be performed */
47 typedef struct _PDBAction
48 {
49  FilterExprNode *condition;
52  guint32 rate_quantum;
53  guint16 rate;
54  guint8 id;
55  union
56  {
58  struct
59  {
60  SyntheticMessage message;
62  } create_context;
63  } content;
64 } PDBAction;
65 
66 void pdb_action_set_condition(PDBAction *self, GlobalConfig *cfg, const gchar *filter_string, GError **error);
67 void pdb_action_set_rate(PDBAction *self, const gchar *rate_);
68 void pdb_action_set_trigger(PDBAction *self, const gchar *trigger, GError **error);
69 
70 PDBAction *pdb_action_new(gint id);
71 void pdb_action_free(PDBAction *self);
72 
73 #endif
PDBActionTrigger
Definition: pdb-action.h:33
@ RAT_MATCH
Definition: pdb-action.h:34
@ RAT_TIMEOUT
Definition: pdb-action.h:35
void pdb_action_set_rate(PDBAction *self, const gchar *rate_)
Definition: pdb-action.c:52
PDBAction * pdb_action_new(gint id)
Definition: pdb-action.c:89
void pdb_action_free(PDBAction *self)
Definition: pdb-action.c:102
PDBActionContentType
Definition: pdb-action.h:40
@ RAC_CREATE_CONTEXT
Definition: pdb-action.h:43
@ RAC_NONE
Definition: pdb-action.h:41
@ RAC_MESSAGE
Definition: pdb-action.h:42
void pdb_action_set_trigger(PDBAction *self, const gchar *trigger, GError **error)
Definition: pdb-action.c:78
void pdb_action_set_condition(PDBAction *self, GlobalConfig *cfg, const gchar *filter_string, GError **error)
Definition: pdb-action.c:30
Definition: pdb-action.h:48
PDBActionContentType content_type
Definition: pdb-action.h:51
SyntheticContext context
Definition: pdb-action.h:61
guint16 rate
Definition: pdb-action.h:53
guint8 id
Definition: pdb-action.h:54
SyntheticMessage message
Definition: pdb-action.h:57
FilterExprNode * condition
Definition: pdb-action.h:49
PDBActionTrigger trigger
Definition: pdb-action.h:50
guint32 rate_quantum
Definition: pdb-action.h:52
Definition: synthetic-context.h:31
Definition: synthetic-message.h:45
GlobalConfig * cfg
Definition: test_batched_ack_tracker.c:34