diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-06-12 15:31:08 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-06-12 15:31:08 +0200 |
commit | ca0ddc30a3edce02a440904a01f0b866c0f82b5a (patch) | |
tree | f751d9d677ce901841874e05650f7ea236a90976 /tcpsrv.c | |
parent | 21dafea3ee98d16a8fe93d0d5228939dc259aea7 (diff) | |
download | rsyslog-ca0ddc30a3edce02a440904a01f0b866c0f82b5a.tar.gz rsyslog-ca0ddc30a3edce02a440904a01f0b866c0f82b5a.tar.xz rsyslog-ca0ddc30a3edce02a440904a01f0b866c0f82b5a.zip |
completed multi-ruleset core support
... as well as added multi-ruleset support for imtcp
Diffstat (limited to 'tcpsrv.c')
-rw-r--r-- | tcpsrv.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -69,6 +69,7 @@ #include "netstrm.h" #include "nssel.h" #include "errmsg.h" +#include "ruleset.h" #include "unicode-helper.h" MODULE_TYPE_LIB @@ -81,6 +82,7 @@ MODULE_TYPE_LIB DEFobjStaticHelpers DEFobjCurrIf(conf) DEFobjCurrIf(glbl) +DEFobjCurrIf(ruleset) DEFobjCurrIf(tcps_sess) DEFobjCurrIf(errmsg) DEFobjCurrIf(net) @@ -104,6 +106,8 @@ addNewLstnPort(tcpsrv_t *pThis, uchar *pszPort) CHKmalloc(pEntry = malloc(sizeof(tcpLstnPortList_t))); pEntry->pszPort = pszPort; pEntry->pSrv = pThis; +RUNLOG_VAR("%p", pThis->pRuleset); + pEntry->pRuleset = pThis->pRuleset; CHKmalloc(pEntry->pszInputName = ustrdup(pThis->pszInputName)); /* and add to list */ @@ -755,6 +759,16 @@ finalize_it: } +/* Set the ruleset (ptr) to use */ +static rsRetVal +SetRuleset(tcpsrv_t *pThis, ruleset_t *pRuleset) +{ + DEFiRet; + pThis->pRuleset = pRuleset; + RETiRet; +} + + /* here follows a number of methods that shuffle authentication settings down * to the drivers. Drivers not supporting these settings may return an error * state. @@ -855,6 +869,7 @@ CODESTARTobjQueryInterface(tcpsrv) pIf->SetCBOnRegularClose = SetCBOnRegularClose; pIf->SetCBOnErrClose = SetCBOnErrClose; pIf->SetOnMsgReceive = SetOnMsgReceive; + pIf->SetRuleset = SetRuleset; finalize_it: ENDobjQueryInterface(tcpsrv) @@ -868,6 +883,7 @@ CODESTARTObjClassExit(tcpsrv) /* release objects we no longer need */ objRelease(tcps_sess, DONT_LOAD_LIB); objRelease(conf, CORE_COMPONENT); + objRelease(ruleset, CORE_COMPONENT); objRelease(glbl, CORE_COMPONENT); objRelease(errmsg, CORE_COMPONENT); objRelease(netstrms, DONT_LOAD_LIB); @@ -891,6 +907,7 @@ BEGINObjClassInit(tcpsrv, 1, OBJ_IS_LOADABLE_MODULE) /* class, version - CHANGE CHKiRet(objUse(tcps_sess, DONT_LOAD_LIB)); CHKiRet(objUse(conf, CORE_COMPONENT)); CHKiRet(objUse(glbl, CORE_COMPONENT)); + CHKiRet(objUse(ruleset, CORE_COMPONENT)); /* set our own handlers */ OBJSetMethodHandler(objMethod_DEBUGPRINT, tcpsrvDebugPrint); |