static rsRetVal addInstance(void __attribute__((unused)) *pVal, uchar *const pNewVal)
{
	instanceConf_t *inst;
	DEFiRet;

	if(pNewVal == NULL || *pNewVal == '\0') {
		parser_errmsg("imptcp: port number must be specified, listener ignored");
		ABORT_FINALIZE(RS_RET_PARAM_ERROR);
	}

	/* if we reach this point, a valid port is given in pNewVal */
	CHKiRet(createInstance(&inst));
	CHKmalloc(inst->pszBindPort = ustrdup(pNewVal));
	if((cs.lstnIP == NULL) || (cs.lstnIP[0] == '\0')) {
		inst->pszBindAddr = NULL;
	} else {
		CHKmalloc(inst->pszBindAddr = ustrdup(cs.lstnIP));
	}
	if((cs.pszBindRuleset == NULL) || (cs.pszBindRuleset[0] == '\0')) {
		inst->pszBindRuleset = NULL;
	} else {
		CHKmalloc(inst->pszBindRuleset = ustrdup(cs.pszBindRuleset));
	}
	if((cs.pszInputName == NULL) || (cs.pszInputName[0] == '\0')) {
		inst->pszInputName = NULL;
	} else {
		CHKmalloc(inst->pszInputName = ustrdup(cs.pszInputName));
	}
	inst->pBindRuleset = NULL;
	inst->bSuppOctetFram = cs.bSuppOctetFram;
	inst->bKeepAlive = cs.bKeepAlive;
	inst->iKeepAliveIntvl = cs.iKeepAliveIntvl;
	inst->iKeepAliveProbes = cs.iKeepAliveProbes;
	inst->iKeepAliveTime = cs.iKeepAliveTime;
	inst->bEmitMsgOnClose = cs.bEmitMsgOnClose;
	inst->bEmitMsgOnOpen = cs.bEmitMsgOnOpen;
	inst->iAddtlFrameDelim = cs.iAddtlFrameDelim;
	inst->maxFrameSize = cs.maxFrameSize;
	inst->iTCPSessMax = cs.iTCPSessMax;

finalize_it:
	free(pNewVal);
	RETiRet;
}
static rsRetVal addInstance(void __attribute__((unused)) *pVal, uchar *const pNewVal)
{
	instanceConf_t *inst;
	DEFiRet;

	if(pNewVal == NULL || *pNewVal == '\0') {
		parser_errmsg("imptcp: port number must be specified, listener ignored");
		ABORT_FINALIZE(RS_RET_PARAM_ERROR);
	}

	 
	CHKiRet(createInstance(&inst));
	CHKmalloc(inst->pszBindPort = ustrdup(pNewVal));
	if((cs.lstnIP == NULL) || (cs.lstnIP[0] == '\0')) {
		inst->pszBindAddr = NULL;
	} else {
		CHKmalloc(inst->pszBindAddr = ustrdup(cs.lstnIP));
	}
	if((cs.pszBindRuleset == NULL) || (cs.pszBindRuleset[0] == '\0')) {
		inst->pszBindRuleset = NULL;
	} else {
		CHKmalloc(inst->pszBindRuleset = ustrdup(cs.pszBindRuleset));
	}
	if((cs.pszInputName == NULL) || (cs.pszInputName[0] == '\0')) {
		inst->pszInputName = NULL;
	} else {
		CHKmalloc(inst->pszInputName = ustrdup(cs.pszInputName));
	}
	inst->pBindRuleset = NULL;
	inst->bSuppOctetFram = cs.bSuppOctetFram;
	inst->bKeepAlive = cs.bKeepAlive;
	inst->iKeepAliveIntvl = cs.iKeepAliveIntvl;
	inst->iKeepAliveProbes = cs.iKeepAliveProbes;
	inst->iKeepAliveTime = cs.iKeepAliveTime;
	inst->bEmitMsgOnClose = cs.bEmitMsgOnClose;
	inst->bEmitMsgOnOpen = cs.bEmitMsgOnOpen;
	inst->iAddtlFrameDelim = cs.iAddtlFrameDelim;
	inst->maxFrameSize = cs.maxFrameSize;
	inst->iTCPSessMax = cs.iTCPSessMax;

finalize_it:
	free(pNewVal);
	RETiRet;
}