mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 07:08:19 +00:00
Internal refactoring of how plugin components are tagged/managed.
Made some class templates for code that seemed duplicated between file/protocol tags and managers. Seems like it helps a bit and hopefully can be also be used to transition other things that have enum value "tags" (e.g. logging writers, input readers) to the plugin system.
This commit is contained in:
parent
9bd7a65071
commit
99c89b42d7
26 changed files with 432 additions and 366 deletions
|
@ -42,7 +42,7 @@ bool AnalyzerSet::Add(file_analysis::Tag tag, RecordVal* args)
|
|||
if ( analyzer_map.Lookup(key) )
|
||||
{
|
||||
DBG_LOG(DBG_FILE_ANALYSIS, "Instantiate analyzer %s skipped for file id"
|
||||
" %s: already exists", file_mgr->GetAnalyzerName(tag),
|
||||
" %s: already exists", file_mgr->GetComponentName(tag),
|
||||
file->GetID().c_str());
|
||||
delete key;
|
||||
return true;
|
||||
|
@ -82,7 +82,7 @@ bool AnalyzerSet::AddMod::Perform(AnalyzerSet* set)
|
|||
if ( set->analyzer_map.Lookup(key) )
|
||||
{
|
||||
DBG_LOG(DBG_FILE_ANALYSIS, "Add analyzer %s skipped for file id"
|
||||
" %s: already exists", file_mgr->GetAnalyzerName(a->Tag()),
|
||||
" %s: already exists", file_mgr->GetComponentName(a->Tag()),
|
||||
a->GetFile()->GetID().c_str());
|
||||
|
||||
Abort();
|
||||
|
@ -108,12 +108,12 @@ bool AnalyzerSet::Remove(file_analysis::Tag tag, HashKey* key)
|
|||
if ( ! a )
|
||||
{
|
||||
DBG_LOG(DBG_FILE_ANALYSIS, "Skip remove analyzer %s for file id %s",
|
||||
file_mgr->GetAnalyzerName(tag), file->GetID().c_str());
|
||||
file_mgr->GetComponentName(tag), file->GetID().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
DBG_LOG(DBG_FILE_ANALYSIS, "Remove analyzer %s for file id %s",
|
||||
file_mgr->GetAnalyzerName(tag),
|
||||
file_mgr->GetComponentName(tag),
|
||||
file->GetID().c_str());
|
||||
|
||||
delete a;
|
||||
|
@ -155,7 +155,7 @@ file_analysis::Analyzer* AnalyzerSet::InstantiateAnalyzer(Tag tag,
|
|||
if ( ! a )
|
||||
{
|
||||
reporter->Error("Failed file analyzer %s instantiation for file id %s",
|
||||
file_mgr->GetAnalyzerName(tag), file->GetID().c_str());
|
||||
file_mgr->GetComponentName(tag), file->GetID().c_str());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -165,7 +165,7 @@ file_analysis::Analyzer* AnalyzerSet::InstantiateAnalyzer(Tag tag,
|
|||
void AnalyzerSet::Insert(file_analysis::Analyzer* a, HashKey* key)
|
||||
{
|
||||
DBG_LOG(DBG_FILE_ANALYSIS, "Add analyzer %s for file id %s",
|
||||
file_mgr->GetAnalyzerName(a->Tag()), file->GetID().c_str());
|
||||
file_mgr->GetComponentName(a->Tag()), file->GetID().c_str());
|
||||
analyzer_map.Insert(key, a);
|
||||
delete key;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue