Skip to main content

ManagedSa

Struct ManagedSa 

Source
pub struct ManagedSa {
    pub sa: SecurityAssociation,
    pub state: SaState,
    pub key_id: Option<u16>,
}
Expand description

A managed Security Association with lifecycle state.

Fields§

§sa: SecurityAssociation

The underlying SA parameters.

§state: SaState

Current lifecycle state.

§key_id: Option<u16>

Assigned encryption key ID (if keyed).

Implementations§

Source§

impl ManagedSa

Source

pub fn new(spi: u16, service_type: ServiceType) -> Result<Self, Error>

Creates a new SA in UNKEYED state.

Source

pub fn rekey(&mut self, key_id: u16) -> Result<(), Error>

Assign a key to this SA (UNKEYED → KEYED).

Per Section 3.3.3.3.4: SA must be in the Unkeyed state.

Source

pub fn start(&mut self) -> Result<(), Error>

Activate the SA for operations (KEYED → OPERATIONAL).

Source

pub fn stop(&mut self) -> Result<(), Error>

Deactivate the SA (OPERATIONAL → KEYED).

Source

pub fn expire(&mut self) -> Result<(), Error>

Expire the SA, removing its key association (KEYED → UNKEYED).

Per Section 3.3.3.4.2: SA must be in the Keyed state.

Source

pub fn set_arsn(&mut self, arsn: u64)

Set the Anti-Replay Sequence Number.

Source

pub fn read_arsn(&self) -> u64

Read the current ARSN.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.