SCLogDebug("Stored for TX %"PRIu64, tx_id);
}
-int DeStateDetectStartDetection(ThreadVars *tv,
+/* returns: true match, false no match */
+bool DeStateDetectStartDetection(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
const Signature *s, Packet *p, Flow *f,
/* TX based matches (inspect engines) */
void *alstate = FlowGetAppState(f);
if (unlikely(!StateIsValid(alproto, alstate))) {
- return 0;
+ return false;
}
SigMatchData *smd = NULL;
det_ctx->tx_id = 0;
det_ctx->tx_id_set = 0;
det_ctx->p = NULL;
- return alert_cnt ? 1:0;
+ return (alert_cnt > 0);
}
static int DoInspectItem(ThreadVars *tv,
* \param flags Flags.
* \param alproto App protocol.
*
- * \retval >= 0 An integer value indicating the no of matches.
+ * \retval bool true is sig matched, false if it didn't
*/
-int DeStateDetectStartDetection(ThreadVars *tv, DetectEngineCtx *de_ctx,
+bool DeStateDetectStartDetection(ThreadVars *tv, DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
const Signature *s, Packet *p, Flow *f,
const uint8_t flags, const AppProto alproto);
uint8_t flow_flags = 0; /* flow/state flags */
const Signature *s = NULL;
const Signature *next_s = NULL;
- int state_alert = 0;
bool app_decoder_events = false;
bool has_state = false; /* do we have an alstate to work with? */
}
while (match_cnt--) {
RULE_PROFILING_START(p);
- state_alert = 0;
+ bool state_alert = false;
#ifdef PROFILING
bool smatch = false; /* signature match */
#endif
state_alert = DeStateDetectStartDetection(th_v, de_ctx, det_ctx, s,
p, pflow, flow_flags, alproto);
PACKET_PROFILING_DETECT_END(p, PROF_DETECT_STATEFUL_START);
- if (state_alert == 0)
+ if (state_alert == false)
goto next;
/* match */