]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Move Flow Reference/Dereferene api from flow-util.h to flow.h.
authorAnoop Saldanha <anoopsaldanha@gmail.com>
Fri, 5 Oct 2012 12:22:37 +0000 (17:52 +0530)
committerVictor Julien <victor@inliniac.net>
Wed, 10 Oct 2012 12:48:36 +0000 (14:48 +0200)
Remove duplicate FlowDeReference from decode.h

src/decode.h
src/flow-util.h
src/flow.h

index 4b097a2123c3ed44be507e88d9f9376b6f3cc2db..68333e460517784f98645501b4924f211335d4f0 100644 (file)
@@ -626,17 +626,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
index c6e15b3e21408b2c9d3cb89e033171fdc423888c..e93b013a6a8208541737488e36d704be926a501c 100644 (file)
 #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 *);
index 5b030eed56007c855a0429e69d6537bb98eb2859..5595110adf1d9c253fea6cbcbce44aed06ed9eab 100644 (file)
@@ -481,6 +481,23 @@ 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)
+
+/* \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)
+
 int FlowClearMemory(Flow *,uint8_t );
 
 #endif /* __FLOW_H__ */