From: Victor Julien Date: Fri, 23 May 2014 12:51:44 +0000 (+0200) Subject: flow: move FlowGetFlowState X-Git-Tag: suricata-2.1beta1~43 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fc6ad56944d801772e4384e853c3c8077def545c;p=thirdparty%2Fsuricata.git flow: move FlowGetFlowState Move FlowGetFlowState to flow-private.h so that all parts of the flow engine can use it. --- diff --git a/src/flow-manager.c b/src/flow-manager.c index bea4b6b351..fb6d2a1077 100644 --- a/src/flow-manager.c +++ b/src/flow-manager.c @@ -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 * diff --git a/src/flow-private.h b/src/flow-private.h index bd25960b2b..32163c75d2 100644 --- a/src/flow-private.h +++ b/src/flow-private.h @@ -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__ */