diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/imrelp/imrelp.c | 13 | ||||
-rw-r--r-- | plugins/omrelp/omrelp.c | 11 |
2 files changed, 22 insertions, 2 deletions
diff --git a/plugins/imrelp/imrelp.c b/plugins/imrelp/imrelp.c index f3972233..5994faca 100644 --- a/plugins/imrelp/imrelp.c +++ b/plugins/imrelp/imrelp.c @@ -75,6 +75,7 @@ static struct configSettings_s { struct instanceConf_s { uchar *pszBindPort; /* port to bind to */ sbool bEnableTLS; + sbool bEnableTLSZip; struct instanceConf_s *next; }; @@ -92,7 +93,8 @@ static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current lo /* input instance parameters */ static struct cnfparamdescr inppdescr[] = { { "port", eCmdHdlrString, CNFPARAM_REQUIRED }, - { "tls", eCmdHdlrBinary, 0 } + { "tls", eCmdHdlrBinary, 0 }, + { "tls.compression", eCmdHdlrBinary, 0 } }; static struct cnfparamblk inppblk = { CNFPARAMBLK_VERSION, @@ -158,6 +160,7 @@ createInstance(instanceConf_t **pinst) inst->pszBindPort = NULL; inst->bEnableTLS = 0; + inst->bEnableTLSZip = 0; /* node created, let's add to config */ if(loadModConf->tail == NULL) { @@ -222,8 +225,12 @@ addListner(modConfData_t __attribute__((unused)) *modConf, instanceConf_t *inst) CHKiRet(relpEngineListnerConstruct(pRelpEngine, &pSrv)); CHKiRet(relpSrvSetLstnPort(pSrv, inst->pszBindPort)); - if(inst->bEnableTLS) + if(inst->bEnableTLS) { relpSrvEnableTLS(pSrv); + if(inst->bEnableTLSZip) { + relpSrvEnableTLSZip(pSrv); + } + } CHKiRet(relpEngineListnerConstructFinalize(pRelpEngine, pSrv)); finalize_it: @@ -259,6 +266,8 @@ CODESTARTnewInpInst inst->pszBindPort = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); } else if(!strcmp(inppblk.descr[i].name, "tls")) { inst->bEnableTLS = (unsigned) pvals[i].val.d.n; + } else if(!strcmp(inppblk.descr[i].name, "tls.compression")) { + inst->bEnableTLSZip = (unsigned) pvals[i].val.d.n; } else { dbgprintf("imrelp: program error, non-handled " "param '%s'\n", inppblk.descr[i].name); diff --git a/plugins/omrelp/omrelp.c b/plugins/omrelp/omrelp.c index a8e2e55c..50f6f905 100644 --- a/plugins/omrelp/omrelp.c +++ b/plugins/omrelp/omrelp.c @@ -56,6 +56,7 @@ DEFobjCurrIf(errmsg) DEFobjCurrIf(glbl) #define DFLT_ENABLE_TLS 0 +#define DFLT_ENABLE_TLSZIP 0 static relpEngine_t *pRelpEngine; /* our relp engine */ @@ -69,6 +70,7 @@ typedef struct _instanceData { unsigned nSent; relpClt_t *pRelpClt; /* relp client for this instance */ sbool bEnableTLS; + sbool bEnableTLSZip; uchar *tplName; } instanceData; @@ -83,6 +85,7 @@ static configSettings_t __attribute__((unused)) cs; static struct cnfparamdescr actpdescr[] = { { "target", eCmdHdlrGetWord, 1 }, { "tls", eCmdHdlrBinary, 0 }, + { "tls.compression", eCmdHdlrBinary, 0 }, { "port", eCmdHdlrGetWord, 0 }, { "rebindinterval", eCmdHdlrInt, 0 }, { "timeout", eCmdHdlrInt, 0 }, @@ -122,6 +125,10 @@ doCreateRelpClient(instanceData *pData) if(pData->bEnableTLS) { if(relpCltEnableTLS(pData->pRelpClt) != RELP_RET_OK) ABORT_FINALIZE(RS_RET_RELP_ERR); + if(pData->bEnableTLSZip) { + if(relpCltEnableTLSZip(pData->pRelpClt) != RELP_RET_OK) + ABORT_FINALIZE(RS_RET_RELP_ERR); + } } if(glbl.GetSourceIPofLocalClient() == NULL) { /* ar Do we have a client IP set? */ if(relpCltSetClientIP(pData->pRelpClt, glbl.GetSourceIPofLocalClient()) != RELP_RET_OK) @@ -139,6 +146,7 @@ CODESTARTcreateInstance pData->timeout = 90; pData->rebindInterval = 0; pData->bEnableTLS = DFLT_ENABLE_TLS; + pData->bEnableTLSZip = DFLT_ENABLE_TLSZIP; ENDcreateInstance BEGINfreeInstance @@ -159,6 +167,7 @@ setInstParamDefaults(instanceData *pData) pData->timeout = 90; pData->rebindInterval = 0; pData->bEnableTLS = DFLT_ENABLE_TLS; + pData->bEnableTLSZip = DFLT_ENABLE_TLSZIP; } @@ -188,6 +197,8 @@ CODESTARTnewActInst pData->rebindInterval = (unsigned) pvals[i].val.d.n; } else if(!strcmp(actpblk.descr[i].name, "tls")) { pData->bEnableTLS = (unsigned) pvals[i].val.d.n; + } else if(!strcmp(actpblk.descr[i].name, "tls.compression")) { + pData->bEnableTLSZip = (unsigned) pvals[i].val.d.n; } else { dbgprintf("omrelp: program error, non-handled " "param '%s'\n", actpblk.descr[i].name); |