Merge in SNORT/snort3 from ~OSHUMEIK/snort3:fix_static_build to master
Squashed commit of the following:
commit
cc436080f672ff6ed30899493d3fd340d1c1963f
Author: Oleksii Shumeiko <oshumeik@cisco.com>
Date: Tue Dec 10 10:02:05 2024 +0200
log: print all warnings before command line is parsed
commit
f8d595f5517c2990037a0a59ac47fb16c564cdd2
Author: Yehor Velykozhon <yvelykoz@cisco.com>
Date: Mon Dec 9 17:02:24 2024 +0200
build: include/exclude snort_ml module conditionally
ML_INCLUDE_DIRS
)
-if (ML_FOUND AND NOT ENABLE_KAIZEN_MOCK)
+if (ML_FOUND AND NOT USE_LIBML_MOCK)
set(HAVE_LIBML TRUE)
endif()
/* libml available */
#cmakedefine HAVE_LIBML 1
+/* don't worry about libml and mock the inspector */
+#cmakedefine USE_LIBML_MOCK 1
+
/* Availability of specific library functions */
/* Define to 1 if you have the `malloc_trim' function. */
append_cache_entry ML_LIBRARIES_DIR_HINT PATH $optarg
;;
--without-libml)
- append_cache_entry ENABLE_KAIZEN_MOCK BOOL true
+ append_cache_entry USE_LIBML_MOCK BOOL true
;;
SIGNAL_SNORT_RELOAD=*)
append_cache_entry SIGNAL_SNORT_RELOAD STRING $optarg
{
void ParseWarning(WarningGroup wg, const char* format, ...)
{
- if ( !(SnortConfig::get_conf()->warning_flags & (1 << wg)) )
+ if ( SnortConfig::get_conf() and !(SnortConfig::get_conf()->warning_flags & (1 << wg)) )
return;
char buf[STD_BUF+1];
add_subdirectory(arp_spoof)
add_subdirectory(binder)
add_subdirectory(extractor)
-add_subdirectory(kaizen)
+
+if ( HAVE_LIBML OR USE_LIBML_MOCK )
+ add_subdirectory(kaizen)
+endif()
+
add_subdirectory(normalize)
add_subdirectory(packet_capture)
add_subdirectory(perf_monitor)
)
endif()
+if ( HAVE_LIBML OR USE_LIBML_MOCK )
+ set(KAIZEN_STATIC_OBJ
+ $<TARGET_OBJECTS:kaizen>
+ )
+endif()
+
set(STATIC_NETWORK_INSPECTOR_PLUGINS
$<TARGET_OBJECTS:appid>
$<TARGET_OBJECTS:binder>
$<TARGET_OBJECTS:extractor>
- $<TARGET_OBJECTS:kaizen>
+ ${KAIZEN_STATIC_OBJ}
$<TARGET_OBJECTS:normalize>
$<TARGET_OBJECTS:port_scan>
$<TARGET_OBJECTS:reputation>
static const InspectApi kaizen_engine_api =
{
{
-#if defined(HAVE_LIBML) || defined(REG_TEST)
PT_INSPECTOR,
-#else
- PT_MAX,
-#endif
sizeof(InspectApi),
INSAPI_VERSION,
0,
static const InspectApi kaizen_api =
{
{
-#if defined(HAVE_LIBML) || defined(REG_TEST)
PT_INSPECTOR,
-#else
- PT_MAX,
-#endif
sizeof(InspectApi),
INSAPI_VERSION,
0,
extern const BaseApi* nin_appid[];
extern const BaseApi* nin_extractor[];
+
+#if defined(HAVE_LIBML) || defined(USE_LIBML_MOCK)
extern const BaseApi* nin_kaizen_engine[];
extern const BaseApi* nin_kaizen[];
+#endif
+
extern const BaseApi* nin_port_scan[];
extern const BaseApi* nin_rna[];
PluginManager::load_plugins(network_inspectors);
PluginManager::load_plugins(nin_appid);
PluginManager::load_plugins(nin_extractor);
+
+#if defined(HAVE_LIBML) || defined(USE_LIBML_MOCK)
PluginManager::load_plugins(nin_kaizen_engine);
PluginManager::load_plugins(nin_kaizen);
+#endif
+
PluginManager::load_plugins(nin_port_scan);
PluginManager::load_plugins(nin_rna);