Struct etherparse::IpAuthenticationHeaderSlice
source · [−]pub struct IpAuthenticationHeaderSlice<'a> { /* private fields */ }
Expand description
A slice containing an IP Authentication Header (rfc4302)
Implementations
sourceimpl<'a> IpAuthenticationHeaderSlice<'a>
impl<'a> IpAuthenticationHeaderSlice<'a>
sourcepub fn from_slice(
slice: &'a [u8]
) -> Result<IpAuthenticationHeaderSlice<'a>, ReadError>
pub fn from_slice(
slice: &'a [u8]
) -> Result<IpAuthenticationHeaderSlice<'a>, ReadError>
Creates a ip authentication header slice from a slice.
sourcepub unsafe fn from_slice_unchecked(
slice: &'a [u8]
) -> IpAuthenticationHeaderSlice<'a>
pub unsafe fn from_slice_unchecked(
slice: &'a [u8]
) -> IpAuthenticationHeaderSlice<'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 authentification 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 precondtions are not fullfilled the behavior of this function and the methods of the return IpAuthenticationHeaderSlice will be undefined.
sourcepub fn slice(&self) -> &'a [u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn slice(&self) -> &'a [u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Returns the slice containing the authentification header.
sourcepub fn next_header(&self) -> u8
pub fn next_header(&self) -> u8
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 raw_icv(&self) -> &'a [u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn raw_icv(&self) -> &'a [u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Return a slice with the raw integrity check value
sourcepub fn to_header(&self) -> IpAuthenticationHeader
pub fn to_header(&self) -> IpAuthenticationHeader
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
sourceimpl<'a> Clone for IpAuthenticationHeaderSlice<'a>
impl<'a> Clone for IpAuthenticationHeaderSlice<'a>
sourcefn clone(&self) -> IpAuthenticationHeaderSlice<'a>
fn clone(&self) -> IpAuthenticationHeaderSlice<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'a> Debug for IpAuthenticationHeaderSlice<'a>
impl<'a> Debug for IpAuthenticationHeaderSlice<'a>
sourceimpl<'a> PartialEq<IpAuthenticationHeaderSlice<'a>> for IpAuthenticationHeaderSlice<'a>
impl<'a> PartialEq<IpAuthenticationHeaderSlice<'a>> for IpAuthenticationHeaderSlice<'a>
sourcefn eq(&self, other: &IpAuthenticationHeaderSlice<'a>) -> bool
fn eq(&self, other: &IpAuthenticationHeaderSlice<'a>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &IpAuthenticationHeaderSlice<'a>) -> bool
fn ne(&self, other: &IpAuthenticationHeaderSlice<'a>) -> bool
This method tests for !=
.
impl<'a> Eq for IpAuthenticationHeaderSlice<'a>
impl<'a> StructuralEq for IpAuthenticationHeaderSlice<'a>
impl<'a> StructuralPartialEq for IpAuthenticationHeaderSlice<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for IpAuthenticationHeaderSlice<'a>
impl<'a> Send for IpAuthenticationHeaderSlice<'a>
impl<'a> Sync for IpAuthenticationHeaderSlice<'a>
impl<'a> Unpin for IpAuthenticationHeaderSlice<'a>
impl<'a> UnwindSafe for IpAuthenticationHeaderSlice<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more