]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
flow: move FlowGetFlowState
authorVictor Julien <victor@inliniac.net>
Fri, 23 May 2014 12:51:44 +0000 (14:51 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 28 Jul 2014 13:47:45 +0000 (15:47 +0200)
Move FlowGetFlowState to flow-private.h so that all parts of the flow
engine can use it.

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

index bea4b6b35169db97563b7a934f691a1b0e7263e7..fb6d2a1077fdab84e64fab6e3ded6d3bf029571a 100644 (file)
@@ -127,24 +127,6 @@ void FlowKillFlowManagerThread(void)
     return;
 }
 
-/** \internal
- *  \brief Get the flow's state
- *
- *  \param f flow
- *
- *  \retval state either FLOW_STATE_NEW, FLOW_STATE_ESTABLISHED or FLOW_STATE_CLOSED
- */
-static inline int FlowGetFlowState(Flow *f) {
-    if (flow_proto[f->protomap].GetProtoState != NULL) {
-        return flow_proto[f->protomap].GetProtoState(f->protoctx);
-    } else {
-        if ((f->flags & FLOW_TO_SRC_SEEN) && (f->flags & FLOW_TO_DST_SEEN))
-            return FLOW_STATE_ESTABLISHED;
-        else
-            return FLOW_STATE_NEW;
-    }
-}
-
 /** \internal
  *  \brief get timeout for flow
  *
index bd25960b2bf0c755e5d01c6ee9739da2a259655a..32163c75d2b37a1ec4f752d567b2b64da29b15f8 100644 (file)
@@ -96,5 +96,23 @@ uint32_t flowbits_removed;
 SCMutex flowbits_mutex;
 #endif /* FLOWBITS_STATS */
 
+/** \internal
+ *  \brief Get the flow's state
+ *
+ *  \param f flow
+ *
+ *  \retval state either FLOW_STATE_NEW, FLOW_STATE_ESTABLISHED or FLOW_STATE_CLOSED
+ */
+static inline int FlowGetFlowState(Flow *f) {
+    if (flow_proto[f->protomap].GetProtoState != NULL) {
+        return flow_proto[f->protomap].GetProtoState(f->protoctx);
+    } else {
+        if ((f->flags & FLOW_TO_SRC_SEEN) && (f->flags & FLOW_TO_DST_SEEN))
+            return FLOW_STATE_ESTABLISHED;
+        else
+            return FLOW_STATE_NEW;
+    }
+}
+
 #endif /* __FLOW_PRIVATE_H__ */