syslog-ng source
pdb-ratelimit.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2002-2017 Balabit
3  * Copyright (c) 1998-2017 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 
24 #ifndef CORRELATION_PDB_RATELIMIT_H_INCLUDED
25 #define CORRELATION_PDB_RATELIMIT_H_INCLUDED
26 
27 #include "correlation-key.h"
28 
29 /* This class encapsulates a rate-limit state stored in
30  db->state. */
31 typedef struct _PDBRateLimit
32 {
33  /* key in the hashtable. NOTE: host/program/pid/session_id are allocated, thus they need to be freed when the structure is freed. */
35  gint buckets;
36  guint64 last_check;
37 } PDBRateLimit;
38 
41 
42 #endif
PDBRateLimit * pdb_rate_limit_new(CorrelationKey *key)
Definition: pdb-ratelimit.c:31
void pdb_rate_limit_free(PDBRateLimit *self)
Definition: pdb-ratelimit.c:46
Definition: correlation-key.h:47
Definition: pdb-ratelimit.h:32
CorrelationKey key
Definition: pdb-ratelimit.h:34
guint64 last_check
Definition: pdb-ratelimit.h:36
gint buckets
Definition: pdb-ratelimit.h:35
struct tm key
Definition: cache.c:63