Struct etherparse::Ipv6Header[][src]

pub struct Ipv6Header {
    pub traffic_class: u8,
    pub flow_label: u32,
    pub payload_length: u16,
    pub next_header: u8,
    pub hop_limit: u8,
    pub source: [u8; 16],
    pub destination: [u8; 16],
}
Expand description

IPv6 header according to rfc8200.

Fields

traffic_class: u8flow_label: u32

If non 0 serves as a hint to router and switches with multiple outbound paths that these packets should stay on the same path, so that they will not be reordered.

payload_length: u16

The length of the payload and extension headers in bytes (0 in case of jumbo payloads).

next_header: u8

IP protocol number specifying the next header or transport layer protocol.

See IpNumber or ip_number for a definitions of ids.

hop_limit: u8

The number of hops the packet can take before it is discarded.

source: [u8; 16]

IPv6 source address

destination: [u8; 16]

IPv6 destination address

Implementations

👎 Deprecated since 0.10.1:

Renamed to Ipv6Header::from_slice

Renamed to Ipv6Header::from_slice

Read an Ipv6Header from a slice and return the header & unused parts of the slice.

Reads an IPv6 header from the current position.

Reads an IPv6 header assuming the version & flow_label field have already been read.

Takes a slice and skips an ipv6 header extensions and returns the next_header ip number & the slice past the header.

Returns true if the given ip protocol number is a skippable header extension.

A skippable header extension is an extension header for which it is known how to determine the protocol number of the following header as well as how many octets have to be skipped to reach the start of the following header.

Takes a slice & ip protocol number (identifying the first header type) and returns next_header id & the slice past after all ipv6 header extensions.

Skips the ipv6 header extension and returns the next ip protocol number

Skips all ipv6 header extensions and returns the next ip protocol number

Writes a given IPv6 header to the current position.

Length of the serialized header in bytes.

The function always returns the constant Ipv6Header::SERIALIZED_SIZE and exists to keep the methods consistent with other headers.

Sets the field total_length based on the size of the payload and the options. Returns an error if the payload is too big to fit.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Size of the header itself in bytes.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.