Move IP and IP tunnel code from Sessions into packet analyzers

This commit is contained in:
Tim Wojtulewicz 2020-09-23 16:17:06 -07:00
parent 69da2d7b1d
commit 1cf251d1ca
53 changed files with 1226 additions and 907 deletions

View file

@ -8,6 +8,8 @@
#include "iosource/Packet.h"
#include "Dispatcher.h"
ZEEK_FORWARD_DECLARE_NAMESPACED(PacketProfiler, zeek::detail);
namespace zeek {
namespace packet_analysis {
@ -24,7 +26,7 @@ public:
/**
* Destructor.
*/
~Manager() = default;
~Manager();
/**
* Second-stage initialization of the manager. This is called late
@ -69,6 +71,18 @@ public:
*/
void ProcessPacket(Packet* packet);
/**
* Process the inner packet of an encapsulation. This can be used by tunnel
* analyzers to process a inner packet from the "beginning" directly through
* the root analyzer. This short-circuits some of the additional processing
* that happens in ProcessPacket().
*
* @param packet The packet to process.
*/
bool ProcessInnerPacket(Packet* packet);
uint64_t PacketsProcessed() const { return num_packets_processed; }
private:
/**
* Instantiates a new analyzer instance.
@ -92,6 +106,9 @@ private:
std::map<std::string, AnalyzerPtr> analyzers;
AnalyzerPtr root_analyzer = nullptr;
uint64_t num_packets_processed = 0;
detail::PacketProfiler* pkt_profiler = nullptr;
};
} // namespace packet_analysis