From 545346e697fe930b8b7b9bd0ede47890b26a4832 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 5 Mar 2008 10:30:06 +0000 Subject: - changed modules.c calling conventions to be interface-based - moved module loader from conf.c to module.c, where it belongs - made the necessary plumbing to auto-load library modules - upgraded debug system to include iRet in function exit message - changed module interface so that instances need only to be supported by output plugins (if we actually need them for input plugins, we can always add it again...) - milestone: first implementation of library modules (but do not get unloaded on exit/hup so far) --- plugins/imfile/imfile.c | 17 ----------------- plugins/imgssapi/imgssapi.c | 17 +---------------- plugins/imklog/imklog.c | 12 ------------ plugins/immark/immark.c | 13 ------------- plugins/imtcp/imtcp.c | 15 +-------------- plugins/imtemplate/imtemplate.c | 17 ----------------- plugins/imudp/imudp.c | 13 ------------- plugins/imuxsock/imuxsock.c | 13 ------------- 8 files changed, 2 insertions(+), 115 deletions(-) (limited to 'plugins') diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c index c13e96e9..14d6cf3f 100644 --- a/plugins/imfile/imfile.c +++ b/plugins/imfile/imfile.c @@ -69,13 +69,6 @@ static int iFilPtr = 0; /* number of files to be monitored; pointer to next fre #define MAX_INPUT_FILES 100 static fileInfo_t files[MAX_INPUT_FILES]; -/* instanceData must be defined to keep the framework happy, but it currently - * is of no practical use. This may change in later revisions of the plugin - * interface. - */ -typedef struct _instanceData { -} instanceData; - /* enqueue the read file line as a message */ @@ -349,16 +342,6 @@ ENDafterRun * In general, they need to be present, but you do NOT need to provide * any code here. */ -BEGINfreeInstance -CODESTARTfreeInstance -ENDfreeInstance - - -BEGINdbgPrintInstInfo -CODESTARTdbgPrintInstInfo -ENDdbgPrintInstInfo - - BEGINmodExit CODESTARTmodExit ENDmodExit diff --git a/plugins/imgssapi/imgssapi.c b/plugins/imgssapi/imgssapi.c index cd42c778..d93799f3 100644 --- a/plugins/imgssapi/imgssapi.c +++ b/plugins/imgssapi/imgssapi.c @@ -76,9 +76,6 @@ DEF_IMOD_STATIC_DATA DEFobjCurrIf(tcpsrv) DEFobjCurrIf(tcps_sess) -typedef struct _instanceData { -} instanceData; - static tcpsrv_t *pOurTcpsrv = NULL; /* our TCP server(listener) TODO: change for multiple instances */ static gss_cred_id_t gss_server_creds = GSS_C_NO_CREDENTIAL; @@ -679,17 +676,6 @@ CODESTARTafterRun ENDafterRun - -BEGINfreeInstance -CODESTARTfreeInstance -ENDfreeInstance - - -BEGINdbgPrintInstInfo -CODESTARTdbgPrintInstInfo -ENDdbgPrintInstInfo - - BEGINqueryEtryPt CODESTARTqueryEtryPt CODEqueryEtryPt_STD_IMOD_QUERIES @@ -714,10 +700,9 @@ CODESTARTmodInit CODEmodInit_QueryRegCFSLineHdlr pOurTcpsrv = NULL; /* request objects we use */ - CHKiRet(objUse(tcps_sess, "tcps_sess")); + CHKiRet(objUse(tcps_sess, "tcpsrv.so")); CHKiRet(objUse(tcpsrv, "tcpsrv")); - CHKiRet(objUse(tcpsrv, "tcpsrv")); /* register config file handlers */ CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputgssserverpermitplaintcp", 0, eCmdHdlrBinary, NULL, &bPermitPlainTcp, STD_LOADABLE_MODULE_ID)); diff --git a/plugins/imklog/imklog.c b/plugins/imklog/imklog.c index 9b4581b2..238328ea 100644 --- a/plugins/imklog/imklog.c +++ b/plugins/imklog/imklog.c @@ -46,8 +46,6 @@ MODULE_TYPE_INPUT /* Module static data */ DEF_IMOD_STATIC_DATA -typedef struct _instanceData { -} instanceData; /* configuration settings TODO: move to instance data? */ int dbgPrintSymbols = 0; /* this one is extern so the helpers can access it! */ @@ -641,16 +639,6 @@ CODESTARTafterRun ENDafterRun -BEGINfreeInstance -CODESTARTfreeInstance -ENDfreeInstance - - -BEGINdbgPrintInstInfo -CODESTARTdbgPrintInstInfo -ENDdbgPrintInstInfo - - BEGINmodExit CODESTARTmodExit ENDmodExit diff --git a/plugins/immark/immark.c b/plugins/immark/immark.c index 7454ef92..30118de0 100644 --- a/plugins/immark/immark.c +++ b/plugins/immark/immark.c @@ -50,9 +50,6 @@ MODULE_TYPE_INPUT DEF_IMOD_STATIC_DATA static int iMarkMessagePeriod = DEFAULT_MARK_PERIOD; -typedef struct _instanceData { -} instanceData; - /* This function is called to gather input. It must terminate only * a) on failure (iRet set accordingly) * b) on termination of the input module (as part of the unload process) @@ -97,16 +94,6 @@ CODESTARTafterRun ENDafterRun -BEGINfreeInstance -CODESTARTfreeInstance -ENDfreeInstance - - -BEGINdbgPrintInstInfo -CODESTARTdbgPrintInstInfo -ENDdbgPrintInstInfo - - BEGINmodExit CODESTARTmodExit ENDmodExit diff --git a/plugins/imtcp/imtcp.c b/plugins/imtcp/imtcp.c index 9ea0863c..fea79d49 100644 --- a/plugins/imtcp/imtcp.c +++ b/plugins/imtcp/imtcp.c @@ -53,10 +53,6 @@ DEFobjCurrIf(tcpsrv) DEFobjCurrIf(tcps_sess) /* Module static data */ - -typedef struct _instanceData { -} instanceData; - static tcpsrv_t *pOurTcpsrv = NULL; /* our TCP server(listener) TODO: change for multiple instances */ /* config settings */ @@ -195,15 +191,6 @@ resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unus } -BEGINfreeInstance -CODESTARTfreeInstance -ENDfreeInstance - - -BEGINdbgPrintInstInfo -CODESTARTdbgPrintInstInfo -ENDdbgPrintInstInfo - BEGINqueryEtryPt CODESTARTqueryEtryPt @@ -217,7 +204,7 @@ CODESTARTmodInit CODEmodInit_QueryRegCFSLineHdlr pOurTcpsrv = NULL; /* request objects we use */ - CHKiRet(objUse(tcps_sess, "tcps_sess")); + CHKiRet(objUse(tcps_sess, "tcpsrv.so")); CHKiRet(objUse(tcpsrv, "tcpsrv")); /* register config file handlers */ diff --git a/plugins/imtemplate/imtemplate.c b/plugins/imtemplate/imtemplate.c index e1e29ba6..33938045 100644 --- a/plugins/imtemplate/imtemplate.c +++ b/plugins/imtemplate/imtemplate.c @@ -92,13 +92,6 @@ DEF_IMOD_STATIC_DATA /* must be present, starts static data */ */ /* static int imtemplateWhateverVar = 0; */ -/* instanceData must be defined to keep the framework happy, but it currently - * is of no practical use. This may change in later revisions of the plugin - * interface. - */ -typedef struct _instanceData { -} instanceData; - /* config settings */ @@ -378,16 +371,6 @@ ENDafterRun * In general, they need to be present, but you do NOT need to provide * any code here. */ -BEGINfreeInstance -CODESTARTfreeInstance -ENDfreeInstance - - -BEGINdbgPrintInstInfo -CODESTARTdbgPrintInstInfo -ENDdbgPrintInstInfo - - BEGINmodExit CODESTARTmodExit ENDmodExit diff --git a/plugins/imudp/imudp.c b/plugins/imudp/imudp.c index edb8f4c1..df497632 100644 --- a/plugins/imudp/imudp.c +++ b/plugins/imudp/imudp.c @@ -53,9 +53,6 @@ static uchar *pRcvBuf = NULL; /* receive buffer (for a single packet). We use a * termination if we can not get it. -- rgerhards, 2007-12-27 */ -typedef struct _instanceData { -} instanceData; - /* config settings */ @@ -247,16 +244,6 @@ CODESTARTafterRun ENDafterRun -BEGINfreeInstance -CODESTARTfreeInstance -ENDfreeInstance - - -BEGINdbgPrintInstInfo -CODESTARTdbgPrintInstInfo -ENDdbgPrintInstInfo - - BEGINmodExit CODESTARTmodExit ENDmodExit diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c index 227cf6aa..1be2e66f 100644 --- a/plugins/imuxsock/imuxsock.c +++ b/plugins/imuxsock/imuxsock.c @@ -61,9 +61,6 @@ MODULE_TYPE_INPUT /* Module static data */ DEF_IMOD_STATIC_DATA -typedef struct _instanceData { -} instanceData; - static int startIndexUxLocalSockets; /* process funix from that index on (used to * suppress local logging. rgerhards 2005-08-01 * read-only after startup @@ -273,16 +270,6 @@ CODESTARTafterRun ENDafterRun -BEGINfreeInstance -CODESTARTfreeInstance -ENDfreeInstance - - -BEGINdbgPrintInstInfo -CODESTARTdbgPrintInstInfo -ENDdbgPrintInstInfo - - BEGINmodExit CODESTARTmodExit ENDmodExit -- cgit