⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

OpenvpnClient

Struct OpenvpnClient 

Source
pub struct OpenvpnClient { /* private fields */ }
Expand description

OpenVPN client connection

Implementations§

Source§

impl OpenvpnClient

Source

pub fn new(config: OpenvpnConfig, session_id: u64) -> Self

Create a new OpenVPN client with the given configuration

Source

pub fn state(&self) -> OpenvpnState

Get current connection state

Source

pub fn session_id(&self) -> u64

Get the session ID

Source

pub fn connect(&mut self, now: u64) -> Result<Vec<u8>, OpenvpnError>

Initiate a connection (send hard reset)

Source

pub fn disconnect(&mut self)

Clean disconnect

Source

pub fn send_control( &mut self, payload: &[u8], now: u64, ) -> Result<Vec<u8>, OpenvpnError>

Send a control channel message (reliable, with pending ACK)

Source

pub fn send_data(&mut self, payload: &[u8]) -> Result<Vec<u8>, OpenvpnError>

Encrypt and send a data channel packet

Source

pub fn receive_packet(&mut self, data: &[u8]) -> Result<Vec<u8>, OpenvpnError>

Process an incoming packet

Source

pub fn process_control(&mut self, data: &[u8]) -> Result<Vec<u8>, OpenvpnError>

Handle control channel messages

Source

pub fn renegotiate(&mut self, now: u64) -> Result<Vec<u8>, OpenvpnError>

Initiate TLS key renegotiation

Source

pub fn needs_renegotiation(&self, now: u64) -> bool

Check if renegotiation is needed based on elapsed time

Source

pub fn traffic_stats(&self) -> (u64, u64)

Get bytes sent/received counters

Auto Trait Implementations§

§

impl Freeze for OpenvpnClient

§

impl RefUnwindSafe for OpenvpnClient

§

impl Send for OpenvpnClient

§

impl Sync for OpenvpnClient

§

impl Unpin for OpenvpnClient

§

impl UnwindSafe for OpenvpnClient

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.