Struct smoltcp::wire::Ipv4Packet [] [src]

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

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

Methods

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

[src]

Imbue a raw octet buffer with IPv4 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 version field.

[src]

Return the header length, in octets.

[src]

Return the Differential Services Code Point field.

[src]

Return the Explicit Congestion Notification field.

[src]

Return the total length field.

[src]

Return the fragment identification field.

[src]

Return the "don't fragment" flag.

[src]

Return the "more fragments" flag.

[src]

Return the fragment offset, in octets.

[src]

Return the time to live field.

[src]

Return the protocol field.

[src]

Return the header checksum field.

[src]

Return the source address field.

[src]

Return the destination address 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 payload.

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

[src]

Set the version field.

[src]

Set the header length, in octets.

[src]

Set the Differential Services Code Point field.

[src]

Set the Explicit Congestion Notification field.

[src]

Set the total length field.

[src]

Set the fragment identification field.

[src]

Clear the entire flags field.

[src]

Set the "don't fragment" flag.

[src]

Set the "more fragments" flag.

[src]

Set the fragment offset, in octets.

[src]

Set the time to live field.

[src]

Set the protocol field.

[src]

Set the header checksum field.

[src]

Set the source address field.

[src]

Set the destination address field.

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

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