]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #1040 in SNORT/snort3 from expose-u2_packet to master
authorHui Cao (huica) <huica@cisco.com>
Tue, 17 Oct 2017 13:53:59 +0000 (09:53 -0400)
committerHui Cao (huica) <huica@cisco.com>
Tue, 17 Oct 2017 13:53:59 +0000 (09:53 -0400)
Squashed commit of the following:

commit 2439da6fc82c8876a4fe846b19a673689fc905d2
Author: Victor Roemer (viroemer) <viroemer@cisco.com>
Date:   Mon Oct 16 13:26:24 2017 +0000

    cleanup

commit 6f8aa06a3e92190ba72613f0b61a31371322484a
Author: Victor Roemer (viroemer) <viroemer@cisco.com>
Date:   Fri Oct 13 09:23:14 2017 -0400

    Move u2_packet.cc

commit c30de3bca9f2f70dcdc43e10b8a0324976b2b16c
Author: Victor Roemer (viroemer) <viroemer@cisco.com>
Date:   Wed Oct 11 10:17:13 2017 -0400

    build: remove u2_packet.h from loggers/Makefile.am

commit 504f0e68d6d929e0991bf1a16d03347d247237fa
Author: Victor Roemer (viroemer) <viroemer@cisco.com>
Date:   Wed Oct 11 08:28:39 2017 -0400

    log: Make U2PseudoHeader a public interface

src/log/CMakeLists.txt
src/log/Makefile.am
src/log/u2_packet.cc [moved from src/loggers/u2_packet.cc with 100% similarity]
src/log/u2_packet.h [moved from src/loggers/u2_packet.h with 97% similarity]
src/loggers/CMakeLists.txt
src/loggers/Makefile.am
src/loggers/unified2.cc

index 068b8c1546881128712518b80fd2f27cfcd7381e..d2ae8d1a6ebb534c097556a522fb298d306ea336 100644 (file)
@@ -4,6 +4,7 @@ set (LOG_INCLUDES
     obfuscator.h
     text_log.h
     unified2.h
+    u2_packet.h
 )
 
 add_library ( log STATIC
@@ -17,6 +18,7 @@ add_library ( log STATIC
     packet_tracer.cc
     packet_tracer.h
     text_log.cc
+    u2_packet.cc
 )
 
 install(FILES ${LOG_INCLUDES}
index a3ec813a2b979b84e049a5a49dde59d5974e095f..04fe71f49c5916f874d88a54f0ca9cacbd2adfae 100644 (file)
@@ -7,6 +7,7 @@ x_include_HEADERS = \
 messages.h \
 obfuscator.h \
 text_log.h \
+u2_packet.h \
 unified2.h
 
 liblog_a_SOURCES = \
@@ -18,7 +19,8 @@ messages.cc \
 obfuscator.cc \
 packet_tracer.cc \
 packet_tracer.h \
-text_log.cc
+text_log.cc \
+u2_packet.cc
 
 if ENABLE_UNIT_TESTS
 SUBDIRS = test
similarity index 97%
rename from src/loggers/u2_packet.h
rename to src/log/u2_packet.h
index 0d49b341abfcf487c3a8d9a89c4a51dc2e4f089e..a0a1b121778b509a52bbdbfa3b4ebb45e1a4d1d7 100644 (file)
 #include "protocols/ipv6.h"
 #include "protocols/tcp.h"
 
+#include "main/snort_types.h"
+
 struct Packet;
 
-class U2PseudoHeader
+class SO_PUBLIC U2PseudoHeader
 {
 public:
     U2PseudoHeader(const Packet*);
index 0e06e6b2e5986de23b987112cc175b5f4ad662be..195360c354b895df1b0318ce1647cc9c6b487949 100644 (file)
@@ -14,8 +14,6 @@ set (PLUGIN_LIST
     alert_syslog.cc
     log_hext.cc
     log_pcap.cc
-    u2_packet.cc
-    u2_packet.h
     unified2.cc
 )
 
@@ -38,7 +36,7 @@ else (STATIC_LOGGERS)
     add_dynamic_module(alert_syslog loggers alert_syslog.cc)
     add_dynamic_module(log_hext loggers log_hext.cc)
     add_dynamic_module(log_pcap loggers log_pcap.cc)
-    add_dynamic_module(unified2 loggers unified2.cc u2_packet.cc u2_packet.h)
+    add_dynamic_module(unified2 loggers unified2.cc)
 
 endif (STATIC_LOGGERS)
 
index 020eb808acb1c99e3f772c90876bec2bdcafcf05..a93afa3eccd9db0d9a06d338e394b3dff64735f9 100644 (file)
@@ -15,7 +15,6 @@ alert_syslog.cc \
 log_hext.cc \
 log_pcap.cc \
 u2_packet.cc \
-u2_packet.h \
 unified2.cc
 
 if STATIC_LOGGERS
@@ -57,6 +56,6 @@ log_pcap_la_SOURCES = log_pcap.cc
 ehlib_LTLIBRARIES += unified2.la
 unified2_la_CXXFLAGS = $(AM_CXXFLAGS) -DBUILDING_SO
 unified2_la_LDFLAGS = $(AM_LDFLAGS) -module -export-dynamic -avoid-version -shared
-unified2_la_SOURCES = unified2.cc u2_packet.cc u2_packet.h
+unified2_la_SOURCES = unified2.cc
 endif
 
index 49bc19ba96e63506dab6f17a8b1030fde6ed5681..9496513417615c305fe5266e76b12cd5258837bc 100644 (file)
@@ -39,6 +39,7 @@
 #include "log/messages.h"
 #include "log/obfuscator.h"
 #include "log/unified2.h"
+#include "log/u2_packet.h"
 #include "main/snort_config.h"
 #include "network_inspectors/appid/appid_api.h"
 #include "packet_io/active.h"
@@ -51,8 +52,6 @@
 #include "utils/util.h"
 #include "utils/util_cstring.h"
 
-#include "u2_packet.h"
-
 using namespace std;
 
 #define S_NAME "unified2"
@@ -979,7 +978,7 @@ void U2Logger::log(Packet* p, const char* msg, Event* event)
 {
     assert(p);
 
-    // FIXIT-H convert to packet method if correct
+    // FIXIT-L convert to packet method
     if ( !p->is_cooked() or p->pseudo_type == PSEUDO_PKT_IP )
         _Unified2LogPacketAlert(p, msg, &config, event, UNIFIED2_PACKET);