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§
Source§impl LayerDispatch for Dot3Layer
impl LayerDispatch for Dot3Layer
Source§fn dispatch_kind(&self) -> LayerKind
fn dispatch_kind(&self) -> LayerKind
Get the kind of this layer.
Source§fn dispatch_index(&self) -> &LayerIndex
fn dispatch_index(&self) -> &LayerIndex
Get the layer index (start/end offsets).
Source§fn dispatch_summary(&self, buf: &[u8]) -> String
fn dispatch_summary(&self, buf: &[u8]) -> String
Get a human-readable summary.
Source§fn dispatch_header_len(&self, _buf: &[u8]) -> usize
fn dispatch_header_len(&self, _buf: &[u8]) -> usize
Get the header length in bytes.
Source§fn dispatch_field_names(&self) -> &'static [&'static str]
fn dispatch_field_names(&self) -> &'static [&'static str]
Get field names for this layer type.
Source§fn dispatch_get_field(
&self,
buf: &[u8],
name: &str,
) -> Option<Result<FieldValue, FieldError>>
fn dispatch_get_field( &self, buf: &[u8], name: &str, ) -> Option<Result<FieldValue, FieldError>>
Get a field value by name.
Source§fn dispatch_set_field(
&self,
buf: &mut [u8],
name: &str,
value: FieldValue,
) -> Option<Result<(), FieldError>>
fn dispatch_set_field( &self, buf: &mut [u8], name: &str, value: FieldValue, ) -> Option<Result<(), FieldError>>
Set a field value by name.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more