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 thenext header
andextended 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
Auto Trait Implementations
impl RefUnwindSafe for Ipv6RawExtensionHeader
impl Send for Ipv6RawExtensionHeader
impl Sync for Ipv6RawExtensionHeader
impl Unpin for Ipv6RawExtensionHeader
impl UnwindSafe for Ipv6RawExtensionHeader
Blanket Implementations
Mutably borrows from an owned value. Read more