Skip to main content

Notification

Enum Notification 

Source
pub enum Notification {
Show 21 variants Client { event: ClientEvent, cid: u64, kid: Option<u64>, env: BTreeMap<String, String>, }, ClientAddress { cid: u64, addr: String, primary: bool, }, State { timestamp: u64, name: OpenVpnState, description: String, local_ip: String, remote_ip: String, remote_port: Option<u16>, local_addr: String, local_port: Option<u16>, 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, }, PkSign { data: String, algorithm: Option<String>, }, InfoMsg { extra: String, }, NeedCertificate { hint: String, }, Info { message: String, }, Remote { host: String, port: u16, protocol: TransportProtocol, }, Proxy { index: u32, proxy_type: TransportProtocol, host: String, }, Password(PasswordNotification), Simple { kind: String, payload: String, },
}
Expand description

A parsed real-time notification from OpenVPN.

The Debug implementation masks the values of known sensitive ENV keys (e.g. password) in Client notifications, printing <redacted> instead.

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: BTreeMap<String, String>

Accumulated ENV map. Each >CLIENT:ENV,key=val line becomes one entry. The terminating >CLIENT:ENV,END is consumed but not included. If a key appears more than once, the last value wins.

§

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: Option<u16>

(f) Remote server port (empty in many states).

§local_addr: String

(g) Local address (may be empty).

§local_port: Option<u16>

(h) Local port (empty in many states).

§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.

§

PkSign

>PK_SIGN:base64_data[,algorithm]

Sent by OpenVPN 2.5+ when --management-external-key is active and a signature is needed. The management client responds with PkSig.

The algorithm field is present only when the management client announced version > 2 via the version command. For RSA-PSS, the algorithm includes comma-separated params: RSA_PKCS1_PSS_PADDING,hashalg=SHA256,saltlen=max.

Source: management-notes.txt, ssl_openssl.c get_sig_from_man().

Fields

§data: String

Base64-encoded data to be signed.

§algorithm: Option<String>

Signing algorithm (e.g. RSA_PKCS1_PADDING, ECDSA, RSA_PKCS1_PSS_PADDING,hashalg=SHA256,saltlen=max). Only present when management client version > 2.

§

InfoMsg

>INFOMSG:extra

Authentication-related information from the server, such as CR_TEXT challenges, OPEN_URL, or WEB_AUTH SSO directives. Delivered to the client via client-pending-auth.

Source: management-notes.txt (see “client-pending-auth” section).

Fields

§extra: String

The info message content (e.g. WEB_AUTH::https://... or CR_TEXT:R,E:Enter your TOTP code).

§

NeedCertificate

>NEED-CERTIFICATE:hint

Requests an external certificate when --management-external-cert is active. The hint identifies which certificate to provide (e.g. macosx-keychain:subject:o=OpenVPN-TEST). The management client responds with Certificate.

Fields

§hint: String

Hint string for locating the certificate.

§

Info

>INFO:message

Informational notification sent at any time (not just the initial banner). Notable sub-types include >INFO:WEB_AUTH::url for web-based authentication.

The initial >INFO: banner on connect is still surfaced as OvpnMessage::Info (before the codec enters notification mode). This variant captures all subsequent >INFO: messages.

Fields

§message: String

The info message content.

§

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: TransportProtocol

Proxy type (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 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Notification

Source§

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

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

impl Eq for Notification

Source§

impl PartialEq for Notification

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more