]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Move FlowIncrUsecnt to header file to allow for inlining.
authorKen Steele <ken@tilera.com>
Thu, 12 Sep 2013 20:39:07 +0000 (16:39 -0400)
committerVictor Julien <victor@inliniac.net>
Mon, 16 Sep 2013 09:47:49 +0000 (11:47 +0200)
Move FlowIncrUsecnt() and FlowDecrUsecnt() from flow.c to flow.h to
allow for inlining.

src/flow.c
src/flow.h

index f22e6ab80e86bf1fce6e782ba196d8d7545eafff..2b24d3298fee1b254dfc05e48a62203cef9125c6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2012 Open Information Security Foundation
+/* Copyright (C) 2007-2013 Open Information Security Foundation
  *
  * You can copy, redistribute or modify this Program under the terms of
  * the GNU General Public License version 2 as published by the Free
@@ -172,33 +172,6 @@ void FlowSetIPOnlyFlagNoLock(Flow *f, char direction)
     return;
 }
 
-/**
- *  \brief increase the use cnt of a flow
- *
- *  \param f flow to decrease use cnt for
- */
-void FlowIncrUsecnt(Flow *f)
-{
-    if (f == NULL)
-        return;
-
-    (void) SC_ATOMIC_ADD(f->use_cnt, 1);
-    return;
-}
-/**
- *  \brief decrease the use cnt of a flow
- *
- *  \param f flow to decrease use cnt for
- */
-void FlowDecrUsecnt(Flow *f)
-{
-    if (f == NULL)
-        return;
-
-    (void) SC_ATOMIC_SUB(f->use_cnt, 1);
-    return;
-}
-
 /**
  *  \brief determine the direction of the packet compared to the flow
  *  \retval 0 to_server
index 2afe4f8bf3492b80a6941c4079f2822033a42699..b94882cd7ae35e331ff272820d9d05a29f48651c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2012 Open Information Security Foundation
+/* Copyright (C) 2007-2013 Open Information Security Foundation
  *
  * You can copy, redistribute or modify this Program under the terms of
  * the GNU General Public License version 2 as published by the Free
@@ -387,9 +387,6 @@ void FlowShutdown(void);
 void FlowSetIPOnlyFlag(Flow *, char);
 void FlowSetIPOnlyFlagNoLock(Flow *, char);
 
-void FlowIncrUsecnt(Flow *);
-void FlowDecrUsecnt(Flow *);
-
 void FlowRegisterTests (void);
 int FlowSetProtoTimeout(uint8_t ,uint32_t ,uint32_t ,uint32_t);
 int FlowSetProtoEmergencyTimeout(uint8_t ,uint32_t ,uint32_t ,uint32_t);
@@ -477,6 +474,32 @@ static inline void FlowSetSessionNoApplayerInspectionFlag(Flow *f) {
     f->flags |= FLOW_NO_APPLAYER_INSPECTION;
 }
 
+/**
+ *  \brief increase the use count of a flow
+ *
+ *  \param f flow to decrease use count for
+ */
+static inline void FlowIncrUsecnt(Flow *f)
+{
+    if (f == NULL)
+        return;
+
+    (void) SC_ATOMIC_ADD(f->use_cnt, 1);
+}
+
+/**
+ *  \brief decrease the use count of a flow
+ *
+ *  \param f flow to decrease use count for
+ */
+static inline void FlowDecrUsecnt(Flow *f)
+{
+    if (f == NULL)
+        return;
+
+    (void) SC_ATOMIC_SUB(f->use_cnt, 1);
+}
+
 #define FlowReference(dst_f_ptr, f) do {            \
         if ((f) != NULL) {                          \
             FlowIncrUsecnt((f));                    \