]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
legacy paf_max implementation
authorrcombs <rcombs@sq18.sfeng.sourcefire.com>
Thu, 13 Nov 2014 21:33:21 +0000 (16:33 -0500)
committerrcombs <rcombs@sq18.sfeng.sourcefire.com>
Thu, 13 Nov 2014 21:33:21 +0000 (16:33 -0500)
ChangeLog
src/stream/stream_splitter.cc
src/stream/stream_splitter.h
src/stream/tcp/stream_tcp.cc

index 66cb1d5b9a4d5ae698a1990140f67509bde5831b..702ad77e718fde75e8adc4cf342aaca3a6243747 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,6 +24,7 @@
 -- fixed inspector reinit
 -- fixed byte_extract and byte_jump endianisms
 -- suspend active when purging caches
+-- temporary support for legacy paf_max
 
 127
 -- REG_TEST out logging tcp options for rebuilt packets to match snort bug
index 4207420f25f403c379afa5f1a18376e7bc45f55f..86103c8a5f6b9c23e4dc19b2d0fabc476e530e97 100644 (file)
 static THREAD_LOCAL uint8_t pdu_buf[65536];
 static THREAD_LOCAL StreamBuffer str_buf;
 
+unsigned StreamSplitter::max_pdu = 16384;
+
+void StreamSplitter::set_max(unsigned m)
+{ max_pdu = m; }
+
 unsigned StreamSplitter::max()
-{ return 16384; }  // subclasses should override this
+{ return max_pdu; }
 
 const StreamBuffer* StreamSplitter::reassemble(
     Flow*, unsigned, unsigned offset, const uint8_t* p,
index e5637d92a8dca666c5030f9314811b1da1fb1b6b..83f0a1fc08f44ef8b4ca9721158f265477aae758 100644 (file)
@@ -69,6 +69,11 @@ public:
     virtual bool is_paf() { return false; };
     virtual unsigned max();
 
+    // FIXIT-L this is temporary for legacy paf_max required only
+    // for HI; it is not appropriate for multiple stream_tcp with 
+    // different paf_max; the HI splitter should pull from there
+    static void set_max(unsigned);
+
     virtual void reset() { };
     virtual void update() { };
 
@@ -79,7 +84,7 @@ protected:
     StreamSplitter(bool b) { c2s = b; };
 
 private:
-    static unsigned s_max;
+    static unsigned max_pdu;
     bool c2s;
 };
 
index cb56868a46ae69312cce5c4414883102b5e67232..a4a0947ea89ea4e3267a304ce0f6d2500991e77b 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "main/snort.h"
 #include "stream/flush_bucket.h"
+#include "stream/stream_splitter.h"
 
 //-------------------------------------------------------------------------
 // inspector stuff
@@ -43,6 +44,7 @@ public:
     ~StreamTcp();
 
     void show(SnortConfig*) override;
+    bool configure(SnortConfig*) override;
 
     void tinit() override;
     void tterm() override;
@@ -68,6 +70,12 @@ void StreamTcp::show(SnortConfig*)
     tcp_show(config);
 }
 
+bool StreamTcp::configure(SnortConfig*)
+{
+    StreamSplitter::set_max(config->paf_max);
+    return true;
+}
+
 void StreamTcp::tinit()
 {
     FlushBucket::set(config->footprint);