mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00
Store packet's ip header as unique_ptr
This commit is contained in:
parent
2000f89b12
commit
ecd970ffde
13 changed files with 86 additions and 92 deletions
|
@ -63,8 +63,7 @@ void Packet::Init(int arg_link_type, pkt_timeval *arg_ts, uint32_t arg_caplen,
|
|||
l3_checksummed = false;
|
||||
|
||||
encap.reset();
|
||||
delete ip_hdr;
|
||||
ip_hdr = nullptr;
|
||||
ip_hdr.reset();
|
||||
|
||||
proto = -1;
|
||||
tunnel_type = BifEnum::Tunnel::IP;
|
||||
|
@ -83,8 +82,6 @@ Packet::~Packet()
|
|||
{
|
||||
if ( copy )
|
||||
delete [] data;
|
||||
|
||||
delete ip_hdr;
|
||||
}
|
||||
|
||||
const IP_Hdr Packet::IP() const
|
||||
|
|
|
@ -16,11 +16,11 @@ typedef struct timeval pkt_timeval;
|
|||
#include "pcap.h" // For DLT_ constants
|
||||
#include "zeek/NetVar.h" // For BifEnum::Tunnel
|
||||
#include "zeek/TunnelEncapsulation.h"
|
||||
#include "zeek/IP.h"
|
||||
|
||||
ZEEK_FORWARD_DECLARE_NAMESPACED(ODesc, zeek);
|
||||
ZEEK_FORWARD_DECLARE_NAMESPACED(Val, zeek);
|
||||
ZEEK_FORWARD_DECLARE_NAMESPACED(RecordVal, zeek);
|
||||
ZEEK_FORWARD_DECLARE_NAMESPACED(IP_Hdr, zeek);
|
||||
|
||||
namespace zeek {
|
||||
|
||||
|
@ -231,7 +231,7 @@ public:
|
|||
* The IP header for this packet. This is filled in by the IP analyzer
|
||||
* during processing if the packet contains an IP header.
|
||||
*/
|
||||
IP_Hdr* ip_hdr = nullptr;
|
||||
std::unique_ptr<IP_Hdr> ip_hdr = nullptr;
|
||||
|
||||
/**
|
||||
* The protocol of the packet. This is used by the tunnel analyzers to
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue