summaryrefslogtreecommitdiff
path: root/plugins/omrelp
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2008-12-12 17:46:20 +0100
committerMichael Biebl <biebl@debian.org>2008-12-12 17:46:20 +0100
commit84080b58f8c6c5c040723a02503ddd90f02b5898 (patch)
treecf8c63e076f1ebb9cb2bea644a4f45172808a3e5 /plugins/omrelp
parent53123ea8a1b9180b9aa0568e847f9245987c1b7c (diff)
downloadrsyslog-84080b58f8c6c5c040723a02503ddd90f02b5898.tar.gz
Imported Upstream version 3.20.2upstream/3.20.2
Diffstat (limited to 'plugins/omrelp')
-rw-r--r--plugins/omrelp/Makefile.am2
-rw-r--r--plugins/omrelp/Makefile.in13
-rw-r--r--plugins/omrelp/omrelp.c21
3 files changed, 23 insertions, 13 deletions
diff --git a/plugins/omrelp/Makefile.am b/plugins/omrelp/Makefile.am
index dfc2111..f8384f4 100644
--- a/plugins/omrelp/Makefile.am
+++ b/plugins/omrelp/Makefile.am
@@ -1,6 +1,6 @@
pkglib_LTLIBRARIES = omrelp.la
omrelp_la_SOURCES = omrelp.c
-omrelp_la_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(RELP_CFLAGS)
+omrelp_la_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(RELP_CFLAGS) $(rsrt_cflags)
omrelp_la_LDFLAGS = -module -avoid-version
omrelp_la_LIBADD = $(RELP_LIBS)
diff --git a/plugins/omrelp/Makefile.in b/plugins/omrelp/Makefile.in
index b4a2e0f..fbc06e7 100644
--- a/plugins/omrelp/Makefile.in
+++ b/plugins/omrelp/Makefile.in
@@ -103,6 +103,7 @@ EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
GREP = @GREP@
+HAVE_GNUTLS_CONFIG = @HAVE_GNUTLS_CONFIG@
HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@
HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@
INSTALL = @INSTALL@
@@ -111,6 +112,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
+LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@
+LIBLOGGING_LIBS = @LIBLOGGING_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
@@ -131,6 +134,8 @@ PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
RELP_CFLAGS = @RELP_CFLAGS@
RELP_LIBS = @RELP_LIBS@
+RFC3195_CFLAGS = @RFC3195_CFLAGS@
+RFC3195_LIBS = @RFC3195_LIBS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -161,6 +166,8 @@ dl_libs = @dl_libs@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
+gnutls_cflags = @gnutls_cflags@
+gnutls_libs = @gnutls_libs@
gss_libs = @gss_libs@
host = @host@
host_alias = @host_alias@
@@ -190,8 +197,8 @@ program_transform_name = @program_transform_name@
psdir = @psdir@
pthreads_cflags = @pthreads_cflags@
pthreads_libs = @pthreads_libs@
-rfc3195_cflags = @rfc3195_cflags@
-rfc3195_libs = @rfc3195_libs@
+rsrt_cflags = @rsrt_cflags@
+rsrt_libs = @rsrt_libs@
rt_libs = @rt_libs@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
@@ -206,7 +213,7 @@ top_srcdir = @top_srcdir@
zlib_libs = @zlib_libs@
pkglib_LTLIBRARIES = omrelp.la
omrelp_la_SOURCES = omrelp.c
-omrelp_la_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(RELP_CFLAGS)
+omrelp_la_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(RELP_CFLAGS) $(rsrt_cflags)
omrelp_la_LDFLAGS = -module -avoid-version
omrelp_la_LIBADD = $(RELP_LIBS)
all: all-am
diff --git a/plugins/omrelp/omrelp.c b/plugins/omrelp/omrelp.c
index 0457168..71d6e79 100644
--- a/plugins/omrelp/omrelp.c
+++ b/plugins/omrelp/omrelp.c
@@ -36,11 +36,12 @@
#include <errno.h>
#include <ctype.h>
#include <librelp.h>
-#include "syslogd.h"
+#include "dirty.h"
#include "syslogd-types.h"
#include "srUtils.h"
#include "cfsysline.h"
#include "module-template.h"
+#include "glbl.h"
#include "errmsg.h"
MODULE_TYPE_OUTPUT
@@ -49,6 +50,7 @@ MODULE_TYPE_OUTPUT
*/
DEF_OMOD_STATIC_DATA
DEFobjCurrIf(errmsg)
+DEFobjCurrIf(glbl)
static relpEngine_t *pRelpEngine; /* our relp engine */
@@ -118,7 +120,7 @@ static rsRetVal doConnect(instanceData *pData)
DEFiRet;
if(pData->bInitialConnect) {
- iRet = relpCltConnect(pData->pRelpClt, family, (uchar*) pData->port, (uchar*) pData->f_hname);
+ iRet = relpCltConnect(pData->pRelpClt, glbl.GetDefPFFamily(), (uchar*) pData->port, (uchar*) pData->f_hname);
if(iRet == RELP_RET_OK)
pData->bInitialConnect = 0;
} else {
@@ -162,7 +164,6 @@ CODESTARTdoAction
/* forward */
ret = relpCltSendSyslog(pData->pRelpClt, (uchar*) pMsg, lenMsg);
-RUNLOG_VAR("%d", ret);
if(ret != RELP_RET_OK) {
/* error! */
dbgprintf("error forwarding via relp, suspending\n");
@@ -218,16 +219,16 @@ CODE_STD_STRING_REQUESTparseSelectorAct(1)
++p; /* eat */
pData->compressionLevel = iLevel;
} else {
- errmsg.LogError(NO_ERRCODE, "Invalid compression level '%c' specified in "
+ errmsg.LogError(0, NO_ERRCODE, "Invalid compression level '%c' specified in "
"forwardig action - NOT turning on compression.",
*p);
}
# else
- errmsg.LogError(NO_ERRCODE, "Compression requested, but rsyslogd is not compiled "
+ errmsg.LogError(0, NO_ERRCODE, "Compression requested, but rsyslogd is not compiled "
"with compression support - request ignored.");
# endif /* #ifdef USE_NETZIP */
} else { /* invalid option! Just skip it... */
- errmsg.LogError(NO_ERRCODE, "Invalid option %c in forwarding action - ignoring.", *p);
+ errmsg.LogError(0, NO_ERRCODE, "Invalid option %c in forwarding action - ignoring.", *p);
++p; /* eat invalid option */
}
/* the option processing is done. We now do a generic skip
@@ -243,7 +244,7 @@ CODE_STD_STRING_REQUESTparseSelectorAct(1)
/* we probably have end of string - leave it for the rest
* of the code to handle it (but warn the user)
*/
- errmsg.LogError(NO_ERRCODE, "Option block not terminated in forwarding action.");
+ errmsg.LogError(0, NO_ERRCODE, "Option block not terminated in forwarding action.");
}
/* extract the host first (we do a trick - we replace the ';' or ':' with a '\0')
* now skip to port and then template name. rgerhards 2005-07-06
@@ -261,7 +262,7 @@ CODE_STD_STRING_REQUESTparseSelectorAct(1)
/* SKIP AND COUNT */;
pData->port = malloc(i + 1);
if(pData->port == NULL) {
- errmsg.LogError(NO_ERRCODE, "Could not get memory to store relp port, "
+ errmsg.LogError(0, NO_ERRCODE, "Could not get memory to store relp port, "
"using default port, results may not be what you intend\n");
/* we leave f_forw.port set to NULL, this is then handled by getRelpPt() */
} else {
@@ -277,7 +278,7 @@ CODE_STD_STRING_REQUESTparseSelectorAct(1)
if(bErr == 0) { /* only 1 error msg! */
bErr = 1;
errno = 0;
- errmsg.LogError(NO_ERRCODE, "invalid selector line (port), probably not doing "
+ errmsg.LogError(0, NO_ERRCODE, "invalid selector line (port), probably not doing "
"what was intended");
}
}
@@ -311,6 +312,7 @@ CODESTARTmodExit
relpEngineDestruct(&pRelpEngine);
/* release what we no longer need */
+ objRelease(glbl, CORE_COMPONENT);
objRelease(errmsg, CORE_COMPONENT);
ENDmodExit
@@ -332,6 +334,7 @@ CODEmodInit_QueryRegCFSLineHdlr
/* tell which objects we need */
CHKiRet(objUse(errmsg, CORE_COMPONENT));
+ CHKiRet(objUse(glbl, CORE_COMPONENT));
ENDmodInit
/* vim:set ai: