From fa67273c1644551b50919fa7879acfdc92e269bc Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 7 Mar 2008 08:06:16 +0000 Subject: - added RSYSLOGD_MODDIR environment variable - added -M rsyslogd option (allows to specify module directory location) - converted net.c into a loadable library plugin --- plugins/imtcp/imtcp.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'plugins/imtcp') diff --git a/plugins/imtcp/imtcp.c b/plugins/imtcp/imtcp.c index ca52d3c5..2da094a4 100644 --- a/plugins/imtcp/imtcp.c +++ b/plugins/imtcp/imtcp.c @@ -51,6 +51,7 @@ MODULE_TYPE_INPUT DEF_IMOD_STATIC_DATA DEFobjCurrIf(tcpsrv) DEFobjCurrIf(tcps_sess) +DEFobjCurrIf(net) /* Module static data */ static tcpsrv_t *pOurTcpsrv = NULL; /* our TCP server(listener) TODO: change for multiple instances */ @@ -65,7 +66,7 @@ static int isPermittedHost(struct sockaddr *addr, char *fromHostFQDN, void __attribute__((unused)) *pUsrSrv, void __attribute__((unused)) *pUsrSess) { - return isAllowedSender(pAllowedSenders_TCP, addr, fromHostFQDN); + return isAllowedSender(net.pAllowedSenders_TCP, addr, fromHostFQDN); } @@ -159,7 +160,7 @@ ENDrunInput BEGINwillRun CODESTARTwillRun /* first apply some config settings */ - PrintAllowedSenders(2); /* TCP */ + net.PrintAllowedSenders(2); /* TCP */ if(pOurTcpsrv == NULL) ABORT_FINALIZE(RS_RET_NO_RUN); finalize_it: @@ -169,9 +170,9 @@ ENDwillRun BEGINafterRun CODESTARTafterRun /* do cleanup here */ - if (pAllowedSenders_TCP != NULL) { - clearAllowedSenders (pAllowedSenders_TCP); - pAllowedSenders_TCP = NULL; + if(net.pAllowedSenders_TCP != NULL) { + net.clearAllowedSenders(net.pAllowedSenders_TCP); + net.pAllowedSenders_TCP = NULL; } ENDafterRun @@ -204,6 +205,7 @@ CODESTARTmodInit CODEmodInit_QueryRegCFSLineHdlr pOurTcpsrv = NULL; /* request objects we use */ + CHKiRet(objUse(net, "net")); CHKiRet(objUse(tcps_sess, "tcpsrv")); CHKiRet(objUse(tcpsrv, "tcpsrv")); -- cgit