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) -> Result<Packet<T>, Error>
Wrap a buffer with an ARP packet. Returns an error if the buffer is too small to contain one.
fn into_inner(self) -> T
Consumes the packet, returning the underlying buffer.
fn hardware_type(&self) -> Hardware
Return the hardware type field.
fn protocol_type(&self) -> Protocol
Return the protocol type field.
fn hardware_len(&self) -> u8
Return the hardware length field.
fn protocol_len(&self) -> u8
Return the protocol length field.
fn operation(&self) -> Operation
Return the operation field.
fn source_hardware_addr(&self) -> &[u8]
Return the source hardware address field.
fn source_protocol_addr(&self) -> &[u8]
Return the source protocol address field.
fn target_hardware_addr(&self) -> &[u8]
Return the target hardware address field.
fn target_protocol_addr(&self) -> &[u8]
Return the target protocol address field.
impl<T: AsRef<[u8]> + AsMut<[u8]>> Packet<T>
[src]
fn set_hardware_type(&mut self, value: Hardware)
Set the hardware type field.
fn set_protocol_type(&mut self, value: Protocol)
Set the protocol type field.
fn set_hardware_len(&mut self, value: u8)
Set the hardware length field.
fn set_protocol_len(&mut self, value: u8)
Set the protocol length field.
fn set_operation(&mut self, value: Operation)
Set the operation field.
fn set_source_hardware_addr(&mut self, value: &[u8])
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])
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])
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])
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]
impl<T: AsRef<[u8]>> PrettyPrint for Packet<T>
[src]
fn pretty_print(buffer: &AsRef<[u8]>,
f: &mut Formatter,
indent: &mut PrettyIndent)
-> Result
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