mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00

These two are almost always used in conjunction with each other, and TaggedComponent is never used by itself. Combining them together into a single class will help simplify some of the code around managing the mapping between Tags and Components.
31 lines
738 B
C++
31 lines
738 B
C++
// See the file "COPYING" in the main distribution directory for copyright.
|
|
|
|
#include "zeek/packet_analysis/Component.h"
|
|
|
|
#include "zeek/Desc.h"
|
|
#include "zeek/packet_analysis/Manager.h"
|
|
|
|
using namespace zeek::packet_analysis;
|
|
|
|
Component::Component(const std::string& name, factory_callback arg_factory,
|
|
Tag::subtype_t arg_subtype)
|
|
: plugin::Component(plugin::component::PACKET_ANALYZER, name, arg_subtype,
|
|
packet_mgr->GetTagType())
|
|
{
|
|
factory = arg_factory;
|
|
}
|
|
|
|
void Component::Initialize()
|
|
{
|
|
InitializeTag();
|
|
packet_mgr->RegisterComponent(this, "ANALYZER_");
|
|
}
|
|
|
|
void Component::DoDescribe(ODesc* d) const
|
|
{
|
|
if ( factory )
|
|
{
|
|
d->Add("ANALYZER_");
|
|
d->Add(CanonicalName());
|
|
}
|
|
}
|