pub struct ArpPacketSlice<'a> { /* private fields */ }Expand description
Slice containing an “Address Resolution Protocol” Packet.
Implementations§
Source§impl<'a> ArpPacketSlice<'a>
impl<'a> ArpPacketSlice<'a>
Sourcepub fn from_slice(slice: &'a [u8]) -> Result<ArpPacketSlice<'a>, LenError>
pub fn from_slice(slice: &'a [u8]) -> Result<ArpPacketSlice<'a>, LenError>
Creates an ArpPacketSlice from a slice and verifies that the
given slice has enough data to contain an complete ARP packet.
Sourcepub const fn hw_addr_type(&self) -> ArpHardwareId
pub const fn hw_addr_type(&self) -> ArpHardwareId
Network link protocol type (e.g. ArpHardwareId::ETHERNET).
Sourcepub const fn proto_addr_type(&self) -> EtherType
pub const fn proto_addr_type(&self) -> EtherType
Protocol for which the ARP request is intended (e.g. EtherType::IPV4).
Sourcepub const fn hw_addr_size(&self) -> u8
pub const fn hw_addr_size(&self) -> u8
Length (in octets) of a hardware address (e.g. 6 for Ethernet).
Sourcepub const fn proto_addr_size(&self) -> u8
pub const fn proto_addr_size(&self) -> u8
Length (in octets) of network addresses (e.g. 4 for IPv4 or 16 for IPv6).
Sourcepub const fn operation(&self) -> ArpOperation
pub const fn operation(&self) -> ArpOperation
Specifies the operation that the sender is performing
Sourcepub const fn sender_hw_addr(&self) -> &[u8] ⓘ
pub const fn sender_hw_addr(&self) -> &[u8] ⓘ
Sender hardware address (e.g. MAC address).
Sourcepub const fn sender_protocol_addr(&self) -> &[u8] ⓘ
pub const fn sender_protocol_addr(&self) -> &[u8] ⓘ
Sender protocol address (e.g. IPv4 address).
Sourcepub const fn target_hw_addr(&self) -> &[u8] ⓘ
pub const fn target_hw_addr(&self) -> &[u8] ⓘ
Target hardware address (e.g. MAC address).
Sourcepub const fn target_protocol_addr(&self) -> &[u8] ⓘ
pub const fn target_protocol_addr(&self) -> &[u8] ⓘ
Buffer containing the target protocol address (e.g. IPv4 address)..
Trait Implementations§
Source§impl<'a> Clone for ArpPacketSlice<'a>
impl<'a> Clone for ArpPacketSlice<'a>
Source§fn clone(&self) -> ArpPacketSlice<'a>
fn clone(&self) -> ArpPacketSlice<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for ArpPacketSlice<'a>
impl<'a> Debug for ArpPacketSlice<'a>
Source§impl<'a> PartialEq for ArpPacketSlice<'a>
impl<'a> PartialEq for ArpPacketSlice<'a>
impl<'a> Eq for ArpPacketSlice<'a>
impl<'a> StructuralPartialEq for ArpPacketSlice<'a>
Auto Trait Implementations§
impl<'a> Freeze for ArpPacketSlice<'a>
impl<'a> RefUnwindSafe for ArpPacketSlice<'a>
impl<'a> Send for ArpPacketSlice<'a>
impl<'a> Sync for ArpPacketSlice<'a>
impl<'a> Unpin for ArpPacketSlice<'a>
impl<'a> UnwindSafe for ArpPacketSlice<'a>
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