pnet_packet/
sll.rs

1//! A Linux cooked-mode capture (LINKTYPE_LINUX_SLL) packet abstraction.
2
3use alloc::vec::Vec;
4
5use super::ethernet::EtherType;
6use pnet_macros::packet;
7use pnet_macros_support::types::*;
8
9// ref: https://wiki.wireshark.org/SLL
10// ref: https://www.tcpdump.org/linktypes/LINKTYPE_LINUX_SLL.html
11
12/// Represents an SLL packet (LINKTYPE_LINUX_SLL).
13#[packet]
14pub struct SLL {
15	#[construct_with(u16)]
16	pub packet_type: u16be,
17	#[construct_with(u16)]
18	pub link_layer_address_type: u16be,
19	#[construct_with(u16)]
20	pub link_layer_address_len: u16be,
21	#[construct_with(u8, u8, u8, u8, u8, u8, u8, u8)]
22	#[length = "8"]
23	pub link_layer_address: Vec<u8>,
24	#[construct_with(u16)]
25	pub protocol: EtherType,
26	#[payload]
27	pub payload: Vec<u8>,
28}