1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//! A Linux cooked-mode capture (LINKTYPE_LINUX_SLL) packet abstraction.

use alloc::vec::Vec;

use super::ethernet::EtherType;
use xenet_macro::packet;
use xenet_macro_helper::types::*;

/// Represents an SLL packet (LINKTYPE_LINUX_SLL).
#[packet]
pub struct SLL {
    #[construct_with(u16)]
    pub packet_type: u16be,
    #[construct_with(u16)]
    pub link_layer_address_type: u16be,
    #[construct_with(u16)]
    pub link_layer_address_len: u16be,
    #[construct_with(u8, u8, u8, u8, u8, u8, u8, u8)]
    #[length = "8"]
    pub link_layer_address: Vec<u8>,
    #[construct_with(u16)]
    pub protocol: EtherType,
    #[payload]
    pub payload: Vec<u8>,
}