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§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more