mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 20:18:20 +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
|
@ -70,12 +70,12 @@ void AnalyzerTimer::Init(Analyzer* arg_analyzer, analyzer_timer_func arg_timer,
|
|||
Ref(analyzer->Conn());
|
||||
}
|
||||
|
||||
analyzer::ID Analyzer::id_counter = 0;;
|
||||
analyzer::ID Analyzer::id_counter = 0;
|
||||
|
||||
const char* Analyzer::GetAnalyzerName() const
|
||||
{
|
||||
assert(tag);
|
||||
return analyzer_mgr->GetAnalyzerName(tag);
|
||||
return analyzer_mgr->GetComponentName(tag);
|
||||
}
|
||||
|
||||
void Analyzer::SetAnalyzerTag(const Tag& arg_tag)
|
||||
|
@ -87,7 +87,7 @@ void Analyzer::SetAnalyzerTag(const Tag& arg_tag)
|
|||
bool Analyzer::IsAnalyzer(const char* name)
|
||||
{
|
||||
assert(tag);
|
||||
return strcmp(analyzer_mgr->GetAnalyzerName(tag), name) == 0;
|
||||
return strcmp(analyzer_mgr->GetComponentName(tag), name) == 0;
|
||||
}
|
||||
|
||||
// Used in debugging output.
|
||||
|
@ -98,7 +98,7 @@ static string fmt_analyzer(Analyzer* a)
|
|||
|
||||
Analyzer::Analyzer(const char* name, Connection* conn)
|
||||
{
|
||||
Tag tag = analyzer_mgr->GetAnalyzerTag(name);
|
||||
Tag tag = analyzer_mgr->GetComponentTag(name);
|
||||
|
||||
if ( ! tag )
|
||||
reporter->InternalError("unknown analyzer name %s; mismatch with tag analyzer::Component?", name);
|
||||
|
@ -494,7 +494,7 @@ Analyzer* Analyzer::FindChild(Tag arg_tag)
|
|||
|
||||
Analyzer* Analyzer::FindChild(const char* name)
|
||||
{
|
||||
Tag tag = analyzer_mgr->GetAnalyzerTag(name);
|
||||
Tag tag = analyzer_mgr->GetComponentTag(name);
|
||||
return tag ? FindChild(tag) : 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue