mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 19:48:20 +00:00
Merge remote-tracking branch 'origin/topic/jsiwek/faf-cleanup'
Closes #1002. * origin/topic/jsiwek/faf-cleanup: Move file analyzers to new plugin infrastructure. Add a general file analysis overview/how-to document. Improve file analysis doxygen comments. Improve tracking of HTTP file extraction (addresses #988). Fix HTTP multipart body file analysis. Remove logging of analyzers field of FileAnalysis::Info. Remove extraction counter in default file extraction scripts. Remove FileAnalysis::postpone_timeout. Make default get_file_handle handlers &priority=5. Add input interface to forward data for file analysis. File analysis framework interface simplifications.
This commit is contained in:
commit
d8b05af7e5
127 changed files with 2458 additions and 1412 deletions
69
src/file_analysis/Component.cc
Normal file
69
src/file_analysis/Component.cc
Normal file
|
@ -0,0 +1,69 @@
|
|||
// See the file "COPYING" in the main distribution directory for copyright.
|
||||
|
||||
#include "Component.h"
|
||||
#include "Manager.h"
|
||||
|
||||
#include "../Desc.h"
|
||||
#include "../util.h"
|
||||
|
||||
using namespace file_analysis;
|
||||
|
||||
analyzer::Tag::type_t Component::type_counter = 0;
|
||||
|
||||
Component::Component(const char* arg_name, factory_callback arg_factory,
|
||||
analyzer::Tag::subtype_t arg_subtype)
|
||||
: plugin::Component(plugin::component::FILE_ANALYZER)
|
||||
{
|
||||
name = copy_string(arg_name);
|
||||
canon_name = canonify_name(arg_name);
|
||||
factory = arg_factory;
|
||||
|
||||
tag = analyzer::Tag(++type_counter, arg_subtype);
|
||||
}
|
||||
|
||||
Component::Component(const Component& other)
|
||||
: plugin::Component(Type())
|
||||
{
|
||||
name = copy_string(other.name);
|
||||
canon_name = copy_string(other.canon_name);
|
||||
factory = other.factory;
|
||||
tag = other.tag;
|
||||
}
|
||||
|
||||
Component::~Component()
|
||||
{
|
||||
delete [] name;
|
||||
delete [] canon_name;
|
||||
}
|
||||
|
||||
analyzer::Tag Component::Tag() const
|
||||
{
|
||||
return tag;
|
||||
}
|
||||
|
||||
void Component::Describe(ODesc* d)
|
||||
{
|
||||
plugin::Component::Describe(d);
|
||||
d->Add(name);
|
||||
d->Add(" (");
|
||||
|
||||
if ( factory )
|
||||
{
|
||||
d->Add("ANALYZER_");
|
||||
d->Add(canon_name);
|
||||
}
|
||||
|
||||
d->Add(")");
|
||||
}
|
||||
|
||||
Component& Component::operator=(const Component& other)
|
||||
{
|
||||
if ( &other != this )
|
||||
{
|
||||
name = copy_string(other.name);
|
||||
factory = other.factory;
|
||||
tag = other.tag;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue