mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
packet_analysis: Introduce PacketAnalyzer::__disable_analyzer()
This adds machinery to the packet_analysis manager for disabling and enabling packet analyzers and implements two low-level bifs to use it. Extend Analyzer::enable_analyzer() and Analyzer::disable_analyzer() to transparently work with packet analyzers, too. This also allows to add packet analyzers to Analyzer::disabled_analyzers.
This commit is contained in:
parent
0d5c669c1c
commit
af5a0215c0
12 changed files with 206 additions and 11 deletions
|
@ -88,6 +88,30 @@ AnalyzerPtr Manager::GetAnalyzer(const std::string& name)
|
|||
return analyzer_it->second;
|
||||
}
|
||||
|
||||
bool Manager::EnableAnalyzer(EnumVal* tag)
|
||||
{
|
||||
Component* c = Lookup(tag);
|
||||
AnalyzerPtr a = GetAnalyzer(c->Name());
|
||||
if ( ! a )
|
||||
return false;
|
||||
|
||||
a->SetEnabled(true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Manager::DisableAnalyzer(EnumVal* tag)
|
||||
{
|
||||
Component* c = Lookup(tag);
|
||||
AnalyzerPtr a = GetAnalyzer(c->Name());
|
||||
if ( ! a )
|
||||
return false;
|
||||
|
||||
a->SetEnabled(false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Manager::ProcessPacket(Packet* packet)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue