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: u8
flow_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.
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
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.
pub fn read_without_version<T: Read + Seek + Sized>(
reader: &mut T,
version_rest: u8
) -> Result<Ipv6Header, Error>
pub fn read_without_version<T: Read + Seek + Sized>(
reader: &mut T,
version_rest: u8
) -> Result<Ipv6Header, Error>
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 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
impl RefUnwindSafe for Ipv6Header
impl Send for Ipv6Header
impl Sync for Ipv6Header
impl Unpin for Ipv6Header
impl UnwindSafe for Ipv6Header
Blanket Implementations
Mutably borrows from an owned value. Read more