Struct smoltcp::wire::ArpPacket
[−]
[src]
pub struct ArpPacket<T: AsRef<[u8]>> { /* fields omitted */ }
A read/write wrapper around an Address Resolution Protocol packet buffer.
Methods
impl<T: AsRef<[u8]>> Packet<T>
[src]
fn new(buffer: T) -> Packet<T>
[src]
Imbue a raw octet buffer with ARP packet structure.
fn new_checked(buffer: T) -> Result<Packet<T>>
[src]
fn check_len(&self) -> Result<()>
[src]
Ensure that no accessor method will panic if called.
Returns Err(Error::Truncated)
if the buffer is too short.
The result of this check is invalidated by calling set_hardware_len or set_protocol_len.
fn into_inner(self) -> T
[src]
Consume the packet, returning the underlying buffer.
fn hardware_type(&self) -> Hardware
[src]
Return the hardware type field.
fn protocol_type(&self) -> Protocol
[src]
Return the protocol type field.
fn hardware_len(&self) -> u8
[src]
Return the hardware length field.
fn protocol_len(&self) -> u8
[src]
Return the protocol length field.
fn operation(&self) -> Operation
[src]
Return the operation field.
fn source_hardware_addr(&self) -> &[u8]
[src]
Return the source hardware address field.
fn source_protocol_addr(&self) -> &[u8]
[src]
Return the source protocol address field.
fn target_hardware_addr(&self) -> &[u8]
[src]
Return the target hardware address field.
fn target_protocol_addr(&self) -> &[u8]
[src]
Return the target protocol address field.
impl<T: AsRef<[u8]> + AsMut<[u8]>> Packet<T>
[src]
fn set_hardware_type(&mut self, value: Hardware)
[src]
Set the hardware type field.
fn set_protocol_type(&mut self, value: Protocol)
[src]
Set the protocol type field.
fn set_hardware_len(&mut self, value: u8)
[src]
Set the hardware length field.
fn set_protocol_len(&mut self, value: u8)
[src]
Set the protocol length field.
fn set_operation(&mut self, value: Operation)
[src]
Set the operation field.
fn set_source_hardware_addr(&mut self, value: &[u8])
[src]
Set the source hardware address field.
Panics
The function panics if value
is not self.hardware_len()
long.
fn set_source_protocol_addr(&mut self, value: &[u8])
[src]
Set the source protocol address field.
Panics
The function panics if value
is not self.protocol_len()
long.
fn set_target_hardware_addr(&mut self, value: &[u8])
[src]
Set the target hardware address field.
Panics
The function panics if value
is not self.hardware_len()
long.
fn set_target_protocol_addr(&mut self, value: &[u8])
[src]
Set the target protocol address field.
Panics
The function panics if value
is not self.protocol_len()
long.
Trait Implementations
impl<T: Debug + AsRef<[u8]>> Debug for Packet<T>
[src]
impl<T: AsRef<[u8]>> Display for Packet<T>
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<T: AsRef<[u8]>> PrettyPrint for Packet<T>
[src]
fn pretty_print(
buffer: &AsRef<[u8]>,
f: &mut Formatter,
indent: &mut PrettyIndent
) -> Result
[src]
buffer: &AsRef<[u8]>,
f: &mut Formatter,
indent: &mut PrettyIndent
) -> Result
Write a concise, formatted representation of a packet contained in the provided buffer, and any nested packets it may contain. Read more