summaryrefslogtreecommitdiffstats
path: root/plugins/imtcp/imtcp.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-04-21 16:54:05 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-04-21 16:54:05 +0200
commit88caccecf8dd8beaf46915df05241a44f7d635f6 (patch)
tree7d6db5808b3bdd2453f041fef5c808b8fab36119 /plugins/imtcp/imtcp.c
parent6e410a76f64d74fec03de27a6ca1f3f996844917 (diff)
parent8e536c5b25ca1a7106f541149cf0d76bdf9237da (diff)
downloadrsyslog-88caccecf8dd8beaf46915df05241a44f7d635f6.tar.gz
rsyslog-88caccecf8dd8beaf46915df05241a44f7d635f6.tar.xz
rsyslog-88caccecf8dd8beaf46915df05241a44f7d635f6.zip
Merge branch 'master' into beta
Conflicts: ChangeLog configure.ac doc/manual.html
Diffstat (limited to 'plugins/imtcp/imtcp.c')
-rw-r--r--plugins/imtcp/imtcp.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/imtcp/imtcp.c b/plugins/imtcp/imtcp.c
index 7b3eeda5..5a8a62f6 100644
--- a/plugins/imtcp/imtcp.c
+++ b/plugins/imtcp/imtcp.c
@@ -80,7 +80,9 @@ static permittedPeers_t *pPermPeersRoot = NULL;
/* config settings */
static int iTCPSessMax = 200; /* max number of sessions */
static int iStrmDrvrMode = 0; /* mode for stream driver, driver-dependent (0 mostly means plain tcp) */
+static int iAddtlFrameDelim = TCPSRV_NO_ADDTL_DELIMITER; /* addtl frame delimiter, e.g. for netscreen, default none */
static uchar *pszStrmDrvrAuthMode = NULL; /* authentication mode to use */
+static uchar *pszInputName = NULL; /* value for inputname property, NULL is OK and handled by core engine */
/* callbacks */
@@ -167,6 +169,8 @@ static rsRetVal addTCPListener(void __attribute__((unused)) *pVal, uchar *pNewVa
CHKiRet(tcpsrv.SetCBOnRegularClose(pOurTcpsrv, onRegularClose));
CHKiRet(tcpsrv.SetCBOnErrClose(pOurTcpsrv, onErrClose));
CHKiRet(tcpsrv.SetDrvrMode(pOurTcpsrv, iStrmDrvrMode));
+ CHKiRet(tcpsrv.SetInputName(pOurTcpsrv, pszInputName == NULL ? (uchar*)"imtcp" : pszInputName));
+ CHKiRet(tcpsrv.SetAddtlFrameDelim(pOurTcpsrv, iAddtlFrameDelim));
/* now set optional params, but only if they were actually configured */
if(pszStrmDrvrAuthMode != NULL) {
CHKiRet(tcpsrv.SetDrvrAuthMode(pOurTcpsrv, pszStrmDrvrAuthMode));
@@ -240,6 +244,15 @@ resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unus
{
iTCPSessMax = 200;
iStrmDrvrMode = 0;
+ iAddtlFrameDelim = TCPSRV_NO_ADDTL_DELIMITER;
+ if(pszInputName != NULL) {
+ free(pszInputName);
+ pszInputName = NULL;
+ }
+ if(pszStrmDrvrAuthMode != NULL) {
+ free(pszStrmDrvrAuthMode);
+ pszStrmDrvrAuthMode = NULL;
+ }
return RS_RET_OK;
}
@@ -274,6 +287,10 @@ CODEmodInit_QueryRegCFSLineHdlr
eCmdHdlrGetWord, NULL, &pszStrmDrvrAuthMode, STD_LOADABLE_MODULE_ID));
CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputtcpserverstreamdriverpermittedpeer", 0,
eCmdHdlrGetWord, setPermittedPeer, NULL, STD_LOADABLE_MODULE_ID));
+ CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputtcpserveraddtlframedelimiter", 0, eCmdHdlrInt,
+ NULL, &iAddtlFrameDelim, STD_LOADABLE_MODULE_ID));
+ CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputtcpserverinputname", 0,
+ eCmdHdlrGetWord, NULL, &pszInputName, STD_LOADABLE_MODULE_ID));
CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler,
resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID));
ENDmodInit