Struct etherparse::Ipv6Header

source ·
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

§next_header: u8

Specifies what the next header or transport layer protocol is (see IpTrafficClass 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§

Reads an IPv6 header from the current position.

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

Skips the ipv6 header extension and returns the traffic_class

Skips all ipv6 header extensions and returns the last traffic_class

Writes a given IPv6 header to the current position.

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 !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
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.