1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
/*
* Copyright (c) 2017 Balabit
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* As an additional exemption you are allowed to compile & link against the
* OpenSSL libraries as published by the OpenSSL project. See the file
* COPYING for details.
*
*/
#ifndef MODULES_AFFILE_WILDCARD_SOURCE_H_
#define MODULES_AFFILE_WILDCARD_SOURCE_H_
#include "syslog-ng.h"
#include "driver.h"
#include "wildcard-file-reader.h"
#include "file-list.h"
#include "directory-monitor.h"
#include "directory-monitor-factory.h"
#define DEFAULT_MAX_FILES 100
typedef struct _WildcardSourceDriver
{
LogSrcDriver super;
gchar *base_dir;
gchar *filename_pattern;
MonitorMethod monitor_method;
gint monitor_freq;
guint32 max_files;
gboolean window_size_initialized;
gboolean recursive;
FileReaderOptions file_reader_options;
FileOpenerOptions file_opener_options;
GPatternSpec *compiled_pattern;
GHashTable *file_readers;
GHashTable *directory_monitors;
FileOpener *file_opener;
PendingFileList *waiting_list;
} WildcardSourceDriver;
LogDriver *wildcard_sd_new(GlobalConfig *cfg);
void wildcard_sd_set_base_dir(LogDriver *s, const gchar *base_dir);
void wildcard_sd_set_filename_pattern(LogDriver *s, const gchar *filename_pattern);
void wildcard_sd_set_recursive(LogDriver *s, gboolean recursive);
gboolean wildcard_sd_set_monitor_method(LogDriver *s, const gchar *method);
void wildcard_sd_set_monitor_freq(LogDriver *s, gint monitor_freq);
void wildcard_sd_set_max_files(LogDriver *s, guint32 max_files);
gboolean affile_is_legacy_wildcard_source(const gchar *filename);
LogDriver *wildcard_sd_legacy_new(const gchar *filename, GlobalConfig *cfg);
#endif /* MODULES_AFFILE_WILDCARD_SOURCE_H_ */
|