Store the ip header in the packet after processing, reuse other places

This commit is contained in:
Tim Wojtulewicz 2020-09-30 20:30:27 -07:00
parent 7d2c35174f
commit 665d0d9814
5 changed files with 51 additions and 58 deletions

View file

@ -88,11 +88,7 @@ public:
/**
* Destructor.
*/
~Packet()
{
if ( copy )
delete [] data;
}
~Packet();
/**
* (Re-)initialize from packet data.
@ -135,6 +131,9 @@ public:
[[deprecated("Remove in v4.1. Use ToRawPktHdrval() instead.")]]
RecordVal* BuildPktHdrVal() const;
// Wrapper to generate a packet-level weird. Has to be public for llanalyzers to use it.
void Weird(const char* name, const EncapsulationStack* encap = nullptr);
/**
* Maximal length of a layer 2 address.
*/
@ -227,9 +226,6 @@ public:
int gre_version = -1;
int gre_link_type = DLT_RAW;
// Wrapper to generate a packet-level weird. Has to be public for llanalyzers to use it.
void Weird(const char* name, const EncapsulationStack* encap = nullptr);
private:
// Renders an MAC address into its ASCII representation.
ValPtr FmtEUI48(const u_char* mac) const;