~ubuntu-branches/ubuntu/lucid/rsyslog/lucid

« back to all changes in this revision

Viewing changes to syslogd.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2007-10-19 17:21:49 UTC
  • Revision ID: james.westby@ubuntu.com-20071019172149-ie6ej2xve33mxiu7
Tags: upstream-1.19.10
ImportĀ upstreamĀ versionĀ 1.19.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* common header for syslogd
 
2
 * Copyright 2007 Rainer Gerhards and Adiscon GmbH.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU General Public License
 
6
 * as published by the Free Software Foundation; either version 2
 
7
 * of the License, or (at your option) any later version.
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software
 
16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
17
 *
 
18
 * A copy of the GPL can be found in the file "COPYING" in this distribution.
 
19
 */
 
20
#ifndef SYSLOGD_H_INCLUDED
 
21
#define SYSLOGD_H_INCLUDED 1
 
22
 
 
23
#include "syslogd-types.h"
 
24
#include "objomsr.h"
 
25
 
 
26
#ifdef USE_NETZIP
 
27
#include <unistd.h>
 
28
#include <zlib.h>
 
29
/* config param: minimum message size to try compression. The smaller
 
30
 * the message, the less likely is any compression gain. We check for
 
31
 * gain before we submit the message. But to do so we still need to
 
32
 * do the (costly) compress() call. The following setting sets a size
 
33
 * for which no call to compress() is done at all. This may result in
 
34
 * a few more bytes being transmited but better overall performance.
 
35
 * Note: I have not yet checked the minimum UDP packet size. It might be
 
36
 * that we do not save anything by compressing very small messages, because
 
37
 * UDP might need to pad ;)
 
38
 * rgerhards, 2006-11-30
 
39
 */
 
40
#define MIN_SIZE_FOR_COMPRESS   60
 
41
#endif
 
42
 
 
43
#define MAXLINE         2048            /* maximum line length */
 
44
 
 
45
/* Flags to logmsg().
 
46
 */
 
47
#define INTERNAL_MSG    0x001   /* msg generated by logmsgInternal() --> special handling */
 
48
#define SYNC_FILE       0x002   /* do fsync on file after printing */
 
49
#define ADDDATE         0x004   /* add a date to the message */
 
50
#define MARK            0x008   /* this message is a mark */
 
51
 
 
52
void dbgprintf(char *, ...);
 
53
void logerror(char *type);
 
54
void logerrorSz(char *type, char *errMsg);
 
55
void logerrorInt(char *type, int iErr);
 
56
 
 
57
void printchopped(char *hname, char *msg, int len, int fd, int iSourceType);
 
58
void freeAllSockets(int **socks);
 
59
int isAllowedSender(struct AllowedSenders *pAllowRoot, struct sockaddr *pFrom, const char *pszFromHost);
 
60
void getCurrTime(struct syslogTime *t);
 
61
int formatTimestampToMySQL(struct syslogTime *ts, char* pDst, size_t iLenDst);
 
62
int formatTimestamp3339(struct syslogTime *ts, char* pBuf, size_t iLenBuf);
 
63
int formatTimestamp3164(struct syslogTime *ts, char* pBuf, size_t iLenBuf);
 
64
void untty(void);
 
65
rsRetVal cflineParseTemplateName(uchar** pp, omodStringRequest_t *pOMSR, int iEntry, int iTplOpts, uchar *dfltTplName);
 
66
rsRetVal cflineParseFileName(uchar* p, uchar *pFileName, omodStringRequest_t *pOMSR, int iEntry, int iTplOpts);
 
67
int getSubString(uchar **ppSrc,  char *pDst, size_t DstSize, char cSep);
 
68
 
 
69
extern int glblHadMemShortage; /* indicates if we had memory shortage some time during the run */
 
70
extern syslogCODE rs_prioritynames[];
 
71
extern syslogCODE rs_facilitynames[];
 
72
extern char LocalHostName[];
 
73
extern int family;
 
74
extern int NoHops;
 
75
extern int *finet;
 
76
extern int send_to_all;
 
77
extern int option_DisallowWarning;
 
78
extern int Debug;
 
79
extern char**LocalHosts;
 
80
extern int DisableDNS;
 
81
extern char **StripDomains;
 
82
extern char *LocalDomain;
 
83
extern int bDropMalPTRMsgs;
 
84
extern struct AllowedSenders *pAllowedSenders_TCP;
 
85
extern char     ctty[];
 
86
 
 
87
#endif /* #ifndef SYSLOGD_H_INCLUDED */