Struct etherparse::Ipv6HeaderSlice
source · pub struct Ipv6HeaderSlice<'a> { /* private fields */ }
Expand description
A slice containing an ipv6 header of a network package.
Implementations§
source§impl<'a> Ipv6HeaderSlice<'a>
impl<'a> Ipv6HeaderSlice<'a>
sourcepub fn from_slice(slice: &'a [u8]) -> Result<Ipv6HeaderSlice<'a>, ReadError>
pub fn from_slice(slice: &'a [u8]) -> Result<Ipv6HeaderSlice<'a>, ReadError>
Creates a slice containing an ipv6 header (without header extensions).
sourcepub fn traffic_class(&self) -> u8
pub fn traffic_class(&self) -> u8
Read the “traffic class” field from the slice.
sourcepub fn flow_label(&self) -> u32
pub fn flow_label(&self) -> u32
Read the “flow label” field from the slice.
sourcepub fn payload_length(&self) -> u16
pub fn payload_length(&self) -> u16
Read the “payload length” field from the slice. The length should contain the length of all extension headers and payload.
sourcepub fn next_header(&self) -> u8
pub fn next_header(&self) -> u8
Read the “next header” field from the slice. The next header value specifies what the next header or transport layer protocol is (see IpTrafficClass for a definitions of ids).
sourcepub fn hop_limit(&self) -> u8
pub fn hop_limit(&self) -> u8
Read the “hop limit” field from the slice. The hop limit specifies the number of hops the packet can take before it is discarded.
sourcepub fn source_addr(&self) -> Ipv6Addr
pub fn source_addr(&self) -> Ipv6Addr
Return the ipv6 source address as an std::net::Ipv6Addr
sourcepub fn destination(&self) -> &'a [u8] ⓘ
pub fn destination(&self) -> &'a [u8] ⓘ
Returns a slice containing the IPv6 destination address.
sourcepub fn destination_addr(&self) -> Ipv6Addr
pub fn destination_addr(&self) -> Ipv6Addr
Return the ipv6 destination address as an std::net::Ipv6Addr
sourcepub fn to_header(&self) -> Ipv6Header
pub fn to_header(&self) -> Ipv6Header
Decode all the fields and copy the results to a Ipv6Header struct
Trait Implementations§
source§impl<'a> Clone for Ipv6HeaderSlice<'a>
impl<'a> Clone for Ipv6HeaderSlice<'a>
source§fn clone(&self) -> Ipv6HeaderSlice<'a>
fn clone(&self) -> Ipv6HeaderSlice<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more