pub struct Ipv6ExtensionsSlice<'a> { /* private fields */ }
Expand description

Slice containing the IPv6 extension headers present after the ip header.

Currently supported:

  • Authentication Header
  • Hop by Hop Options Header
  • Destination Options Header (before and after routing headers)
  • Routing Header
  • Fragment
  • Authentication Header

Currently not supported:

  • Encapsulating Security Payload Header (ESP)
  • Host Identity Protocol (HIP)
  • IP Mobility
  • Site Multihoming by IPv6 Intermediation (SHIM6)

Implementations§

source§

impl<'a> Ipv6ExtensionsSlice<'a>

source

pub fn from_slice( start_ip_number: IpNumber, start_slice: &'a [u8] ) -> Result<(Ipv6ExtensionsSlice<'_>, IpNumber, &'a [u8]), HeaderSliceError>

Collects all ipv6 extension headers in a slice & checks if a fragmentation header that fragments the packet is present.

source

pub fn from_slice_lax( start_ip_number: IpNumber, start_slice: &'a [u8] ) -> (Ipv6ExtensionsSlice<'_>, IpNumber, &'a [u8], Option<(HeaderSliceError, Layer)>)

Collects all ipv6 extension headers in a slice until an error is encountered or a “non IP extension header” is found and returns the successfully parsed parts (+ the unparsed slice it’s IpNumber and the error if one occurred).

The returned values are

  • Ipv6ExtensionsSlice containing the successfully parsed IPv6 extension headers
  • IpNumber of unparsed data
  • Slice with unparsed data
  • Optional with error if there was an error wich stoped the parsing.
source

pub fn is_fragmenting_payload(&self) -> bool

Returns true if a fragmentation header is present in the extensions that fragments the payload.

Note: A fragmentation header can still be present even if the return value is false in case the fragmentation headers don’t fragment the payload. This is the case if the offset of all fragmentation header is 0 and the more fragment bit is not set.

source

pub fn first_header(&self) -> Option<IpNumber>

Returns the ip protocol number of the first header in the slice if the slice contains an ipv6 extension header. If no ipv6 header is present None is returned.

None is only returned if the slice length of this struct is 0.

source

pub fn slice(&self) -> &'a [u8]

Slice containing the ipv6 extension headers.

source

pub fn is_empty(&self) -> bool

Returns true if no IPv6 extension header is present (slice is empty).

Trait Implementations§

source§

impl<'a> Clone for Ipv6ExtensionsSlice<'a>

source§

fn clone(&self) -> Ipv6ExtensionsSlice<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for Ipv6ExtensionsSlice<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Default for Ipv6ExtensionsSlice<'a>

source§

fn default() -> Ipv6ExtensionsSlice<'a>

Returns the “default value” for a type. Read more
source§

impl<'a> IntoIterator for Ipv6ExtensionsSlice<'a>

§

type Item = Ipv6ExtensionSlice<'a>

The type of the elements being iterated over.
§

type IntoIter = Ipv6ExtensionSliceIter<'a>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<'a> PartialEq for Ipv6ExtensionsSlice<'a>

source§

fn eq(&self, other: &Ipv6ExtensionsSlice<'a>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> Eq for Ipv6ExtensionsSlice<'a>

source§

impl<'a> StructuralPartialEq for Ipv6ExtensionsSlice<'a>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.