~ubuntu-branches/ubuntu/hardy/syslog-ng/hardy

« back to all changes in this revision

Viewing changes to src/affile.h

  • Committer: Bazaar Package Importer
  • Author(s): SZALAY Attila
  • Date: 2006-05-25 11:21:50 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20060525112150-b18srkxcrz980xi9
Tags: 1.9.11-1
* New upstream version
  - Fixed log facility and priority detecting. (Closes: #350120, #350344, #357071, #367256)
* Added bison to Build-Dependency. (Closes: #368765)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
 *
3
 
 * Copyright (c) 1999 Bal�zs Scheidler
4
 
 * Copyright (c) 1999-2001 BalaBit IT Ltd.
5
 
 * 
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.
 
1
/*
 
2
 * Copyright (c) 2002, 2003, 2004 BalaBit IT Ltd, Budapest, Hungary
 
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.
 
7
 *
 
8
 * Note that this permission is granted for only version 2 of the GPL.
 
9
 *
 
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.
10
13
 *
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.
19
 
 *
20
 
 * Inspired by nsyslog, originally written by Darren Reed.
21
 
 *
22
 
 * $Id: affile.h,v 1.19.4.1 2004/05/06 08:38:27 bazsi Exp $
23
 
 *
24
 
 ***************************************************************************/
25
 
 
26
 
#ifndef __AFFILE_H
27
 
#define __AFFILE_H
28
 
 
29
 
#include "syslog-ng.h"
30
 
 
31
 
#include "log.h"
32
 
#include "io.h"
33
 
#include "sources.h"
34
 
#include "destinations.h"
35
 
 
36
 
#define AFFILE_COMPRESS       0x0001
37
 
#define AFFILE_COMPRESS_SHIFT 0
38
 
 
39
 
#define AFFILE_ENCRYPT        0x0002
40
 
#define AFFILE_ENCRYPT_SHIFT  1
41
 
 
42
 
#define AFFILE_PIPE           0x0004
43
 
#define AFFILE_NO_EXPAND      0x0008
44
 
 
45
 
#define AFFILE_CREATE_DIRS    0x0010
46
 
#define AFFILE_CREATE_DIRS_SHIFT 4
47
 
 
48
 
#define AFFILE_FSYNC          0x0020
49
 
#define AFFILE_FSYNC_SHIFT    5
50
 
#define AFFILE_SANITIZE_FILENAMES 0x0040
51
 
 
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);
66
 
 
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);
 
22
 */
 
23
 
 
24
#ifndef SDFILE_H_INCLUDED
 
25
#define SDFILE_H_INCLUDED
 
26
 
 
27
#include "driver.h"
 
28
#include "logreader.h"
 
29
#include "logwriter.h"
 
30
 
 
31
#define AFFILE_PIPE        0x00000001
 
32
#define AFFILE_NO_EXPAND   0x00000002
 
33
#define AFFILE_TMPL_ESCAPE 0x00000004
 
34
#define AFFILE_CREATE_DIRS 0x00000008
 
35
 
 
36
typedef struct _AFFileSourceDriver
 
37
{
 
38
  LogDriver super;
 
39
  GString *filename;
 
40
  LogPipe *reader;
 
41
  LogReaderOptions reader_options;
 
42
  guint32 flags;
 
43
} AFFileSourceDriver;
 
44
 
 
45
LogDriver *affile_sd_new(gchar *filename, guint32 flags);
 
46
 
 
47
typedef struct _AFFileDestDriver
 
48
{
 
49
  LogDriver super;
 
50
  LogTemplate *filename_template;
 
51
  LogPipe *writer;
 
52
  guint32 flags;
 
53
  uid_t file_uid;
 
54
  gid_t file_gid;
 
55
  mode_t file_perm;
 
56
  uid_t dir_uid;
 
57
  gid_t dir_gid;
 
58
  mode_t dir_perm;
 
59
  LogWriterOptions writer_options;
 
60
  GHashTable *writer_hash;
 
61
  GlobalConfig *cfg;
 
62
  
 
63
  gboolean use_time_recvd;
 
64
  gint time_reap;
 
65
  guint reap_timer;
 
66
} AFFileDestDriver;
 
67
 
 
68
LogDriver *affile_dd_new(gchar *filename, guint32 flags);
 
69
 
 
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);
69
80
 
70
81
#endif