Struct etherparse::Ipv6RawExtensionHeader[][src]

pub struct Ipv6RawExtensionHeader {
    pub next_header: u8,
    // some fields omitted
}
Expand description

Raw IPv6 extension header (undecoded payload).

IPv6 extension header with only minimal data interpretation. NOTE only ipv6 header extensions with the first two bytes representing the next header and the header length in 8-octets (- 8 octets) can be represented with this struct. This excludes the “Authentication Header” (AH) and “Encapsulating Security Payload” (ESP).

The following headers can be represented in a Ipv6RawExtensionHeader:

  • Hop by Hop
  • Destination Options
  • Routing
  • Mobility
  • Host Identity Protocol
  • Shim6 Protocol

Fields

next_header: u8

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

See IpNumber or ip_number for a definition of the known values.

Implementations

Minimum length of a Ipv6RawExtensionHeader payload

Maximum length of a Ipv6RawExtensionHeader the payload

Returns true if the given header type ip number can be represented in an Ipv6ExtensionHeader.

Creates an generic IPv6 extension header with the given data.

Arguments
  • next_header - type of content after this header (protocol number)
  • payload - slice containing the data of the header. This must NOT contain the next header and extended header length fields of the header.

Note that payload must have at least the length of 6 bytes and only supports length increases in steps of 8. This measn that the following expression must be true (payload.len() + 2) % 8 == 0. The maximum length of the payload is 2046 bytes (Ipv6RawExtensionHeader::MAX_PAYLOAD_LEN).

If a payload with a non supported length is provided a ValueError is returned.

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

Return a slice containing the current payload. This does NOT contain the next_header and header_length fields. But everything after these two fields.

Sets the payload (content of the header after the next_header & header_length fields).

Note that payload must have at least the length of 6 bytes and only supports length increases in steps of 8. This measn that the following expression must be true (payload.len() + 2) % 8 == 0. The maximum length of the payload is 2046 bytes (Ipv6RawExtensionHeader::MAX_PAYLOAD_LEN).

If a payload with a non supported length is provided a ValueError is returned and the payload of the header is not changed.

Read an fragment header from the current reader position.

Writes a given IPv6 extension header to the current position.

Length of the header in bytes.

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

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

This method tests for !=.

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.