pub struct AuthenticationHeaderWriter<'a> {
pub bytes: &'a mut [u8],
}
Expand description
Writes the Authentication Header fields.
Fields§
§bytes: &'a mut [u8]
Implementations§
Source§impl<'a> AuthenticationHeaderWriter<'a>
impl<'a> AuthenticationHeaderWriter<'a>
Sourcepub fn new(bytes: &'a mut [u8]) -> Result<Self, &'static str>
pub fn new(bytes: &'a mut [u8]) -> Result<Self, &'static str>
Creates a new AuthenticationHeaderWriter
from the given data slice.
Sourcepub fn header_len(&self) -> usize
pub fn header_len(&self) -> usize
Returns the total header length in bytes.
Sourcepub fn set_next_header(&mut self, next_header: u8)
pub fn set_next_header(&mut self, next_header: u8)
Sets the next header field.
Identifies the type of the next header.
Sourcepub fn set_payload_len(&mut self, payload_len: u8)
pub fn set_payload_len(&mut self, payload_len: u8)
Sets the payload length field.
Length of this Authentication Header with scaling factor of 4, minus 2.
E.g: Header length = (payload_len + 2) * 4.
Sourcepub fn set_reserved(&mut self, reserved: u16)
pub fn set_reserved(&mut self, reserved: u16)
Sets the reserved field.
Should be all zeros.
Sourcepub fn set_spi(&mut self, spi: u32)
pub fn set_spi(&mut self, spi: u32)
Sets 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 set_sequence_number(&mut self, sequence_number: u32)
pub fn set_sequence_number(&mut self, sequence_number: u32)
Sets the sequence number field.
Monotonically increasing counter value to prevent replay attacks.
Auto Trait Implementations§
impl<'a> Freeze for AuthenticationHeaderWriter<'a>
impl<'a> RefUnwindSafe for AuthenticationHeaderWriter<'a>
impl<'a> Send for AuthenticationHeaderWriter<'a>
impl<'a> Sync for AuthenticationHeaderWriter<'a>
impl<'a> Unpin for AuthenticationHeaderWriter<'a>
impl<'a> !UnwindSafe for AuthenticationHeaderWriter<'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