pub struct ArpPacketMut<'a> { /* private fields */ }Expand description
A structurally validated mutable ARP packet view.
Implementations§
Source§impl<'a> ArpPacketMut<'a>
impl<'a> ArpPacketMut<'a>
Sourcepub fn parse(bytes: &'a mut [u8]) -> Result<Self, ParseError>
pub fn parse(bytes: &'a mut [u8]) -> Result<Self, ParseError>
Validates the generic RFC 826 layout and excludes supplied trailing bytes.
Sourcepub fn hardware_type(&self) -> ArpHardwareType
pub fn hardware_type(&self) -> ArpHardwareType
Returns the RFC 826 hardware type, preserving unknown values.
Sourcepub fn protocol_type(&self) -> ArpProtocolType
pub fn protocol_type(&self) -> ArpProtocolType
Returns the RFC 826 protocol type, preserving unknown values.
Sourcepub fn hardware_address_length(&self) -> u8
pub fn hardware_address_length(&self) -> u8
Returns the encoded hardware address length, which this view cannot change.
Sourcepub fn protocol_address_length(&self) -> u8
pub fn protocol_address_length(&self) -> u8
Returns the encoded protocol address length, which this view cannot change.
Sourcepub fn operation(&self) -> ArpOperation
pub fn operation(&self) -> ArpOperation
Returns the RFC 826 operation, preserving unknown values.
Sourcepub fn set_hardware_type(&mut self, value: ArpHardwareType)
pub fn set_hardware_type(&mut self, value: ArpHardwareType)
Replaces the RFC 826 hardware type without changing address lengths.
Sourcepub fn set_protocol_type(&mut self, value: ArpProtocolType)
pub fn set_protocol_type(&mut self, value: ArpProtocolType)
Replaces the RFC 826 protocol type without changing address lengths.
Sourcepub fn set_operation(&mut self, value: ArpOperation)
pub fn set_operation(&mut self, value: ArpOperation)
Replaces the RFC 826 operation.
Sourcepub fn sender_hardware_address(&self) -> &[u8]
pub fn sender_hardware_address(&self) -> &[u8]
Returns the sender hardware address bytes.
Sourcepub fn sender_hardware_address_mut(&mut self) -> &mut [u8] ⓘ
pub fn sender_hardware_address_mut(&mut self) -> &mut [u8] ⓘ
Returns mutable sender hardware address bytes.
Sourcepub fn sender_protocol_address(&self) -> &[u8]
pub fn sender_protocol_address(&self) -> &[u8]
Returns the sender protocol address bytes.
Sourcepub fn sender_protocol_address_mut(&mut self) -> &mut [u8] ⓘ
pub fn sender_protocol_address_mut(&mut self) -> &mut [u8] ⓘ
Returns mutable sender protocol address bytes.
Sourcepub fn target_hardware_address(&self) -> &[u8]
pub fn target_hardware_address(&self) -> &[u8]
Returns the target hardware address bytes.
Sourcepub fn target_hardware_address_mut(&mut self) -> &mut [u8] ⓘ
pub fn target_hardware_address_mut(&mut self) -> &mut [u8] ⓘ
Returns mutable target hardware address bytes.
Sourcepub fn target_protocol_address(&self) -> &[u8]
pub fn target_protocol_address(&self) -> &[u8]
Returns the target protocol address bytes.
Sourcepub fn target_protocol_address_mut(&mut self) -> &mut [u8] ⓘ
pub fn target_protocol_address_mut(&mut self) -> &mut [u8] ⓘ
Returns mutable target protocol address bytes.
Sourcepub fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
pub fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
Returns all represented ARP bytes mutably.