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

@ -107,7 +107,7 @@ static RecordVal* build_syn_packet_val(bool is_orig, const IP_Hdr* ip,
options += opt_len;
}
static auto SYN_packet = zeek::lookup_type<RecordType>("SYN_packet");
static auto SYN_packet = zeek::id::lookup_type<RecordType>("SYN_packet");
RecordVal* v = new RecordVal(SYN_packet);
v->Assign(0, val_mgr->Bool(is_orig));
@ -1422,7 +1422,7 @@ int TCP_Analyzer::ParseTCPOptions(const struct tcphdr* tcp, bool is_orig)
{
auto p = reinterpret_cast<const uint32_t*>(o + 2);
auto num_pointers = (length - 2) / 4;
auto vt = zeek::vars::index_vec;
auto vt = zeek::id::index_vec;
auto sack = make_intrusive<VectorVal>(std::move(vt));
for ( auto i = 0; i < num_pointers; ++i )
@ -2078,7 +2078,7 @@ bool TCPStats_Endpoint::DataSent(double /* t */, uint64_t seq, int len, int capl
RecordVal* TCPStats_Endpoint::BuildStats()
{
static auto endpoint_stats = zeek::lookup_type<RecordType>("endpoint_stats");
static auto endpoint_stats = zeek::id::lookup_type<RecordType>("endpoint_stats");
RecordVal* stats = new RecordVal(endpoint_stats);
stats->Assign(0, val_mgr->Count(num_pkts));