]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #1329 in SNORT/snort3 from nhttp114 to master
authorTom Peters (thopeter) <thopeter@cisco.com>
Fri, 10 Aug 2018 18:40:13 +0000 (14:40 -0400)
committerTom Peters (thopeter) <thopeter@cisco.com>
Fri, 10 Aug 2018 18:40:13 +0000 (14:40 -0400)
Squashed commit of the following:

commit 0f2d05b6ead980a8056e5452774557ae037d76dc
Author: Tom Peters <thopeter@cisco.com>
Date:   Tue Aug 7 11:39:55 2018 -0400

    http_inspect: add perfmon to splitter

src/service_inspectors/http2_inspect/http2_api.cc
src/service_inspectors/http2_inspect/http2_api.h
src/service_inspectors/http_inspect/http_api.cc
src/service_inspectors/http_inspect/http_api.h
src/service_inspectors/http_inspect/http_inspect.cc
src/service_inspectors/http_inspect/http_stream_splitter_finish.cc
src/service_inspectors/http_inspect/http_stream_splitter_reassemble.cc
src/service_inspectors/http_inspect/http_stream_splitter_scan.cc

index e53f77e405afcf99212a7bad8a1990580509cc16..c50750b95211bfa643511523365a31e286696606 100644 (file)
@@ -63,8 +63,8 @@ const InspectApi Http2Api::http2_api =
     "http2",
     Http2Api::http2_init,
     Http2Api::http2_term,
-    Http2Api::http2_tinit,
-    Http2Api::http2_tterm,
+    nullptr,
+    nullptr,
     Http2Api::http2_ctor,
     Http2Api::http2_dtor,
     nullptr,
index 595e36ad5a1cf9b4fab9d5941be558a0237130f6..4bdb1b30ab5fbffbc62f5a00f799442b2497617c 100644 (file)
@@ -42,8 +42,6 @@ private:
     static void http2_term() { }
     static snort::Inspector* http2_ctor(snort::Module* mod);
     static void http2_dtor(snort::Inspector* p) { delete p; }
-    static void http2_tinit() { }
-    static void http2_tterm() { }
 };
 
 #endif
index 6d924ae085effdb3a013d369155e19e7c51f39d1..2c77c4cf69a9568f6e352d1ab529f00e1fda0be3 100644 (file)
@@ -78,8 +78,8 @@ const InspectApi HttpApi::http_api =
     "http",
     HttpApi::http_init,
     HttpApi::http_term,
-    HttpApi::http_tinit,
-    HttpApi::http_tterm,
+    nullptr,
+    nullptr,
     HttpApi::http_ctor,
     HttpApi::http_dtor,
     nullptr,
index 20d6f73cec56f13387998f0c22c889439afc63ac..2116e07112923bf53525a4c6509236f85979bdd5 100644 (file)
@@ -42,8 +42,6 @@ private:
     static void http_term() { }
     static snort::Inspector* http_ctor(snort::Module* mod);
     static void http_dtor(snort::Inspector* p) { delete p; }
-    static void http_tinit() { }
-    static void http_tterm() { }
 };
 
 #endif
index ac22079d1f1749cc66cf4321608bc2fbc759a313..2dcd91fd096d6687d49c6d67efa2a5a8d9872896 100644 (file)
@@ -379,6 +379,8 @@ bool HttpInspect::process(const uint8_t* data, const uint16_t dsize, Flow* const
 
 void HttpInspect::clear(Packet* p)
 {
+    Profile profile(HttpModule::get_profile_stats());
+
     HttpFlowData* const session_data =
         (HttpFlowData*)p->flow->get_flow_data(HttpFlowData::inspector_id);
 
index 990a4bb7cfeacb5d0d90f815b101aaf845235b2e..72b8725386159744284c023a12476b913b8e8e5b 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "file_api/file_flows.h"
 
+#include "http_module.h"
 #include "http_msg_request.h"
 #include "http_stream_splitter.h"
 #include "http_test_input.h"
@@ -31,6 +32,8 @@ using namespace HttpEnums;
 
 bool HttpStreamSplitter::finish(snort::Flow* flow)
 {
+    snort::Profile profile(HttpModule::get_profile_stats());
+
     HttpFlowData* session_data = (HttpFlowData*)flow->get_flow_data(HttpFlowData::inspector_id);
     // FIXIT-M - this assert has been changed to check for null session data and return false if so
     //           due to lack of reliable feedback to stream that scan has been called...if that is
index 1ea14bdaf9bdcc5f1fc11c9b4a8ad098057a1489..12fbccec0d07deeb053afe38082e4e159198321f 100644 (file)
@@ -24,6 +24,7 @@
 #include "protocols/packet.h"
 
 #include "http_inspect.h"
+#include "http_module.h"
 #include "http_stream_splitter.h"
 #include "http_test_input.h"
 
@@ -223,6 +224,8 @@ void HttpStreamSplitter::decompress_copy(uint8_t* buffer, uint32_t& offset, cons
 const snort::StreamBuffer HttpStreamSplitter::reassemble(snort::Flow* flow, unsigned total, unsigned,
     const uint8_t* data, unsigned len, uint32_t flags, unsigned& copied)
 {
+    snort::Profile profile(HttpModule::get_profile_stats());
+
     snort::StreamBuffer http_buf { nullptr, 0 };
 
     copied = len;
index e906776e655e3af9b7f0948e65dde179c7addfbc..3f1af00f0ba335051444f20708c40b77e56f706f 100644 (file)
@@ -22,6 +22,7 @@
 #endif
 
 #include "http_inspect.h"
+#include "http_module.h"
 #include "http_stream_splitter.h"
 #include "http_test_input.h"
 
@@ -81,6 +82,8 @@ HttpCutter* HttpStreamSplitter::get_cutter(SectionType type,
 StreamSplitter::Status HttpStreamSplitter::scan(Flow* flow, const uint8_t* data, uint32_t length,
     uint32_t, uint32_t* flush_offset)
 {
+    snort::Profile profile(HttpModule::get_profile_stats());
+
     assert(length <= MAX_OCTETS);
 
     // This is the session state information we share with HttpInspect and store with stream. A