Switch zeek:🆔:lookup to zeek:🆔:find

For parity with Scope since it now uses Find instead of Lookup
This commit is contained in:
Jon Siwek 2020-05-14 18:00:18 -07:00
parent 7843416e51
commit 4debad8caf
59 changed files with 339 additions and 339 deletions

View file

@ -431,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::id::lookup_const("Files::disable")->AsTableVal();
disabled = zeek::id::find_const("Files::disable")->AsTableVal();
auto index = val_mgr->Count(bool(tag));
auto yield = disabled->Lookup(index.get());
@ -498,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::id::lookup_type<VectorType>("mime_matches");
static auto mime_match = zeek::id::lookup_type<RecordType>("mime_match");
static auto mime_matches = zeek::id::find_type<VectorType>("mime_matches");
static auto mime_match = zeek::id::find_type<RecordType>("mime_match");
auto rval = make_intrusive<VectorVal>(mime_matches);
for ( RuleMatcher::MIME_Matches::const_iterator it = m.begin();

View file

@ -60,7 +60,7 @@ void Entropy::Finalize()
montepi = scc = ent = mean = chisq = 0.0;
entropy->Get(&ent, &chisq, &mean, &montepi, &scc);
static auto entropy_test_result = zeek::id::lookup_type<RecordType>("entropy_test_result");
static auto entropy_test_result = zeek::id::find_type<RecordType>("entropy_test_result");
auto ent_result = make_intrusive<RecordVal>(entropy_test_result);
ent_result->Assign(0, make_intrusive<Val>(ent, TYPE_DOUBLE));
ent_result->Assign(1, make_intrusive<Val>(chisq, TYPE_DOUBLE));

View file

@ -634,7 +634,7 @@ void file_analysis::OCSP::ParseResponse(OCSP_RESPONSE *resp)
//ocsp_resp_record->Assign(7, make_intrusive<StringVal>(len, buf));
//BIO_reset(bio);
certs_vector = new VectorVal(zeek::id::lookup_type<VectorType>("x509_opaque_vector"));
certs_vector = new VectorVal(zeek::id::find_type<VectorType>("x509_opaque_vector"));
vl.emplace_back(AdoptRef{}, certs_vector);
#if ( OPENSSL_VERSION_NUMBER < 0x10100000L ) || defined(LIBRESSL_VERSION_NUMBER)

View file

@ -391,7 +391,7 @@ void file_analysis::X509::ParseSAN(X509_EXTENSION* ext)
else if ( gen->type == GEN_IPADD )
{
if ( ips == nullptr )
ips = new VectorVal(zeek::id::lookup_type<VectorType>("addr_vec"));
ips = new VectorVal(zeek::id::find_type<VectorType>("addr_vec"));
uint32_t* addr = (uint32_t*) gen->d.ip->data;

View file

@ -556,7 +556,7 @@ function x509_verify%(certs: x509_opaque_vector, root_certs: table_string_of_str
}
int num_certs = sk_X509_num(chain);
chainVector = new VectorVal(zeek::id::lookup_type<VectorType>("x509_opaque_vector"));
chainVector = new VectorVal(zeek::id::find_type<VectorType>("x509_opaque_vector"));
for ( int i = 0; i < num_certs; i++ )
{