]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #692 in SNORT/snort3 from statics to master
authorRuss Combs (rucombs) <rucombs@cisco.com>
Fri, 4 Nov 2016 13:21:37 +0000 (09:21 -0400)
committerRuss Combs (rucombs) <rucombs@cisco.com>
Fri, 4 Nov 2016 13:21:37 +0000 (09:21 -0400)
Squashed commit of the following:

commit 16bb37ec5884dce78e34640b69536e4e32d4a16b
Author: Russ Combs <rucombs@cisco.com>
Date:   Thu Nov 3 18:35:46 2016 -0400

    fix dynamic build for recent appid / http_inspect / sip changes

commit ba9d0ab0df042323ffb308b1a28088cc2acbfa50
Author: Russ Combs <rucombs@cisco.com>
Date:   Tue Nov 1 14:30:44 2016 -0400

    ensure static appid and http_inspect and their rule options are loaded

src/CMakeLists.txt
src/Makefile.am
src/network_inspectors/CMakeLists.txt
src/network_inspectors/network_inspectors.cc
src/service_inspectors/CMakeLists.txt
src/service_inspectors/imap/imap.cc
src/service_inspectors/pop/pop.cc
src/service_inspectors/service_inspectors.cc
src/service_inspectors/smtp/smtp.cc
src/service_inspectors/ssl/ssl_inspector.cc

index 7da85f4531507fc744b0e429f2c2d8a88947e455..b8848ede8aa047c7b23dc3d6fe6e521b713b509d 100644 (file)
@@ -41,25 +41,6 @@ include_directories(AFTER ${EXTERNAL_INCLUDES})
 include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
 include_directories(BEFORE network_inspectors)
 
-# Build options for specific libraries
-# FIXIT is this needed?  see also
-# STATIC_INSPECTOR_LIBS in service_inspectors/CMakeLists.txt
-if (STATIC_INSPECTORS)
-    set (STATIC_INSPECTOR_LIBRARIES
-#        appid
-        arp_spoof
-        back_orifice
-        dns
-        ftp_telnet
-#        http_inspect
-        rpc_decode
-        sip
-        ssh
-        wizard
-    )
-endif()
-
-
 if (STATIC_CODECS)
     set (STATIC_CODEC_LIBRARIES
         link_codecs
@@ -97,10 +78,10 @@ target_link_libraries( snort
     ${STATIC_CODEC_LIBRARIES}
     network_inspectors
     service_inspectors
+# include only those with otherwise unresolved dependencies
     appid
     http_inspect
-    ${STATIC_INSPECTOR_LIBRARIES}
-    port_scan
+    sip
     reputation
     stream
     stream_base
@@ -113,10 +94,6 @@ target_link_libraries( snort
     stream_file
     stream_paf
     mime
-    imap
-    pop
-    smtp
-    ssl
     ${PIGLET_LIBRARIES}
     ips_options
     search_engines
index 78a327599cb60e592559bd3c51154323155c3bd1..c40bfeea9e3cb9ac65ea72ff07d7b50eadf6c899 100644 (file)
@@ -17,7 +17,6 @@ service_inspectors/ftp_telnet/libftp_telnet.a \
 service_inspectors/gtp/libgtp_inspect.a \
 service_inspectors/modbus/libmodbus.a \
 service_inspectors/rpc_decode/librpc_decode.a \
-service_inspectors/sip/libsip.a \
 service_inspectors/ssh/libssh.a \
 service_inspectors/wizard/libwizard.a
 endif
@@ -51,13 +50,14 @@ codecs/ip/libip_codecs.a \
 codecs/misc/libmisc_codecs.a \
 $(codec_list) \
 network_inspectors/libnetwork_inspectors.a \
+network_inspectors/appid/libappid.a \
 network_inspectors/binder/libbinder.a \
 network_inspectors/normalize/libnormalize.a \
 network_inspectors/perf_monitor/libperf_monitor.a \
 network_inspectors/reputation/libreputation.a \
 service_inspectors/libservice_inspectors.a \
-network_inspectors/appid/libappid.a \
 service_inspectors/http_inspect/libhttp_inspect.a \
+service_inspectors/sip/libsip.a \
 $(lib_list) \
 pub_sub/libpub_sub.a \
 service_inspectors/imap/libimap.a \
index a3123efe1d536b00c1fc3729a3df1140017b5ab8..98fcfa708f8d86c31f5ca5a77b8f73100f95fb13 100644 (file)
@@ -10,7 +10,6 @@ add_subdirectory(reputation)
 
 if(STATIC_INSPECTORS)
     set(STATIC_INSPECTOR_LIBS
-        appid
         arp_spoof
         packet_capture
     )
@@ -28,5 +27,4 @@ target_link_libraries( network_inspectors
     perf_monitor
     port_scan
     reputation
-    stream_tcp
 )
index 0d7d4887e2ba5fd577968664c45eda290da74220..8afcb029bc12029f48334bbc526b5b292629c799 100644 (file)
@@ -23,6 +23,7 @@
 #endif
 #include "framework/inspector.h"
 
+extern const BaseApi* nin_appid;
 extern const BaseApi* nin_binder;
 extern const BaseApi* nin_normalize;
 extern const BaseApi* nin_perf_monitor;
@@ -30,14 +31,16 @@ extern const BaseApi* nin_port_scan_global;
 extern const BaseApi* nin_port_scan;
 extern const BaseApi* nin_reputation;
 
+extern const BaseApi* ips_appid;
+
 #ifdef STATIC_INSPECTORS
-extern const BaseApi* nin_appid;
 extern const BaseApi* nin_arp_spoof;
 extern const BaseApi* nin_packet_capture;
 #endif
 
 const BaseApi* network_inspectors[] =
 {
+    nin_appid,
     nin_binder,
     nin_normalize,
     nin_perf_monitor,
@@ -45,8 +48,9 @@ const BaseApi* network_inspectors[] =
     nin_port_scan,
     nin_reputation,
 
+    ips_appid,
+
 #ifdef STATIC_INSPECTORS
-    nin_appid,
     nin_arp_spoof,
     nin_packet_capture,
 #endif
index d4ca46fa51da130a9936ba84a597d955e6b19503..6f68dc639e4faf6b3dfe0f278ff71baa8c7d221e 100644 (file)
@@ -24,15 +24,9 @@ if (STATIC_INSPECTORS)
         dns
         ftp_telnet
         gtp_inspect
-        imap
         modbus
-#        http_inspect
-        pop
         rpc_decode
-        sip
-        smtp
         ssh
-        ssl
         wizard
     )
 endif()
@@ -43,5 +37,10 @@ add_library( service_inspectors STATIC
 )
 
 target_link_libraries( service_inspectors
-    http_inspect ${STATIC_INSPECTOR_LIBS}
+    ${STATIC_INSPECTOR_LIBS}
+    imap
+    pop
+    smtp
+    ssl
 )
+
index 4085a3fe5d292db031e1c672aa6fbbe46ea4b48d..47dbe1732570b6b1c3bfb8ecc5334f7a2c37508e 100644 (file)
@@ -842,14 +842,15 @@ const InspectApi imap_api =
     nullptr  // reset
 };
 
-// can't be linked dynamically yet
-//#ifdef BUILDING_SO
-//SO_PUBLIC const BaseApi* snort_plugins[] =
-//{
-//    &imap_api.base,
-//    nullptr
-//};
-//#else
+#undef BUILDING_SO  // FIXIT-L can't be linked dynamically yet
+
+#ifdef BUILDING_SO
+SO_PUBLIC const BaseApi* snort_plugins[] =
+{
+    &imap_api.base,
+    nullptr
+};
+#else
 const BaseApi* sin_imap = &imap_api.base;
-//#endif
+#endif
 
index 78db7a5dfb163092b0951e8ed6d86953e0173e12..081f570e4f4ae4bb0ee612e709adc5c9156f79bb 100644 (file)
@@ -779,14 +779,15 @@ const InspectApi pop_api =
     nullptr  // reset
 };
 
-// can't be linked dynamically yet
-//#ifdef BUILDING_SO
-//SO_PUBLIC const BaseApi* snort_plugins[] =
-//{
-//    &pop_api.base,
-//    nullptr
-//};
-//#else
+#undef BUILDING_SO  // FIXIT-L can't be linked dynamically yet
+
+#ifdef BUILDING_SO
+SO_PUBLIC const BaseApi* snort_plugins[] =
+{
+    &pop_api.base,
+    nullptr
+};
+#else
 const BaseApi* sin_pop = &pop_api.base;
-//#endif
+#endif
 
index f1b0a28124d212c7d0cc9758aeee7c5016626397..e53b87438078879eda7a6f0ad58b410b2faf5ac1 100644 (file)
 #endif
 #include "framework/inspector.h"
 
+extern const BaseApi* sin_http;
 extern const BaseApi* sin_imap;
 extern const BaseApi* sin_pop;
-extern const BaseApi* sin_smtp;
 extern const BaseApi* sin_sip;
+extern const BaseApi* sin_smtp;
 extern const BaseApi* sin_ssl;
+
+extern const BaseApi* ips_http_uri;
+extern const BaseApi* ips_http_client_body;
+extern const BaseApi* ips_http_method;
+extern const BaseApi* ips_http_cookie;
+extern const BaseApi* ips_http_stat_code;
+extern const BaseApi* ips_http_stat_msg;
+extern const BaseApi* ips_http_raw_uri;
+extern const BaseApi* ips_http_raw_header;
+extern const BaseApi* ips_http_raw_cookie;
+extern const BaseApi* ips_http_version;
+extern const BaseApi* ips_http_header;
+extern const BaseApi* ips_http_trailer;
+extern const BaseApi* ips_http_raw_trailer;
+extern const BaseApi* ips_http_raw_request;
+extern const BaseApi* ips_http_raw_status;
 extern const BaseApi* ips_sip_body;
 extern const BaseApi* ips_sip_header;
 extern const BaseApi* ips_sip_method;
@@ -37,7 +54,6 @@ extern const BaseApi* ips_ssl_state;
 extern const BaseApi* ips_ssl_version;
 
 #ifdef STATIC_INSPECTORS
-extern const BaseApi* ips_appid;
 extern const BaseApi* ips_dce_iface;
 extern const BaseApi* ips_dce_opnum;
 extern const BaseApi* ips_dce_stub_data;
@@ -54,22 +70,6 @@ extern const BaseApi* ips_modbus_unit;
 
 // FIXIT-L use snort_plugins aliases for static builds
 // so only one extern symbol per library is required
-extern const BaseApi* ips_http_uri;
-extern const BaseApi* ips_http_client_body;
-extern const BaseApi* ips_http_method;
-extern const BaseApi* ips_http_cookie;
-extern const BaseApi* ips_http_stat_code;
-extern const BaseApi* ips_http_stat_msg;
-extern const BaseApi* ips_http_raw_uri;
-extern const BaseApi* ips_http_raw_header;
-extern const BaseApi* ips_http_raw_cookie;
-extern const BaseApi* ips_http_version;
-extern const BaseApi* ips_http_header;
-extern const BaseApi* ips_http_trailer;
-extern const BaseApi* ips_http_raw_trailer;
-extern const BaseApi* ips_http_raw_request;
-extern const BaseApi* ips_http_raw_status;
-
 extern const BaseApi* sin_bo;
 extern const BaseApi* sin_dce_smb;
 extern const BaseApi* sin_dce_tcp;
@@ -81,7 +81,6 @@ extern const BaseApi* sin_ftp_server;
 extern const BaseApi* sin_ftp_data;
 extern const BaseApi* sin_gtp;
 extern const BaseApi* sin_modbus;
-extern const BaseApi* sin_http;
 extern const BaseApi* sin_rpc_decode;
 extern const BaseApi* sin_ssh;
 extern const BaseApi* sin_telnet;
@@ -90,12 +89,28 @@ extern const BaseApi* sin_wizard;
 
 const BaseApi* service_inspectors[] =
 {
+    sin_http,
     sin_imap,
     sin_pop,
     sin_sip,
     sin_smtp,
     sin_ssl,
 
+    ips_http_uri,
+    ips_http_client_body,
+    ips_http_method,
+    ips_http_cookie,
+    ips_http_stat_code,
+    ips_http_stat_msg,
+    ips_http_raw_uri,
+    ips_http_raw_header,
+    ips_http_raw_cookie,
+    ips_http_version,
+    ips_http_header,
+    ips_http_trailer,
+    ips_http_raw_trailer,
+    ips_http_raw_request,
+    ips_http_raw_status,
     ips_sip_body,
     ips_sip_header,
     ips_sip_method,
@@ -104,7 +119,6 @@ const BaseApi* service_inspectors[] =
     ips_ssl_version,
 
 #ifdef STATIC_INSPECTORS
-    ips_appid,
     ips_dce_iface,
     ips_dce_opnum,
     ips_dce_stub_data,
@@ -119,22 +133,6 @@ const BaseApi* service_inspectors[] =
     ips_modbus_func,
     ips_modbus_unit,
 
-    ips_http_uri,
-    ips_http_client_body,
-    ips_http_method,
-    ips_http_cookie,
-    ips_http_stat_code,
-    ips_http_stat_msg,
-    ips_http_raw_uri,
-    ips_http_raw_header,
-    ips_http_raw_cookie,
-    ips_http_version,
-    ips_http_header,
-    ips_http_trailer,
-    ips_http_raw_trailer,
-    ips_http_raw_request,
-    ips_http_raw_status,
-
     sin_bo,
     sin_dce_smb,
     sin_dce_tcp,
@@ -146,7 +144,6 @@ const BaseApi* service_inspectors[] =
     sin_ftp_data,
     sin_gtp,
     sin_modbus,
-    sin_http,
     sin_rpc_decode,
     sin_ssh,
     sin_telnet,
index 902260ec68faad7c917a82f206bafdc2b4d1c56e..e2e38ceab0b7a1b29d9e28d6e55d48c138222160 100644 (file)
@@ -1672,14 +1672,15 @@ const InspectApi smtp_api =
     nullptr                 // reset
 };
 
-// can't be linked dynamically yet
-//#ifdef BUILDING_SO
-//SO_PUBLIC const BaseApi* snort_plugins[] =
-//{
-//    &smtp_api.base,
-//    nullptr
-//};
-//#else
+#undef BUILDING_SO  // FIXIT-L can't be linked dynamically yet
+
+#ifdef BUILDING_SO
+SO_PUBLIC const BaseApi* snort_plugins[] =
+{
+    &smtp_api.base,
+    nullptr
+};
+#else
 const BaseApi* sin_smtp = &smtp_api.base;
-//#endif
+#endif
 
index 61bfa0063c51abef44c22c5607f87d78da4f21ae..454edd84b5c3c9783af0a4cbc1d3ae0d012e11f0 100644 (file)
@@ -511,14 +511,15 @@ const InspectApi ssl_api =
     nullptr  // reset
 };
 
-// can't be linked dynamically yet
-//#ifdef BUILDING_SO
-//SO_PUBLIC const BaseApi* snort_plugins[] =
-//{
-//    &ssl_api.base,
-//    nullptr
-//};
-//#else
+#undef BUILDING_SO  // FIXIT-L can't be linked dynamically yet
+
+#ifdef BUILDING_SO
+SO_PUBLIC const BaseApi* snort_plugins[] =
+{
+    &ssl_api.base,
+    nullptr
+};
+#else
 const BaseApi* sin_ssl = &ssl_api.base;
-//#endif
+#endif