flow: move FlowGetFlowState

Move FlowGetFlowState to flow-private.h so that all parts of the flow
engine can use it.
pull/1058/head
Victor Julien 11 years ago
parent e6ed6731b1
commit fc6ad56944

@ -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
*

@ -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__ */

Loading…
Cancel
Save