openvpn_plugin/ffi/mod.rs
1// Copyright 2023 Mullvad VPN AB.
2//
3// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
5// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
6// option. This file may not be copied, modified, or distributed
7// except according to those terms.
8
9use std::os::raw::c_int;
10
11/// Contains functions for parsing C formatted data from OpenVPN.
12pub mod parse;
13
14/// Rust representations of the C structs sent in and expected back by OpenVPN.
15mod structs;
16pub use self::structs::*;
17
18// Return values. Returned from the plugin to OpenVPN to indicate success or failure. Can also
19// Accept (success) or decline (error) operations, such as incoming client connection attempts.
20pub const OPENVPN_PLUGIN_FUNC_SUCCESS: c_int = 0;
21pub const OPENVPN_PLUGIN_FUNC_ERROR: c_int = 1;
22pub const OPENVPN_PLUGIN_FUNC_DEFERRED: c_int = 2;