]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Define FlowThreadId and add it to the flow
authorVictor Julien <victor@inliniac.net>
Tue, 25 Nov 2014 10:07:03 +0000 (11:07 +0100)
committerVictor Julien <victor@inliniac.net>
Wed, 17 Dec 2014 13:06:08 +0000 (14:06 +0100)
16 bits id should be enough for threads for a while.

src/flow-util.h
src/flow.h

index 8271c33207981db0eb94a3210d9c03062f43363c..8ed6fd88040f856d1d1af374d0847d6b0fb26058 100644 (file)
@@ -55,6 +55,7 @@
         (f)->data_al_so_far[0] = 0; \
         (f)->data_al_so_far[1] = 0; \
         (f)->de_ctx_id = 0; \
+        (f)->thread_id = 0; \
         (f)->alparser = NULL; \
         (f)->alstate = NULL; \
         (f)->de_state = NULL; \
@@ -97,6 +98,7 @@
         (f)->data_al_so_far[0] = 0; \
         (f)->data_al_so_far[1] = 0; \
         (f)->de_ctx_id = 0; \
+        (f)->thread_id = 0; \
         if ((f)->de_state != NULL) { \
             SCMutexLock(&(f)->de_state_m); \
             DetectEngineStateReset((f)->de_state, (STREAM_TOSERVER | STREAM_TOCLIENT)); \
index 802f61fd2a855f40017deb8476db972db182c6b5..12cda835aa9ce5867e75c8666d27099a2397d5ec 100644 (file)
@@ -272,6 +272,9 @@ typedef unsigned int FlowRefCount;
 typedef unsigned short FlowRefCount;
 #endif
 
+/** Local Thread ID */
+typedef uint16_t FlowThreadId;
+
 /**
  *  \brief Flow data structure.
  *
@@ -357,6 +360,9 @@ typedef struct Flow_
      *  de_state and stored sgh ptrs are reset. */
     uint32_t de_ctx_id;
 
+    /** Thread ID for the stream/detect portion of this flow */
+    FlowThreadId thread_id;
+
     /** application level storage ptrs.
      *
      */