pub struct RadioTapLayer {
pub index: LayerIndex,
}Expand description
RadioTap layer - a zero-copy view into the RadioTap header.
The RadioTap header has a variable length indicated by the it_len field.
Present fields are indicated by a bitmask in it_present.
Fields§
§index: LayerIndexImplementations§
Source§impl RadioTapLayer
impl RadioTapLayer
Sourcepub fn new(start: usize, end: usize) -> Self
pub fn new(start: usize, end: usize) -> Self
Create a new RadioTapLayer from start/end offsets.
Sourcepub fn validate(buf: &[u8], offset: usize) -> Result<(), FieldError>
pub fn validate(buf: &[u8], offset: usize) -> Result<(), FieldError>
Validate the buffer has enough data for a RadioTap header.
Sourcepub fn header_length(&self, buf: &[u8]) -> Result<u16, FieldError>
pub fn header_length(&self, buf: &[u8]) -> Result<u16, FieldError>
Total header length (little-endian u16).
Sourcepub fn present(&self, buf: &[u8]) -> Result<u32, FieldError>
pub fn present(&self, buf: &[u8]) -> Result<u32, FieldError>
Present flags bitmask (little-endian u32).
Sourcepub fn has_field(&self, buf: &[u8], bit: u32) -> bool
pub fn has_field(&self, buf: &[u8], bit: u32) -> bool
Check if a specific present field bit is set.
Sourcepub fn has_fcs(&self, buf: &[u8]) -> bool
pub fn has_fcs(&self, buf: &[u8]) -> bool
Check if the FCS flag is set (indicating the payload includes FCS).
Sourcepub fn parse_fields(&self, buf: &[u8]) -> Result<RadioTapFields, FieldError>
pub fn parse_fields(&self, buf: &[u8]) -> Result<RadioTapFields, FieldError>
Parse all present fields from the RadioTap header.
Trait Implementations§
Source§impl Clone for RadioTapLayer
impl Clone for RadioTapLayer
Source§fn clone(&self) -> RadioTapLayer
fn clone(&self) -> RadioTapLayer
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 RadioTapLayer
impl Debug for RadioTapLayer
Source§impl Layer for RadioTapLayer
impl Layer for RadioTapLayer
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 RadioTapLayer
impl RefUnwindSafe for RadioTapLayer
impl Send for RadioTapLayer
impl Sync for RadioTapLayer
impl Unpin for RadioTapLayer
impl UnsafeUnpin for RadioTapLayer
impl UnwindSafe for RadioTapLayer
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