mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
Add component API to transparently remap one component to another one.
When a specific component is requested through its tag or name, one can now have the component manager transparently return a different one that has been registered to replace the original one. We limit this to disabled components to avoid unnecessary confusion. That also means that remappings are currently only supported for analyzers (because other types of components cannot be disabled for now, per the previous change).
This commit is contained in:
parent
ac1a7508ee
commit
5d0c61e68b
7 changed files with 123 additions and 32 deletions
|
@ -82,14 +82,14 @@ AnalyzerPtr Manager::GetAnalyzer(const std::string& name) {
|
|||
}
|
||||
|
||||
bool Manager::EnableAnalyzer(EnumVal* tag) {
|
||||
Component* c = Lookup(tag);
|
||||
Component* c = Lookup(tag, false);
|
||||
c->SetEnabled(true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Manager::DisableAnalyzer(EnumVal* tag) {
|
||||
Component* c = Lookup(tag);
|
||||
Component* c = Lookup(tag, false);
|
||||
c->SetEnabled(false);
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue