Struct smoltcp::wire::Ipv4Packet [−][src]
Expand description
A read/write wrapper around an Internet Protocol version 4 packet buffer.
Implementations
Imbue a raw octet buffer with IPv4 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.
Returns Err(Error::Malformed)
if the header length is greater
than total length.
The result of this check is invalidated by calling set_header_len and set_total_len.
Consume the packet, returning the underlying buffer.
Return the header length, in octets.
Return the “more fragments” flag.
Return the fragment offset, in octets.
Set the version field.
Set the header length, in octets.
Set the total length field.
Clear the entire flags field.
Set the “don’t fragment” flag.
Set the “more fragments” flag.
Set the fragment offset, in octets.
Set the time to live field.
Set the protocol field.
Set the header checksum field.
Set the source address field.
Set the destination address field.
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