Remove BroValUnion by hoisting underlying Val subclass values into subclasses

This commit is contained in:
Vern Paxson 2020-11-10 15:18:54 -08:00 committed by Tim Wojtulewicz
parent 49ca8e2163
commit 7f92a573d2
29 changed files with 632 additions and 512 deletions

View file

@ -263,7 +263,7 @@ refine connection KRB_Conn += {
rv->Assign(1, zeek::val_mgr->Bool(${msg.ap_options.mutual_required}));
auto rvticket = proc_ticket(${msg.ticket});
auto authenticationinfo = zeek_analyzer()->GetAuthenticationInfo(rvticket->GetField(2)->AsString(), rvticket->GetField(4)->AsString(), rvticket->GetField(3)->AsCount());
auto authenticationinfo = zeek_analyzer()->GetAuthenticationInfo(rvticket->GetStringField(2), rvticket->GetStringField(4), rvticket->GetCountField(3));
if ( authenticationinfo )
rvticket->Assign(5, authenticationinfo);

View file

@ -176,7 +176,7 @@ bool NFS_Interp::RPC_BuildReply(RPC_CallInfo* c, BifEnum::rpc_status rpc_status,
case BifEnum::NFS3::PROC_READ:
bro_uint_t offset;
offset = c->RequestVal()->AsRecordVal()->GetField(1)->AsCount();
offset = c->RequestVal()->AsRecordVal()->GetCountField(1);
reply = nfs3_read_reply(buf, n, nfs_status, offset);
event = nfs_proc_read;
break;

View file

@ -127,7 +127,7 @@ function get_contents_file%(cid: conn_id, direction: count%): file
auto cf = c->GetRootAnalyzer()->GetContentsFile(direction);
if ( cf )
return zeek::make_intrusive<zeek::Val>(std::move(cf));
return zeek::make_intrusive<zeek::FileVal>(std::move(cf));
}
// Return some sort of error value.
@ -136,5 +136,5 @@ function get_contents_file%(cid: conn_id, direction: count%): file
else
zeek::emit_builtin_error("no contents file for given direction");
return zeek::make_intrusive<zeek::Val>(zeek::make_intrusive<zeek::File>(stderr, "-", "w"));
return zeek::make_intrusive<zeek::FileVal>(zeek::make_intrusive<zeek::File>(stderr, "-", "w"));
%}