pub struct HeaderDigest {
pub frame_control: u16,
pub addr1: [u8; 6],
pub addr2: [u8; 6],
pub addr3: [u8; 6],
pub seq_ctrl: u16,
}Expand description
The fixed part of the measured MPDU’s MAC header: enough to drop retries, tell uplink from downlink and attribute the frame to a transmitter.
Fields§
§frame_control: u16Frame control field.
addr1: [u8; 6]Receiver address.
addr2: [u8; 6]Transmitter address.
addr3: [u8; 6]Third address (BSSID, or source/destination depending on To/From DS).
seq_ctrl: u16Sequence control field.
Implementations§
Source§impl HeaderDigest
impl HeaderDigest
Sourcepub const HEADER_LEN: usize = 24
pub const HEADER_LEN: usize = 24
Length of the header prefix the digest is read from: FC, duration, three addresses and sequence control.
Sourcepub fn parse(hdr: &[u8]) -> Option<Self>
pub fn parse(hdr: &[u8]) -> Option<Self>
Parse the first Self::HEADER_LEN bytes of an 802.11 MAC header. None if hdr is
shorter, or the frame type carries no transmitter address (ACK, CTS).
Sourcepub const fn frame_type(&self) -> u8
pub const fn frame_type(&self) -> u8
Frame type (bits 2..4 of frame control): 0 management, 1 control, 2 data.
Sourcepub const fn is_retry(&self) -> bool
pub const fn is_retry(&self) -> bool
Whether the Retry bit is set: the MPDU is a retransmission.
Sourcepub const fn has_transmitter(&self) -> bool
pub const fn has_transmitter(&self) -> bool
Whether the frame carries a transmitter address. ACK and CTS carry only a receiver.
Sourcepub const fn sequence_number(&self) -> u16
pub const fn sequence_number(&self) -> u16
The 12-bit sequence number.