]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
flow: new flow queue: flow_recycle_q
authorVictor Julien <victor@inliniac.net>
Wed, 30 Apr 2014 10:30:30 +0000 (12:30 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 28 Jul 2014 13:47:44 +0000 (15:47 +0200)
This queue will be used by the FlowManager to pass timed out flows
to another thread that will do the actual cleanup.

src/flow-private.h
src/flow.c

index fc26e04f606a203ace82adbf051c3bfb9893b5fb..bd25960b2bf0c755e5d01c6ee9739da2a259655a 100644 (file)
@@ -78,6 +78,9 @@ FlowProto flow_proto[FLOW_PROTO_MAX];
 /** spare/unused/prealloced flows live here */
 FlowQueue flow_spare_q;
 
+/** queue to pass flows to cleanup/log thread(s) */
+FlowQueue flow_recycle_q;
+
 FlowBucket *flow_hash;
 FlowConfig flow_config;
 
index 9f9e2bd4bd89a95a7a7ac27042f8cf4caf12d632..b18697bd1b0b440105aeaa91deec427be3aff34d 100644 (file)
@@ -304,6 +304,7 @@ void FlowInitConfig(char quiet)
     SC_ATOMIC_INIT(flow_memuse);
     SC_ATOMIC_INIT(flow_prune_idx);
     FlowQueueInit(&flow_spare_q);
+    FlowQueueInit(&flow_recycle_q);
 
     unsigned int seed = RandomTimePreseed();
     /* set defaults */
@@ -470,6 +471,7 @@ void FlowShutdown(void)
     }
     (void) SC_ATOMIC_SUB(flow_memuse, flow_config.hash_size * sizeof(FlowBucket));
     FlowQueueDestroy(&flow_spare_q);
+    FlowQueueDestroy(&flow_recycle_q);
 
     SC_ATOMIC_DESTROY(flow_prune_idx);
     SC_ATOMIC_DESTROY(flow_memuse);