Deprecate internal_type(), replace with zeek::lookup_type()

This commit is contained in:
Jon Siwek 2020-05-08 17:44:20 -07:00
parent 32b895f4ba
commit ac06259eec
44 changed files with 218 additions and 182 deletions

View file

@ -34,7 +34,7 @@
#include "Conn.h"
#include "Reporter.h"
#include "IPAddr.h"
#include "Var.h" // for internal_type()
#include "Var.h"
#include "broker/Data.h"
@ -417,7 +417,7 @@ IntrusivePtr<TableVal> Val::GetRecordFields()
if ( t->Tag() != TYPE_RECORD && t->Tag() != TYPE_TYPE )
{
reporter->Error("non-record value/type passed to record_fields");
return make_intrusive<TableVal>(IntrusivePtr{NewRef{}, internal_type("record_field_table")->AsTableType()});
return make_intrusive<TableVal>(zeek::lookup_type<TableType>("record_field_table"));
}
RecordType* rt = nullptr;
@ -435,7 +435,7 @@ IntrusivePtr<TableVal> Val::GetRecordFields()
if ( t->Tag() != TYPE_RECORD )
{
reporter->Error("non-record value/type passed to record_fields");
return make_intrusive<TableVal>(IntrusivePtr{NewRef{}, internal_type("record_field_table")->AsTableType()});
return make_intrusive<TableVal>(zeek::lookup_type<TableType>("record_field_table"));
}
rt = t->AsRecordType();
@ -1933,7 +1933,7 @@ IntrusivePtr<VectorVal> TableVal::LookupSubnets(const SubNetVal* search)
if ( ! subnets )
reporter->InternalError("LookupSubnets called on wrong table type");
auto result = make_intrusive<VectorVal>(internal_type("subnet_vec")->AsVectorType());
auto result = make_intrusive<VectorVal>(zeek::lookup_type("subnet_vec")->AsVectorType());
auto matches = subnets->FindAll(search);
for ( auto element : matches )