pub struct SecurityHeader<'a> { /* private fields */ }Expand description
A parsed view over a Security Header in a byte buffer.
The Security Header consists of:
- SPI (16 bits, mandatory)
- Initialization Vector (0-32 bytes, optional)
- Sequence Number (0-8 bytes, optional)
- Pad Length (0-2 bytes, optional)
All field lengths are determined by the Security Association.
Implementations§
Source§impl<'a> SecurityHeader<'a>
impl<'a> SecurityHeader<'a>
Sourcepub fn parse(sa: &SecurityAssociation, bytes: &'a [u8]) -> Result<Self, Error>
pub fn parse(sa: &SecurityAssociation, bytes: &'a [u8]) -> Result<Self, Error>
Parse a Security Header from the given bytes using the SA to determine field lengths.
Sourcepub fn sequence_number(&self) -> &[u8] ⓘ
pub fn sequence_number(&self) -> &[u8] ⓘ
Returns the Sequence Number bytes.
Sourcepub fn sequence_number_value(&self) -> u64
pub fn sequence_number_value(&self) -> u64
Returns the Sequence Number as a u64 value.
Sourcepub fn pad_length(&self) -> u16
pub fn pad_length(&self) -> u16
Returns the Pad Length value.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for SecurityHeader<'a>
impl<'a> RefUnwindSafe for SecurityHeader<'a>
impl<'a> Send for SecurityHeader<'a>
impl<'a> Sync for SecurityHeader<'a>
impl<'a> Unpin for SecurityHeader<'a>
impl<'a> UnsafeUnpin for SecurityHeader<'a>
impl<'a> UnwindSafe for SecurityHeader<'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
Mutably borrows from an owned value. Read more