Struct smoltcp::wire::Icmpv4Packet [−][src]
Expand description
A read/write wrapper around an Internet Control Message Protocol version 4 packet buffer.
Implementations
Imbue a raw octet buffer with ICMPv4 packet structure.
Shorthand for a combination of new_unchecked and check_len.
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_header_len.
Consume the packet, returning the underlying buffer.
Return the identifier field (for echo request and reply packets).
Panics
This function may panic if this packet is not an echo request or reply packet.
Return the sequence number field (for echo request and reply packets).
Panics
This function may panic if this packet is not an echo request or reply packet.
Return the header length. The result depends on the value of the message type field.
Set the message type field.
Set the message code field.
Set the checksum field.
Set the identifier field (for echo request and reply packets).
Panics
This function may panic if this packet is not an echo request or reply packet.
Set the sequence number field (for echo request and reply packets).
Panics
This function may panic if this packet is not an echo request or reply packet.
Compute and fill in the header checksum.
Trait Implementations
fn pretty_print(
buffer: &dyn AsRef<[u8]>,
f: &mut Formatter<'_>,
indent: &mut PrettyIndent
) -> Result
fn pretty_print(
buffer: &dyn 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
Auto Trait Implementations
impl<T> RefUnwindSafe for Packet<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Packet<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more