code style: fix too-long lines

This commit is contained in:
Rainer Gerhards 2017-12-23 17:25:31 +01:00
parent 44eacd7261
commit 8cb0a95a38
13 changed files with 84 additions and 58 deletions

View File

@ -103,7 +103,8 @@ extern int yydebug;
/* somehow, I need these prototype even though the headers are
* included. I guess that's some autotools magic I don't understand...
*/
#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__DragonflyBSD__) && !defined(_AIX)
#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) \
&& !defined(__DragonflyBSD__) && !defined(_AIX)
int fileno(FILE *stream);
#endif

View File

@ -223,7 +223,8 @@ cfsysline(uchar *p)
ASSERT(p != NULL);
errno = 0;
if(getSubString(&p, (char*) szCmd, sizeof(szCmd), ' ') != 0) {
errmsg.LogError(0, RS_RET_NOT_FOUND, "Invalid $-configline - could not extract command - line ignored\n");
errmsg.LogError(0, RS_RET_NOT_FOUND, "Invalid $-configline "
"- could not extract command - line ignored\n");
ABORT_FINALIZE(RS_RET_NOT_FOUND);
}

View File

@ -51,7 +51,8 @@ struct dynstats_bucket_s {
struct dynstats_bucket_s *next; /* linked list ptr */
struct dynstats_ctr_s *ctrs;
/*survivor objects are used to keep counter values around for upto unused-ttl duration,
so in case it is accessed within (ttl - 2 * ttl) time-period we can re-store the accumulator value from this */
so in case it is accessed within (ttl - 2 * ttl) time-period we can re-store the
accumulator value from this */
struct dynstats_ctr_s *survivor_ctrs;
htable *survivor_table;

View File

@ -1303,7 +1303,8 @@ static bool save_response(rsksictx ctx, FILE* outfile, QueueItem *item) {
int res = KSI_OK;
if(item->respHandle != NULL && item->ksi_status == KSI_OK) {
CHECK_KSI_API(KSI_AsyncHandle_getSignature(item->respHandle, &sig), ctx, "KSI_AsyncHandle_getSignature");
CHECK_KSI_API(KSI_AsyncHandle_getSignature(item->respHandle, &sig), ctx,
"KSI_AsyncHandle_getSignature");
CHECK_KSI_API(KSI_Signature_serialize(sig, &raw, &raw_len), ctx,
"KSI_Signature_serialize");
tlvWriteKSISigLS12(outfile, item->intarg1, raw, raw_len);
@ -1396,8 +1397,10 @@ static bool process_requests_async(rsksictx ctx, KSI_CTX *ksi_ctx, KSI_AsyncServ
CHECK_KSI_API(KSI_AggregationReq_setRequestHash((KSI_AggregationReq*)req,
KSI_DataHash_ref((KSI_DataHash*)item->arg)), ctx,
"KSI_AggregationReq_setRequestHash");
CHECK_KSI_API(KSI_Integer_new(ksi_ctx, item->intarg2, &level), ctx, "KSI_Integer_new");
CHECK_KSI_API(KSI_AggregationReq_setRequestLevel(req, level), ctx, "KSI_AggregationReq_setRequestLevel");
CHECK_KSI_API(KSI_Integer_new(ksi_ctx, item->intarg2, &level), ctx,
"KSI_Integer_new");
CHECK_KSI_API(KSI_AggregationReq_setRequestLevel(req, level), ctx,
"KSI_AggregationReq_setRequestLevel");
CHECK_KSI_API(KSI_AsyncAggregationHandle_new(ksi_ctx, req, &reqHandle), ctx,
"KSI_AsyncAggregationHandle_new");
CHECK_KSI_API(KSI_AsyncHandle_setRequestCtx(reqHandle, (void*)item, NULL), ctx,
@ -1496,12 +1499,14 @@ void *signer_thread(void *arg) {
KSI_AsyncService_free(as);
as=NULL;
} else {
res = KSI_AsyncService_setOption(as, KSI_ASYNC_OPT_MAX_REQUEST_COUNT, (void*) (ctx->max_requests));
res = KSI_AsyncService_setOption(as, KSI_ASYNC_OPT_MAX_REQUEST_COUNT,
(void*) (ctx->max_requests));
if (res != KSI_OK)
reportKSIAPIErr(ctx, NULL, "KSI_AsyncService_setOption(max_request)", res);
/* ingoring the possible error here */
KSI_AsyncService_setOption(as, KSI_ASYNC_OPT_REQUEST_CACHE_SIZE, (void*) (ctx->max_requests * 5));
KSI_AsyncService_setOption(as, KSI_ASYNC_OPT_REQUEST_CACHE_SIZE,
(void*) (ctx->max_requests * 5));
}
}

View File

@ -670,8 +670,10 @@ doModInit(rsRetVal (*modInit)(int, int*, rsRetVal(**)(), rsRetVal(*)(), modInfo_
CHKiRet((*pNew->modQueryEtryPt)((uchar*)"dbgPrintInstInfo", &pNew->dbgPrintInstInfo));
CHKiRet((*pNew->modQueryEtryPt)((uchar*)"parseSelectorAct", &pNew->mod.om.parseSelectorAct));
CHKiRet((*pNew->modQueryEtryPt)((uchar*)"tryResume", &pNew->tryResume));
CHKiRet((*pNew->modQueryEtryPt)((uchar*)"createWrkrInstance", &pNew->mod.om.createWrkrInstance));
CHKiRet((*pNew->modQueryEtryPt)((uchar*)"freeWrkrInstance", &pNew->mod.om.freeWrkrInstance));
CHKiRet((*pNew->modQueryEtryPt)((uchar*)"createWrkrInstance",
&pNew->mod.om.createWrkrInstance));
CHKiRet((*pNew->modQueryEtryPt)((uchar*)"freeWrkrInstance",
&pNew->mod.om.freeWrkrInstance));
/* try load optional interfaces */
localRet = (*pNew->modQueryEtryPt)((uchar*)"doHUP", &pNew->doHUP);
@ -915,12 +917,13 @@ static void modPrintList(void)
NULL : pMod->mod.om.beginTransaction));
dbgprintf("\tEndTransaction: %p\n",
((pMod->mod.om.endTransaction == (rsRetVal (*)(void*))dummyEndTransaction) ?
NULL : pMod->mod.om.endTransaction));
NULL : pMod->mod.om.endTransaction));
#else
dbgprintf("\tBeginTransaction: %p\n", ((pMod->mod.om.beginTransaction == dummyBeginTransaction) ?
NULL : pMod->mod.om.beginTransaction));
dbgprintf("\tBeginTransaction: %p\n",
((pMod->mod.om.beginTransaction == dummyBeginTransaction) ?
NULL : pMod->mod.om.beginTransaction));
dbgprintf("\tEndTransaction: %p\n", ((pMod->mod.om.endTransaction == dummyEndTransaction) ?
NULL : pMod->mod.om.endTransaction));
NULL : pMod->mod.om.endTransaction));
#endif
break;
case eMOD_IN:

View File

@ -448,7 +448,8 @@ PermittedPeerWildcardMatch(permittedPeers_t *const pPeer,
break;
case PEER_WILDCARD_AT_END:
if( pWildcard->lenDomainPart > (size_t) (pC - pStart)
|| strncmp((char*)pStart, (char*)pWildcard->pszDomainPart, pWildcard->lenDomainPart)) {
|| strncmp((char*)pStart, (char*)pWildcard->pszDomainPart,
pWildcard->lenDomainPart)) {
*pbIsMatching = 0;
FINALIZE;
}
@ -983,7 +984,8 @@ MaskCmp(struct NetAddr *pAllow, uint8_t bits, struct sockaddr *pFrom, const char
struct in6_addr *ip6 = &(SIN6(pFrom))->sin6_addr;
struct in_addr *net = &(SIN(pAllow->addr.NetAddr))->sin_addr;
if ((ip6->s6_addr32[3] & (u_int32_t) htonl((0xffffffff << (32 - bits)))) == net->s_addr &&
if ((ip6->s6_addr32[3] & (u_int32_t)
htonl((0xffffffff << (32 - bits)))) == net->s_addr &&
#if BYTE_ORDER == LITTLE_ENDIAN
(ip6->s6_addr32[2] == (u_int32_t)0xffff0000) &&
#else

View File

@ -1032,7 +1032,8 @@ gtlsChkPeerCertValidity(nsd_gtls_t *pThis)
cert_list = gnutls_certificate_get_peers(pThis->sess, &cert_list_size);
if(cert_list_size < 1) {
errno = 0;
errmsg.LogError(0, RS_RET_TLS_NO_CERT, "peer did not provide a certificate, not permitted to talk to it");
errmsg.LogError(0, RS_RET_TLS_NO_CERT,
"peer did not provide a certificate, not permitted to talk to it");
ABORT_FINALIZE(RS_RET_TLS_NO_CERT);
}
@ -1079,7 +1080,8 @@ gtlsChkPeerCertValidity(nsd_gtls_t *pThis)
errmsg.LogError(0, RS_RET_CERT_NOT_YET_ACTIVE, "not permitted to talk to peer: "
"certificate %d not yet active", i);
gtlsGetCertInfo(pThis, &pStr);
errmsg.LogError(0, RS_RET_CERT_NOT_YET_ACTIVE, "invalid cert info: %s", cstrGetSzStrNoNULL(pStr));
errmsg.LogError(0, RS_RET_CERT_NOT_YET_ACTIVE,
"invalid cert info: %s", cstrGetSzStrNoNULL(pStr));
cstrDestruct(&pStr);
ABORT_FINALIZE(RS_RET_CERT_NOT_YET_ACTIVE);
}
@ -1539,7 +1541,8 @@ AcceptConnReq(nsd_t *pNsd, nsd_t **ppNew)
gnuRet = gnutls_handshake(pNew->sess);
if(gnuRet == GNUTLS_E_AGAIN || gnuRet == GNUTLS_E_INTERRUPTED) {
pNew->rtryCall = gtlsRtry_handshake;
dbgprintf("GnuTLS handshake does not complete immediately - setting to retry (this is OK and normal)\n");
dbgprintf("GnuTLS handshake does not complete immediately - "
"setting to retry (this is OK and normal)\n");
} else if(gnuRet == 0) {
/* we got a handshake, now check authorization */
CHKiRet(gtlsChkPeerAuth(pNew));

View File

@ -38,7 +38,8 @@ typedef nsd_if_t nsd_gtls_if_t; /* we just *implement* this interface */
struct nsd_gtls_s {
BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */
nsd_t *pTcp; /**< our aggregated nsd_ptcp data */
uchar *pszConnectHost; /**< hostname used for connect - may be used to authenticate peer if no other name given */
uchar *pszConnectHost; /**< hostname used for connect - may be used to
authenticate peer if no other name given */
int iMode; /* 0 - plain tcp, 1 - TLS */
int bAbortConn; /* if set, abort conncection (fatal error had happened) */
enum {
@ -50,8 +51,10 @@ struct nsd_gtls_s {
gtlsRtryCall_t rtryCall;/**< what must we retry? */
int bIsInitiator; /**< 0 if socket is the server end (listener), 1 if it is the initiator */
gnutls_session_t sess;
int bHaveSess; /* as we don't know exactly which gnutls_session values are invalid, we use this one
to flag whether or not we are in a session (same as -1 for a socket meaning no sess) */
int bHaveSess; /* as we don't know exactly which gnutls_session values
are invalid, we use this one to flag whether or
not we are in a session (same as -1 for a socket
meaning no sess) */
int bReportAuthErr; /* only the first auth error is to be reported, this var triggers it. Initially, it is
* set to 1 and changed to 0 after the first report. It is changed back to 1 after
* one successful authentication. */

View File

@ -303,7 +303,8 @@ SerializeProp(strm_t *pStrm, uchar *pszPropName, propType_t propType, void *pUsr
ISOBJ_TYPE_assert(pStrm, strm);
assert(pszPropName != NULL);
/*dbgprintf("objSerializeProp: strm %p, propName '%s', type %d, pUsr %p\n", pStrm, pszPropName, propType, pUsr);*/
/*dbgprintf("objSerializeProp: strm %p, propName '%s', type %d, pUsr %p\n",
pStrm, pszPropName, propType, pUsr);*/
/* if we have no user pointer, there is no need to write this property.
* TODO: think if that's the righ point of view
* rgerhards, 2008-01-06

View File

@ -80,26 +80,26 @@ extern int src_exists;
#define CONF_PROP_BUFSIZE 16 /* should be close to sizeof(ptr) or lighly above it */
#define CONF_IPARAMS_BUFSIZE 16 /* initial size of iparams array in wti (is automatically extended) */
#define CONF_MIN_SIZE_FOR_COMPRESS 60 /* config param: minimum message size to try compression. The smaller
* the message, the less likely is any compression gain. We check for
* gain before we submit the message. But to do so we still need to
* do the (costly) compress() call. The following setting sets a size
* for which no call to compress() is done at all. This may result in
* a few more bytes being transmited but better overall performance.
* Note: I have not yet checked the minimum UDP packet size. It might be
* that we do not save anything by compressing very small messages, because
* UDP might need to pad ;)
* rgerhards, 2006-11-30
*/
* the message, the less likely is any compression gain. We check for
* gain before we submit the message. But to do so we still need to
* do the (costly) compress() call. The following setting sets a size
* for which no call to compress() is done at all. This may result in
* a few more bytes being transmited but better overall performance.
* Note: I have not yet checked the minimum UDP packet size. It might be
* that we do not save anything by compressing very small messages, because
* UDP might need to pad ;)
* rgerhards, 2006-11-30
*/
#define CONF_OMOD_NUMSTRINGS_MAXSIZE 5 /* cache for pointers to output module buffer pointers. All
* rsyslog-provided plugins do NOT need more than five buffers. If
* more are needed (future developments, third-parties), rsyslog
* must be recompiled with a larger parameter. Hardcoding this
* saves us some overhead, both in runtime in code complexity. As
* it is doubtful if ever more than 3 parameters are needed, the
* approach taken here is considered appropriate.
* rgerhards, 2010-06-24
*/
* rsyslog-provided plugins do NOT need more than five buffers. If
* more are needed (future developments, third-parties), rsyslog
* must be recompiled with a larger parameter. Hardcoding this
* saves us some overhead, both in runtime in code complexity. As
* it is doubtful if ever more than 3 parameters are needed, the
* approach taken here is considered appropriate.
* rgerhards, 2010-06-24
*/
#define CONF_NUM_MULTISUB 1024 /* default number of messages per multisub structure */
/* ############################################################# *
@ -164,8 +164,8 @@ extern int src_exists;
static inline syslog_pri_t __attribute__((unused))
pri2fac(const syslog_pri_t pri)
{
unsigned fac = pri >> 3;
return (fac > 23) ? LOG_FAC_INVLD : fac;
unsigned fac = pri >> 3;
return (fac > 23) ? LOG_FAC_INVLD : fac;
}
#define pri2sev(pri) ((pri) & 0x07)
@ -368,7 +368,8 @@ operation not carried out */
RS_RET_HOST_NOT_SPECIFIED = -2151, /**< (target) host was not specified where it was needed */
RS_RET_ERR_LIBNET_INIT = -2152, /**< error initializing libnet, e.g. because not running as root */
RS_RET_FORCE_TERM = -2153, /**< thread was forced to terminate by bShallShutdown, a state, not an error */
RS_RET_RULES_QUEUE_EXISTS = -2154,/**< we were instructed to create a new ruleset queue, but one already exists */
RS_RET_RULES_QUEUE_EXISTS = -2154,/**< we were instructed to create a new
ruleset queue, but one already exists */
RS_RET_NO_CURR_RULESET = -2155,/**< no current ruleset exists (but one is required) */
RS_RET_NO_MSG_PASSING = -2156,
/*< output module interface parameter passing mode "MSG" is not available but required */

View File

@ -99,7 +99,8 @@ void seedRandomNumber(void);
#define MAX_RANDOM_NUMBER RAND_MAX
long int randomNumber(void);
long long currentTimeMills(void);
rsRetVal ATTR_NONNULL() split_binary_parameters(uchar **const szBinary, char ***const aParams, int *const iParams, es_str_t *const param_binary);
rsRetVal ATTR_NONNULL() split_binary_parameters(uchar **const szBinary,
char ***const aParams, int *const iParams, es_str_t *const param_binary);
/* mutex operations */
/* some useful constants */

View File

@ -397,28 +397,28 @@ processDataRcvd(tcps_sess_t *pThis,
prop.GetString(pThis->fromHost, &propPeerIP, &lenPeerIP);
if(c != ' ') {
errmsg.LogError(0, NO_ERRCODE, "imtcp %s: Framing Error in received TCP message from "
"peer: (hostname) %s, (ip) %s: delimiter is not SP but has "
"ASCII value %d.", pThis->pSrv->pszInputName, propPeerName, propPeerIP, c);
"peer: (hostname) %s, (ip) %s: delimiter is not SP but has "
"ASCII value %d.", pThis->pSrv->pszInputName, propPeerName, propPeerIP, c);
}
if(pThis->iOctetsRemain < 1) {
/* TODO: handle the case where the octet count is 0! */
errmsg.LogError(0, NO_ERRCODE, "imtcp %s: Framing Error in received TCP message from "
"peer: (hostname) %s, (ip) %s: invalid octet count %d.",
pThis->pSrv->pszInputName, propPeerName, propPeerIP, pThis->iOctetsRemain);
"peer: (hostname) %s, (ip) %s: invalid octet count %d.",
pThis->pSrv->pszInputName, propPeerName, propPeerIP, pThis->iOctetsRemain);
pThis->eFraming = TCP_FRAMING_OCTET_STUFFING;
} else if(pThis->iOctetsRemain > iMaxLine) {
/* while we can not do anything against it, we can at least log an indication
* that something went wrong) -- rgerhards, 2008-03-14
*/
errmsg.LogError(0, NO_ERRCODE, "imtcp %s: received oversize message from peer: "
"(hostname) %s, (ip) %s: size is %d bytes, max msg size "
"is %d, truncating...", pThis->pSrv->pszInputName, propPeerName,
propPeerIP, pThis->iOctetsRemain, iMaxLine);
"(hostname) %s, (ip) %s: size is %d bytes, max msg size "
"is %d, truncating...", pThis->pSrv->pszInputName, propPeerName,
propPeerIP, pThis->iOctetsRemain, iMaxLine);
}
if(pThis->iOctetsRemain > pThis->pSrv->maxFrameSize) {
errmsg.LogError(0, NO_ERRCODE, "imtcp %s: Framing Error in received TCP message from "
"peer: (hostname) %s, (ip) %s: frame too large: %d, change "
"to octet stuffing", pThis->pSrv->pszInputName, propPeerName, propPeerIP,
"peer: (hostname) %s, (ip) %s: frame too large: %d, change "
"to octet stuffing", pThis->pSrv->pszInputName, propPeerName, propPeerIP,
pThis->iOctetsRemain);
pThis->eFraming = TCP_FRAMING_OCTET_STUFFING;
} else {
@ -428,7 +428,8 @@ processDataRcvd(tcps_sess_t *pThis,
}
} else if(pThis->inputState == eInMsgTruncating) {
if(( ((c == '\n') && !pThis->pSrv->bDisableLFDelim)
|| ((pThis->pSrv->addtlFrameDelim != TCPSRV_NO_ADDTL_DELIMITER) && (c == pThis->pSrv->addtlFrameDelim))
|| ((pThis->pSrv->addtlFrameDelim != TCPSRV_NO_ADDTL_DELIMITER)
&& (c == pThis->pSrv->addtlFrameDelim))
) && pThis->eFraming == TCP_FRAMING_OCTET_STUFFING) {
pThis->inputState = eAtStrtFram;
}
@ -451,7 +452,8 @@ processDataRcvd(tcps_sess_t *pThis,
}
if(( ((c == '\n') && !pThis->pSrv->bDisableLFDelim)
|| ((pThis->pSrv->addtlFrameDelim != TCPSRV_NO_ADDTL_DELIMITER) && (c == pThis->pSrv->addtlFrameDelim))
|| ((pThis->pSrv->addtlFrameDelim != TCPSRV_NO_ADDTL_DELIMITER)
&& (c == pThis->pSrv->addtlFrameDelim))
) && pThis->eFraming == TCP_FRAMING_OCTET_STUFFING) { /* record delimiter? */
defaultDoSubmitMessage(pThis, stTime, ttGenTime, pMultiSub);
++(*pnMsgs);

View File

@ -80,7 +80,8 @@ struct tcpsrv_s {
uchar dfltTZ[8]; /**< default TZ if none in timestamp; '\0' =No Default */
tcpLstnPortList_t *pLstnPorts; /**< head pointer for listen ports */
int addtlFrameDelim; /**< additional frame delimiter for plain TCP syslog framing (e.g. to handle NetScreen) */
int addtlFrameDelim; /**< additional frame delimiter for plain TCP syslog
framing (e.g. to handle NetScreen) */
int maxFrameSize; /**< max frame size for octet counted*/
int bDisableLFDelim; /**< if 1, standard LF frame delimiter is disabled (*very dangerous*) */
int discardTruncatedMsg;/**< discard msg part that has been truncated*/
@ -147,7 +148,8 @@ BEGINinterface(tcpsrv) /* name must also be changed in ENDinterface macro! */
/* added v5 */
rsRetVal (*SetSessMax)(tcpsrv_t *pThis, int iMaxSess); /* 2009-04-09 */
/* added v6 */
rsRetVal (*SetOnMsgReceive)(tcpsrv_t *pThis, rsRetVal (*OnMsgReceive)(tcps_sess_t*, uchar*, int)); /* 2009-05-24 */
rsRetVal (*SetOnMsgReceive)(tcpsrv_t *pThis,
rsRetVal (*OnMsgReceive)(tcps_sess_t*, uchar*, int)); /* 2009-05-24 */
rsRetVal (*SetRuleset)(tcpsrv_t *pThis, ruleset_t*); /* 2009-06-12 */
/* added v7 (accidently named v8!) */
rsRetVal (*SetLstnMax)(tcpsrv_t *pThis, int iMaxLstn); /* 2009-08-17 */