} FlowWorkerThreadData;
static void FlowWorkerFlowTimeout(
- ThreadVars *tv, Packet *p, FlowWorkerThreadData *fw, void *detect_thread);
+ ThreadVars *tv, Packet *p, FlowWorkerThreadData *fw, DetectEngineThreadCtx *det_ctx);
/**
* \internal
* on, so IPS logic stays valid.
*/
static inline void FlowWorkerStreamTCPUpdate(ThreadVars *tv, FlowWorkerThreadData *fw, Packet *p,
- void *detect_thread, const bool timeout)
+ DetectEngineThreadCtx *det_ctx, const bool timeout)
{
FLOWWORKER_PROFILING_START(p, PROFILE_FLOWWORKER_STREAM);
StreamTcp(tv, p, fw->stream_thread, &fw->pq);
while ((x = PacketDequeueNoLock(&fw->pq))) {
SCLogDebug("packet %"PRIu64" extra packet %p", p->pcap_cnt, x);
- if (detect_thread != NULL) {
+ if (det_ctx != NULL) {
FLOWWORKER_PROFILING_START(x, PROFILE_FLOWWORKER_DETECT);
- Detect(tv, x, detect_thread);
+ Detect(tv, x, det_ctx);
FLOWWORKER_PROFILING_END(x, PROFILE_FLOWWORKER_DETECT);
}
}
}
-static void FlowWorkerFlowTimeout(ThreadVars *tv, Packet *p, FlowWorkerThreadData *fw,
- void *detect_thread)
+static void FlowWorkerFlowTimeout(
+ ThreadVars *tv, Packet *p, FlowWorkerThreadData *fw, DetectEngineThreadCtx *det_ctx)
{
DEBUG_VALIDATE_BUG_ON(p->pkt_src != PKT_SRC_FFR);
DEBUG_ASSERT_FLOW_LOCKED(p->flow);
/* handle TCP and app layer */
- FlowWorkerStreamTCPUpdate(tv, fw, p, detect_thread, true);
+ FlowWorkerStreamTCPUpdate(tv, fw, p, det_ctx, true);
PacketUpdateEngineEventCounters(tv, fw->dtv, p);
/* handle Detect */
SCLogDebug("packet %"PRIu64" calling Detect", p->pcap_cnt);
- if (detect_thread != NULL) {
+ if (det_ctx != NULL) {
FLOWWORKER_PROFILING_START(p, PROFILE_FLOWWORKER_DETECT);
- Detect(tv, p, detect_thread);
+ Detect(tv, p, det_ctx);
FLOWWORKER_PROFILING_END(p, PROFILE_FLOWWORKER_DETECT);
}
static TmEcode FlowWorker(ThreadVars *tv, Packet *p, void *data)
{
FlowWorkerThreadData *fw = data;
- void *detect_thread = SC_ATOMIC_GET(fw->detect_thread);
+ DetectEngineThreadCtx *det_ctx = SC_ATOMIC_GET(fw->detect_thread);
DEBUG_VALIDATE_BUG_ON(p == NULL);
DEBUG_VALIDATE_BUG_ON(tv->flow_queue == NULL);
/* if detect is disabled, we need to apply file flags to the flow
* here on the first packet. */
- if (detect_thread == NULL &&
+ if (det_ctx == NULL &&
((PKT_IS_TOSERVER(p) && (p->flowflags & FLOW_PKT_TOSERVER_FIRST)) ||
(PKT_IS_TOCLIENT(p) && (p->flowflags & FLOW_PKT_TOCLIENT_FIRST)))) {
DisableDetectFlowFileFlags(p->flow);
}
- FlowWorkerStreamTCPUpdate(tv, fw, p, detect_thread, false);
+ FlowWorkerStreamTCPUpdate(tv, fw, p, det_ctx, false);
PacketAppUpdate2FlowFlags(p);
/* handle the app layer part of the UDP packet payload */
/* handle Detect */
DEBUG_ASSERT_FLOW_LOCKED(p->flow);
SCLogDebug("packet %"PRIu64" calling Detect", p->pcap_cnt);
- if (detect_thread != NULL) {
+ if (det_ctx != NULL) {
FLOWWORKER_PROFILING_START(p, PROFILE_FLOWWORKER_DETECT);
- Detect(tv, p, detect_thread);
+ Detect(tv, p, det_ctx);
FLOWWORKER_PROFILING_END(p, PROFILE_FLOWWORKER_DETECT);
}