diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2017-01-25 13:33:00 +0100 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2017-01-30 10:07:26 +0100 |
| commit | 587d145c32a5225bc845d13d50502564e1db96df (patch) | |
| tree | 46e2c6bbdd70e37addc2442ff6d1720e12bc30e0 | |
| parent | b900f4f5903d86f6209459339496bfdcf006b93d (diff) | |
| download | mullvadvpn-587d145c32a5225bc845d13d50502564e1db96df.tar.xz mullvadvpn-587d145c32a5225bc845d13d50502564e1db96df.zip | |
Rename ffi function arguments
| -rw-r--r-- | talpid_openvpn_plugin/src/ffi/mod.rs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/talpid_openvpn_plugin/src/ffi/mod.rs b/talpid_openvpn_plugin/src/ffi/mod.rs index eacb87f963..019decf157 100644 --- a/talpid_openvpn_plugin/src/ffi/mod.rs +++ b/talpid_openvpn_plugin/src/ffi/mod.rs @@ -64,28 +64,29 @@ pub struct openvpn_plugin_args_func_return { /// arbitrary object inside `handle` that will then be passed to all subsequent calls to the /// plugin. #[no_mangle] -pub extern "C" fn openvpn_plugin_open_v3(version: c_int, - _arguments: *const openvpn_plugin_args_open_in, - _retptr: *const openvpn_plugin_args_open_return) +pub extern "C" fn openvpn_plugin_open_v3(_version: c_int, + _args: *const openvpn_plugin_args_open_in, + _retptr: *mut openvpn_plugin_args_open_return) -> c_int { - println!("openvpn_plugin_open_v3(version: {})", version); + println!("openvpn_plugin_open_v3()"); OPENVPN_PLUGIN_FUNC_SUCCESS } /// Called by OpenVPN just before the plugin is unloaded. Should correctly close the plugin and /// deallocate any `handle` initialized by the plugin in `openvpn_plugin_open_v3` #[no_mangle] -pub extern "C" fn openvpn_plugin_close_v1(handle: *const c_void) { - println!("openvpn_plugin_close_v1(handle: {:p})", handle); +pub extern "C" fn openvpn_plugin_close_v1(_handle: *const c_void) { + println!("openvpn_plugin_close_v1()"); } /// Called by OpenVPN for each OPENVPN_PLUGIN_* event that it registered for in /// `openvpn_plugin_open_v3` #[no_mangle] -pub extern "C" fn openvpn_plugin_func_v3(version: c_int, - _arguments: *const openvpn_plugin_args_func_in, +pub extern "C" fn openvpn_plugin_func_v3(_version: c_int, + args: *const openvpn_plugin_args_func_in, _retptr: *const openvpn_plugin_args_func_return) -> c_int { - println!("openvpn_plugin_func_v3(version: {})", version); + let event_name = unsafe { consts::plugin_event_name((*args).event_type) }; + println!("openvpn_plugin_func_v3({})", event_name); OPENVPN_PLUGIN_FUNC_SUCCESS } |
