pub struct AuthenticationHeaderReader<'a> {
pub bytes: &'a [u8],
}
Expand description
Reads the Authentication extension header fields.
Fields§
§bytes: &'a [u8]
Implementations§
Source§impl<'a> AuthenticationHeaderReader<'a>
impl<'a> AuthenticationHeaderReader<'a>
Sourcepub fn new(bytes: &'a [u8]) -> Result<Self, &'static str>
pub fn new(bytes: &'a [u8]) -> Result<Self, &'static str>
Creates a new AuthenticationHeaderReader
from the given data slice.
Sourcepub fn next_header(&self) -> u8
pub fn next_header(&self) -> u8
Returns the next header field.
Specifies the type of the next header.
Sourcepub fn payload_len(&self) -> u8
pub fn payload_len(&self) -> u8
Returns the payload length field.
Length of the payload in 32-bit words, minus 2.
Sourcepub fn spi(&self) -> u32
pub fn spi(&self) -> u32
Returns the Security Parameters Index field.
Arbitrary value which is used (together with the dest_addr) to identify the security association of the receiving party.
Sourcepub fn sequence_number(&self) -> u32
pub fn sequence_number(&self) -> u32
Returns the sequence number field.
Monotonically increasing counter value to prevent replay attacks.
Sourcepub fn authentication_data(&self) -> Result<&'a [u8], &'static str>
pub fn authentication_data(&self) -> Result<&'a [u8], &'static str>
Returns the authentication data field.
Variable-length field.
Sourcepub fn header_len(&self) -> usize
pub fn header_len(&self) -> usize
Returns the total header length in bytes.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for AuthenticationHeaderReader<'a>
impl<'a> RefUnwindSafe for AuthenticationHeaderReader<'a>
impl<'a> Send for AuthenticationHeaderReader<'a>
impl<'a> Sync for AuthenticationHeaderReader<'a>
impl<'a> Unpin for AuthenticationHeaderReader<'a>
impl<'a> UnwindSafe for AuthenticationHeaderReader<'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