1
/***************************************************************************
3
* Copyright (c) 1999 Bal�zs Scheidler
4
* Copyright (c) 1999-2001 BalaBit IT Ltd.
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
2
* Copyright (c) 2002, 2003, 2004 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.
11
14
* This program is distributed in the hope that it will be useful,
12
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
19
* You should have received a copy of the GNU General Public License
17
20
* along with this program; if not, write to the Free Software
18
21
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
* Inspired by nsyslog, originally written by Darren Reed.
22
* $Id: affile.h,v 1.19.4.1 2004/05/06 08:38:27 bazsi Exp $
24
***************************************************************************/
29
#include "syslog-ng.h"
34
#include "destinations.h"
36
#define AFFILE_COMPRESS 0x0001
37
#define AFFILE_COMPRESS_SHIFT 0
39
#define AFFILE_ENCRYPT 0x0002
40
#define AFFILE_ENCRYPT_SHIFT 1
42
#define AFFILE_PIPE 0x0004
43
#define AFFILE_NO_EXPAND 0x0008
45
#define AFFILE_CREATE_DIRS 0x0010
46
#define AFFILE_CREATE_DIRS_SHIFT 4
48
#define AFFILE_FSYNC 0x0020
49
#define AFFILE_FSYNC_SHIFT 5
50
#define AFFILE_SANITIZE_FILENAMES 0x0040
52
void affile_set_syncfreq(struct log_dest_driver *affile, int syncfreq);
53
void affile_set_fsync(struct log_dest_driver *c, int enable);
54
void affile_set_compress(struct log_dest_driver *affile, int enable);
55
void affile_set_encrypt(struct log_dest_driver *affile, int enable);
56
void affile_set_owner(struct log_dest_driver *c, char *owner);
57
void affile_set_group(struct log_dest_driver *c, char *group);
58
void affile_set_perm(struct log_dest_driver *c, int perm);
59
void affile_set_dir_owner(struct log_dest_driver *c, char *owner);
60
void affile_set_dir_group(struct log_dest_driver *c, char *group);
61
void affile_set_dir_perm(struct log_dest_driver *c, int perm);
62
void affile_set_create_dirs(struct log_dest_driver *c, int enable);
63
void affile_set_file_template(struct log_dest_driver *c, char *template);
64
void affile_set_template_escape(struct log_dest_driver *c, int enable);
65
void affile_set_remove_if_older(struct log_dest_driver *c, int interval);
67
struct log_source_driver *make_affile_source(const char *name, int flags, UINT8 *prefix, UINT32 pad_size);
68
struct log_dest_driver *make_affile_dest(const char *name, int flags);
24
#ifndef SDFILE_H_INCLUDED
25
#define SDFILE_H_INCLUDED
28
#include "logreader.h"
29
#include "logwriter.h"
31
#define AFFILE_PIPE 0x00000001
32
#define AFFILE_NO_EXPAND 0x00000002
33
#define AFFILE_TMPL_ESCAPE 0x00000004
34
#define AFFILE_CREATE_DIRS 0x00000008
36
typedef struct _AFFileSourceDriver
41
LogReaderOptions reader_options;
45
LogDriver *affile_sd_new(gchar *filename, guint32 flags);
47
typedef struct _AFFileDestDriver
50
LogTemplate *filename_template;
59
LogWriterOptions writer_options;
60
GHashTable *writer_hash;
63
gboolean use_time_recvd;
68
LogDriver *affile_dd_new(gchar *filename, guint32 flags);
70
void affile_dd_set_compress(LogDriver *s, gboolean compress);
71
void affile_dd_set_encrypt(LogDriver *s, gboolean enable);
72
void affile_dd_set_file_uid(LogDriver *s, const gchar *file_uid);
73
void affile_dd_set_file_gid(LogDriver *s, const gchar *file_gid);
74
void affile_dd_set_file_perm(LogDriver *s, mode_t file_perm);
75
void affile_dd_set_dir_uid(LogDriver *s, const gchar *dir_uid);
76
void affile_dd_set_dir_gid(LogDriver *s, const gchar *dir_gid);
77
void affile_dd_set_dir_perm(LogDriver *s, mode_t dir_perm);
78
void affile_dd_set_create_dirs(LogDriver *s, gboolean create_dirs);
79
void affile_dd_set_fsync(LogDriver *s, gboolean enable);