2
* Copyright (c) 2002-2009 BalaBit IT Ltd, Budapest, Hungary
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License version 2 as published
6
* by the Free Software Foundation.
8
* Note that this permission is granted for only version 2 of the GPL.
10
* As an additional exemption you are allowed to compile & link against the
11
* OpenSSL libraries as published by the OpenSSL project. See the file
12
* COPYING for details.
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
19
* You should have received a copy of the GNU General Public License
20
* along with this program; if not, write to the Free Software
21
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24
#include "logprocess.h"
28
log_process_rule_init(LogProcessRule *self, const gchar *name)
30
memset(self, 0, sizeof(LogProcessRule));
32
self->name = g_strdup(name);
37
log_process_rule_ref(LogProcessRule *self)
43
log_process_rule_unref(LogProcessRule *self)
45
if (--self->ref_cnt == 0)
55
log_process_pipe_init(LogPipe *self)
61
log_process_pipe_deinit(LogPipe *self)
67
log_process_pipe_queue(LogPipe *s, LogMessage *msg, const LogPathOptions *path_options)
69
LogProcessPipe *self = (LogProcessPipe *) s;
70
if (log_process_rule_process(self->rule, msg))
74
log_pipe_queue(s->pipe_next, msg, path_options);
76
log_msg_drop(msg, path_options);
80
if (path_options->matched)
81
(*path_options->matched) = FALSE;
82
log_msg_drop(msg, path_options);
87
log_process_pipe_free(LogPipe *s)
89
LogProcessPipe *self = (LogProcessPipe *) s;
91
log_process_rule_unref(self->rule);
96
log_process_pipe_new(LogProcessRule *rule)
98
LogProcessPipe *self = g_new0(LogProcessPipe, 1);
100
log_pipe_init_instance(&self->super);
101
log_process_rule_ref(rule);
103
self->super.init = log_process_pipe_init;
104
self->super.deinit = log_process_pipe_deinit;
105
self->super.queue = log_process_pipe_queue;
106
self->super.free_fn = log_process_pipe_free;