diff options
| -rw-r--r-- | talpid_openvpn_plugin/src/lib.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/talpid_openvpn_plugin/src/lib.rs b/talpid_openvpn_plugin/src/lib.rs index d2d1ea9d74..49e4ce031c 100644 --- a/talpid_openvpn_plugin/src/lib.rs +++ b/talpid_openvpn_plugin/src/lib.rs @@ -8,8 +8,38 @@ extern crate error_chain; #[macro_use] extern crate assert_matches; +use std::collections::HashMap; + + mod ffi; /// Publicly export the functions making up the public interface of the plugin. These are the C FFI /// functions called by OpenVPN. pub use ffi::{openvpn_plugin_open_v3, openvpn_plugin_close_v1, openvpn_plugin_func_v3}; + +use ffi::consts::OpenVpnPluginEvent; + + +error_chain!{} + + +/// Struct processing OpenVPN events and notifies listeners over IPC +struct EventProcessor; + +impl EventProcessor { + pub fn new() -> Result<EventProcessor> { + Ok(EventProcessor) + } + + pub fn process_event(&mut self, event: OpenVpnPluginEvent, env: HashMap<String, String>) { + // TODO(linus): This is where we should send events to core. + println!("Hello from EventProcessor: {:?}", event); + } +} + +impl Drop for EventProcessor { + fn drop(&mut self) { + // TODO(linus): If we need, this is where we send some shutdown event or similar to core. + println!("Dropping EventProcessor!"); + } +} |
