Move IntrusivePtr and utility methods to the zeek namespace

This commit is contained in:
Tim Wojtulewicz 2020-06-24 16:40:00 -04:00
parent 4668378d91
commit 9364e6a5b7
255 changed files with 3761 additions and 3730 deletions

View file

@ -260,10 +260,10 @@ bool Manager::SetReassemblyBuffer(const string& file_id, uint64_t max)
bool Manager::SetExtractionLimit(const string& file_id, RecordVal* args,
uint64_t n) const
{ return SetExtractionLimit(file_id, {NewRef{}, args}, n); }
{ return SetExtractionLimit(file_id, {zeek::NewRef{}, args}, n); }
bool Manager::SetExtractionLimit(const string& file_id,
IntrusivePtr<RecordVal> args, uint64_t n) const
zeek::IntrusivePtr<RecordVal> args, uint64_t n) const
{
File* file = LookupFile(file_id);
@ -275,10 +275,10 @@ bool Manager::SetExtractionLimit(const string& file_id,
bool Manager::AddAnalyzer(const string& file_id, const file_analysis::Tag& tag,
RecordVal* args) const
{ return AddAnalyzer(file_id, tag, {NewRef{}, args}); }
{ return AddAnalyzer(file_id, tag, {zeek::NewRef{}, args}); }
bool Manager::AddAnalyzer(const string& file_id, const file_analysis::Tag& tag,
IntrusivePtr<RecordVal> args) const
zeek::IntrusivePtr<RecordVal> args) const
{
File* file = LookupFile(file_id);
@ -290,10 +290,10 @@ bool Manager::AddAnalyzer(const string& file_id, const file_analysis::Tag& tag,
bool Manager::RemoveAnalyzer(const string& file_id, const file_analysis::Tag& tag,
RecordVal* args) const
{ return RemoveAnalyzer(file_id, tag, {NewRef{}, args}); }
{ return RemoveAnalyzer(file_id, tag, {zeek::NewRef{}, args}); }
bool Manager::RemoveAnalyzer(const string& file_id, const file_analysis::Tag& tag,
IntrusivePtr<RecordVal> args) const
zeek::IntrusivePtr<RecordVal> args) const
{
File* file = LookupFile(file_id);
@ -455,10 +455,10 @@ bool Manager::IsDisabled(const analyzer::Tag& tag)
}
Analyzer* Manager::InstantiateAnalyzer(const Tag& tag, RecordVal* args, File* f) const
{ return InstantiateAnalyzer(tag, {NewRef{}, args}, f); }
{ return InstantiateAnalyzer(tag, {zeek::NewRef{}, args}, f); }
Analyzer* Manager::InstantiateAnalyzer(const Tag& tag,
IntrusivePtr<RecordVal> args,
zeek::IntrusivePtr<RecordVal> args,
File* f) const
{
Component* c = Lookup(tag);
@ -517,22 +517,22 @@ string Manager::DetectMIME(const u_char* data, uint64_t len) const
return *(matches.begin()->second.begin());
}
IntrusivePtr<VectorVal> file_analysis::GenMIMEMatchesVal(const RuleMatcher::MIME_Matches& m)
zeek::IntrusivePtr<VectorVal> file_analysis::GenMIMEMatchesVal(const RuleMatcher::MIME_Matches& m)
{
static auto mime_matches = zeek::id::find_type<zeek::VectorType>("mime_matches");
static auto mime_match = zeek::id::find_type<zeek::RecordType>("mime_match");
auto rval = make_intrusive<VectorVal>(mime_matches);
auto rval = zeek::make_intrusive<VectorVal>(mime_matches);
for ( RuleMatcher::MIME_Matches::const_iterator it = m.begin();
it != m.end(); ++it )
{
auto element = make_intrusive<RecordVal>(mime_match);
auto element = zeek::make_intrusive<RecordVal>(mime_match);
for ( set<string>::const_iterator it2 = it->second.begin();
it2 != it->second.end(); ++it2 )
{
element->Assign(0, val_mgr->Int(it->first));
element->Assign(1, make_intrusive<StringVal>(*it2));
element->Assign(1, zeek::make_intrusive<StringVal>(*it2));
}
rval->Assign(rval->Size(), std::move(element));