2
* This file contains type defintions used by syslogd and its modules.
3
* It is a required input for any module.
5
* File begun on 2007-07-13 by RGerhards (extracted from syslogd.c)
7
* Copyright 2007 Rainer Gerhards and Adiscon GmbH.
9
* This file is part of rsyslog.
11
* Rsyslog is free software: you can redistribute it and/or modify
12
* it under the terms of the GNU General Public License as published by
13
* the Free Software Foundation, either version 3 of the License, or
14
* (at your option) any later version.
16
* Rsyslog is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU General Public License for more details.
21
* You should have received a copy of the GNU General Public License
22
* along with Rsyslog. If not, see <http://www.gnu.org/licenses/>.
24
* A copy of the GPL can be found in the file "COPYING" in this distribution.
26
#ifndef SYSLOGD_TYPES_INCLUDED
27
#define SYSLOGD_TYPES_INCLUDED 1
29
#include "stringbuf.h"
31
#include <sys/param.h>
40
# define UNAMESZ UT_NAMESIZE /* length of a login name */
42
# define UNAMESZ 8 /* length of a login name */
44
#define MAXUNAMES 20 /* maximum number of user names */
45
#define MAXFNAME 200 /* max file pathname length */
47
#define _DB_MAXDBLEN 128 /* maximum number of db */
48
#define _DB_MAXUNAMELEN 128 /* maximum number of user name */
49
#define _DB_MAXPWDLEN 128 /* maximum number of user's pass */
50
#define _DB_DELAYTIMEONERROR 20 /* If an error occur we stop logging until
51
a delayed time is over */
54
/* we define features of the syslog code. This features can be used
55
* to check if modules are compatible with them - and possible other
56
* applications I do not yet envision. -- rgerhards, 2007-07-24
58
typedef enum _syslogFeature {
59
sFEATURERepeatedMsgReduction = 1
62
/* we define our own facility and severities */
63
/* facility and severity codes */
64
typedef struct _syslogCode {
69
/* values for host comparisons specified with host selector blocks
70
* (+host, -host). rgerhards 2005-10-18.
72
enum _EHostnameCmpMode {
73
HN_NO_COMP = 0, /* do not compare hostname */
74
HN_COMP_MATCH = 1, /* hostname must match */
75
HN_COMP_NOMATCH = 2 /* hostname must NOT match */
77
typedef enum _EHostnameCmpMode EHostnameCmpMode;
79
/* rgerhards 2004-11-11: the following structure represents
80
* a time as it is used in syslog.
83
int timeType; /* 0 - unitinialized , 1 - RFC 3164, 2 - syslog-protocol */
87
int hour; /* 24 hour clock */
90
int secfrac; /* fractional seconds (must be 32 bit!) */
92
char OffsetMode; /* UTC offset + or - */
93
char OffsetHour; /* UTC offset in hours */
94
int OffsetMinute; /* UTC offset in minutes */
95
/* full UTC offset minutes = OffsetHours*60 + OffsetMinute. Then use
96
* OffsetMode to know the direction.
99
typedef struct syslogTime syslogTime_t;
101
#endif /* #ifndef SYSLOGD_TYPES_INCLUDED */