mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 13:08:20 +00:00
GH-1186: Remove Packet::hdr_size and uses of it.
This change also removes Packet::IP(), since Packet now contains an ip_hdr member that points at the IP header if it exists.
This commit is contained in:
parent
8337b4cf2d
commit
b3eb63c48a
10 changed files with 36 additions and 69 deletions
|
@ -49,7 +49,6 @@ void Packet::Init(int arg_link_type, pkt_timeval *arg_ts, uint32_t arg_caplen,
|
|||
dump_packet = false;
|
||||
|
||||
time = ts.tv_sec + double(ts.tv_usec) / 1e6;
|
||||
hdr_size = 0;
|
||||
eth_type = 0;
|
||||
vlan = 0;
|
||||
inner_vlan = 0;
|
||||
|
@ -84,11 +83,6 @@ Packet::~Packet()
|
|||
delete [] data;
|
||||
}
|
||||
|
||||
const IP_Hdr Packet::IP() const
|
||||
{
|
||||
return IP_Hdr((struct ip *) (data + hdr_size), false);
|
||||
}
|
||||
|
||||
void Packet::Weird(const char* name)
|
||||
{
|
||||
sessions->Weird(name, this);
|
||||
|
|
|
@ -114,12 +114,6 @@ public:
|
|||
uint32_t len, const u_char *data, bool copy = false,
|
||||
std::string tag = "");
|
||||
|
||||
/**
|
||||
* Interprets the Layer 3 of the packet as IP and returns a
|
||||
* corresponding object.
|
||||
*/
|
||||
const IP_Hdr IP() const;
|
||||
|
||||
/**
|
||||
* Returns a \c raw_pkt_hdr RecordVal, which includes layer 2 and
|
||||
* also everything in IP_Hdr (i.e., IP4/6 + TCP/UDP/ICMP).
|
||||
|
@ -156,11 +150,6 @@ public:
|
|||
// These are computed from Layer 2 data. These fields are only valid if
|
||||
// l2_valid returns true.
|
||||
|
||||
/**
|
||||
* Layer 2 header size. Valid iff l2_valid is true.
|
||||
*/
|
||||
uint32_t hdr_size;
|
||||
|
||||
/**
|
||||
* Layer 3 protocol identified (if any). Valid iff l2_valid is true.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue