syslog-ng source
wildcard-source.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 Balabit
3  *
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, or (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  * As an additional exemption you are allowed to compile & link against the
18  * OpenSSL libraries as published by the OpenSSL project. See the file
19  * COPYING for details.
20  *
21  */
22 #ifndef MODULES_AFFILE_WILDCARD_SOURCE_H_
23 #define MODULES_AFFILE_WILDCARD_SOURCE_H_
24 
25 #include "syslog-ng.h"
26 #include "driver.h"
27 #include "wildcard-file-reader.h"
28 #include "file-list.h"
29 #include "directory-monitor.h"
31 
32 #define DEFAULT_MAX_FILES 100
33 
34 typedef struct _WildcardSourceDriver
35 {
36  LogSrcDriver super;
37  gchar *base_dir;
42  guint32 max_files;
43 
45  gboolean recursive;
46 
49 
50  GPatternSpec *compiled_pattern;
51  GPatternSpec *compiled_exclude;
52  GHashTable *file_readers;
53  GHashTable *directory_monitors;
54  FileOpener *file_opener;
55 
56  PendingFileList *waiting_list;
58 
59 LogDriver *wildcard_sd_new(GlobalConfig *cfg);
60 
61 void wildcard_sd_set_base_dir(LogDriver *s, const gchar *base_dir);
62 void wildcard_sd_set_filename_pattern(LogDriver *s, const gchar *filename_pattern);
63 void wildcard_sd_set_exclude_pattern(LogDriver *s, const gchar *exclude_pattern);
64 void wildcard_sd_set_recursive(LogDriver *s, gboolean recursive);
65 gboolean wildcard_sd_set_monitor_method(LogDriver *s, const gchar *method);
66 void wildcard_sd_set_monitor_freq(LogDriver *s, gint monitor_freq);
67 void wildcard_sd_set_max_files(LogDriver *s, guint32 max_files);
68 
69 gboolean affile_is_legacy_wildcard_source(const gchar *filename);
70 LogDriver *wildcard_sd_legacy_new(const gchar *filename, GlobalConfig *cfg);
71 
72 #endif /* MODULES_AFFILE_WILDCARD_SOURCE_H_ */
MonitorMethod
Definition: directory-monitor-factory.h:30
Definition: file-opener.h:44
Definition: file-reader.h:30
Definition: wildcard-source.h:35
MonitorMethod monitor_method
Definition: wildcard-source.h:40
GHashTable * file_readers
Definition: wildcard-source.h:52
PendingFileList * waiting_list
Definition: wildcard-source.h:56
gchar * exclude_pattern
Definition: wildcard-source.h:39
gchar * base_dir
Definition: wildcard-source.h:37
GHashTable * directory_monitors
Definition: wildcard-source.h:53
GPatternSpec * compiled_exclude
Definition: wildcard-source.h:51
GPatternSpec * compiled_pattern
Definition: wildcard-source.h:50
FileReaderOptions file_reader_options
Definition: wildcard-source.h:47
gboolean recursive
Definition: wildcard-source.h:45
guint32 max_files
Definition: wildcard-source.h:42
FileOpenerOptions file_opener_options
Definition: wildcard-source.h:48
FileOpener * file_opener
Definition: wildcard-source.h:54
gboolean window_size_initialized
Definition: wildcard-source.h:44
gchar * filename_pattern
Definition: wildcard-source.h:38
gint monitor_freq
Definition: wildcard-source.h:41
LogSrcDriver super
Definition: wildcard-source.h:36
GlobalConfig * cfg
Definition: test_batched_ack_tracker.c:34
void wildcard_sd_set_monitor_freq(LogDriver *s, gint monitor_freq)
Definition: wildcard-source.c:467
void wildcard_sd_set_max_files(LogDriver *s, guint32 max_files)
Definition: wildcard-source.c:475
LogDriver * wildcard_sd_legacy_new(const gchar *filename, GlobalConfig *cfg)
Definition: wildcard-source.c:538
gboolean wildcard_sd_set_monitor_method(LogDriver *s, const gchar *method)
Definition: wildcard-source.c:451
gboolean affile_is_legacy_wildcard_source(const gchar *filename)
Definition: wildcard-source.c:532
void wildcard_sd_set_base_dir(LogDriver *s, const gchar *base_dir)
Definition: wildcard-source.c:416
void wildcard_sd_set_filename_pattern(LogDriver *s, const gchar *filename_pattern)
Definition: wildcard-source.c:425
LogDriver * wildcard_sd_new(GlobalConfig *cfg)
Definition: wildcard-source.c:500
void wildcard_sd_set_exclude_pattern(LogDriver *s, const gchar *exclude_pattern)
Definition: wildcard-source.c:434
void wildcard_sd_set_recursive(LogDriver *s, gboolean recursive)
Definition: wildcard-source.c:443