]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
cleanup cmake options
authorJoel Cornett <joel.cornett@gmail.com>
Fri, 6 May 2016 16:20:35 +0000 (12:20 -0400)
committerJoel Cornett <joel.cornett@gmail.com>
Mon, 9 May 2016 17:31:09 +0000 (13:31 -0400)
13 files changed:
cmake/configure_options.cmake
cmake/create_options.cmake
config.cmake.h.in
configure.ac
configure_cmake.sh
doc/extending.txt
src/CMakeLists.txt
src/Makefile.am
src/main.cc
src/main.h
src/main/snort_config.cc
src/main/snort_config.h
src/main/snort_module.cc

index e7c2792dfd6478052cd208ca0330e7dc26685af6..adddec69566629e28a46c90b2467bb97e5182ebb 100644 (file)
-#
-#
-# This file converts cmake cache variables and command line options
-# into compiler flags
-#
+# map cmake options to compiler defines and do miscellaneous further configuration work
+# cmake options are defined in cmake/create_options.cmake
 
+# features
 
-# convert cmake options into compiler defines
+set ( SHELL ${ENABLE_SHELL} )
+set ( SIDE_CHANNEL ${BUILD_SIDE_CHANNEL} )
+set ( UNIT_TEST ${BUILD_UNIT_TESTS} )
+set ( PIGLET ${ENABLE_PIGLET} )
 
-set_project_compiler_defines_if_true (ENABLE_DEBUG_MSGS "DEBUG_MSGS")
-set_project_compiler_defines_if_true (ENABLE_DEBUG "DEBUG")
-set_project_compiler_defines_if_true (BUILD_HA "ENABLE_HA")
-set_project_compiler_defines_if_true (ENABLE_LARGE_PCAP "_LARGEFILE_SOURCE")
-set_project_compiler_defines_if_true (ENABLE_LARGE_PCAP "_FILE_OFFSET_BITS=64")
+if ( NOT ENABLE_COREFILES )
+    set ( NOCOREFILE ON )
+endif ( NOT ENABLE_COREFILES )
 
+set ( _LARGEFILE_SOURCE ${ENABLE_LARGE_PCAP} )
 
+if ( ENABLE_LARGE_PCAP )
+    set ( _FILE_OFFSET_BITS 64 )
+endif ( ENABLE_LARGE_PCAP )
 
-# convert cmake options into config.h defines
+# documentation
 
-
-set_if_true (STATIC_INSPECTORS STATIC_INSPECTORS)
-set_if_true (STATIC_SEARCH_ENGINES STATIC_SEARCH_ENGINES)
-set_if_true (STATIC_LOGGERS STATIC_LOGGERS)
-set_if_true (STATIC_IPS_ACTIONS STATIC_IPS_ACTIONS)
-set_if_true (STATIC_IPS_OPTIONS STATIC_IPS_OPTIONS)
-set_if_true (STATIC_CODECS STATIC_CODECS)
-set_if_true (BUILD_HA ENABLE_HA )
-set_if_true (ENABLE_DEBUG DEBUG)
-set_if_false (ENABLE_DEBUG NDEBUG)
-set_if_false (ENABLE_COREFILES NOCOREFILE)
-set_if_true (BUILD_SHELL BUILD_SHELL)
-set_if_true (BUILD_SIDE_CHANNEL SIDE_CHANNEL)
-set_if_true (BUILD_UNIT_TESTS UNIT_TEST)
-set_if_true (BUILD_PIGLET PIGLET)
-set_if_true (ENABLE_PROFILE PROFILE)
-set_if_true (ENABLE_SHELL BUILD_SHELL)
-set_if_true (BUILD_PIGLET PIGLET)
-set_if_true (STATIC_PIGLETS STATIC_PIGLETS)
-
-
-# convert cmake options into CXX flags
-if(ENABLE_DEBUG)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
-endif(ENABLE_DEBUG)
-
-if (ENABLE_GDB)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -ggdb")
-endif ()
-
-if(ENABLE_PROFILE AND CMAKE_COMPILER_IS_GNUCXX)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg")
+if ( NOT ASCIIDOC_FOUND )
+    get_property ( MAKE_HTML_DOC_HELP_STRING CACHE "MAKE_HTML_DOC" PROPERTY HELPSTRING )
+    set ( MAKE_HTML_DOC OFF CACHE BOOL ${MAKE_HTML_DOC_HELP_STRING} FORCE )
 endif()
 
-if (ENABLE_ADDRESS_SANITIZER)
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
+if ( NOT (DBLATEX_FOUND AND ASCIIDOC_FOUND) )
+    get_property ( MAKE_PDF_DOC_HELP_STRING CACHE "MAKE_PDF_DOC" PROPERTY HELPSTRING )
+    set ( MAKE_PDF_DOC OFF CACHE BOOL ${MAKE_PDF_DOC_HELP_STRING} FORCE )
 endif()
 
-if (ENABLE_CODE_COVERAGE)
-    set(CMAKE_CPP_FLAGS "${CMAKE_CPP_FLAGS} -DNDEBUG")
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g -fprofile-arcs -ftest-coverage")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g -fprofile-arcs -ftest-coverage")
-
-    if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
-        set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lgcov")
-    endif ()
+if ( NOT (W3M_FOUND AND ASCIIDOC_FOUND) )
+    get_property ( MAKE_TEXT_DOC_HELP_STRING CACHE "MAKE_TEXT_DOC" PROPERTY HELPSTRING )
+    set ( MAKE_TEXT_DOC OFF CACHE BOOL ${MAKE_TEXT_DOC_HELP_STRING} FORCE )
 endif()
 
-if (BUILD_UNIT_TESTS)
-    enable_testing()
-endif()
+# debugging
 
-# If not found, automatically set the cache to false
-if (NOT ASCIIDOC_FOUND)
-    get_property(MAKE_HTML_DOC_HELP_STRING CACHE "MAKE_HTML_DOC" PROPERTY HELPSTRING)
-    set(MAKE_HTML_DOC "OFF" CACHE BOOL ${MAKE_HTML_DOC_HELP_STRING} FORCE)
-endif()
+set ( DEBUG_MSGS ${ENABLE_DEBUG_MSGS} )
 
-if (NOT (DBLATEX_FOUND AND ASCIIDOC_FOUND))
-    get_property(MAKE_PDF_DOC_HELP_STRING CACHE "MAKE_PDF_DOC" PROPERTY HELPSTRING)
-    set(MAKE_PDF_DOC "OFF" CACHE BOOL ${MAKE_PDF_DOC_HELP_STRING} FORCE)
-endif()
+set ( DEBUG ${ENABLE_DEBUG} )
+if ( ENABLE_DEBUG )
+    set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g" )
+endif ( ENABLE_DEBUG )
 
-if (NOT (W3M_FOUND AND ASCIIDOC_FOUND))
-    get_property(MAKE_TEXT_DOC_HELP_STRING CACHE "MAKE_TEXT_DOC" PROPERTY HELPSTRING)
-    set(MAKE_TEXT_DOC "OFF" CACHE BOOL ${MAKE_TEXT_DOC_HELP_STRING} FORCE)
-endif()
+if ( ENABLE_GDB )
+    set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -ggdb" )
+endif ( ENABLE_GDB )
 
+if ( ENABLE_PROFILE AND CMAKE_COMPILER_IS_GNUCXX )
+    set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg" )
+endif ( ENABLE_PROFILE AND CMAKE_COMPILER_IS_GNUCXX )
 
+if ( ENABLE_ADDRESS_SANITIZER )
+    set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer" )
+    set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer" )
+endif ( ENABLE_ADDRESS_SANITIZER )
 
-# If the user switches DAQS, search for the new, correct version
-if(DEFINED STATIC_DAQ_PRREVIOUSLY_ENABLED)
-    if(NOT (ENABLE_STATIC_DAQ STREQUAL STATIC_DAQ_PRREVIOUSLY_ENABLED))
-        unset(DAQ_FOUND CACHE)
-        unset(DAQ_INCLUDE_DIR)
-        unset(DAQ_LIBRARY CACHE)
-        unset(DAQ_LIBRARIES CACHE)
-        set(STATIC_DAQ_PRREVIOUSLY_ENABLED "${ENABLE_STATIC_DAQ}" CACHE INTERNAL "save daq link type" FORCE)
-        find_package(DAQ REQUIRED)
-    endif()
-else()
-    set(STATIC_DAQ_PRREVIOUSLY_ENABLED "${ENABLE_STATIC_DAQ}" CACHE INTERNAL "save daq link type" FORCE)
-endif()
+if ( ENABLE_CODE_COVERAGE )
+    set ( CMAKE_CPP_FLAGS "${CMAKE_CPP_FLAGS} -DNDEBUG" )
+    set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g -fprofile-arcs -ftest-coverage" )
+    set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g -fprofile-arcs -ftest-coverage" )
+
+    if ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" )
+        set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lgcov" )
+    endif ()
+endif ( ENABLE_CODE_COVERAGE )
 
index 11b3920d66673815967479c86474ca31a3c3b201..6cfee9ad1d153834b95e477610560553e4fdcc28 100644 (file)
@@ -1,46 +1,64 @@
+#  All of the possible user options.  All of these options will show up
+#  in the CACHE.  If you'd like to change one of these values,
+#  use `ccmake ${PATH_TO_SOURCE}`.
+#  Alternatively, you can pass them to cmake on the command line using
+#  the '-D' flag:
+#      cmake -DENABLE_FOO=ON -DCMAKE_INSTALL_PREFIX=/my/install/path $cmake_src_path
 
+# static/dynamic switches
+option ( STATIC_CODECS "include codecs in binary" ON )
+option ( STATIC_INSPECTORS "include inspectors in binary" ON )
+option ( STATIC_LOGGERS "include loggers in binary" ON )
+option ( STATIC_IPS_ACTIONS "include ips actions in binary" ON )
+option ( STATIC_IPS_OPTIONS "include ips options in binary" ON )
+option ( STATIC_SEARCH_ENGINES "include search engines in binary" ON )
+option ( ENABLE_STATIC_DAQ "link static DAQ modules" ON )
 
-#  All of the possible user options.  All of these optinos will show up
-#  in the CACHE.  If you'd like to change one of these values,
-#  use `ccmamke ${PATH_TO_SOURCE}`.
-
-
-option (STATIC_CODECS "include decoders in binary?" ON)
-option (STATIC_INSPECTORS "include inspectors in binary" ON)
-option (STATIC_LOGGERS "include loggers in binary" ON)
-option (STATIC_IPS_ACTIONS "include internal ips actions in binary" ON)
-option (STATIC_IPS_OPTIONS "include ips options in binary" ON)
-option (STATIC_SEARCH_ENGINES "include search engines in binary" ON)
-option (ENABLE_STATIC_DAQ "Link static DAQ modules" ON)
-option (ENABLE_PTHREAD "Disable pthread support" ON)
-option (ENABLE_DEBUG_MSGS "Enable debug printing options (bugreports and developers only)" OFF)
-option (ENABLE_DEBUG "Enable debugging options (bugreports and developers only)" OFF)
-option (ENABLE_GDB "Enable gdb debugging information" OFF)
-option (ENABLE_PROFILE "Enable profiling options (developers only)" OFF)
-option (ENABLE_SHELL "enable shell support" OFF)
-option (ENABLE_COREFILES "Prevent Snort from generating core files" ON)
-option (ENABLE_INTEL_SOFT_CPM "Enable Intel Soft CPM support" OFF)
-option (ENABLE_LARGE_PCAP "Enable support for pcaps larger than 2 GB" OFF)
-option (ENABLE_ADDRESS_SANITIZER "enable address sanitizer support" OFF)
-option (ENABLE_CODE_COVERAGE "Whether to enable code coverage support" OFF)
-option (BUILD_SHELL "Build the command line shell" OFF)
-option (BUILD_SIDE_CHANNEL "Build the side channel library" OFF)
-option (BUILD_UNIT_TESTS "Build Snort++ unit tests" OFF)
-option (BUILD_PIGLET "Build Piglet test harness" OFF)
-option (BUILD_EXTRA_PLUGINS "Build and test the plugins in the extra directory" OFF)
-option (MAKE_HTML_DOC "Create the HTML documentation" ON)
-option (MAKE_PDF_DOC "Create the PDF documentation" ON)
-option (MAKE_TEXT_DOC "Create the text documentation" ON)
-
-option (STATIC_PIGLETS "include piglet plugins in binary" ON)
-option (BUILD_PIGLET "Build Piglet test harness" OFF)
-
-set (SIGNAL_SNORT_RELOAD "" CACHE STRING "set the SIGNAL_SNORT_RELOAD value.  THIS NUMBER MUST BE AN INTEGER!!")
-set (SIGNAL_SNORT_DUMP_STATS "" CACHE STRING "set the SIGNAL_SNORT_DUMP_STATS value. THIS NUMBER MUST BE AN INTEGER!!")
-set (SIGNAL_SNORT_ROTATE_STATS "" CACHE STRING "set the SIGNAL_SNORT_ROTATE_STATS value. THIS NUMBER MUST BE AN INTEGER!!")
-set (SIGNAL_SNORT_READ_ATTR_TBL "" CACHE STRING "set the SIGNAL_SNORT_READ_ATTR_TBL value. THIS NUMBER MUST BE AN INTEGER!!")
+# features
+option ( ENABLE_SHELL "enable shell support" OFF )
+option ( BUILD_SIDE_CHANNEL "Build the side channel library" OFF )
+option ( BUILD_UNIT_TESTS "Build Snort++ unit tests" OFF )
+option ( ENABLE_PIGLET "enable piglet test harness" OFF )
+
+option ( ENABLE_PTHREAD "enable pthread support" ON )
+option ( ENABLE_COREFILES "Prevent Snort from generating core files" ON )
+option ( ENABLE_INTEL_SOFT_CPM "Enable Intel Soft CPM support" OFF )
+option ( ENABLE_LARGE_PCAP "Enable support for pcaps larger than 2 GB" OFF )
+
+# documentation
+option ( MAKE_HTML_DOC "Create the HTML documentation" ON )
+option ( MAKE_PDF_DOC "Create the PDF documentation" ON )
+option ( MAKE_TEXT_DOC "Create the text documentation" ON )
+
+# debugging
+option ( ENABLE_DEBUG_MSGS "Enable debug printing options (bugreports and developers only)" OFF )
+option ( ENABLE_DEBUG "Enable debugging options (bugreports and developers only)" OFF )
+option ( ENABLE_GDB "Enable gdb debugging information" OFF )
+option ( ENABLE_PROFILE "Enable profiling options (developers only)" OFF )
+option ( ENABLE_ADDRESS_SANITIZER "enable address sanitizer support" OFF )
+option ( ENABLE_CODE_COVERAGE "Whether to enable code coverage support" OFF )
+
+# signals
+set (
+    SIGNAL_SNORT_RELOAD "SIGHUP"
+    CACHE STRING "set the SNORT_RELOAD signal (must be a valid integer or signal name)"
+)
+
+set (
+    SIGNAL_SNORT_DUMP_STATS "SIGUSR1"
+    CACHE STRING "set the SNORT_DUMP_STATS signal (must be a valid integer or signal name)"
+)
+
+set (
+    SIGNAL_SNORT_ROTATE_STATS "SIGUSR2"
+    CACHE STRING "set the SNORT_ROTATE_STATS signal (must be a valid integer or signal name)"
+)
 
+set (
+    SIGNAL_SNORT_READ_ATTR_TBL "SIGURG"
+    CACHE STRING "set the SNORT_READ_ATTR_TBL signal (must be a valid integer or signal name)"
+)
 
 #Setting default directories...appended to INSTALL_PREFIX unless a full path is provided
-set (SNORT_DATA_DIR share/doc/${CMAKE_PROJECT_NAME})
+set ( SNORT_DATA_DIR share/doc/${CMAKE_PROJECT_NAME} )
 
index 5fd33f7d3f76991c5a079e3e158d80a60ea87a81..34b3b9848198ca7ba18d80f9fc7defbefae275fa 100644 (file)
@@ -81,9 +81,6 @@
 /* enable piglet in build */
 #cmakedefine PIGLET 1
 
-/* enable static piglet plugins in build */
-#cmakedefine STATIC_PIGLETS 1
-
 /* Set by user */
 #cmakedefine SIGNAL_SNORT_DUMP_STATS @SIGNAL_SNORT_DUMP_STATS@
 
@@ -97,7 +94,7 @@
 #cmakedefine SIGNAL_SNORT_ROTATE_STATS @SIGNAL_SNORT_ROTATE_STATS@
 
 /* enable ha capable build */
-#cmakedefine BUILD_SHELL 1
+#cmakedefine SHELL 1
 
 
 
index 843dd5018ed244153770a3a7588ef671f1526862..0e50d1049558f7ffb7f0c783f0ab9b6fd7e64c9a 100644 (file)
@@ -380,22 +380,12 @@ if test "x$static_codecs" = "xyes"; then
     AC_DEFINE(STATIC_CODECS, [1], [include internal decoders in binary])
 fi
 
-AC_ARG_ENABLE(static-piglets,
-  AC_HELP_STRING([--disable-static-piglets],[do not include piglets in binary]),
-  static_piglets="$enableval", static_piglets="yes")
-
-AM_CONDITIONAL(STATIC_PIGLETS, [test "x$static_piglets" = "xyes"])
-
-if test "x$static_piglets" = "xyes"; then
-    AC_DEFINE(STATIC_PIGLETS, [1], [include internal piglets in binary])
-fi
-
 AC_ARG_ENABLE(shell,
     AC_HELP_STRING([--enable-shell],[enable command line shell support]),
     enable_shell="$enableval", enable_shell="no")
 
 if test "x$enable_shell" = "xyes"; then
-    AC_DEFINE(BUILD_SHELL, [1], [enable shell support])
+    AC_DEFINE(SHELL, [1], [enable shell support])
 fi
 
 AC_ARG_ENABLE(large-pcap,
@@ -545,7 +535,7 @@ if test "x$enable_piglet" = "xyes"; then
     AC_DEFINE(PIGLET, [1], [enable piglet test harness in build])
 fi
 
-AM_CONDITIONAL(BUILD_PIGLET, test "x$enable_piglet" = "xyes")
+AM_CONDITIONAL(ENABLE_PIGLET, test "x$enable_piglet" = "xyes")
 
 #--------------------------------------------------------------------------
 # pcap
index b419ef3918fc693ca93e3a9e987d002744ca4de3..779f1265479bc92a33d04f03149e279fd66f9118 100755 (executable)
@@ -29,7 +29,6 @@ Optional Features:
     --disable-static-ips-options    do not include ips options in binary
     --disable-static-search-engines    do not include search engines in binary
     --disable-static-codecs    do not include codecs in binary
-    --disable-static-piglets   do not include piglets in binary
     --enable-valgrind        Only use if you are testing with valgrind.
     --enable-shell           enable command line shell support
     --enable-linux-smp-stats Enable statistics reporting through proc
@@ -170,12 +169,6 @@ while [ $# -ne 0 ]; do
         --enable-static-search-engines)
             append_cache_entry STATIC_SEARCH_ENGINES       BOOL   true
             ;;
-        --disable-static-piglets)
-            append_cache_entry STATIC_PIGLETS       BOOL   false
-            ;;
-        --enable-static-piglets)
-            append_cache_entry STATIC_PIGLETS       BOOL   true
-            ;;
         --disable-static-daq)
             append_cache_entry ENABLE_STATIC_DAQ    BOOL   false
             ;;
@@ -249,10 +242,10 @@ while [ $# -ne 0 ]; do
             append_cache_entry BUILD_UNIT_TESTS    BOOL   true
             ;;
         --disable-piglet)
-            append_cache_entry BUILD_PIGLET    BOOL   false
+            append_cache_entry ENABLE_PIGLET    BOOL   false
             ;;
         --enable-piglet)
-            append_cache_entry BUILD_PIGLET    BOOL   true
+            append_cache_entry ENABLE_PIGLET    BOOL   true
             ;;
         --disable-html-docs)
             append_cache_entry MAKE_HTML_DOC    BOOL   false
index 57e74f72116106fcb2a49b9203541e75ecf90740..32c15d17ebe93f18960426bebff0a5bee5a0869b 100644 (file)
@@ -310,8 +310,8 @@ Here is a minimal example of a piglet test script for the IPv4 Codec plugin:
         end
     }
 
-To run snort in piglet mode, first build snort with the BUILD_PIGLET option turned on
-(pass the flag -DBUILD_PIGLET:BOOL=ON in cmake).
+To run snort in piglet mode, first build snort with the ENABLE_PIGLET option turned on
+(pass the flag -DENABLE_PIGLET:BOOL=ON in cmake).
 
 Then, run the following command:
 
index 98b498e1be4a23aff01d6fabd6c7c0e194219ca7..5c47026bb783dead01b76569109465e4a9234d22 100644 (file)
@@ -64,15 +64,16 @@ if (STATIC_CODECS)
 endif()
 
 if (BUILD_UNIT_TESTS)
+    enable_testing()
     set( UNIT_TESTS_LIBRARIES catch_tests)
     add_subdirectory(catch)
 endif (BUILD_UNIT_TESTS)
 
-if (BUILD_PIGLET)
-    set(PIGLET_LIBRARIES piglet piglet_plugins)
-    add_subdirectory(piglet)
-    add_subdirectory(piglet_plugins)
-endif (BUILD_PIGLET)
+if ( ENABLE_PIGLET )
+    set ( PIGLET_LIBRARIES piglet piglet_plugins )
+    add_subdirectory ( piglet )
+    add_subdirectory ( piglet_plugins )
+endif ( ENABLE_PIGLET )
 
 #  The main Snort executableRA
 add_executable( snort
index fa884a018680da193499a82500d7350b9a2865af..4099ea222fcdb96e8c7d64df115ae21703742886 100644 (file)
@@ -33,7 +33,7 @@ if BUILD_UNIT_TESTS
 test_list = catch/libcatch_tests.a
 endif
 
-if BUILD_PIGLET
+if ENABLE_PIGLET
 pig_list = \
 piglet/libpiglet.a \
 piglet_plugins/libpiglet_plugins.a
@@ -154,6 +154,6 @@ if BUILD_UNIT_TESTS
 SUBDIRS += catch
 endif
 
-if BUILD_PIGLET
+if ENABLE_PIGLET
 SUBDIRS += piglet piglet_plugins
 endif
index de1a650486adc2b920d8513b4c9db7105e25b9ee..7151bf7d206e4f2854976241869e9d15b32f37e8 100644 (file)
@@ -32,7 +32,7 @@
 #include <string.h>
 #include <time.h>
 
-#ifdef BUILD_SHELL
+#ifdef SHELL
 #include <sys/socket.h>
 #include <netinet/in.h>
 #endif
@@ -82,7 +82,7 @@ static int main_exit_code = 0;
 static bool paused = false;
 
 static bool pause_enabled = false;
-#ifdef BUILD_SHELL
+#ifdef SHELL
 static bool shell_enabled = false;
 #endif
 
@@ -95,7 +95,7 @@ const char* get_prompt()
 
 static bool use_shell(SnortConfig* sc)
 {
-#ifdef BUILD_SHELL
+#ifdef SHELL
     return ( sc->run_flags & RUN_FLAG__SHELL );
 #else
     UNUSED(sc);
@@ -418,7 +418,7 @@ int main_resume(lua_State*)
     return 0;
 }
 
-#ifdef BUILD_SHELL
+#ifdef SHELL
 int main_detach(lua_State*)
 {
     shell_enabled = false;
@@ -526,7 +526,7 @@ static bool house_keeping()
 // socket foo
 //-------------------------------------------------------------------------
 
-#ifdef BUILD_SHELL
+#ifdef SHELL
 // FIXIT-M make these non-blocking
 // FIXIT-M allow at least 2 remote controls
 // FIXIT-M bind to configured ip including INADDR_ANY
@@ -690,7 +690,7 @@ static bool check_response()
 
 static void service_check()
 {
-#ifdef BUILD_SHELL
+#ifdef SHELL
     if ( service_users() )
         return;
 #endif
@@ -771,7 +771,7 @@ static bool set_mode()
     else
         LogMessage("Commencing packet processing\n");
 
-#ifdef BUILD_SHELL
+#ifdef SHELL
     if ( use_shell(snort_conf) )
     {
         LogMessage("Entering command shell\n");
@@ -858,7 +858,7 @@ static void main_loop()
 
 static void snort_main()
 {
-#ifdef BUILD_SHELL
+#ifdef SHELL
     socket_init();
 #endif
     TimeStart();
@@ -890,7 +890,7 @@ static void snort_main()
     pigs = nullptr;
 
     TimeStop();
-#ifdef BUILD_SHELL
+#ifdef SHELL
     socket_term();
 #endif
 }
index 980dbe86b503cb6f650d3f59a3ced208addfef04..8abdfddaee4f85227b34bb0f80f288122f8b6d0f 100644 (file)
@@ -40,7 +40,7 @@ int main_resume(lua_State* = nullptr);
 int main_quit(lua_State* = nullptr);
 int main_help(lua_State* = nullptr);
 
-#ifdef BUILD_SHELL
+#ifdef SHELL
 int main_dump_plugins(lua_State* = nullptr);
 int main_detach(lua_State* = nullptr);
 #endif
index 561645fcb93361f08cad06900813ec9ce75bd334..48f5079030225f5d6b3a6f6271681e9c3b150dae 100644 (file)
@@ -394,7 +394,7 @@ void SnortConfig::merge(SnortConfig* cmd_line)
     if (cmd_line->run_flags & RUN_FLAG__PROCESS_ALL_EVENTS)
         event_queue_config->process_all_events = 1;
 
-#ifdef BUILD_SHELL
+#ifdef SHELL
     if ( cmd_line->remote_control )
         remote_control = cmd_line->remote_control;
 #endif
index 6fb36c52714821ff9bb5030c07f67dfb292f51dd..86cc05f1d71aeca680312f522650c7440611eb4d 100644 (file)
@@ -74,7 +74,7 @@ enum RunFlag
     RUN_FLAG__TREAT_DROP_AS_IGNORE= 0x00100000,     /* --treat-drop-as-ignore */
     RUN_FLAG__PCAP_RELOAD         = 0x00200000,     /* --pcap-reload */
     RUN_FLAG__TEST                = 0x00400000,     /* -T */
-#ifdef BUILD_SHELL
+#ifdef SHELL
     RUN_FLAG__SHELL               = 0x00800000,     /* --shell */
 #endif
 #ifdef PIGLET
index b7d204f885a6fc0ebad098bcd259118c891fadac..ed394519774048df9573ef1cd10f9be9db58cabf 100644 (file)
@@ -57,7 +57,7 @@ using namespace std;
 // commands
 //-------------------------------------------------------------------------
 
-#ifdef BUILD_SHELL
+#ifdef SHELL
 static const Parameter s_reload[] =
 {
     { "filename", Parameter::PT_STRING, nullptr, nullptr,
@@ -170,7 +170,7 @@ static const Parameter s_params[] =
     { "-i", Parameter::PT_STRING, nullptr, nullptr,
       "<iface>... list of interfaces" },
 
-#ifdef BUILD_SHELL
+#ifdef SHELL
     { "-j", Parameter::PT_PORT, nullptr, nullptr,
       "<port> to listen for telnet connections" },
 #endif
@@ -417,7 +417,7 @@ static const Parameter s_params[] =
     { "--script-path", Parameter::PT_STRING, nullptr, nullptr,
       "<path> to a luajit script or directory containing luajit scripts" },
 
-#ifdef BUILD_SHELL
+#ifdef SHELL
     { "--shell", Parameter::PT_IMPLIED, nullptr, nullptr,
       "enable the interactive command line", },
 #endif
@@ -497,7 +497,7 @@ static const Parameter s_params[] =
 
 #define s_name "snort"
 
-#ifdef BUILD_SHELL
+#ifdef SHELL
 #define s_help \
     "command line configuration and shell commands"
 #else
@@ -511,7 +511,7 @@ public:
     SnortModule() : Module(s_name, s_help, s_params)
     { }
 
-#ifdef BUILD_SHELL
+#ifdef SHELL
     const Command* get_commands() const override
     { return snort_cmds; }
 #endif
@@ -579,7 +579,7 @@ bool SnortModule::set(const char*, Value& v, SnortConfig* sc)
             sc->daq_config->set_input_spec(v.get_string());
     }
 
-#ifdef BUILD_SHELL
+#ifdef SHELL
     else if ( v.is("-j") )
         sc->remote_control = v.get_long();
 #endif
@@ -822,7 +822,7 @@ bool SnortModule::set(const char*, Value& v, SnortConfig* sc)
     else if ( v.is("--script-path") )
         ConfigScriptPaths(sc, v.get_string());
 
-#ifdef BUILD_SHELL
+#ifdef SHELL
     else if ( v.is("--shell") )
         sc->run_flags |= RUN_FLAG__SHELL;
 #endif