mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 07:08:19 +00:00
Remove now-unused Packet::l2_valid field
This commit is contained in:
parent
b3eb63c48a
commit
04dbc8e8be
3 changed files with 8 additions and 27 deletions
|
@ -55,7 +55,6 @@ void Packet::Init(int arg_link_type, pkt_timeval *arg_ts, uint32_t arg_caplen,
|
|||
|
||||
l2_src = nullptr;
|
||||
l2_dst = nullptr;
|
||||
l2_valid = false;
|
||||
l2_checksummed = false;
|
||||
|
||||
l3_proto = L3_UNKNOWN;
|
||||
|
@ -68,13 +67,6 @@ void Packet::Init(int arg_link_type, pkt_timeval *arg_ts, uint32_t arg_caplen,
|
|||
tunnel_type = BifEnum::Tunnel::IP;
|
||||
gre_version = -1;
|
||||
gre_link_type = DLT_RAW;
|
||||
|
||||
if ( data )
|
||||
{
|
||||
// From here we assume that layer 2 is valid. If the packet analysis fails,
|
||||
// the packet manager will invalidate the packet.
|
||||
l2_valid = true;
|
||||
}
|
||||
}
|
||||
|
||||
Packet::~Packet()
|
||||
|
|
|
@ -147,47 +147,36 @@ public:
|
|||
uint32_t cap_len; /// Captured packet length
|
||||
uint32_t link_type; /// pcap link_type (DLT_EN10MB, DLT_RAW, etc)
|
||||
|
||||
// These are computed from Layer 2 data. These fields are only valid if
|
||||
// l2_valid returns true.
|
||||
|
||||
/**
|
||||
* Layer 3 protocol identified (if any). Valid iff l2_valid is true.
|
||||
* Layer 3 protocol identified (if any).
|
||||
*/
|
||||
Layer3Proto l3_proto;
|
||||
|
||||
/**
|
||||
* If layer 2 is Ethernet, innermost ethertype field. Valid iff
|
||||
* l2_valid is true.
|
||||
* If layer 2 is Ethernet, innermost ethertype field.
|
||||
*/
|
||||
uint32_t eth_type;
|
||||
|
||||
/**
|
||||
* Layer 2 source address. Valid iff l2_valid is true.
|
||||
* Layer 2 source address.
|
||||
*/
|
||||
const u_char* l2_src = nullptr;
|
||||
|
||||
/**
|
||||
* Layer 2 destination address. Valid iff l2_valid is true.
|
||||
* Layer 2 destination address.
|
||||
*/
|
||||
const u_char* l2_dst = nullptr;
|
||||
|
||||
/**
|
||||
* (Outermost) VLAN tag if any, else 0. Valid iff l2_valid is true.
|
||||
* (Outermost) VLAN tag if any, else 0.
|
||||
*/
|
||||
uint32_t vlan;
|
||||
|
||||
/**
|
||||
* (Innermost) VLAN tag if any, else 0. Valid iff l2_valid is true.
|
||||
* (Innermost) VLAN tag if any, else 0.
|
||||
*/
|
||||
uint32_t inner_vlan;
|
||||
|
||||
/**
|
||||
* True if L2 processing succeeded. If data is set on initialization of
|
||||
* the packet, L2 is assumed to be valid. The packet manager will then
|
||||
* process the packet and set l2_valid to False if the analysis failed.
|
||||
*/
|
||||
bool l2_valid;
|
||||
|
||||
/**
|
||||
* Indicates whether the layer 2 checksum was validated by the
|
||||
* hardware/kernel before being received by zeek.
|
||||
|
|
|
@ -101,8 +101,8 @@ void Manager::ProcessPacket(Packet* packet)
|
|||
}
|
||||
|
||||
// Start packet analysis
|
||||
packet->l2_valid = root_analyzer->ForwardPacket(packet->cap_len, packet->data,
|
||||
packet, packet->link_type);
|
||||
root_analyzer->ForwardPacket(packet->cap_len, packet->data,
|
||||
packet, packet->link_type);
|
||||
|
||||
if ( raw_packet )
|
||||
event_mgr.Enqueue(raw_packet, packet->ToRawPktHdrVal());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue