mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +00:00
Rename IPBasedTransportAnalyzer to SessionAdapter
This also also combines the old TransportLayerAnalyzer class into SessionAdapter, and removes the old class. This requires naming changes in a few places but no functionality changes.
This commit is contained in:
parent
c56fb3e8e4
commit
b22ce6848f
24 changed files with 340 additions and 329 deletions
39
src/packet_analysis/protocol/ip/SessionAdapter.cc
Normal file
39
src/packet_analysis/protocol/ip/SessionAdapter.cc
Normal file
|
@ -0,0 +1,39 @@
|
|||
#include "zeek/packet_analysis/protocol/ip/SessionAdapter.h"
|
||||
|
||||
#include "zeek/File.h"
|
||||
#include "zeek/ZeekString.h"
|
||||
#include "zeek/packet_analysis/protocol/ip/IPBasedAnalyzer.h"
|
||||
|
||||
using namespace zeek::packet_analysis::IP;
|
||||
|
||||
void SessionAdapter::Done()
|
||||
{
|
||||
Analyzer::Done();
|
||||
}
|
||||
|
||||
bool SessionAdapter::IsReuse(double t, const u_char* pkt)
|
||||
{
|
||||
return parent->IsReuse(t, pkt);
|
||||
}
|
||||
|
||||
void SessionAdapter::SetContentsFile(unsigned int /* direction */,
|
||||
FilePtr /* f */)
|
||||
{
|
||||
reporter->Error("analyzer type does not support writing to a contents file");
|
||||
}
|
||||
|
||||
zeek::FilePtr SessionAdapter::GetContentsFile(unsigned int /* direction */) const
|
||||
{
|
||||
reporter->Error("analyzer type does not support writing to a contents file");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void SessionAdapter::PacketContents(const u_char* data, int len)
|
||||
{
|
||||
if ( packet_contents && len > 0 )
|
||||
{
|
||||
zeek::String* cbs = new zeek::String(data, len, true);
|
||||
auto contents = make_intrusive<StringVal>(cbs);
|
||||
EnqueueConnEvent(packet_contents, ConnVal(), std::move(contents));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue