pub struct Dot11FcsLayer {
pub index: LayerIndex,
}Expand description
IEEE 802.11 FCS layer - same as Dot11Layer but includes a 4-byte FCS trailer.
Fields§
§index: LayerIndexImplementations§
Source§impl Dot11FcsLayer
impl Dot11FcsLayer
Sourcepub fn new(start: usize, end: usize) -> Self
pub fn new(start: usize, end: usize) -> Self
Create a new Dot11FcsLayer from start/end offsets.
Sourcepub fn dot11(&self) -> Dot11Layer
pub fn dot11(&self) -> Dot11Layer
Get the inner Dot11Layer view (excluding FCS).
Sourcepub fn fcs(&self, buf: &[u8]) -> Result<u32, FieldError>
pub fn fcs(&self, buf: &[u8]) -> Result<u32, FieldError>
Read the FCS field (4 bytes at end of frame, little-endian).
Sourcepub fn compute_fcs(data: &[u8]) -> u32
pub fn compute_fcs(data: &[u8]) -> u32
Compute the CRC32 FCS for the frame data (excluding the FCS itself).
Sourcepub fn verify_fcs(&self, buf: &[u8]) -> Result<bool, FieldError>
pub fn verify_fcs(&self, buf: &[u8]) -> Result<bool, FieldError>
Verify that the FCS matches the frame data.
Sourcepub fn frame_type(&self, buf: &[u8]) -> Result<u8, FieldError>
pub fn frame_type(&self, buf: &[u8]) -> Result<u8, FieldError>
Delegate field access to the inner Dot11Layer.
pub fn subtype(&self, buf: &[u8]) -> Result<u8, FieldError>
pub fn flags(&self, buf: &[u8]) -> Result<u8, FieldError>
pub fn addr1(&self, buf: &[u8]) -> Result<MacAddress, FieldError>
pub fn addr2(&self, buf: &[u8]) -> Result<MacAddress, FieldError>
pub fn addr3(&self, buf: &[u8]) -> Result<MacAddress, FieldError>
pub fn duration(&self, buf: &[u8]) -> Result<u16, FieldError>
Trait Implementations§
Source§impl Clone for Dot11FcsLayer
impl Clone for Dot11FcsLayer
Source§fn clone(&self) -> Dot11FcsLayer
fn clone(&self) -> Dot11FcsLayer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Dot11FcsLayer
impl Debug for Dot11FcsLayer
Source§impl Layer for Dot11FcsLayer
impl Layer for Dot11FcsLayer
Source§fn header_len(&self, buf: &[u8]) -> usize
fn header_len(&self, buf: &[u8]) -> usize
Get the header length for this layer
Source§fn field_names(&self) -> &'static [&'static str]
fn field_names(&self) -> &'static [&'static str]
Get the list of field names for this layer
Auto Trait Implementations§
impl Freeze for Dot11FcsLayer
impl RefUnwindSafe for Dot11FcsLayer
impl Send for Dot11FcsLayer
impl Sync for Dot11FcsLayer
impl Unpin for Dot11FcsLayer
impl UnsafeUnpin for Dot11FcsLayer
impl UnwindSafe for Dot11FcsLayer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more