Skip to main content

Notification

Enum Notification 

Source
pub enum Notification {
Show 17 variants Client { event: ClientEvent, cid: u64, kid: Option<u64>, env: Vec<(String, String)>, }, ClientAddress { cid: u64, addr: String, primary: bool, }, State { timestamp: u64, name: OpenVpnState, description: String, local_ip: String, remote_ip: String, remote_port: String, local_addr: String, local_port: String, local_ipv6: String, }, ByteCount { bytes_in: u64, bytes_out: u64, }, ByteCountCli { cid: u64, bytes_in: u64, bytes_out: u64, }, Log { timestamp: u64, level: LogLevel, message: String, }, Echo { timestamp: u64, param: String, }, Hold { text: String, }, Fatal { message: String, }, Pkcs11IdCount { count: u32, }, NeedOk { name: String, message: String, }, NeedStr { name: String, message: String, }, RsaSign { data: String, }, Remote { host: String, port: u16, protocol: TransportProtocol, }, Proxy { index: u32, proxy_type: String, host: String, }, Password(PasswordNotification), Simple { kind: String, payload: String, },
}
Expand description

A parsed real-time notification from OpenVPN.

Variants§

§

Client

A multi-line >CLIENT: notification (CONNECT, REAUTH, ESTABLISHED, DISCONNECT). The header and all ENV key=value pairs are accumulated into a single struct before this is emitted.

Fields

§event: ClientEvent

The client event sub-type.

§cid: u64

Client ID (sequential, assigned by OpenVPN).

§kid: Option<u64>

Key ID (present for CONNECT/REAUTH, absent for ESTABLISHED/DISCONNECT).

§env: Vec<(String, String)>

Accumulated ENV pairs, in order. Each >CLIENT:ENV,key=val line becomes one (key, val) entry. The terminating >CLIENT:ENV,END is consumed but not included.

§

ClientAddress

A single-line >CLIENT:ADDRESS notification.

Fields

§cid: u64

Client ID.

§addr: String

Assigned virtual address.

§primary: bool

Whether this is the primary address for the client.

§

State

>STATE:timestamp,name,desc,local_ip,remote_ip,remote_port,local_addr,local_port,local_ipv6

Field order per management-notes.txt: (a) timestamp, (b) state name, (c) description, (d) TUN/TAP local IPv4, (e) remote server address, (f) remote server port, (g) local address, (h) local port, (i) TUN/TAP local IPv6.

Fields

§timestamp: u64

(a) Unix timestamp of the state change.

§name: OpenVpnState

(b) State name (e.g. Connected, Reconnecting).

§description: String

(c) Verbose description (mostly for RECONNECTING/EXITING).

§local_ip: String

(d) TUN/TAP local IPv4 address (may be empty).

§remote_ip: String

(e) Remote server address (may be empty).

§remote_port: String

(f) Remote server port (may be empty).

§local_addr: String

(g) Local address (may be empty).

§local_port: String

(h) Local port (may be empty).

§local_ipv6: String

(i) TUN/TAP local IPv6 address (may be empty).

§

ByteCount

>BYTECOUNT:bytes_in,bytes_out (client mode)

Fields

§bytes_in: u64

Bytes received since last reset.

§bytes_out: u64

Bytes sent since last reset.

§

ByteCountCli

>BYTECOUNT_CLI:cid,bytes_in,bytes_out (server mode, per-client)

Fields

§cid: u64

Client ID.

§bytes_in: u64

Bytes received from this client.

§bytes_out: u64

Bytes sent to this client.

§

Log

>LOG:timestamp,level,message

Fields

§timestamp: u64

Unix timestamp of the log entry.

§level: LogLevel

Log severity level.

§message: String

The log message text.

§

Echo

>ECHO:timestamp,param_string

Fields

§timestamp: u64

Unix timestamp.

§param: String

The echoed parameter string.

§

Hold

>HOLD:Waiting for hold release[:N]

Fields

§text: String

The hold message text.

§

Fatal

>FATAL:message

Fields

§message: String

The fatal error message.

§

Pkcs11IdCount

>PKCS11ID-COUNT:count

Fields

§count: u32

Number of available PKCS#11 identities.

§

NeedOk

>NEED-OK:Need 'name' confirmation MSG:message

Fields

§name: String

The prompt name.

§message: String

The prompt message to display.

§

NeedStr

>NEED-STR:Need 'name' input MSG:message

Fields

§name: String

The prompt name.

§message: String

The prompt message to display.

§

RsaSign

>RSA_SIGN:base64_data

Fields

§data: String

Base64-encoded data to be signed.

§

Remote

>REMOTE:host,port,protocol

Fields

§host: String

Remote server hostname or IP.

§port: u16

Remote server port.

§protocol: TransportProtocol

Transport protocol.

§

Proxy

>PROXY:index,proxy_type,host

Sent when OpenVPN needs proxy information (requires --management-query-proxy). The management client responds with a proxy command.

Fields

§index: u32

Connection index (1-based).

§proxy_type: String

Proxy type string (e.g. "TCP", "UDP").

§host: String

Server hostname or IP to connect through.

§

Password(PasswordNotification)

>PASSWORD:... — see PasswordNotification for the sub-types.

§

Simple

Fallback for any notification type not explicitly modeled above. Kept for forward compatibility with future OpenVPN versions.

Fields

§kind: String

The notification type keyword (e.g. "BYTECOUNT").

§payload: String

Everything after the first colon.

Trait Implementations§

Source§

impl Clone for Notification

Source§

fn clone(&self) -> Notification

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Notification

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Notification

Source§

fn eq(&self, other: &Notification) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Notification

Source§

impl StructuralPartialEq for Notification

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.