Struct etherparse::IpAuthHeaderSlice
source · pub struct IpAuthHeaderSlice<'a> { /* private fields */ }
Expand description
A slice containing an IP Authentication Header (rfc4302)
Implementations§
source§impl<'a> IpAuthHeaderSlice<'a>
impl<'a> IpAuthHeaderSlice<'a>
sourcepub fn from_slice(
slice: &'a [u8]
) -> Result<IpAuthHeaderSlice<'a>, HeaderSliceError>
pub fn from_slice( slice: &'a [u8] ) -> Result<IpAuthHeaderSlice<'a>, HeaderSliceError>
Creates a ip authentication header slice from a slice.
sourcepub unsafe fn from_slice_unchecked(slice: &'a [u8]) -> IpAuthHeaderSlice<'a>
pub unsafe fn from_slice_unchecked(slice: &'a [u8]) -> IpAuthHeaderSlice<'a>
Creates a ip authentication header slice from a slice (assumes slice size & content was validated before).
§Safety
This method assumes that the slice was previously validated to contain
a valid authentication header. This means the slice length must at
least be at least 8 and (slice[1] + 2)*4
. The data that the
slice points must also be valid (meaning no nullptr or alike allowed).
If these preconditions are not fulfilled the behavior of this function and the methods of the return IpAuthHeaderSlice will be undefined.
sourcepub fn next_header(&self) -> IpNumber
pub fn next_header(&self) -> IpNumber
sourcepub fn sequence_number(&self) -> u32
pub fn sequence_number(&self) -> u32
This unsigned 32-bit field contains a counter value that increases by one for each packet sent.
sourcepub fn to_header(&self) -> IpAuthHeader
pub fn to_header(&self) -> IpAuthHeader
Decode some of the fields and copy the results to a Ipv6ExtensionHeader struct together with a slice pointing to the non decoded parts.
Trait Implementations§
source§impl<'a> Clone for IpAuthHeaderSlice<'a>
impl<'a> Clone for IpAuthHeaderSlice<'a>
source§fn clone(&self) -> IpAuthHeaderSlice<'a>
fn clone(&self) -> IpAuthHeaderSlice<'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 IpAuthHeaderSlice<'a>
impl<'a> Debug for IpAuthHeaderSlice<'a>
source§impl<'a> PartialEq for IpAuthHeaderSlice<'a>
impl<'a> PartialEq for IpAuthHeaderSlice<'a>
source§fn eq(&self, other: &IpAuthHeaderSlice<'a>) -> bool
fn eq(&self, other: &IpAuthHeaderSlice<'a>) -> bool
self
and other
values to be equal, and is used
by ==
.