Struct etherparse::Ipv6ExtensionsSlice
source · 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>
impl<'a> Ipv6ExtensionsSlice<'a>
sourcepub fn from_slice(
start_ip_number: IpNumber,
start_slice: &'a [u8],
) -> Result<(Ipv6ExtensionsSlice<'a>, IpNumber, &'a [u8]), HeaderSliceError>
pub fn from_slice( start_ip_number: IpNumber, start_slice: &'a [u8], ) -> Result<(Ipv6ExtensionsSlice<'a>, IpNumber, &'a [u8]), HeaderSliceError>
Collects all ipv6 extension headers in a slice & checks if a fragmentation header that fragments the packet is present.
sourcepub fn from_slice_lax(
start_ip_number: IpNumber,
start_slice: &'a [u8],
) -> (Ipv6ExtensionsSlice<'a>, IpNumber, &'a [u8], Option<(HeaderSliceError, Layer)>)
pub fn from_slice_lax( start_ip_number: IpNumber, start_slice: &'a [u8], ) -> (Ipv6ExtensionsSlice<'a>, 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 headersIpNumber
of unparsed data- Slice with unparsed data
- Optional with error if there was an error wich stoped the parsing.
sourcepub fn is_fragmenting_payload(&self) -> bool
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.
sourcepub fn first_header(&self) -> Option<IpNumber>
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.
Trait Implementations§
source§impl<'a> Clone for Ipv6ExtensionsSlice<'a>
impl<'a> Clone for Ipv6ExtensionsSlice<'a>
source§fn clone(&self) -> Ipv6ExtensionsSlice<'a>
fn clone(&self) -> Ipv6ExtensionsSlice<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'a> Debug for Ipv6ExtensionsSlice<'a>
impl<'a> Debug for Ipv6ExtensionsSlice<'a>
source§impl<'a> Default for Ipv6ExtensionsSlice<'a>
impl<'a> Default for Ipv6ExtensionsSlice<'a>
source§fn default() -> Ipv6ExtensionsSlice<'a>
fn default() -> Ipv6ExtensionsSlice<'a>
source§impl<'a> IntoIterator for Ipv6ExtensionsSlice<'a>
impl<'a> IntoIterator for Ipv6ExtensionsSlice<'a>
source§impl<'a> PartialEq for Ipv6ExtensionsSlice<'a>
impl<'a> PartialEq for Ipv6ExtensionsSlice<'a>
impl<'a> Eq for Ipv6ExtensionsSlice<'a>
impl<'a> StructuralPartialEq for Ipv6ExtensionsSlice<'a>
Auto Trait Implementations§
impl<'a> Freeze for Ipv6ExtensionsSlice<'a>
impl<'a> RefUnwindSafe for Ipv6ExtensionsSlice<'a>
impl<'a> Send for Ipv6ExtensionsSlice<'a>
impl<'a> Sync for Ipv6ExtensionsSlice<'a>
impl<'a> Unpin for Ipv6ExtensionsSlice<'a>
impl<'a> UnwindSafe for Ipv6ExtensionsSlice<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)