Struct etherparse::LinuxSllSlice
source · pub struct LinuxSllSlice<'a> { /* private fields */ }
Expand description
Slice containing a Linux Cooked Capture v1 (SLL) header & payload.
Implementations§
source§impl<'a> LinuxSllSlice<'a>
impl<'a> LinuxSllSlice<'a>
sourcepub fn from_slice(
slice: &'a [u8]
) -> Result<LinuxSllSlice<'a>, HeaderSliceError>
pub fn from_slice( slice: &'a [u8] ) -> Result<LinuxSllSlice<'a>, HeaderSliceError>
Try creating a LinuxSllSlice
from a slice containing the
header & payload
sourcepub fn slice(&self) -> &'a [u8] ⓘ
pub fn slice(&self) -> &'a [u8] ⓘ
Returns the slice containing the Linux Cooked Capture v1 (SLL) header & payload.
sourcepub fn packet_type(&self) -> LinuxSllPacketType
pub fn packet_type(&self) -> LinuxSllPacketType
Read the packet type field from the header
sourcepub fn arp_hardware_type(&self) -> ArpHardwareId
pub fn arp_hardware_type(&self) -> ArpHardwareId
Read the arp hardware type field from the header
sourcepub fn sender_address_valid_length(&self) -> u16
pub fn sender_address_valid_length(&self) -> u16
Read the link layer address length field from the header
sourcepub fn sender_address_full(&self) -> [u8; 8]
pub fn sender_address_full(&self) -> [u8; 8]
Read the link layer address field from the header. Only the first
LinuxSllSlice::link_layer_address_length
bytes are meaningful
sourcepub fn sender_address(&self) -> &'a [u8] ⓘ
pub fn sender_address(&self) -> &'a [u8] ⓘ
Get the meaningful bytes of the slice of the link layer address from the header
sourcepub fn protocol_type(&self) -> LinuxSllProtocolType
pub fn protocol_type(&self) -> LinuxSllProtocolType
Read the protocol type field from the header
sourcepub fn to_header(&self) -> LinuxSllHeader
pub fn to_header(&self) -> LinuxSllHeader
Decode all the header fields and copy the results to a
LinuxSllHeader
struct
sourcepub fn header_slice(&self) -> &[u8] ⓘ
pub fn header_slice(&self) -> &[u8] ⓘ
Slice only containing the header
sourcepub fn payload(&self) -> LinuxSllPayloadSlice<'a>
pub fn payload(&self) -> LinuxSllPayloadSlice<'a>
Returns the slice containing the Ethernet II payload & ether type identifying it’s content type.
sourcepub fn payload_slice(&self) -> &'a [u8] ⓘ
pub fn payload_slice(&self) -> &'a [u8] ⓘ
Slice only containing the payload
sourcepub const fn header_len(&self) -> usize
pub const fn header_len(&self) -> usize
Length of the header in bytes (equal to crate::LinuxSllHeader::LEN
)
Trait Implementations§
source§impl<'a> Clone for LinuxSllSlice<'a>
impl<'a> Clone for LinuxSllSlice<'a>
source§fn clone(&self) -> LinuxSllSlice<'a>
fn clone(&self) -> LinuxSllSlice<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'a> Debug for LinuxSllSlice<'a>
impl<'a> Debug for LinuxSllSlice<'a>
source§impl<'a> PartialEq for LinuxSllSlice<'a>
impl<'a> PartialEq for LinuxSllSlice<'a>
source§fn eq(&self, other: &LinuxSllSlice<'a>) -> bool
fn eq(&self, other: &LinuxSllSlice<'a>) -> bool
self
and other
values to be equal, and is used
by ==
.