Move Flow Reference/Dereferene api from flow-util.h to flow.h.

Remove duplicate FlowDeReference from decode.h
pull/140/merge
Anoop Saldanha 14 years ago committed by Victor Julien
parent 73b3d28dc0
commit dba7b8dc41

@ -601,17 +601,6 @@ typedef struct DecodeThreadVars_
}
#endif
/* \todo there is another copy of this same macro inside flow-util.h. The
* reason we have this duplicate is because we couldn't solve endless
* header files cross-reference. */
#define FlowDeReference(src_f_ptr) do { \
if (*(src_f_ptr) != NULL) { \
FlowDecrUsecnt(*(src_f_ptr)); \
*(src_f_ptr) = NULL; \
} \
} while (0)
/**
* \brief Recycle a packet structure for reuse.
* \todo the mutex destroy & init is necessary because of the memset, reconsider

@ -127,23 +127,6 @@
#define FLOW_CHECK_MEMCAP(size) \
((((uint64_t)SC_ATOMIC_GET(flow_memuse) + (uint64_t)(size)) <= flow_config.memcap))
#define FlowReference(dst_f_ptr, f) do { \
if ((f) != NULL) { \
FlowIncrUsecnt((f)); \
*(dst_f_ptr) = f; \
} \
} while (0)
/* \todo there is another copy of this same macro inside decode.h. The reason
* we have this duplicate is because we couldn't solve endless header
* files cross-reference. */
#define FlowDeReference(src_f_ptr) do { \
if (*(src_f_ptr) != NULL) { \
FlowDecrUsecnt(*(src_f_ptr)); \
*(src_f_ptr) = NULL; \
} \
} while (0)
Flow *FlowAlloc(void);
Flow *FlowAllocDirect(void);
void FlowFree(Flow *);

@ -477,6 +477,20 @@ static inline void FlowSetSessionNoApplayerInspectionFlag(Flow *f) {
f->flags |= FLOW_NO_APPLAYER_INSPECTION;
}
#define FlowReference(dst_f_ptr, f) do { \
if ((f) != NULL) { \
FlowIncrUsecnt((f)); \
*(dst_f_ptr) = f; \
} \
} while (0)
#define FlowDeReference(src_f_ptr) do { \
if (*(src_f_ptr) != NULL) { \
FlowDecrUsecnt(*(src_f_ptr)); \
*(src_f_ptr) = NULL; \
} \
} while (0)
int FlowClearMemory(Flow *,uint8_t );
#endif /* __FLOW_H__ */

Loading…
Cancel
Save