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: LinuxSllPacketType
Type of the captured packet
arp_hrd_type: ArpHardwareId
ARPHRD_ value for the link-layer device type
sender_address_valid_length: u16
The 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: LinuxSllProtocolType
The 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 more