Struct smoltcp::wire::Icmpv4Packet [] [src]

pub struct Icmpv4Packet<T: AsRef<[u8]>> { /* fields omitted */ }

A read/write wrapper around an Internet Control Message Protocol version 4 packet buffer.

Methods

impl<T: AsRef<[u8]>> Packet<T>
[src]

[src]

Imbue a raw octet buffer with ICMPv4 packet structure.

[src]

Shorthand for a combination of new and check_len.

[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_header_len.

[src]

Consume the packet, returning the underlying buffer.

[src]

Return the message type field.

[src]

Return the message code field.

[src]

Return the checksum field.

[src]

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.

[src]

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.

[src]

Return the header length. The result depends on the value of the message type field.

[src]

Validate the header checksum.

Fuzzing

This function always returns true when fuzzing.

impl<'a, T: AsRef<[u8]> + ?Sized> Packet<&'a T>
[src]

[src]

Return a pointer to the type-specific data.

impl<T: AsRef<[u8]> + AsMut<[u8]>> Packet<T>
[src]

[src]

Set the message type field.

[src]

Set the message code field.

[src]

Set the checksum field.

[src]

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.

[src]

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.

[src]

Compute and fill in the header checksum.

impl<'a, T: AsRef<[u8]> + AsMut<[u8]> + ?Sized> Packet<&'a mut T>
[src]

[src]

Return a mutable pointer to the type-specific data.

Trait Implementations

impl<T: Debug + AsRef<[u8]>> Debug for Packet<T>
[src]

[src]

Formats the value using the given formatter.

impl<'a, T: AsRef<[u8]> + ?Sized> Display for Packet<&'a T>
[src]

[src]

Formats the value using the given formatter. Read more

impl<T: AsRef<[u8]>> PrettyPrint for Packet<T>
[src]

[src]

Write a concise, formatted representation of a packet contained in the provided buffer, and any nested packets it may contain. Read more