Struct etherparse::LinuxSllHeader
source · pub struct LinuxSllHeader {
pub packet_type: LinuxSllPacketType,
pub arp_hrd_type: ArpHardwareId,
pub sender_address_valid_length: u16,
pub sender_address: [u8; 8],
pub protocol_type: LinuxSllProtocolType,
}Expand description
Linux Cooked Capture v1 (SLL) Header
Fields§
§packet_type: LinuxSllPacketTypeType of the captured packet
arp_hrd_type: ArpHardwareIdARPHRD_ value for the link-layer device type
sender_address_valid_length: u16The size of the adress that is valid
sender_address: [u8; 8]The link-layer adress of the sender of the packet, with the meaningful
bytes specified by sender_address_valid_length. If the original is
larger, the value on the packet is truncated to the first 8 bytes. If
the original is smaller, the remaining bytes will be filled with 0s.
protocol_type: LinuxSllProtocolTypeThe protocol type of the encapsulated packet
Implementations§
source§impl LinuxSllHeader
impl LinuxSllHeader
sourcepub fn from_slice(
slice: &[u8],
) -> Result<(LinuxSllHeader, &[u8]), HeaderSliceError>
pub fn from_slice( slice: &[u8], ) -> Result<(LinuxSllHeader, &[u8]), HeaderSliceError>
Read an SLL header from a slice and return the header & unused parts of the slice.
sourcepub fn from_bytes(bytes: [u8; 16]) -> Result<LinuxSllHeader, HeaderError>
pub fn from_bytes(bytes: [u8; 16]) -> Result<LinuxSllHeader, HeaderError>
Read an SLL header from a static sized byte array.
sourcepub fn read<T: Read + Seek + Sized>(
reader: &mut T,
) -> Result<LinuxSllHeader, ReadError>
Available on crate feature std only.
pub fn read<T: Read + Seek + Sized>( reader: &mut T, ) -> Result<LinuxSllHeader, ReadError>
std only.Reads an SLL header from the current position of the read argument.
sourcepub fn write_to_slice<'a>(
&self,
slice: &'a mut [u8],
) -> Result<&'a mut [u8], SliceWriteSpaceError>
pub fn write_to_slice<'a>( &self, slice: &'a mut [u8], ) -> Result<&'a mut [u8], SliceWriteSpaceError>
Serialize the header to a given slice. Returns the unused part of the slice.
sourcepub fn write<T: Write + Sized>(&self, writer: &mut T) -> Result<(), Error>
Available on crate feature std only.
pub fn write<T: Write + Sized>(&self, writer: &mut T) -> Result<(), Error>
std only.Writes a given Sll header to the current position of the write argument.
sourcepub fn header_len(&self) -> usize
pub fn header_len(&self) -> usize
Length of the serialized header in bytes.
Trait Implementations§
source§impl Clone for LinuxSllHeader
impl Clone for LinuxSllHeader
source§fn clone(&self) -> LinuxSllHeader
fn clone(&self) -> LinuxSllHeader
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for LinuxSllHeader
impl Debug for LinuxSllHeader
source§impl PartialEq for LinuxSllHeader
impl PartialEq for LinuxSllHeader
impl Eq for LinuxSllHeader
impl StructuralPartialEq for LinuxSllHeader
Auto Trait Implementations§
impl Freeze for LinuxSllHeader
impl RefUnwindSafe for LinuxSllHeader
impl Send for LinuxSllHeader
impl Sync for LinuxSllHeader
impl Unpin for LinuxSllHeader
impl UnwindSafe for LinuxSllHeader
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)