pub struct Dot3Layer {
pub index: LayerIndex,
}Expand description
IEEE 802.3 frame (uses length field instead of EtherType)
Fields§
§index: LayerIndexImplementations§
Source§impl Dot3Layer
impl Dot3Layer
pub const fn new(start: usize, end: usize) -> Self
pub const fn at_start() -> Self
pub const fn at_offset(offset: usize) -> Self
pub fn validate(buf: &[u8], offset: usize) -> Result<(), FieldError>
pub fn dst(&self, buf: &[u8]) -> Result<MacAddress, FieldError>
pub fn src(&self, buf: &[u8]) -> Result<MacAddress, FieldError>
pub fn set_dst(&self, buf: &mut [u8], mac: MacAddress) -> Result<(), FieldError>
pub fn set_src(&self, buf: &mut [u8], mac: MacAddress) -> Result<(), FieldError>
pub fn set_len(&self, buf: &mut [u8], len: u16) -> Result<(), FieldError>
Sourcepub fn extract_padding<'a>(&self, buf: &'a [u8]) -> (&'a [u8], &'a [u8])
pub fn extract_padding<'a>(&self, buf: &'a [u8]) -> (&'a [u8], &'a [u8])
Extract padding based on length field
Sourcepub fn answers(
&self,
_buf: &[u8],
_other: &Dot3Layer,
_other_buf: &[u8],
) -> bool
pub fn answers( &self, _buf: &[u8], _other: &Dot3Layer, _other_buf: &[u8], ) -> bool
Check if this answers another packet
pub fn summary(&self, buf: &[u8]) -> String
pub fn get_field( &self, buf: &[u8], name: &str, ) -> Option<Result<FieldValue, FieldError>>
pub fn set_field( &self, buf: &mut [u8], name: &str, value: FieldValue, ) -> Option<Result<(), FieldError>>
pub fn field_names() -> &'static [&'static str]
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Dot3Layer
impl RefUnwindSafe for Dot3Layer
impl Send for Dot3Layer
impl Sync for Dot3Layer
impl Unpin for Dot3Layer
impl UnsafeUnpin for Dot3Layer
impl UnwindSafe for Dot3Layer
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