Move various elements into ID.h and zeek::id namespace

* A handful of generic/useful/common global type pointers that used
  to be in NetVar.h

* Lookup functions that used to be Var.h
This commit is contained in:
Jon Siwek 2020-05-12 18:08:52 -07:00
parent 9210d443d3
commit a5762c12cc
84 changed files with 578 additions and 568 deletions

View file

@ -3,7 +3,6 @@
#include "Manager.h"
#include "File.h"
#include "Analyzer.h"
#include "Var.h"
#include "Event.h"
#include "UID.h"
#include "digest.h"
@ -432,7 +431,7 @@ string Manager::GetFileID(const analyzer::Tag& tag, Connection* c, bool is_orig)
bool Manager::IsDisabled(const analyzer::Tag& tag)
{
if ( ! disabled )
disabled = zeek::lookup_const("Files::disable")->AsTableVal();
disabled = zeek::id::lookup_const("Files::disable")->AsTableVal();
auto index = val_mgr->Count(bool(tag));
auto yield = disabled->Lookup(index.get());
@ -499,8 +498,8 @@ string Manager::DetectMIME(const u_char* data, uint64_t len) const
IntrusivePtr<VectorVal> file_analysis::GenMIMEMatchesVal(const RuleMatcher::MIME_Matches& m)
{
static auto mime_matches = zeek::lookup_type<VectorType>("mime_matches");
static auto mime_match = zeek::lookup_type<RecordType>("mime_match");
static auto mime_matches = zeek::id::lookup_type<VectorType>("mime_matches");
static auto mime_match = zeek::id::lookup_type<RecordType>("mime_match");
auto rval = make_intrusive<VectorVal>(mime_matches);
for ( RuleMatcher::MIME_Matches::const_iterator it = m.begin();