]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Squashed commit of the following:
authorRuss Combs <rucombs@cisco.com>
Wed, 5 Aug 2015 16:05:50 +0000 (12:05 -0400)
committerRuss Combs <rucombs@cisco.com>
Wed, 5 Aug 2015 16:05:50 +0000 (12:05 -0400)
commit 975a706b76bc5999ea499206f95c6eb36dd29b13
Author: Tom Peters <thopeter@cisco.com>
Date:   Wed Aug 5 11:38:30 2015 -0400

    DAQ packet header conditional compilation for piglet

cmake/sanity_checks.cmake
config.cmake.h.in
configure.ac
configure_cmake.sh
src/piglet_plugins/pp_daq_pkthdr_iface.cc
src/piglet_plugins/pp_daq_pkthdr_iface.h

index 4a6578af4879cdf0c466c8d11c51caead8396dd2..27b1f3272d483835eba18f0c09a99cf27cf50cbf 100644 (file)
@@ -216,6 +216,20 @@ check_cxx_source_compiles(
     HAVE_DAQ_ADDRESS_SPACE_ID
 )
 
+check_cxx_source_compiles(
+    "
+    #include <daq.h>
+
+    int main()
+    {
+        DAQ_PktHdr_t hdr;
+        hdr.flow_id = 0;
+        return 0;
+    }
+    "
+    HAVE_DAQ_FLOW_ID
+)
+
 set (CMAKE_REQUIRED_FLAGS)
 set (CMAKE_REQUIRED_INCLUDES)
 set (CMAKE_REQUIRED_LIBRARIES)
index 6069b02820772809e2e895458e40464e88abdc20..c1782007c84656ab8f0452c7c999e95751db90e3 100644 (file)
 /* DAQ version supports address space ID in header. */
 #cmakedefine HAVE_DAQ_ADDRESS_SPACE_ID 1
 
+/* DAQ version supports flow ID in header. */
+#cmakedefine HAVE_DAQ_FLOW_ID 1
 
 
 /* Available compiler options */
 #cmakedefine HAVE_LINUXTHREADS 1
 
 
-
-
 #endif
 
-
index 0af78315676cc8cd550739ff4ca12c4ad85f484e..4a7900f607ad47c46141e8d66b4691cb1606628f 100644 (file)
@@ -799,6 +799,24 @@ if test "x$have_daq_address_space_id" = "xyes"; then
         [DAQ version supports address space ID in header.])
 fi
 
+AC_MSG_CHECKING([for daq flow ID])
+AC_RUN_IFELSE(
+[AC_LANG_PROGRAM(
+[[
+#include <daq.h>
+]],
+[[
+   DAQ_PktHdr_t hdr;
+   hdr.flow_id = 0;
+]])],
+[have_daq_flow_id="yes"],
+[have_daq_flow_id="no"])
+AC_MSG_RESULT($have_daq_flow_id)
+if test "x$have_daq_flow_id" = "xyes"; then
+    AC_DEFINE([HAVE_DAQ_FLOW_ID],[1],
+        [DAQ version supports flow ID in header.])
+fi
+
 #--------------------------------------------------------------------------
 # zlib
 #--------------------------------------------------------------------------
index 5c3aa7496619168a222b369d004cd2b665df3fe6..25f620ed4fbd0251159ee0977be91a6076093efd 100755 (executable)
@@ -41,6 +41,7 @@ Optional Features:
     --disable-corefiles      Prevent Snort from generating core files
     --enable-intel-soft-cpm  Enable Intel Soft CPM support
     --enable-unit-tests      Build unit tests
+    --enable-piglet          Build piglet test capability
     --enable-large-pcap      Enable support for pcaps larger than 2 GB
     --disable-static-daq     Link static DAQ modules.
     --enable-shell           enable command line shell support
@@ -289,6 +290,12 @@ while [ $# -ne 0 ]; do
         --enable-unit-tests)
             append_cache_entry BUILD_UNIT_TESTS    BOOL   true
             ;;
+        --disable-piglet)
+            append_cache_entry BUILD_PIGLET    BOOL   false
+            ;;
+        --enable-piglet)
+            append_cache_entry BUILD_PIGLET    BOOL   true
+            ;;
         --disable-html-docs)
             append_cache_entry MAKE_HTML_DOC    BOOL   false
             ;;
index e0ba4c18d8af6194d1a4e1ab1bdcba03b751edae..53a659f2f46fc6bf809f26ce7fef8927527fb1f5 100644 (file)
 // with this program; if not, write to the Free Software Foundation, Inc.,
 // 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 //--------------------------------------------------------------------------
-// pp_codec_data_iface.cc author Joel Cornett <jocornet@cisco.com>
+// pp_daq_pkthdr_iface.cc author Joel Cornett <jocornet@cisco.com>
 
 #include "pp_daq_pkthdr_iface.h"
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <luajit-2.0/lua.hpp>
 
 #include "lua/lua_table.h"
@@ -39,8 +43,12 @@ static void daq_header_set(lua_State* L, int tindex, struct _daq_pkthdr& daq)
     table.get_field("egress_group", daq.egress_group);
     table.get_field("flags", daq.flags);
     table.get_field("opaque", daq.opaque);
+#ifdef HAVE_DAQ_ADDRESS_SPACE_ID
+#ifdef HAVE_DAQ_FLOW_ID
     table.get_field("flow_id", daq.flow_id);
+#endif
     table.get_field("address_space_id", daq.address_space_id);
+#endif
 
     // FIXIT-L: Do we want to be able to set the priv_ptr field?
 }
@@ -81,8 +89,12 @@ static const luaL_Reg methods[] =
             table.set_field("egress_group", self.egress_group);
             table.set_field("flags", self.flags);
             table.set_field("opaque", self.opaque);
+#ifdef HAVE_DAQ_ADDRESS_SPACE_ID
+#ifdef HAVE_DAQ_FLOW_ID
             table.set_field("flow_id", self.flow_id);
+#endif
             table.set_field("address_space_id", self.address_space_id);
+#endif
 
             // FIXIT-L: Do we want to be able to read the priv_ptr field?
 
index 770d968766e6c12e15ea25ab1080313c66b9f6a3..7ad16eda46dba811154dc14e17a8d8359c9714ff 100644 (file)
@@ -15,7 +15,7 @@
 // with this program; if not, write to the Free Software Foundation, Inc.,
 // 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 //--------------------------------------------------------------------------
-// pp_codec_data_iface.cc author Joel Cornett <jocornet@cisco.com>
+// pp_daq_pkthdr_iface.h author Joel Cornett <jocornet@cisco.com>
 
 #ifndef PP_DAQ_PKTHDR_IFACE_H
 #define PP_DAQ_PKTHDR_IFACE_H