xenet_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 xenet_macro::packet;
7use xenet_macro_helper::types::*;
8
9/// Represents an SLL packet (LINKTYPE_LINUX_SLL).
10#[packet]
11pub struct SLL {
12    #[construct_with(u16)]
13    pub packet_type: u16be,
14    #[construct_with(u16)]
15    pub link_layer_address_type: u16be,
16    #[construct_with(u16)]
17    pub link_layer_address_len: u16be,
18    #[construct_with(u8, u8, u8, u8, u8, u8, u8, u8)]
19    #[length = "8"]
20    pub link_layer_address: Vec<u8>,
21    #[construct_with(u16)]
22    pub protocol: EtherType,
23    #[payload]
24    pub payload: Vec<u8>,
25}