mirror of
https://github.com/OISF/suricata.git
synced 2026-10-11 22:09:53 +00:00
style: remove some useless return
and remove empty line before end of function
This commit is contained in:
committed by
Victor Julien
parent
a262e203f9
commit
20423fdd38
@@ -386,7 +386,6 @@ void AppLayerExpectationClean(Flow *f)
|
||||
out:
|
||||
if (ipp)
|
||||
IPPairRelease(ipp);
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+2
-6
@@ -154,14 +154,12 @@ static void FTPParseMemcap(void)
|
||||
|
||||
static void FTPIncrMemuse(uint64_t size)
|
||||
{
|
||||
(void) SC_ATOMIC_ADD(ftp_memuse, size);
|
||||
return;
|
||||
(void)SC_ATOMIC_ADD(ftp_memuse, size);
|
||||
}
|
||||
|
||||
static void FTPDecrMemuse(uint64_t size)
|
||||
{
|
||||
(void) SC_ATOMIC_SUB(ftp_memuse, size);
|
||||
return;
|
||||
(void)SC_ATOMIC_SUB(ftp_memuse, size);
|
||||
}
|
||||
|
||||
uint64_t FTPMemuseGlobalCounter(void)
|
||||
@@ -291,8 +289,6 @@ static void FTPLocalStorageFree(void *ptr)
|
||||
|
||||
SCFree(td);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
static FTPTransaction *FTPTransactionCreate(FtpState *state)
|
||||
{
|
||||
|
||||
@@ -70,14 +70,12 @@ void HTPParseMemcap(void)
|
||||
|
||||
static void HTPIncrMemuse(uint64_t size)
|
||||
{
|
||||
(void) SC_ATOMIC_ADD(htp_memuse, size);
|
||||
return;
|
||||
(void)SC_ATOMIC_ADD(htp_memuse, size);
|
||||
}
|
||||
|
||||
static void HTPDecrMemuse(uint64_t size)
|
||||
{
|
||||
(void) SC_ATOMIC_SUB(htp_memuse, size);
|
||||
return;
|
||||
(void)SC_ATOMIC_SUB(htp_memuse, size);
|
||||
}
|
||||
|
||||
uint64_t HTPMemuseGlobalCounter(void)
|
||||
|
||||
+1
-10
@@ -2550,10 +2550,8 @@ static void HTPConfigSetDefaultsPhase1(HTPCfgRec *cfg_prec)
|
||||
* config, we have to set the soft limit as well. If libhtp starts using
|
||||
* the soft limit in the future, we at least make sure we control what
|
||||
* it's value is. */
|
||||
htp_config_set_field_limits(cfg_prec->cfg,
|
||||
(size_t)HTP_CONFIG_DEFAULT_FIELD_LIMIT_SOFT,
|
||||
htp_config_set_field_limits(cfg_prec->cfg, (size_t)HTP_CONFIG_DEFAULT_FIELD_LIMIT_SOFT,
|
||||
(size_t)HTP_CONFIG_DEFAULT_FIELD_LIMIT_HARD);
|
||||
return;
|
||||
}
|
||||
|
||||
/* hack: htp random range code expects random values in range of 0-RAND_MAX,
|
||||
@@ -2609,7 +2607,6 @@ static void HTPConfigSetDefaultsPhase2(const char *name, HTPCfgRec *cfg_prec)
|
||||
}
|
||||
|
||||
htp_config_register_request_line(cfg_prec->cfg, HTPCallbackRequestLine);
|
||||
return;
|
||||
}
|
||||
|
||||
static void HTPConfigParseParameters(HTPCfgRec *cfg_prec, ConfNode *s,
|
||||
@@ -2990,8 +2987,6 @@ static void HTPConfigParseParameters(HTPCfgRec *cfg_prec, ConfNode *s,
|
||||
p->name);
|
||||
}
|
||||
} /* TAILQ_FOREACH(p, &default_config->head, next) */
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void HTPConfigure(void)
|
||||
@@ -3318,15 +3313,11 @@ static HTPCfgRec cfglist_backup;
|
||||
void HtpConfigCreateBackup(void)
|
||||
{
|
||||
cfglist_backup = cfglist;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void HtpConfigRestoreBackup(void)
|
||||
{
|
||||
cfglist = cfglist_backup;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/** \test Test case where chunks are sent in smaller chunks and check the
|
||||
|
||||
@@ -1781,7 +1781,6 @@ void AppLayerParserRegisterProtocolParsers(void)
|
||||
}
|
||||
|
||||
ValidateParsers();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -50,8 +50,6 @@ void RegisterSMBParsers(void)
|
||||
#ifdef UNITTESTS
|
||||
AppLayerParserRegisterProtocolUnittests(IPPROTO_TCP, ALPROTO_SMB, SMBParserRegisterTests);
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef UNITTESTS
|
||||
|
||||
@@ -1591,8 +1591,6 @@ static void SMTPLocalStorageFree(void *ptr)
|
||||
|
||||
SCFree(td);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void SMTPTransactionFree(SMTPTransaction *tx, SMTPState *state)
|
||||
@@ -1645,8 +1643,6 @@ static void SMTPStateFree(void *p)
|
||||
}
|
||||
|
||||
SCFree(smtp_state);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void SMTPSetMpmState(void)
|
||||
@@ -1667,7 +1663,6 @@ static void SMTPSetMpmState(void)
|
||||
}
|
||||
|
||||
mpm_table[SMTP_MPM].Prepare(smtp_mpm_ctx);
|
||||
|
||||
}
|
||||
|
||||
static void SMTPFreeMpmState(void)
|
||||
@@ -1783,7 +1778,6 @@ static void *SMTPStateGetTx(void *state, uint64_t id)
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
static int SMTPStateGetAlstateProgress(void *vtx, uint8_t direction)
|
||||
@@ -1904,7 +1898,6 @@ void RegisterSMTPParsers(void)
|
||||
#ifdef UNITTESTS
|
||||
AppLayerParserRegisterProtocolUnittests(IPPROTO_TCP, ALPROTO_SMTP, SMTPParserRegisterTests);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4258,6 +4251,4 @@ void SMTPParserRegisterTests(void)
|
||||
UtRegisterTest("SMTPParserTest13", SMTPParserTest13);
|
||||
UtRegisterTest("SMTPParserTest14", SMTPParserTest14);
|
||||
#endif /* UNITTESTS */
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2931,8 +2931,6 @@ static void SSLStateFree(void *p)
|
||||
TAILQ_INIT(&ssl_state->client_connp.certs);
|
||||
|
||||
SCFree(ssl_state);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void SSLStateTransactionFree(void *state, uint64_t tx_id)
|
||||
@@ -3327,8 +3325,6 @@ void RegisterSSLParsers(void)
|
||||
} else {
|
||||
SCLogConfig("Parser disabled for %s protocol. Protocol detection still on.", proto_name);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -354,7 +354,6 @@ static void TCPProtoDetectCheckBailConditions(ThreadVars *tv,
|
||||
|
||||
failure:
|
||||
DisableAppLayer(tv, f, p);
|
||||
return;
|
||||
}
|
||||
|
||||
static int TCPProtoDetectTriggerOpposingSide(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx,
|
||||
|
||||
@@ -71,8 +71,6 @@ Mangle(char *string)
|
||||
|
||||
while ((c = strchr(string, '_')))
|
||||
*c = '-';
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -456,7 +456,6 @@ int ConfGetChildValueInt(const ConfNode *base, const char *name, intmax_t *val)
|
||||
|
||||
*val = tmpint;
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
int ConfGetChildValueIntWithDefault(const ConfNode *base, const ConfNode *dflt,
|
||||
@@ -671,8 +670,6 @@ void ConfCreateContextBackup(void)
|
||||
{
|
||||
root_backup = root;
|
||||
root = NULL;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -683,8 +680,6 @@ void ConfRestoreContextBackup(void)
|
||||
{
|
||||
root = root_backup;
|
||||
root_backup = NULL;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -155,7 +155,6 @@ void StatsAddUI64(ThreadVars *tv, uint16_t id, uint64_t x)
|
||||
#endif
|
||||
pca->head[id].value += x;
|
||||
pca->head[id].updates++;
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -176,7 +175,6 @@ void StatsIncr(ThreadVars *tv, uint16_t id)
|
||||
#endif
|
||||
pca->head[id].value++;
|
||||
pca->head[id].updates++;
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -197,7 +195,6 @@ void StatsDecr(ThreadVars *tv, uint16_t id)
|
||||
#endif
|
||||
pca->head[id].value--;
|
||||
pca->head[id].updates++;
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -225,8 +222,6 @@ void StatsSetUI64(ThreadVars *tv, uint16_t id, uint64_t x)
|
||||
}
|
||||
|
||||
pca->head[id].updates++;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static ConfNode *GetConfig(void) {
|
||||
@@ -370,8 +365,6 @@ static void StatsReleaseCtx(void)
|
||||
}
|
||||
memset(&stats_table, 0, sizeof(stats_table));
|
||||
SCMutexUnlock(&stats_table_mutex);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -568,8 +561,6 @@ static void StatsReleaseCounter(StatsCounter *pc)
|
||||
if (pc != NULL) {
|
||||
SCFree(pc);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -653,7 +644,6 @@ static void StatsCopyCounterValue(StatsLocalCounter *pcae)
|
||||
|
||||
pc->value = pcae->value;
|
||||
pc->updates = pcae->updates;
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -139,8 +139,6 @@ static void DecodePartialIPV6(Packet *p, uint8_t *partial_packet, uint16_t len )
|
||||
s, d, IPV6_GET_RAW_CLASS(icmp6_ip6h), IPV6_GET_RAW_FLOW(icmp6_ip6h),
|
||||
IPV6_GET_RAW_NH(icmp6_ip6h), IPV6_GET_RAW_PLEN(icmp6_ip6h), IPV6_GET_RAW_HLIM(icmp6_ip6h));
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/** \retval type counterpart type or -1 */
|
||||
|
||||
@@ -59,7 +59,6 @@ static void DecodeIPv4inIPv6(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, c
|
||||
} else {
|
||||
ENGINE_SET_EVENT(p, IPV4_IN_IPV6_WRONG_IP_VER);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -731,8 +731,6 @@ void DecodeRegisterPerfCounters(DecodeThreadVars *dtv, ThreadVars *tv)
|
||||
DEvents[i].event_name, tv);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void DecodeUpdatePacketCounters(ThreadVars *tv,
|
||||
|
||||
@@ -36,8 +36,6 @@ static void DefragPolicyFreeUserData(void *data)
|
||||
{
|
||||
if (data != NULL)
|
||||
SCFree(data);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void DefragPolicyAddHostInfo(char *host_ip_range, uint64_t timeout)
|
||||
|
||||
@@ -288,8 +288,6 @@ void DefragInitConfig(bool quiet)
|
||||
SCLogConfig("defrag memory usage: %"PRIu64" bytes, maximum: %"PRIu64,
|
||||
SC_ATOMIC_GET(defrag_memuse), SC_ATOMIC_GET(defrag_config.memcap));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/** \brief print some defrag stats
|
||||
@@ -331,7 +329,6 @@ void DefragHashShutdown(void)
|
||||
}
|
||||
(void) SC_ATOMIC_SUB(defrag_memuse, defrag_config.hash_size * sizeof(DefragTrackerHashRow));
|
||||
DefragTrackerQueueDestroy(&defragtracker_spare_q);
|
||||
return;
|
||||
}
|
||||
|
||||
/** \brief compare two raw ipv6 addrs
|
||||
|
||||
@@ -228,7 +228,6 @@ error:
|
||||
static void DetectAppLayerProtocolFree(DetectEngineCtx *de_ctx, void *ptr)
|
||||
{
|
||||
SCFree(ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
/** \internal
|
||||
@@ -352,8 +351,7 @@ void DetectAppLayerProtocolRegister(void)
|
||||
sigmatch_table[DETECT_AL_APP_LAYER_PROTOCOL].SetupPrefilter =
|
||||
PrefilterSetupAppProto;
|
||||
sigmatch_table[DETECT_AL_APP_LAYER_PROTOCOL].SupportsPrefilter =
|
||||
PrefilterAppProtoIsPrefilterable;
|
||||
return;
|
||||
PrefilterAppProtoIsPrefilterable;
|
||||
}
|
||||
|
||||
/**********************************Unittests***********************************/
|
||||
|
||||
@@ -644,8 +644,6 @@ static void DetectByteExtractFree(DetectEngineCtx *de_ctx, void *ptr)
|
||||
SCFree((void *)bed->name);
|
||||
SCFree(bed);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -304,8 +304,6 @@ static void DetectIPV4CsumFree(DetectEngineCtx *de_ctx, void *ptr)
|
||||
|
||||
if (cd != NULL)
|
||||
SCFree(cd);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -394,8 +392,6 @@ static void DetectTCPV4CsumFree(DetectEngineCtx *de_ctx, void *ptr)
|
||||
|
||||
if (cd != NULL)
|
||||
SCFree(cd);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -485,8 +481,6 @@ static void DetectTCPV6CsumFree(DetectEngineCtx *de_ctx, void *ptr)
|
||||
|
||||
if (cd != NULL)
|
||||
SCFree(cd);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -578,8 +572,6 @@ static void DetectUDPV4CsumFree(DetectEngineCtx *de_ctx, void *ptr)
|
||||
|
||||
if (cd != NULL)
|
||||
SCFree(cd);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -668,8 +660,6 @@ static void DetectUDPV6CsumFree(DetectEngineCtx *de_ctx, void *ptr)
|
||||
|
||||
if (cd != NULL)
|
||||
SCFree(cd);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -758,8 +748,6 @@ static void DetectICMPV4CsumFree(DetectEngineCtx *de_ctx, void *ptr)
|
||||
|
||||
if (cd != NULL)
|
||||
SCFree(cd);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -853,8 +841,6 @@ static void DetectICMPV6CsumFree(DetectEngineCtx *de_ctx, void *ptr)
|
||||
|
||||
if (cd != NULL)
|
||||
SCFree(cd);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* ---------------------------------- Unit Tests --------------------------- */
|
||||
|
||||
@@ -238,7 +238,6 @@ static void GetDirName(const char *in, char *out, size_t outs)
|
||||
char *dir = dirname(tmp);
|
||||
BUG_ON(dir == NULL);
|
||||
strlcpy(out, dir, outs);
|
||||
return;
|
||||
}
|
||||
|
||||
static int SetupLoadPath(const DetectEngineCtx *de_ctx,
|
||||
|
||||
@@ -252,7 +252,6 @@ static void GetDirName(const char *in, char *out, size_t outs)
|
||||
char *dir = dirname(tmp);
|
||||
BUG_ON(dir == NULL);
|
||||
strlcpy(out, dir, outs);
|
||||
return;
|
||||
}
|
||||
|
||||
static int SetupLoadPath(const DetectEngineCtx *de_ctx,
|
||||
|
||||
@@ -296,8 +296,6 @@ static void AddressCutIPv6CopySubOne(uint32_t *a, uint32_t *b)
|
||||
b[1] = htonl(b[1]);
|
||||
b[2] = htonl(b[2]);
|
||||
b[3] = htonl(b[3]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -334,8 +332,6 @@ static void AddressCutIPv6CopyAddOne(uint32_t *a, uint32_t *b)
|
||||
b[1] = htonl(b[1]);
|
||||
b[2] = htonl(b[2]);
|
||||
b[3] = htonl(b[3]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -352,8 +348,6 @@ static void AddressCutIPv6Copy(uint32_t *a, uint32_t *b)
|
||||
b[1] = htonl(a[1]);
|
||||
b[2] = htonl(a[2]);
|
||||
b[3] = htonl(a[3]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
int DetectAddressCutIPv6(DetectEngineCtx *de_ctx, DetectAddress *a,
|
||||
@@ -1922,6 +1916,4 @@ void DetectAddressIPv6Tests(void)
|
||||
UtRegisterTest("AddressTestIPv6CutNot04", AddressTestIPv6CutNot04);
|
||||
UtRegisterTest("AddressTestIPv6CutNot05", AddressTestIPv6CutNot05);
|
||||
#endif /* UNITTESTS */
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,6 @@ void DetectAddressFree(DetectAddress *ag)
|
||||
return;
|
||||
|
||||
SCFree(ag);
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1342,7 +1341,6 @@ void DetectAddressMapFree(DetectEngineCtx *de_ctx)
|
||||
|
||||
HashListTableFree(de_ctx->address_table);
|
||||
de_ctx->address_table = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
static bool DetectAddressMapAdd(DetectEngineCtx *de_ctx, const char *string,
|
||||
@@ -1487,8 +1485,6 @@ void DetectAddressHeadCleanup(DetectAddressHead *gh)
|
||||
gh->ipv6_head = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1787,8 +1783,6 @@ static void DetectAddressPrint(DetectAddress *gr)
|
||||
SCLogDebug("%s/%s", ip, mask);
|
||||
// printf("%s/%s", ip, mask);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -303,7 +303,6 @@ void AlertQueueAppend(DetectEngineThreadCtx *det_ctx, const Signature *s, Packet
|
||||
|
||||
SCLogDebug("Appending sid %" PRIu32 ", s->num %" PRIu32 " to alert queue", s->id, s->num);
|
||||
det_ctx->alert_queue_size++;
|
||||
return;
|
||||
}
|
||||
|
||||
/** \internal
|
||||
|
||||
@@ -285,7 +285,6 @@ void EngineAnalysisFP(const DetectEngineCtx *de_ctx, const Signature *s, char *l
|
||||
SCFree(pat);
|
||||
|
||||
fprintf(fp, "\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -456,8 +455,6 @@ static void CleanupFPAnalyzer(DetectEngineCtx *de_ctx)
|
||||
|
||||
fclose(de_ctx->ea->rule_engine_analysis_fp);
|
||||
de_ctx->ea->rule_engine_analysis_fp = NULL;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void CleanupRuleAnalyzer(DetectEngineCtx *de_ctx)
|
||||
@@ -617,8 +614,6 @@ static void EngineAnalysisRulesPrintFP(const DetectEngineCtx *de_ctx, const Sign
|
||||
fprintf(ea_ctx->rule_engine_analysis_fp, "(with %d transform(s)) ", bt->transforms.cnt);
|
||||
}
|
||||
fprintf(ea_ctx->rule_engine_analysis_fp, "buffer.\n");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void EngineAnalysisRulesFailure(const DetectEngineCtx *de_ctx, char *line, char *file, int lineno)
|
||||
@@ -1830,5 +1825,4 @@ void EngineAnalysisRules(const DetectEngineCtx *de_ctx,
|
||||
}
|
||||
fprintf(fp, "\n");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -955,7 +955,6 @@ static void RulesDumpGrouping(const DetectEngineCtx *de_ctx,
|
||||
fprintf(fp, "%s\n", js_s);
|
||||
free(js_s);
|
||||
fclose(fp);
|
||||
return;
|
||||
}
|
||||
|
||||
static int RulesGroupByProto(DetectEngineCtx *de_ctx)
|
||||
|
||||
@@ -2537,7 +2537,4 @@ void IPOnlyRegisterTests(void)
|
||||
UtRegisterTest("IPOnlyTestBug5168v1", IPOnlyTestBug5168v1);
|
||||
UtRegisterTest("IPOnlyTestBug5168v2", IPOnlyTestBug5168v2);
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -994,8 +994,6 @@ static void PopulateMpmHelperAddPattern(MpmCtx *mpm_ctx, const DetectContentData
|
||||
cd->id, s->num, flags|MPM_PATTERN_CTX_OWNS_ID);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#define SGH_PROTO(sgh, p) ((sgh)->init->protos[(p)] == 1)
|
||||
@@ -1027,7 +1025,6 @@ static void SetMpm(Signature *s, SigMatch *mpm_sm, const int mpm_sm_list)
|
||||
cd->flags |= DETECT_CONTENT_MPM;
|
||||
s->init_data->mpm_sm_list = mpm_sm_list;
|
||||
s->init_data->mpm_sm = mpm_sm;
|
||||
return;
|
||||
}
|
||||
|
||||
static SigMatch *GetMpmForList(const Signature *s, SigMatch *list, SigMatch *mpm_sm,
|
||||
@@ -1269,7 +1266,6 @@ void RetrieveFPForSig(const DetectEngineCtx *de_ctx, Signature *s)
|
||||
#endif
|
||||
/* assign to signature */
|
||||
SetMpm(s, mpm_sm, mpm_sm_list);
|
||||
return;
|
||||
}
|
||||
|
||||
/** \internal
|
||||
@@ -1529,7 +1525,6 @@ void MpmStoreFree(DetectEngineCtx *de_ctx)
|
||||
|
||||
HashListTableFree(de_ctx->mpm_hash_table);
|
||||
de_ctx->mpm_hash_table = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
static void MpmStoreSetup(const DetectEngineCtx *de_ctx, MpmStore *ms)
|
||||
|
||||
@@ -1179,6 +1179,4 @@ void PayloadRegisterTests(void)
|
||||
UtRegisterTest("PayloadTestSig33", PayloadTestSig33);
|
||||
UtRegisterTest("PayloadTestSig34", PayloadTestSig34);
|
||||
#endif /* UNITTESTS */
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1425,8 +1425,6 @@ void DetectPortHashFree(DetectEngineCtx *de_ctx)
|
||||
|
||||
HashListTableFree(de_ctx->dport_hash_table);
|
||||
de_ctx->dport_hash_table = NULL;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*---------------------- Unittests -------------------------*/
|
||||
@@ -2374,4 +2372,3 @@ void DetectPortTests(void)
|
||||
}
|
||||
|
||||
#endif /* UNITTESTS */
|
||||
|
||||
|
||||
@@ -185,8 +185,6 @@ void SigGroupHeadFree(const DetectEngineCtx *de_ctx, SigGroupHead *sgh)
|
||||
|
||||
PrefilterCleanupRuleGroup(de_ctx, sgh);
|
||||
SCFree(sgh);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -316,8 +314,6 @@ void SigGroupHeadHashFree(DetectEngineCtx *de_ctx)
|
||||
|
||||
HashListTableFree(de_ctx->sgh_hash_table);
|
||||
de_ctx->sgh_hash_table = NULL;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -471,7 +467,6 @@ void SigGroupHeadSetSigCnt(SigGroupHead *sgh, uint32_t max_idx)
|
||||
}
|
||||
sgh->init->sig_cnt = cnt;
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -622,8 +617,6 @@ void SigGroupHeadSetupFiles(const DetectEngineCtx *de_ctx, SigGroupHead *sgh)
|
||||
sgh->filestore_cnt++;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/** \brief build an array of rule id's for sigs with no prefilter
|
||||
|
||||
@@ -109,8 +109,6 @@ static void SCSigRegisterSignatureOrderingFunc(DetectEngineCtx *de_ctx,
|
||||
de_ctx->sc_sig_order_funcs = temp;
|
||||
else
|
||||
prev->next = temp;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -181,15 +181,11 @@ void DetectEngineStateFree(DetectEngineState *state)
|
||||
}
|
||||
}
|
||||
SCFree(state);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void StoreFileNoMatchCnt(DetectEngineState *de_state, uint16_t file_no_match, uint8_t direction)
|
||||
{
|
||||
de_state->dir_state[(direction & STREAM_TOSERVER) ? 0 : 1].filestore_cnt += file_no_match;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static bool StoreFilestoreSigsCantMatch(const SigGroupHead *sgh, const DetectEngineState *de_state, uint8_t direction)
|
||||
@@ -1458,8 +1454,6 @@ void DeStateRegisterTests(void)
|
||||
UtRegisterTest("DeStateSigTest09", DeStateSigTest09);
|
||||
UtRegisterTest("DeStateSigTest10", DeStateSigTest10);
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -991,7 +991,6 @@ static void DetectBufferTypeFree(void)
|
||||
|
||||
HashListTableFree(g_buffer_type_hash);
|
||||
g_buffer_type_hash = NULL;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
static int DetectBufferTypeAdd(const char *string)
|
||||
@@ -2533,7 +2532,6 @@ error:
|
||||
DetectEngineCtxFree(de_ctx);
|
||||
}
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
DetectEngineCtx *DetectEngineCtxInitStubForMT(void)
|
||||
@@ -4938,8 +4936,6 @@ static void DetectEngineDeInitYamlConf(void)
|
||||
{
|
||||
ConfDeInit();
|
||||
ConfRestoreContextBackup();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static int DetectEngineTest01(void)
|
||||
@@ -5137,5 +5133,4 @@ void DetectEngineRegisterTests(void)
|
||||
UtRegisterTest("DetectEngineTest08", DetectEngineTest08);
|
||||
UtRegisterTest("DetectEngineTest09", DetectEngineTest09);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -117,7 +117,6 @@ static void Add(SCFPSupportSMList **list, const int list_id, const int priority)
|
||||
new->next = ip->next;
|
||||
ip->next = new;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -126,8 +126,7 @@ void DetectFilemagicRegister(void)
|
||||
DetectBufferTypeSupportsMultiInstance("file.magic");
|
||||
|
||||
g_file_magic_buffer_id = DetectBufferTypeGetByName("file.magic");
|
||||
SCLogDebug("registering filemagic rule option");
|
||||
return;
|
||||
SCLogDebug("registering filemagic rule option");
|
||||
}
|
||||
|
||||
#define FILEMAGIC_MIN_SIZE 512
|
||||
|
||||
@@ -55,7 +55,6 @@ void DetectFileMd5Register(void)
|
||||
g_file_match_list_id = DetectBufferTypeRegister("files");
|
||||
|
||||
SCLogDebug("registering filemd5 rule option");
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -118,7 +118,6 @@ void DetectFilenameRegister(void)
|
||||
filehandler_table[DETECT_FILE_NAME].Callback = DetectEngineInspectFilename;
|
||||
|
||||
DetectBufferTypeSupportsMultiInstance("file.name");
|
||||
return;
|
||||
}
|
||||
|
||||
static int DetectFileextSetup(DetectEngineCtx *de_ctx, Signature *s, const char *str)
|
||||
|
||||
@@ -55,7 +55,6 @@ void DetectFileSha1Register(void)
|
||||
g_file_match_list_id = DetectBufferTypeRegister("files");
|
||||
|
||||
SCLogDebug("registering filesha1 rule option");
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -56,7 +56,6 @@ void DetectFileSha256Register(void)
|
||||
g_file_match_list_id = DetectBufferTypeRegister("files");
|
||||
|
||||
SCLogDebug("registering filesha256 rule option");
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -217,7 +217,6 @@ void DetectHttp2Register(void)
|
||||
"http2", ALPROTO_HTTP2, SIG_FLAG_TOCLIENT, 0, DetectEngineInspectGenericList, NULL);
|
||||
|
||||
g_http2_match_buffer_id = DetectBufferTypeRegister("http2");
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -62,8 +62,6 @@ void DetectIcmpv4HdrRegister(void)
|
||||
DetectPktMpmRegister("icmpv4.hdr", 2, PrefilterGenericMpmPktRegister, GetData);
|
||||
|
||||
DetectPktInspectEngineRegister("icmpv4.hdr", GetData, DetectEngineInspectPktBufferGeneric);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -58,7 +58,6 @@ void DetectICMPv6mtuRegister(void)
|
||||
#endif
|
||||
sigmatch_table[DETECT_ICMPV6MTU].SupportsPrefilter = PrefilterIcmpv6mtuIsPrefilterable;
|
||||
sigmatch_table[DETECT_ICMPV6MTU].SetupPrefilter = PrefilterSetupIcmpv6mtu;
|
||||
return;
|
||||
}
|
||||
|
||||
// returns 0 on no mtu, and 1 if mtu
|
||||
|
||||
@@ -66,10 +66,7 @@ void DetectICMPv6hdrRegister(void)
|
||||
|
||||
DetectPktMpmRegister("icmpv6.hdr", 2, PrefilterGenericMpmPktRegister, GetData);
|
||||
|
||||
DetectPktInspectEngineRegister("icmpv6.hdr", GetData,
|
||||
DetectEngineInspectPktBufferGeneric);
|
||||
|
||||
return;
|
||||
DetectPktInspectEngineRegister("icmpv6.hdr", GetData, DetectEngineInspectPktBufferGeneric);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -441,8 +441,6 @@ void DetectIPProtoRemoveAllSMs(DetectEngineCtx *de_ctx, Signature *s)
|
||||
SigMatchFree(de_ctx, sm);
|
||||
sm = tmp_sm;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void DetectIPProtoFree(DetectEngineCtx *de_ctx, void *ptr)
|
||||
@@ -928,7 +926,6 @@ static int DetectIPProtoTestSetup15(void)
|
||||
end:
|
||||
SigFree(NULL, sig);
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
static int DetectIPProtoTestSetup16(void)
|
||||
@@ -966,7 +963,6 @@ static int DetectIPProtoTestSetup16(void)
|
||||
end:
|
||||
SigFree(NULL, sig);
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
static int DetectIPProtoTestSetup17(void)
|
||||
@@ -1004,7 +1000,6 @@ static int DetectIPProtoTestSetup17(void)
|
||||
end:
|
||||
SigFree(NULL, sig);
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
static int DetectIPProtoTestSetup18(void)
|
||||
@@ -1042,7 +1037,6 @@ static int DetectIPProtoTestSetup18(void)
|
||||
end:
|
||||
SigFree(NULL, sig);
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
static int DetectIPProtoTestSetup19(void)
|
||||
|
||||
@@ -65,10 +65,7 @@ void DetectIpv4hdrRegister(void)
|
||||
|
||||
DetectPktMpmRegister("ipv4.hdr", 2, PrefilterGenericMpmPktRegister, GetData);
|
||||
|
||||
DetectPktInspectEngineRegister("ipv4.hdr", GetData,
|
||||
DetectEngineInspectPktBufferGeneric);
|
||||
|
||||
return;
|
||||
DetectPktInspectEngineRegister("ipv4.hdr", GetData, DetectEngineInspectPktBufferGeneric);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -65,10 +65,7 @@ void DetectIpv6hdrRegister(void)
|
||||
|
||||
DetectPktMpmRegister("ipv6.hdr", 2, PrefilterGenericMpmPktRegister, GetData);
|
||||
|
||||
DetectPktInspectEngineRegister("ipv6.hdr", GetData,
|
||||
DetectEngineInspectPktBufferGeneric);
|
||||
|
||||
return;
|
||||
DetectPktInspectEngineRegister("ipv6.hdr", GetData, DetectEngineInspectPktBufferGeneric);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -95,7 +95,6 @@ void DetectLuaRegister(void)
|
||||
DetectEngineInspectGenericList, NULL);
|
||||
|
||||
SCLogDebug("registering lua rule option");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Flags for DetectLuaThreadData. */
|
||||
|
||||
@@ -538,8 +538,6 @@ void SigMatchRemoveSMFromList(Signature *s, SigMatch *sm, int sm_list)
|
||||
sm->prev->next = sm->next;
|
||||
if (sm->next != NULL)
|
||||
sm->next->prev = sm->prev;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -802,8 +800,6 @@ static void SigMatchTransferSigMatchAcrossLists(SigMatch *sm,
|
||||
sm->next = NULL;
|
||||
*dst_sm_list_tail = sm;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
int SigMatchListSMBelongsTo(const Signature *s, const SigMatch *key_sm)
|
||||
@@ -2350,8 +2346,6 @@ static void DetectParseDupSigFreeFunc(void *data)
|
||||
{
|
||||
if (data != NULL)
|
||||
SCFree(data);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2430,8 +2424,6 @@ void DetectParseDupSigHashFree(DetectEngineCtx *de_ctx)
|
||||
HashListTableFree(de_ctx->dup_sig_hash_table);
|
||||
|
||||
de_ctx->dup_sig_hash_table = NULL;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -154,8 +154,6 @@ void DetectPcreRegister (void)
|
||||
pcre2_use_jit = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -972,8 +970,6 @@ static void DetectPcreFree(DetectEngineCtx *de_ctx, void *ptr)
|
||||
VarNameStoreUnregister(pd->capids[i], pd->captypes[i]);
|
||||
}
|
||||
SCFree(pd);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef UNITTESTS /* UNITTESTS */
|
||||
@@ -2066,6 +2062,5 @@ static void DetectPcreRegisterTests(void)
|
||||
|
||||
UtRegisterTest("DetectPcreParseHttpHost", DetectPcreParseHttpHost);
|
||||
UtRegisterTest("DetectPcreParseCaptureTest", DetectPcreParseCaptureTest);
|
||||
|
||||
}
|
||||
#endif /* UNITTESTS */
|
||||
|
||||
@@ -332,8 +332,6 @@ static void DetectSslStateFree(DetectEngineCtx *de_ctx, void *ptr)
|
||||
{
|
||||
if (ptr != NULL)
|
||||
SCFree(ptr);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef UNITTESTS
|
||||
|
||||
+1
-4
@@ -65,10 +65,7 @@ void DetectTcphdrRegister(void)
|
||||
|
||||
DetectPktMpmRegister("tcp.hdr", 2, PrefilterGenericMpmPktRegister, GetData);
|
||||
|
||||
DetectPktInspectEngineRegister("tcp.hdr", GetData,
|
||||
DetectEngineInspectPktBufferGeneric);
|
||||
|
||||
return;
|
||||
DetectPktInspectEngineRegister("tcp.hdr", GetData, DetectEngineInspectPktBufferGeneric);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -58,8 +58,6 @@ void DetectTcpmssRegister(void)
|
||||
sigmatch_table[DETECT_TCPMSS].Free = DetectTcpmssFree;
|
||||
sigmatch_table[DETECT_TCPMSS].SupportsPrefilter = PrefilterTcpmssIsPrefilterable;
|
||||
sigmatch_table[DETECT_TCPMSS].SetupPrefilter = PrefilterSetupTcpmss;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -58,8 +58,6 @@ void DetectTemplate2Register(void)
|
||||
sigmatch_table[DETECT_TEMPLATE2].Free = DetectTemplate2Free;
|
||||
sigmatch_table[DETECT_TEMPLATE2].SupportsPrefilter = PrefilterTemplate2IsPrefilterable;
|
||||
sigmatch_table[DETECT_TEMPLATE2].SetupPrefilter = PrefilterSetupTemplate2;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -364,6 +364,5 @@ void DetectTosRegisterTests(void)
|
||||
UtRegisterTest("DetectTosTest09", DetectTosTest09);
|
||||
UtRegisterTest("DetectTosTest10", DetectTosTest10);
|
||||
UtRegisterTest("DetectTosTest12", DetectTosTest12);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -64,8 +64,6 @@ void DetectTtlRegister(void)
|
||||
#endif
|
||||
sigmatch_table[DETECT_TTL].SupportsPrefilter = PrefilterTtlIsPrefilterable;
|
||||
sigmatch_table[DETECT_TTL].SetupPrefilter = PrefilterSetupTtl;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-3
@@ -64,9 +64,7 @@ void DetectUdphdrRegister(void)
|
||||
|
||||
DetectPktMpmRegister("udp.hdr", 2, PrefilterGenericMpmPktRegister, GetData);
|
||||
|
||||
DetectPktInspectEngineRegister("udp.hdr", GetData,
|
||||
DetectEngineInspectPktBufferGeneric);
|
||||
return;
|
||||
DetectPktInspectEngineRegister("udp.hdr", GetData, DetectEngineInspectPktBufferGeneric);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1806,7 +1806,6 @@ static void DetectNoFlow(ThreadVars *tv,
|
||||
|
||||
/* see if the packet matches one or more of the sigs */
|
||||
DetectRun(tv, de_ctx, det_ctx, p);
|
||||
return;
|
||||
}
|
||||
|
||||
/** \brief Detection engine thread wrapper.
|
||||
@@ -1914,4 +1913,3 @@ void SigMatchSignatures(
|
||||
#ifdef UNITTESTS
|
||||
#include "tests/detect.c"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -166,7 +166,6 @@ again:
|
||||
|
||||
/* reset count, so we can kill and respawn (unix socket) */
|
||||
SC_ATOMIC_SET(flowmgr_cnt, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
/** \internal
|
||||
@@ -949,7 +948,6 @@ void FlowManagerThreadSpawn(void)
|
||||
FatalError("flow manager thread spawn failed");
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
typedef struct FlowRecyclerThreadData_ {
|
||||
@@ -1150,7 +1148,6 @@ void FlowRecyclerThreadSpawn(void)
|
||||
FatalError("flow recycler thread spawn failed");
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1217,7 +1214,6 @@ again:
|
||||
|
||||
/* reset count, so we can kill and respawn (unix socket) */
|
||||
SC_ATOMIC_SET(flowrec_cnt, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
void TmModuleFlowManagerRegister (void)
|
||||
|
||||
@@ -409,7 +409,6 @@ static inline void FlowForceReassemblyForHash(void)
|
||||
}
|
||||
FBLOCK_UNLOCK(fb);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -419,5 +418,4 @@ void FlowForceReassembly(void)
|
||||
{
|
||||
/* Carry out flow reassembly for unattended flows */
|
||||
FlowForceReassemblyForHash();
|
||||
return;
|
||||
}
|
||||
|
||||
+1
-8
@@ -141,7 +141,6 @@ void FlowCleanupAppLayer(Flow *f)
|
||||
AppLayerParserStateCleanup(f, f->alstate, f->alparser);
|
||||
f->alstate = NULL;
|
||||
f->alparser = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
/** \brief Set the IPOnly scanned flag for 'direction'.
|
||||
@@ -151,9 +150,7 @@ void FlowCleanupAppLayer(Flow *f)
|
||||
*/
|
||||
void FlowSetIPOnlyFlag(Flow *f, int direction)
|
||||
{
|
||||
direction ? (f->flags |= FLOW_TOSERVER_IPONLY_SET) :
|
||||
(f->flags |= FLOW_TOCLIENT_IPONLY_SET);
|
||||
return;
|
||||
direction ? (f->flags |= FLOW_TOSERVER_IPONLY_SET) : (f->flags |= FLOW_TOCLIENT_IPONLY_SET);
|
||||
}
|
||||
|
||||
/** \brief Set flag to indicate that flow has alerts
|
||||
@@ -651,7 +648,6 @@ void FlowInitConfig(bool quiet)
|
||||
SCLogConfig("flow size %u, memcap allows for %" PRIu64 " flows. Per hash row in perfect "
|
||||
"conditions %" PRIu64,
|
||||
sz, flow_memcap_copy / sz, (flow_memcap_copy / sz) / flow_config.hash_size);
|
||||
return;
|
||||
}
|
||||
|
||||
void FlowReset(void)
|
||||
@@ -709,7 +705,6 @@ void FlowShutdown(void)
|
||||
FlowQueueDestroy(&flow_recycle_q);
|
||||
FlowSparePoolDestroy();
|
||||
DEBUG_VALIDATE_BUG_ON(SC_ATOMIC_GET(flow_memuse) != 0);
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1079,8 +1074,6 @@ void FlowInitFlowProto(void)
|
||||
SCLogDebug("deltas: new: -%u est: -%u closed: -%u bypassed: -%u",
|
||||
d->new_timeout, d->est_timeout, d->closed_timeout, d->bypassed_timeout);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+2
-9
@@ -277,8 +277,6 @@ void HostInitConfig(bool quiet)
|
||||
SCLogConfig("host memory usage: %"PRIu64" bytes, maximum: %"PRIu64,
|
||||
SC_ATOMIC_GET(host_memuse), SC_ATOMIC_GET(host_config.memcap));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/** \brief print some host stats
|
||||
@@ -289,9 +287,8 @@ void HostPrintStats (void)
|
||||
SCLogPerf("hostbits added: %" PRIu32 ", removed: %" PRIu32 ", max memory usage: %" PRIu32 "",
|
||||
hostbits_added, hostbits_removed, hostbits_memuse_max);
|
||||
#endif /* HOSTBITS_STATS */
|
||||
SCLogPerf("host memory usage: %"PRIu64" bytes, maximum: %"PRIu64,
|
||||
SC_ATOMIC_GET(host_memuse), SC_ATOMIC_GET(host_config.memcap));
|
||||
return;
|
||||
SCLogPerf("host memory usage: %" PRIu64 " bytes, maximum: %" PRIu64, SC_ATOMIC_GET(host_memuse),
|
||||
SC_ATOMIC_GET(host_config.memcap));
|
||||
}
|
||||
|
||||
/** \brief shutdown the flow engine
|
||||
@@ -325,7 +322,6 @@ void HostShutdown(void)
|
||||
}
|
||||
(void) SC_ATOMIC_SUB(host_memuse, host_config.hash_size * sizeof(HostHashRow));
|
||||
HostQueueDestroy(&host_spare_q);
|
||||
return;
|
||||
}
|
||||
|
||||
/** \brief Cleanup the host engine
|
||||
@@ -366,8 +362,6 @@ void HostCleanup(void)
|
||||
HRLOCK_UNLOCK(hb);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* calculate the hash key for this packet
|
||||
@@ -724,4 +718,3 @@ void HostRegisterUnittests(void)
|
||||
{
|
||||
RegisterHostStorageTests();
|
||||
}
|
||||
|
||||
|
||||
+1
-7
@@ -274,8 +274,6 @@ void IPPairInitConfig(bool quiet)
|
||||
SCLogConfig("ippair memory usage: %"PRIu64" bytes, maximum: %"PRIu64,
|
||||
SC_ATOMIC_GET(ippair_memuse), SC_ATOMIC_GET(ippair_config.memcap));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/** \brief print some ippair stats
|
||||
@@ -286,9 +284,8 @@ void IPPairPrintStats (void)
|
||||
SCLogPerf("ippairbits added: %" PRIu32 ", removed: %" PRIu32 ", max memory usage: %" PRIu32 "",
|
||||
ippairbits_added, ippairbits_removed, ippairbits_memuse_max);
|
||||
#endif /* IPPAIRBITS_STATS */
|
||||
SCLogPerf("ippair memory usage: %"PRIu64" bytes, maximum: %"PRIu64,
|
||||
SCLogPerf("ippair memory usage: %" PRIu64 " bytes, maximum: %" PRIu64,
|
||||
SC_ATOMIC_GET(ippair_memuse), SC_ATOMIC_GET(ippair_config.memcap));
|
||||
return;
|
||||
}
|
||||
|
||||
/** \brief shutdown the flow engine
|
||||
@@ -323,7 +320,6 @@ void IPPairShutdown(void)
|
||||
}
|
||||
(void) SC_ATOMIC_SUB(ippair_memuse, ippair_config.hash_size * sizeof(IPPairHashRow));
|
||||
IPPairQueueDestroy(&ippair_spare_q);
|
||||
return;
|
||||
}
|
||||
|
||||
/** \brief Cleanup the ippair engine
|
||||
@@ -364,8 +360,6 @@ void IPPairCleanup(void)
|
||||
HRLOCK_UNLOCK(hb);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/** \brief compare two raw ipv6 addrs
|
||||
|
||||
@@ -215,7 +215,6 @@ void PcapLogRegister(void)
|
||||
PcapLogProfileSetup();
|
||||
SC_ATOMIC_INIT(thread_cnt);
|
||||
SC_ATOMIC_SET(thread_cnt, 1); /* first id is 1 */
|
||||
return;
|
||||
}
|
||||
|
||||
#define PCAPLOG_PROFILE_START \
|
||||
@@ -322,8 +321,6 @@ static void PcapFileNameFree(PcapFileName *pf)
|
||||
}
|
||||
SCFree(pf);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1635,8 +1632,6 @@ static void PcapLogFileDeInitCtx(OutputCtx *output_ctx)
|
||||
|
||||
pcre2_code_free(pcre_timestamp_code);
|
||||
pcre2_match_data_free(pcre_timestamp_match);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -413,5 +413,4 @@ void OutputEmailInitConf(ConfNode *conf, OutputJsonEmailCtx *email_ctx)
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -73,8 +73,6 @@ static void SRepCIDRFreeUserData(void *data)
|
||||
{
|
||||
if (data != NULL)
|
||||
SCFree(data);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void SRepCIDRAddNetblock(SRepCIDRTree *cidr_ctx, char *ip, int cat, uint8_t value)
|
||||
@@ -264,7 +262,6 @@ static int SRepCatSplitLine(char *line, uint8_t *cat, char *shortname, size_t sh
|
||||
*cat = (uint8_t)c;
|
||||
strlcpy(shortname, ptrs[1], shortname_len);
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -432,7 +429,6 @@ static int SRepLoadFile(SRepCIDRTree *cidr_ctx, char *filename)
|
||||
fclose(fp);
|
||||
fp = NULL;
|
||||
return r;
|
||||
|
||||
}
|
||||
|
||||
int SRepLoadFileFromFD(SRepCIDRTree *cidr_ctx, FILE *fp)
|
||||
|
||||
@@ -146,7 +146,6 @@ void RunModeIdsAFPRegister(void)
|
||||
"each flow are assigned to a single detect "
|
||||
"thread.",
|
||||
RunModeIdsAFPAutoFp, AFPRunModeEnableIPS);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -76,8 +76,6 @@ void RunModeIdsAFXDPRegister(void)
|
||||
"Workers af-xdp mode, each thread does all"
|
||||
" tasks from acquisition to logging",
|
||||
RunModeIdsAFXDPWorkers, NULL);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef HAVE_AF_XDP
|
||||
|
||||
@@ -62,8 +62,6 @@ void RunModeErfDagRegister(void)
|
||||
"Workers DAG mode, each thread does all "
|
||||
" tasks from acquisition to logging",
|
||||
RunModeIdsErfDagWorkers, NULL);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
int RunModeIdsErfDagSingle(void)
|
||||
|
||||
@@ -45,8 +45,6 @@ void RunModeErfFileRegister(void)
|
||||
"Multi threaded ERF file mode. Packets from "
|
||||
"each flow are assigned to a single detect thread",
|
||||
RunModeErfFileAutoFp, NULL);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
int RunModeErfFileSingle(void)
|
||||
|
||||
@@ -53,8 +53,6 @@ void RunModeIpsIPFWRegister(void)
|
||||
|
||||
RunModeRegisterNewRunMode(RUNMODE_IPFW, "workers",
|
||||
"Multi queue IPFW IPS mode with one thread per queue", RunModeIpsIPFWWorker, NULL);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
int RunModeIpsIPFWAutoFp(void)
|
||||
|
||||
@@ -137,7 +137,6 @@ void RunModeIdsNetmapRegister(void)
|
||||
"each flow are assigned to a single detect "
|
||||
"thread.",
|
||||
RunModeIdsNetmapAutoFp, NetmapRunModeEnableIPS);
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef HAVE_NETMAP
|
||||
|
||||
@@ -218,5 +218,4 @@ void RunModeIdsNflogRegister(void)
|
||||
RUNMODE_NFLOG, "single", "Single threaded nflog mode", RunModeIdsNflogSingle, NULL);
|
||||
RunModeRegisterNewRunMode(
|
||||
RUNMODE_NFLOG, "workers", "Workers nflog mode", RunModeIdsNflogWorkers, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,6 @@ void RunModeIpsNFQRegister(void)
|
||||
|
||||
RunModeRegisterNewRunMode(RUNMODE_NFQ, "workers",
|
||||
"Multi queue NFQ IPS mode with one thread per queue", RunModeIpsNFQWorker, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
int RunModeIpsNFQAutoFp(void)
|
||||
|
||||
@@ -45,8 +45,6 @@ void RunModeFilePcapRegister(void)
|
||||
"Multi-threaded pcap file mode. Packets from each flow are assigned to a consistent "
|
||||
"detection thread",
|
||||
RunModeFilePcapAutoFp, NULL);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -48,8 +48,6 @@ void RunModeIdsPcapRegister(void)
|
||||
"Workers pcap live mode, each thread does all"
|
||||
" tasks from acquisition to logging",
|
||||
RunModeIdsPcapWorkers, NULL);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void PcapDerefConfig(void *conf)
|
||||
|
||||
@@ -63,7 +63,6 @@ void RunModeIdsPfringRegister(void)
|
||||
"Workers pfring mode, each thread does all"
|
||||
" tasks from acquisition to logging",
|
||||
RunModeIdsPfringWorkers, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef HAVE_PFRING
|
||||
|
||||
@@ -247,7 +247,6 @@ void RunModeRegisterRunModes(void)
|
||||
#ifdef UNITTESTS
|
||||
UtRunModeRegister();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -290,8 +289,6 @@ void RunModeListRunmodes(void)
|
||||
"-----------------------\n");
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static const char *RunModeGetConfOrDefault(int capture_mode, const char *capture_plugin_name)
|
||||
@@ -520,8 +517,6 @@ void RunModeRegisterNewRunMode(enum RunModes runmode, const char *name, const ch
|
||||
}
|
||||
mode->RunModeFunc = RunModeFunc;
|
||||
mode->RunModeIsIPSEnabled = RunModeIsIPSEnabled;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -114,8 +114,8 @@ void StreamTcpReassembleInitMemuse(void)
|
||||
void StreamTcpReassembleIncrMemuse(uint64_t size)
|
||||
{
|
||||
(void) SC_ATOMIC_ADD(ra_memuse, size);
|
||||
SCLogDebug("REASSEMBLY %"PRIu64", incr %"PRIu64, StreamTcpReassembleMemuseGlobalCounter(), size);
|
||||
return;
|
||||
SCLogDebug("REASSEMBLY %" PRIu64 ", incr %" PRIu64, StreamTcpReassembleMemuseGlobalCounter(),
|
||||
size);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -141,8 +141,8 @@ void StreamTcpReassembleDecrMemuse(uint64_t size)
|
||||
BUG_ON(postsize > presize);
|
||||
}
|
||||
#endif
|
||||
SCLogDebug("REASSEMBLY %"PRIu64", decr %"PRIu64, StreamTcpReassembleMemuseGlobalCounter(), size);
|
||||
return;
|
||||
SCLogDebug("REASSEMBLY %" PRIu64 ", decr %" PRIu64, StreamTcpReassembleMemuseGlobalCounter(),
|
||||
size);
|
||||
}
|
||||
|
||||
uint64_t StreamTcpReassembleMemuseGlobalCounter(void)
|
||||
|
||||
+3
-9
@@ -228,8 +228,7 @@ void StreamTcpInitMemuse(void)
|
||||
void StreamTcpIncrMemuse(uint64_t size)
|
||||
{
|
||||
(void) SC_ATOMIC_ADD(st_memuse, size);
|
||||
SCLogDebug("STREAM %"PRIu64", incr %"PRIu64, StreamTcpMemuseCounter(), size);
|
||||
return;
|
||||
SCLogDebug("STREAM %" PRIu64 ", incr %" PRIu64, StreamTcpMemuseCounter(), size);
|
||||
}
|
||||
|
||||
void StreamTcpDecrMemuse(uint64_t size)
|
||||
@@ -249,8 +248,7 @@ void StreamTcpDecrMemuse(uint64_t size)
|
||||
BUG_ON(postsize > presize);
|
||||
}
|
||||
#endif
|
||||
SCLogDebug("STREAM %"PRIu64", decr %"PRIu64, StreamTcpMemuseCounter(), size);
|
||||
return;
|
||||
SCLogDebug("STREAM %" PRIu64 ", decr %" PRIu64, StreamTcpMemuseCounter(), size);
|
||||
}
|
||||
|
||||
uint64_t StreamTcpMemuseCounter(void)
|
||||
@@ -967,8 +965,7 @@ void StreamTcpSetOSPolicy(TcpStream *stream, Packet *p)
|
||||
else if (stream->os_policy == OS_POLICY_OLD_SOLARIS)
|
||||
stream->os_policy = OS_POLICY_SOLARIS;
|
||||
|
||||
SCLogDebug("Policy is %"PRIu8"", stream->os_policy);
|
||||
|
||||
SCLogDebug("Policy is %" PRIu8 "", stream->os_policy);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -5103,7 +5100,6 @@ static void StreamTcpPacketCheckPostRst(TcpSession *ssn, Packet *p)
|
||||
StreamTcpSetEvent(p, STREAM_SUSPECTED_RST_INJECT);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -7069,8 +7065,6 @@ void TcpSessionSetReassemblyDepth(TcpSession *ssn, uint32_t size)
|
||||
if (size > ssn->reassembly_depth || size == 0) {
|
||||
ssn->reassembly_depth = size;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const char *StreamTcpStateAsString(const enum TcpState state)
|
||||
|
||||
@@ -681,7 +681,6 @@ void TmSlotSetFuncAppend(ThreadVars *tv, TmModule *tm, const void *data)
|
||||
b->slot_next = slot;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
#if !defined __CYGWIN__ && !defined OS_WIN32 && !defined __OpenBSD__ && !defined sun
|
||||
@@ -1175,8 +1174,6 @@ void TmThreadAppend(ThreadVars *tv, int type)
|
||||
}
|
||||
|
||||
SCMutexUnlock(&tv_root_lock);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static bool ThreadStillHasPackets(ThreadVars *tv)
|
||||
@@ -1340,7 +1337,6 @@ again:
|
||||
}
|
||||
|
||||
SCMutexUnlock(&tv_root_lock);
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1455,7 +1451,6 @@ again:
|
||||
* don't process the last live packets together
|
||||
* with FFR packets */
|
||||
TmThreadDrainPacketThreads();
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_VALIDATION
|
||||
@@ -1526,7 +1521,6 @@ again:
|
||||
}
|
||||
}
|
||||
SCMutexUnlock(&tv_root_lock);
|
||||
return;
|
||||
}
|
||||
|
||||
#define MIN_WAIT_TIME 100
|
||||
@@ -1567,8 +1561,6 @@ void TmThreadKillThreads(void)
|
||||
for (i = 0; i < TVT_MAX; i++) {
|
||||
TmThreadKillThreadsFamily(i);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void TmThreadFree(ThreadVars *tv)
|
||||
@@ -1734,8 +1726,6 @@ void TmThreadInitMC(ThreadVars *tv)
|
||||
FatalError("Error initializing the tv->cond condition "
|
||||
"variable");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void TmThreadDeinitMC(ThreadVars *tv)
|
||||
@@ -1748,7 +1738,6 @@ static void TmThreadDeinitMC(ThreadVars *tv)
|
||||
SCCtrlCondDestroy(tv->ctrl_cond);
|
||||
SCFree(tv->ctrl_cond);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1767,8 +1756,6 @@ void TmThreadTestThreadUnPaused(ThreadVars *tv)
|
||||
if (TmThreadsCheckFlag(tv, THV_KILL))
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1782,8 +1769,6 @@ void TmThreadWaitForFlag(ThreadVars *tv, uint32_t flags)
|
||||
while (!TmThreadsCheckFlag(tv, flags)) {
|
||||
SleepUsec(100);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1794,7 +1779,6 @@ void TmThreadWaitForFlag(ThreadVars *tv, uint32_t flags)
|
||||
void TmThreadContinue(ThreadVars *tv)
|
||||
{
|
||||
TmThreadsUnsetFlag(tv, THV_PAUSE);
|
||||
return;
|
||||
}
|
||||
|
||||
static TmEcode WaitOnThreadsRunningByType(const int t)
|
||||
@@ -1939,7 +1923,6 @@ void TmThreadContinueThreads(void)
|
||||
}
|
||||
}
|
||||
SCMutexUnlock(&tv_root_lock);
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1958,7 +1941,6 @@ void TmThreadCheckThreadState(void)
|
||||
}
|
||||
}
|
||||
SCMutexUnlock(&tv_root_lock);
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -79,8 +79,6 @@ void TmqhFlowRegister(void)
|
||||
} else {
|
||||
tmqh_table[TMQH_FLOW].OutHandler = TmqhOutputFlowHash;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void TmqhFlowPrintAutofpHandler(void)
|
||||
@@ -217,8 +215,6 @@ void TmqhOutputFlowFreeCtx(void *ctx)
|
||||
fctx->size);
|
||||
SCFree(fctx->queues);
|
||||
SCFree(fctx);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void TmqhOutputFlowHash(ThreadVars *tv, Packet *p)
|
||||
@@ -241,8 +237,6 @@ void TmqhOutputFlowHash(ThreadVars *tv, Packet *p)
|
||||
PacketEnqueue(q, p);
|
||||
SCCondSignal(&q->cond_q);
|
||||
SCMutexUnlock(&q->mutex_q);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -271,8 +265,6 @@ void TmqhOutputFlowIPPair(ThreadVars *tv, Packet *p)
|
||||
PacketEnqueue(q, p);
|
||||
SCCondSignal(&q->cond_q);
|
||||
SCMutexUnlock(&q->mutex_q);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void TmqhOutputFlowFTPHash(ThreadVars *tv, Packet *p)
|
||||
@@ -299,8 +291,6 @@ static void TmqhOutputFlowFTPHash(ThreadVars *tv, Packet *p)
|
||||
PacketEnqueue(q, p);
|
||||
SCCondSignal(&q->cond_q);
|
||||
SCMutexUnlock(&q->mutex_q);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef UNITTESTS
|
||||
@@ -413,6 +403,4 @@ void TmqhFlowRegisterTests(void)
|
||||
UtRegisterTest("TmqhOutputFlowSetupCtxTest03",
|
||||
TmqhOutputFlowSetupCtxTest03);
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -438,8 +438,6 @@ void TmqhReleasePacketsToPacketPool(PacketQueue *pq)
|
||||
DEBUG_VALIDATE_BUG_ON(p->flow != NULL);
|
||||
TmqhOutputPacketpool(NULL, p);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/** number of packets to keep reserved when calculating the pending
|
||||
|
||||
@@ -1205,7 +1205,6 @@ void UnixManagerThreadSpawn(int mode)
|
||||
FatalError("Unix socket init failed");
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO can't think of a good name
|
||||
@@ -1268,7 +1267,6 @@ again:
|
||||
}
|
||||
|
||||
SCMutexUnlock(&tv_root_lock);
|
||||
return;
|
||||
}
|
||||
|
||||
#else /* BUILD_UNIX_SOCKET */
|
||||
@@ -1276,17 +1274,14 @@ again:
|
||||
void UnixManagerThreadSpawn(int mode)
|
||||
{
|
||||
SCLogError("Unix socket is not compiled");
|
||||
return;
|
||||
}
|
||||
|
||||
void UnixSocketKillSocketThread(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
void UnixManagerThreadSpawnNonRunmode(const bool unix_socket_enabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#endif /* BUILD_UNIX_SOCKET */
|
||||
|
||||
@@ -92,7 +92,6 @@ static void AffinitySetupInit(void)
|
||||
}
|
||||
SCMutexInit(&thread_affinity[i].taf_mutex, NULL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void BuildCpusetWithCallback(const char *name, ConfNode *node,
|
||||
|
||||
@@ -69,6 +69,4 @@ void SCAtomicRegisterTests(void)
|
||||
#ifdef UNITTESTS
|
||||
UtRegisterTest("SCAtomicTest01", SCAtomicTest01);
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -81,8 +81,6 @@ int MemBufferExpand(MemBuffer **buffer, uint32_t expand_by) {
|
||||
void MemBufferFree(MemBuffer *buffer)
|
||||
{
|
||||
SCFree(buffer);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void MemBufferPrintToFP(MemBuffer *buffer, FILE *fp)
|
||||
|
||||
@@ -76,7 +76,6 @@ void SCClassConfInit(DetectEngineCtx *de_ctx)
|
||||
}
|
||||
de_ctx->class_conf_regex_match =
|
||||
pcre2_match_data_create_from_pattern(de_ctx->class_conf_regex, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
void SCClassConfDeinit(DetectEngineCtx *de_ctx)
|
||||
@@ -194,8 +193,6 @@ void SCClassConfDeInitContext(DetectEngineCtx *de_ctx)
|
||||
HashTableFree(de_ctx->class_conf_ht);
|
||||
|
||||
de_ctx->class_conf_ht = NULL;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -435,8 +432,6 @@ static void SCClassConfDeAllocClasstype(SCClassConfClasstype *ct)
|
||||
|
||||
SCFree(ct);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -512,8 +507,6 @@ char SCClassConfClasstypeHashCompareFunc(void *data1, uint16_t datalen1,
|
||||
void SCClassConfClasstypeHashFree(void *ch)
|
||||
{
|
||||
SCClassConfDeAllocClasstype(ch);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -378,8 +378,6 @@ void SCLogReleaseFGFilters(void)
|
||||
SCMutexUnlock(&sc_log_fg_filters_m[i]);
|
||||
sc_log_fg_filters[i] = NULL;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -628,8 +626,6 @@ void SCLogCheckFDFilterExit(const char *function)
|
||||
|
||||
if (thread_list != NULL)
|
||||
thread_list->entered--;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -715,9 +711,7 @@ void SCLogReleaseFDFilters(void)
|
||||
|
||||
sc_log_fd_filters = NULL;
|
||||
|
||||
SCMutexUnlock( &sc_log_fd_filters_m );
|
||||
|
||||
return;
|
||||
SCMutexUnlock(&sc_log_fd_filters_m);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -874,8 +868,6 @@ void SCLogAddToFGFFileList(SCLogFGFilterFile *fgf_file,
|
||||
sc_log_fg_filters[listtype] = fgf_file_temp;
|
||||
else
|
||||
fgf_file->next = fgf_file_temp;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -921,8 +913,6 @@ void SCLogAddToFGFFuncList(SCLogFGFilterFile *fgf_file,
|
||||
fgf_file->func = fgf_func_temp;
|
||||
else
|
||||
fgf_func->next = fgf_func_temp;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -955,8 +945,6 @@ void SCLogAddToFGFLineList(SCLogFGFilterFunc *fgf_func,
|
||||
fgf_func->line = fgf_line_temp;
|
||||
else
|
||||
fgf_line->next = fgf_line_temp;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -971,7 +959,4 @@ void SCLogReleaseFDFilter(SCLogFDFilter *fdf)
|
||||
SCFree(fdf->func);
|
||||
SCFree(fdf);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -173,8 +173,6 @@ static inline void SCLogPrintToStream(FILE *fd, char *msg)
|
||||
#if defined (OS_WIN32)
|
||||
SCMutexUnlock(&sc_log_stream_lock);
|
||||
#endif /* OS_WIN32 */
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -193,8 +191,6 @@ static inline void SCLogPrintToSyslog(int syslog_log_level, const char *msg)
|
||||
//syslog_r(syslog_log_level, NULL, "%s", msg);
|
||||
|
||||
syslog(syslog_log_level, "%s", msg);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1031,8 +1027,6 @@ static inline void SCLogFreeLogOPIfaceCtx(SCLogOPIfaceCtx *iface_ctx)
|
||||
|
||||
SCFree(temp);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1071,8 +1065,6 @@ static inline void SCLogSetLogLevel(SCLogInitData *sc_lid, SCLogConfig *sc_lc)
|
||||
|
||||
/* we also set it to a global var, as it is easier to access it */
|
||||
sc_log_global_log_level = sc_lc->log_level;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
SCLogLevel SCLogGetLogLevel(void)
|
||||
@@ -1130,8 +1122,6 @@ static inline void SCLogSetLogFormat(SCLogInitData *sc_lid, SCLogConfig *sc_lc)
|
||||
printf("Error allocating memory\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1203,7 +1193,6 @@ static inline void SCLogSetOPIface(SCLogInitData *sc_lid, SCLogConfig *sc_lc)
|
||||
sc_lc->op_ifaces = op_ifaces_ctx;
|
||||
sc_lc->op_ifaces_cnt++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1248,8 +1237,6 @@ static inline void SCLogSetOPFilter(SCLogInitData *sc_lid, SCLogConfig *sc_lc)
|
||||
sc_lc->op_filter_regex_match =
|
||||
pcre2_match_data_create_from_pattern(sc_lc->op_filter_regex, NULL);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1283,8 +1270,6 @@ static void SCLogFreeLogInitData(SCLogInitData *sc_lid)
|
||||
SCLogFreeLogOPIfaceCtx(sc_lid->op_ifaces);
|
||||
SCFree(sc_lid);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -1310,8 +1295,6 @@ static inline void SCLogFreeLogConfig(SCLogConfig *sc_lc)
|
||||
SCLogFreeLogOPIfaceCtx(sc_lc->op_ifaces);
|
||||
SCFree(sc_lc);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1344,8 +1327,6 @@ void SCLogAppendOPIfaceCtx(SCLogOPIfaceCtx *iface_ctx, SCLogInitData *sc_lid)
|
||||
prev->next = iface_ctx;
|
||||
|
||||
sc_lid->op_ifaces_cnt++;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef UNITTESTS
|
||||
@@ -1434,7 +1415,6 @@ void SCLogInitLogModule(SCLogInitData *sc_lid)
|
||||
//SCOutputPrint(sc_did->startup_message);
|
||||
|
||||
rs_log_set_level(sc_log_global_log_level);
|
||||
return;
|
||||
}
|
||||
|
||||
void SCLogLoadConfig(int daemon, int verbose, uint32_t userid, uint32_t groupid)
|
||||
@@ -1632,8 +1612,6 @@ void SCLogDeInitLogModule(void)
|
||||
#if defined (OS_WIN32)
|
||||
SCMutexDestroy(&sc_log_stream_lock);
|
||||
#endif /* OS_WIN32 */
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//------------------------------------Unit_Tests--------------------------------
|
||||
|
||||
@@ -586,7 +586,6 @@ void EBPFBypassFree(void *data)
|
||||
SCFree(eb->key[1]);
|
||||
}
|
||||
SCFree(eb);
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -101,8 +101,6 @@ static void SCHInfoFreeUserDataOSPolicy(void *data)
|
||||
{
|
||||
if (data != NULL)
|
||||
SCFree(data);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -323,8 +321,6 @@ void SCHInfoCleanResources(void)
|
||||
SCRadixReleaseRadixTree(sc_hinfo_tree);
|
||||
sc_hinfo_tree = NULL;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -364,16 +360,12 @@ static void SCHInfoCreateContextBackup(void)
|
||||
{
|
||||
sc_hinfo_tree_backup = sc_hinfo_tree;
|
||||
sc_hinfo_tree = NULL;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void SCHInfoRestoreContextBackup(void)
|
||||
{
|
||||
sc_hinfo_tree = sc_hinfo_tree_backup;
|
||||
sc_hinfo_tree_backup = NULL;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1637,5 +1629,4 @@ void SCHInfoRegisterTests(void)
|
||||
UtRegisterTest("SCHInfoTestLoadFromConfig04", SCHInfoTestLoadFromConfig04);
|
||||
UtRegisterTest("SCHInfoTestLoadFromConfig05", SCHInfoTestLoadFromConfig05);
|
||||
#endif /* UNITTESTS */
|
||||
|
||||
}
|
||||
|
||||
@@ -200,6 +200,4 @@ void MaskIPNetblock(uint8_t *stream, int netmask, int key_bitlen)
|
||||
}
|
||||
stream[i] &= mask;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
|
||||
void LandlockSandboxing(SCInstance *suri)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#else /* HAVE_LINUX_LANDLOCK_H */
|
||||
|
||||
@@ -428,6 +428,4 @@ void MacSetRegisterTests(void)
|
||||
UtRegisterTest("MacSetTest04", MacSetTest04);
|
||||
UtRegisterTest("MacSetTest05", MacSetTest05);
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
+1
-32
@@ -107,9 +107,7 @@ static void SCACGetConfig(void)
|
||||
//ConfNode *ac_conf;
|
||||
//const char *hash_val = NULL;
|
||||
|
||||
//ConfNode *pm = ConfGetNode("pattern-matcher");
|
||||
|
||||
return;
|
||||
// ConfNode *pm = ConfGetNode("pattern-matcher");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -274,8 +272,6 @@ static void SCACSetOutputState(int32_t state, uint32_t pid, MpmCtx *mpm_ctx)
|
||||
output_state->pids = ptmp;
|
||||
|
||||
output_state->pids[output_state->no_of_entries - 1] = pid;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -318,8 +314,6 @@ static inline void SCACEnter(uint8_t *pattern, uint16_t pattern_len, uint32_t pi
|
||||
/* add this pattern id, to the output table of the last state, where the
|
||||
* pattern ends in the trie */
|
||||
SCACSetOutputState(state, pid, mpm_ctx);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -345,8 +339,6 @@ static inline void SCACCreateGotoTable(MpmCtx *mpm_ctx)
|
||||
ctx->goto_table[0][ascii_code] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static inline void SCACDetermineLevel1Gap(MpmCtx *mpm_ctx)
|
||||
@@ -366,8 +358,6 @@ static inline void SCACDetermineLevel1Gap(MpmCtx *mpm_ctx)
|
||||
int32_t newstate = SCACInitNewState(mpm_ctx);
|
||||
ctx->goto_table[0][u] = newstate;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static inline int SCACStateQueueIsEmpty(StateQueue *q)
|
||||
@@ -396,8 +386,6 @@ static inline void SCACEnqueue(StateQueue *q, int32_t state)
|
||||
if (q->top == q->bot) {
|
||||
FatalError("Just ran out of space in the queue. Please file a bug report on this");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static inline int32_t SCACDequeue(StateQueue *q)
|
||||
@@ -454,8 +442,6 @@ static inline void SCACClubOutputStates(int32_t dst_state, int32_t src_state,
|
||||
output_src_state->pids[i];
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -512,8 +498,6 @@ static inline void SCACCreateFailureTable(MpmCtx *mpm_ctx)
|
||||
}
|
||||
}
|
||||
SCFree(q);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -606,8 +590,6 @@ static inline void SCACCreateDeltaTable(MpmCtx *mpm_ctx)
|
||||
}
|
||||
SCFree(q);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static inline void SCACClubOutputStatePresenceWithDeltaTable(MpmCtx *mpm_ctx)
|
||||
@@ -636,8 +618,6 @@ static inline void SCACClubOutputStatePresenceWithDeltaTable(MpmCtx *mpm_ctx)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static inline void SCACInsertCaseSensitiveEntriesForPatterns(MpmCtx *mpm_ctx)
|
||||
@@ -657,8 +637,6 @@ static inline void SCACInsertCaseSensitiveEntriesForPatterns(MpmCtx *mpm_ctx)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#if 0
|
||||
@@ -676,8 +654,6 @@ static void SCACPrintDeltaTable(MpmCtx *mpm_ctx)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -719,8 +695,6 @@ static void SCACPrepareStateTable(MpmCtx *mpm_ctx)
|
||||
ctx->goto_table = NULL;
|
||||
SCFree(ctx->failure_table);
|
||||
ctx->failure_table = NULL;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -921,8 +895,6 @@ void SCACDestroyCtx(MpmCtx *mpm_ctx)
|
||||
mpm_ctx->ctx = NULL;
|
||||
mpm_ctx->memory_cnt--;
|
||||
mpm_ctx->memory_size -= sizeof(SCACCtx);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1114,8 +1086,6 @@ void SCACPrintInfo(MpmCtx *mpm_ctx)
|
||||
printf("Largest: %" PRIu32 "\n", mpm_ctx->maxlen);
|
||||
printf("Total states in the state table: %" PRIu32 "\n", ctx->state_count);
|
||||
printf("\n");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1138,7 +1108,6 @@ void MpmACRegister(void)
|
||||
mpm_table[MPM_AC].RegisterUnittests = SCACRegisterTests;
|
||||
#endif
|
||||
mpm_table[MPM_AC].feature_flags = MPM_FEATURE_FLAG_DEPTH | MPM_FEATURE_FLAG_OFFSET;
|
||||
return;
|
||||
}
|
||||
|
||||
/*************************************Unittests********************************/
|
||||
|
||||
@@ -1001,7 +1001,6 @@ int SCHSAddPatternCS(MpmCtx *mpm_ctx, uint8_t *pat, uint16_t patlen,
|
||||
|
||||
void SCHSPrintSearchStats(MpmThreadCtx *mpm_thread_ctx)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
void SCHSPrintInfo(MpmCtx *mpm_ctx)
|
||||
|
||||
@@ -1216,8 +1216,6 @@ void NapatechStartStats(void)
|
||||
if (TmThreadSpawn(buf_monitor_tv) != 0) {
|
||||
FatalError("Failed to spawn thread for NapatechBufMonitor - Killing engine.");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
bool NapatechSetupNuma(uint32_t stream, uint32_t numa)
|
||||
|
||||
@@ -389,7 +389,6 @@ static int PoolTestInitArg(void *data, void *allocdata)
|
||||
|
||||
static void PoolTestFree(void *ptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static int PoolTestInit01 (void)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user