Enum openvpn_plugin::EventResult
source · pub enum EventResult {
Success,
Deferred,
Failure,
}
Expand description
Enum representing the results an OpenVPN plugin can return from an event callback.
Variants§
Success
Will return OPENVPN_PLUGIN_FUNC_SUCCESS
to OpenVPN.
Indicates that the plugin marks the event as a success. This means an auth is approved
or similar, depending on which type of event.
Deferred
Will return OPENVPN_PLUGIN_FUNC_DEFERRED
to OpenVPN.
WARNING: Can only be returned from the EventType::AuthUserPassVerify
(OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY
) event. No other events may return this variant.
Returning this tells OpenVPN to continue its normal work and that the decision on if the
authentication is accepted or not will be delivered later, via writing to the path under
the auth_control_file
environment variable.
Failure
Will return OPENVPN_PLUGIN_FUNC_ERROR
to OpenVPN.
Both returning Ok(EventResult::Failure)
and Err(e)
from a callback will result in
OPENVPN_PLUGIN_FUNC_ERROR
being returned to OpenVPN. The difference being that an
Err(e)
will also log the error e
. This variant is intended for when the plugin did
not encounter an error, but the event is a failure or is to be declined. Intended to be
used to decline an authentication request and similar.
Trait Implementations§
source§impl Clone for EventResult
impl Clone for EventResult
source§fn clone(&self) -> EventResult
fn clone(&self) -> EventResult
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for EventResult
impl Debug for EventResult
source§impl Hash for EventResult
impl Hash for EventResult
source§impl PartialEq<EventResult> for EventResult
impl PartialEq<EventResult> for EventResult
source§fn eq(&self, other: &EventResult) -> bool
fn eq(&self, other: &EventResult) -> bool
self
and other
values to be equal, and is used
by ==
.