mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00
Move Type types to zeek namespace
This commit is contained in:
parent
4a1b39a2be
commit
ed13972924
120 changed files with 2094 additions and 1934 deletions
50
src/ID.cc
50
src/ID.cc
|
@ -19,24 +19,24 @@
|
|||
#include "zeekygen/ScriptInfo.h"
|
||||
#include "module_util.h"
|
||||
|
||||
IntrusivePtr<RecordType> zeek::id::conn_id;
|
||||
IntrusivePtr<RecordType> zeek::id::endpoint;
|
||||
IntrusivePtr<RecordType> zeek::id::connection;
|
||||
IntrusivePtr<RecordType> zeek::id::fa_file;
|
||||
IntrusivePtr<RecordType> zeek::id::fa_metadata;
|
||||
IntrusivePtr<EnumType> zeek::id::transport_proto;
|
||||
IntrusivePtr<TableType> zeek::id::string_set;
|
||||
IntrusivePtr<TableType> zeek::id::string_array;
|
||||
IntrusivePtr<TableType> zeek::id::count_set;
|
||||
IntrusivePtr<VectorType> zeek::id::string_vec;
|
||||
IntrusivePtr<VectorType> zeek::id::index_vec;
|
||||
IntrusivePtr<zeek::RecordType> zeek::id::conn_id;
|
||||
IntrusivePtr<zeek::RecordType> zeek::id::endpoint;
|
||||
IntrusivePtr<zeek::RecordType> zeek::id::connection;
|
||||
IntrusivePtr<zeek::RecordType> zeek::id::fa_file;
|
||||
IntrusivePtr<zeek::RecordType> zeek::id::fa_metadata;
|
||||
IntrusivePtr<zeek::EnumType> zeek::id::transport_proto;
|
||||
IntrusivePtr<zeek::TableType> zeek::id::string_set;
|
||||
IntrusivePtr<zeek::TableType> zeek::id::string_array;
|
||||
IntrusivePtr<zeek::TableType> zeek::id::count_set;
|
||||
IntrusivePtr<zeek::VectorType> zeek::id::string_vec;
|
||||
IntrusivePtr<zeek::VectorType> zeek::id::index_vec;
|
||||
|
||||
const IntrusivePtr<zeek::detail::ID>& zeek::id::find(std::string_view name)
|
||||
{
|
||||
return global_scope()->Find(name);
|
||||
}
|
||||
|
||||
const IntrusivePtr<BroType>& zeek::id::find_type(std::string_view name)
|
||||
const IntrusivePtr<zeek::BroType>& zeek::id::find_type(std::string_view name)
|
||||
{
|
||||
auto id = global_scope()->Find(name);
|
||||
|
||||
|
@ -89,17 +89,17 @@ IntrusivePtr<Func> zeek::id::find_func(std::string_view name)
|
|||
|
||||
void zeek::id::detail::init()
|
||||
{
|
||||
conn_id = zeek::id::find_type<RecordType>("conn_id");
|
||||
endpoint = zeek::id::find_type<RecordType>("endpoint");
|
||||
connection = zeek::id::find_type<RecordType>("connection");
|
||||
fa_file = zeek::id::find_type<RecordType>("fa_file");
|
||||
fa_metadata = zeek::id::find_type<RecordType>("fa_metadata");
|
||||
transport_proto = zeek::id::find_type<EnumType>("transport_proto");
|
||||
string_set = zeek::id::find_type<TableType>("string_set");
|
||||
string_array = zeek::id::find_type<TableType>("string_array");
|
||||
count_set = zeek::id::find_type<TableType>("count_set");
|
||||
string_vec = zeek::id::find_type<VectorType>("string_vec");
|
||||
index_vec = zeek::id::find_type<VectorType>("index_vec");
|
||||
conn_id = zeek::id::find_type<zeek::RecordType>("conn_id");
|
||||
endpoint = zeek::id::find_type<zeek::RecordType>("endpoint");
|
||||
connection = zeek::id::find_type<zeek::RecordType>("connection");
|
||||
fa_file = zeek::id::find_type<zeek::RecordType>("fa_file");
|
||||
fa_metadata = zeek::id::find_type<zeek::RecordType>("fa_metadata");
|
||||
transport_proto = zeek::id::find_type<zeek::EnumType>("transport_proto");
|
||||
string_set = zeek::id::find_type<zeek::TableType>("string_set");
|
||||
string_array = zeek::id::find_type<zeek::TableType>("string_array");
|
||||
count_set = zeek::id::find_type<zeek::TableType>("count_set");
|
||||
string_vec = zeek::id::find_type<zeek::VectorType>("string_vec");
|
||||
index_vec = zeek::id::find_type<zeek::VectorType>("index_vec");
|
||||
}
|
||||
|
||||
namespace zeek::detail {
|
||||
|
@ -133,7 +133,7 @@ std::string ID::ModuleName() const
|
|||
return extract_module_name(name);
|
||||
}
|
||||
|
||||
void ID::SetType(IntrusivePtr<BroType> t)
|
||||
void ID::SetType(IntrusivePtr<zeek::BroType> t)
|
||||
{
|
||||
type = std::move(t);
|
||||
}
|
||||
|
@ -267,7 +267,7 @@ void ID::UpdateValAttrs()
|
|||
if ( attr )
|
||||
{
|
||||
// Apply &log to all record fields.
|
||||
RecordType* rt = GetType()->AsRecordType();
|
||||
zeek::RecordType* rt = GetType()->AsRecordType();
|
||||
for ( int i = 0; i < rt->NumFields(); ++i )
|
||||
{
|
||||
TypeDecl* fd = rt->FieldDecl(i);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue