Deprecate various IP/packet header Val-building methods

And supply new alternatives that use IntrusivePtr
This commit is contained in:
Jon Siwek 2020-05-04 23:16:24 -07:00
parent 457454bb80
commit 61649d5da7
11 changed files with 107 additions and 55 deletions

View file

@ -39,7 +39,7 @@ bool Discarder::NextPacket(const IP_Hdr* ip, int len, int caplen)
if ( check_ip )
{
zeek::Args args{{AdoptRef{}, ip->BuildPktHdrVal()}};
zeek::Args args{ip->ToPktHdrVal()};
try
{
@ -92,7 +92,7 @@ bool Discarder::NextPacket(const IP_Hdr* ip, int len, int caplen)
int th_len = tp->th_off * 4;
zeek::Args args{
{AdoptRef{}, ip->BuildPktHdrVal()},
ip->ToPktHdrVal(),
{AdoptRef{}, BuildData(data, th_len, len, caplen)},
};
@ -116,7 +116,7 @@ bool Discarder::NextPacket(const IP_Hdr* ip, int len, int caplen)
int uh_len = sizeof (struct udphdr);
zeek::Args args{
{AdoptRef{}, ip->BuildPktHdrVal()},
ip->ToPktHdrVal(),
{AdoptRef{}, BuildData(data, uh_len, len, caplen)},
};
@ -138,7 +138,7 @@ bool Discarder::NextPacket(const IP_Hdr* ip, int len, int caplen)
{
const struct icmp* ih = (const struct icmp*) data;
zeek::Args args{{AdoptRef{}, ip->BuildPktHdrVal()}};
zeek::Args args{ip->ToPktHdrVal()};
try
{