#include <assert.h>
#include <string.h>
+#include "stream/stream_splitter.h"
+
//-------------------------------------------------------------------------
// packet handler stuff
//-------------------------------------------------------------------------
return get_buf(id, p, b);
}
+StreamSplitter* Inspector::get_splitter(bool to_server)
+{
+ if ( !api || api->type != IT_SERVICE )
+ return nullptr;
+
+ return new AtomSplitter(to_server);
+}
+
{ return false; };
// IT_SERVICE only
- virtual class StreamSplitter* get_splitter(bool /*to_server*/)
- { return nullptr; };
+ virtual class StreamSplitter* get_splitter(bool to_server);
void set_api(const InspectApi* p)
{ api = p; };
if ( !flow )
return;
- if ( flow->clouseau )
+ if ( flow->clouseau && (p->proto_bits & flow->clouseau->get_api()->proto_bits) )
bumble(p);
// FIXIT BIND need more than one service inspector?
//::execute(p, fp->service.vec, fp->service.num);
- if ( flow->gadget )
+ if ( flow->gadget && (p->proto_bits & flow->gadget->get_api()->proto_bits) )
flow->gadget->eval(p);
}
else
void eval(Packet*);
- void pinit();
- void pterm();
- void reset();
-
public:
StreamTcpConfig* config;
};
return Stream5VerifyTcpConfig(sc, config);
}
-void StreamTcp::pinit()
-{
- tcp_sinit();
-}
-
-void StreamTcp::pterm()
-{
- tcp_sterm();
-}
-
void StreamTcp::show(SnortConfig*)
{
if ( config )
assert(false);
}
-void StreamTcp::reset()
-{
-}
-
StreamTcpConfig* get_tcp_cfg(Inspector* ins)
{
assert(ins);
return new TcpSession(lws);
}
+void tcp_pinit()
+{
+ tcp_sinit();
+}
+
+void tcp_pterm()
+{
+ tcp_sterm();
+}
+
static const InspectApi tcp_api =
{
{
nullptr, // term
tcp_ctor,
tcp_dtor,
- nullptr, // pinit
- nullptr, // pterm
+ tcp_pinit,
+ tcp_pterm,
tcp_ssn,
tcp_sum,
tcp_stats,