]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
flow timeout: cleanups
authorVictor Julien <victor@inliniac.net>
Wed, 10 Dec 2014 15:41:03 +0000 (16:41 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 19 Dec 2014 11:18:28 +0000 (12:18 +0100)
Rename FlowForceReassemblyForFlowV2 to just FlowForceReassemblyForFlow
as there is no V1.

src/decode.c
src/decode.h
src/flow-manager.c
src/flow-timeout.c
src/flow-timeout.h
src/source-pcap-file.c

index 8ad78bcf32125222c5376379c4210757600d27e8..87aa831b244815499ce935dac16edf8c8bdf094d 100644 (file)
@@ -539,12 +539,9 @@ const char *PktSrcToString(enum PktSrcEnum pkt_src)
         case PKT_SRC_STREAM_TCP_STREAM_END_PSEUDO:
             pkt_src_str = "stream";
             break;
-        case PKT_SRC_FFR_V2:
+        case PKT_SRC_FFR:
             pkt_src_str = "stream (flow timeout)";
             break;
-        case PKT_SRC_FFR_SHUTDOWN:
-            pkt_src_str = "stream (engine shutdown)";
-            break;
     }
     return pkt_src_str;
 }
index 98839be6bcdb67ac3338426e1ed1fcdf548259cb..bd9aeef61b990cd0c8e5c79889e5af5d4cbbf103 100644 (file)
@@ -52,8 +52,7 @@ enum PktSrcEnum {
     PKT_SRC_DECODER_TEREDO,
     PKT_SRC_DEFRAG,
     PKT_SRC_STREAM_TCP_STREAM_END_PSEUDO,
-    PKT_SRC_FFR_V2,
-    PKT_SRC_FFR_SHUTDOWN,
+    PKT_SRC_FFR,
 };
 
 #include "source-nflog.h"
index 7fa2bb280a29d8567a5a8bc4bf09fce7ba3356f7..e8446f5398d05571086d4f7c7314565ace277ac7 100644 (file)
@@ -244,7 +244,7 @@ static int FlowManagerFlowTimedOut(Flow *f, struct timeval *ts)
     int server = 0, client = 0;
     if (!(f->flags & FLOW_TIMEOUT_REASSEMBLY_DONE) &&
             FlowForceReassemblyNeedReassembly(f, &server, &client) == 1) {
-        FlowForceReassemblyForFlowV2(f, server, client);
+        FlowForceReassemblyForFlow(f, server, client);
         return 0;
     }
 #ifdef DEBUG
index a9d1f1460529af8f240c6cf6b6f1e2d15832fdb8..36391783f0c7c886bc7dcd2d5445f74f5e5ef0b3 100644 (file)
@@ -328,7 +328,7 @@ int FlowForceReassemblyNeedReassembly(Flow *f, int *server, int *client)
  *
  * \retval 0 This flow doesn't need any reassembly processing; 1 otherwise.
  */
-int FlowForceReassemblyForFlowV2(Flow *f, int server, int client)
+int FlowForceReassemblyForFlow(Flow *f, int server, int client)
 {
     Packet *p1 = NULL, *p2 = NULL, *p3 = NULL;
     TcpSession *ssn;
@@ -358,7 +358,7 @@ int FlowForceReassemblyForFlowV2(Flow *f, int server, int client)
         if (p1 == NULL) {
             goto done;
         }
-        PKT_SET_SRC(p1, PKT_SRC_FFR_V2);
+        PKT_SET_SRC(p1, PKT_SRC_FFR);
 
         if (server == STREAM_HAS_UNPROCESSED_SEGMENTS_NEED_REASSEMBLY) {
             p2 = FlowForceReassemblyPseudoPacketGet(0, f, ssn, 0);
@@ -367,7 +367,7 @@ int FlowForceReassemblyForFlowV2(Flow *f, int server, int client)
                 TmqhOutputPacketpool(NULL, p1);
                 goto done;
             }
-            PKT_SET_SRC(p2, PKT_SRC_FFR_V2);
+            PKT_SET_SRC(p2, PKT_SRC_FFR);
 
             p3 = FlowForceReassemblyPseudoPacketGet(1, f, ssn, 1);
             if (p3 == NULL) {
@@ -377,7 +377,7 @@ int FlowForceReassemblyForFlowV2(Flow *f, int server, int client)
                 TmqhOutputPacketpool(NULL, p2);
                 goto done;
             }
-            PKT_SET_SRC(p3, PKT_SRC_FFR_V2);
+            PKT_SET_SRC(p3, PKT_SRC_FFR);
         } else {
             p2 = FlowForceReassemblyPseudoPacketGet(0, f, ssn, 1);
             if (p2 == NULL) {
@@ -385,7 +385,7 @@ int FlowForceReassemblyForFlowV2(Flow *f, int server, int client)
                 TmqhOutputPacketpool(NULL, p1);
                 goto done;
             }
-            PKT_SET_SRC(p2, PKT_SRC_FFR_V2);
+            PKT_SET_SRC(p2, PKT_SRC_FFR);
         }
 
     } else if (client == STREAM_HAS_UNPROCESSED_SEGMENTS_NEED_ONLY_DETECTION) {
@@ -394,7 +394,7 @@ int FlowForceReassemblyForFlowV2(Flow *f, int server, int client)
             if (p1 == NULL) {
                 goto done;
             }
-            PKT_SET_SRC(p1, PKT_SRC_FFR_V2);
+            PKT_SET_SRC(p1, PKT_SRC_FFR);
 
             p2 = FlowForceReassemblyPseudoPacketGet(1, f, ssn, 1);
             if (p2 == NULL) {
@@ -402,13 +402,13 @@ int FlowForceReassemblyForFlowV2(Flow *f, int server, int client)
                 TmqhOutputPacketpool(NULL, p1);
                 goto done;
             }
-            PKT_SET_SRC(p2, PKT_SRC_FFR_V2);
+            PKT_SET_SRC(p2, PKT_SRC_FFR);
         } else {
             p1 = FlowForceReassemblyPseudoPacketGet(0, f, ssn, 1);
             if (p1 == NULL) {
                 goto done;
             }
-            PKT_SET_SRC(p1, PKT_SRC_FFR_V2);
+            PKT_SET_SRC(p1, PKT_SRC_FFR);
 
             if (server == STREAM_HAS_UNPROCESSED_SEGMENTS_NEED_ONLY_DETECTION) {
                 p2 = FlowForceReassemblyPseudoPacketGet(1, f, ssn, 1);
@@ -417,7 +417,7 @@ int FlowForceReassemblyForFlowV2(Flow *f, int server, int client)
                     TmqhOutputPacketpool(NULL, p1);
                     goto done;
                 }
-                PKT_SET_SRC(p2, PKT_SRC_FFR_V2);
+                PKT_SET_SRC(p2, PKT_SRC_FFR);
             }
         }
 
@@ -427,7 +427,7 @@ int FlowForceReassemblyForFlowV2(Flow *f, int server, int client)
             if (p1 == NULL) {
                 goto done;
             }
-            PKT_SET_SRC(p1, PKT_SRC_FFR_V2);
+            PKT_SET_SRC(p1, PKT_SRC_FFR);
 
             p2 = FlowForceReassemblyPseudoPacketGet(1, f, ssn, 1);
             if (p2 == NULL) {
@@ -435,13 +435,13 @@ int FlowForceReassemblyForFlowV2(Flow *f, int server, int client)
                 TmqhOutputPacketpool(NULL, p1);
                 goto done;
             }
-            PKT_SET_SRC(p2, PKT_SRC_FFR_V2);
+            PKT_SET_SRC(p2, PKT_SRC_FFR);
         } else if (server == STREAM_HAS_UNPROCESSED_SEGMENTS_NEED_ONLY_DETECTION) {
             p1 = FlowForceReassemblyPseudoPacketGet(1, f, ssn, 1);
             if (p1 == NULL) {
                 goto done;
             }
-            PKT_SET_SRC(p1, PKT_SRC_FFR_V2);
+            PKT_SET_SRC(p1, PKT_SRC_FFR);
         } else {
             /* impossible */
             BUG_ON(1);
@@ -517,7 +517,7 @@ static inline void FlowForceReassemblyForHash(void)
             }
 
             if (FlowForceReassemblyNeedReassembly(f, &server_ok, &client_ok) == 1) {
-                FlowForceReassemblyForFlowV2(f, server_ok, client_ok);
+                FlowForceReassemblyForFlow(f, server_ok, client_ok);
             }
 
             FLOWLOCK_UNLOCK(f);
index 036bd50ce7af70955220fd52e9d19cf209667294..50e007ae066d6c95d3c46827047c7b38e6bf8ff2 100644 (file)
@@ -24,7 +24,7 @@
 #ifndef __FLOW_TIMEOUT_H__
 #define __FLOW_TIMEOUT_H__
 
-int FlowForceReassemblyForFlowV2(Flow *f, int server, int client);
+int FlowForceReassemblyForFlow(Flow *f, int server, int client);
 int FlowForceReassemblyNeedReassembly(Flow *f, int *server, int *client);
 void FlowForceReassembly(void);
 void FlowForceReassemblySetup(int detect_disabled);
index 3202b0d8d4c7e002300804d2b5c9512ed09127a8..8638bdd8d22afc7d2849126ecc7f24c896b4c3e4 100644 (file)
@@ -419,7 +419,7 @@ TmEcode DecodePcapFile(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq, P
     pcap_g.Decoder(tv, dtv, p, GET_PKT_DATA(p), GET_PKT_LEN(p), pq);
 
 #ifdef DEBUG
-    BUG_ON(p->pkt_src != PKT_SRC_WIRE && p->pkt_src != PKT_SRC_FFR_V2);
+    BUG_ON(p->pkt_src != PKT_SRC_WIRE && p->pkt_src != PKT_SRC_FFR);
 #endif
 
     PacketDecodeFinalize(tv, dtv, p);