mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 23:28:20 +00:00
GH-1184: Add 'source' field to weird log denoting where the weird was reported
This commit is contained in:
parent
eccbbb4476
commit
e27008ef26
72 changed files with 964 additions and 890 deletions
|
@ -5,6 +5,8 @@
|
|||
#include "zeek/Dict.h"
|
||||
#include "zeek/DebugLogger.h"
|
||||
#include "zeek/RunState.h"
|
||||
#include "zeek/Sessions.h"
|
||||
#include "zeek/util.h"
|
||||
|
||||
namespace zeek::packet_analysis {
|
||||
|
||||
|
@ -70,7 +72,7 @@ AnalyzerPtr Analyzer::Lookup(uint32_t identifier) const
|
|||
}
|
||||
|
||||
bool Analyzer::ForwardPacket(size_t len, const uint8_t* data, Packet* packet,
|
||||
uint32_t identifier) const
|
||||
uint32_t identifier) const
|
||||
{
|
||||
auto inner_analyzer = Lookup(identifier);
|
||||
if ( ! inner_analyzer )
|
||||
|
@ -96,7 +98,8 @@ bool Analyzer::ForwardPacket(size_t len, const uint8_t* data, Packet* packet) co
|
|||
|
||||
DBG_LOG(DBG_PACKET_ANALYSIS, "Analysis in %s stopped, no default analyzer available.",
|
||||
GetAnalyzerName());
|
||||
packet->Weird("no_suitable_analyzer_found");
|
||||
|
||||
Weird("no_suitable_analyzer_found", packet);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -116,4 +119,9 @@ void Analyzer::RegisterProtocol(uint32_t identifier, AnalyzerPtr child)
|
|||
dispatcher.Register(identifier, std::move(child));
|
||||
}
|
||||
|
||||
}
|
||||
void Analyzer::Weird(const char* name, Packet* packet, const char* addl) const
|
||||
{
|
||||
sessions->Weird(name, packet, addl, GetAnalyzerName());
|
||||
}
|
||||
|
||||
} // namespace zeek::packet_analysis
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue