diff --git a/tun/src/lib.rs b/tun/src/lib.rs index 99f74fc..c05fca9 100644 --- a/tun/src/lib.rs +++ b/tun/src/lib.rs @@ -9,4 +9,4 @@ pub(crate) mod imp; mod options; pub use imp::{TunInterface, TunQueue}; -pub use options::TunInterfaceOptions; +pub use options::TunOptions; diff --git a/tun/src/options.rs b/tun/src/options.rs index 7b7d478..4c81a83 100644 --- a/tun/src/options.rs +++ b/tun/src/options.rs @@ -4,7 +4,7 @@ use std::io::Error; use super::TunInterface; #[derive(Default)] -pub struct TunInterfaceOptions { +pub struct TunOptions { /// (Windows + Linux) Name the tun interface. pub(crate) name: Option, /// (Linux) Don't include packet information. @@ -13,7 +13,7 @@ pub struct TunInterfaceOptions { pub(crate) tun_excl: Option<()>, } -impl TunInterfaceOptions { +impl TunOptions { pub fn new() -> Self { Self::default() } diff --git a/tun/src/unix/apple/mod.rs b/tun/src/unix/apple/mod.rs index 4ed002c..a82ceb9 100644 --- a/tun/src/unix/apple/mod.rs +++ b/tun/src/unix/apple/mod.rs @@ -15,7 +15,7 @@ mod sys; pub use super::queue::TunQueue; -use super::{ifname_to_string, string_to_ifname, TunInterfaceOptions}; +use super::{ifname_to_string, string_to_ifname, TunOptions}; use kern_control::SysControlSocket; #[derive(Debug)] @@ -26,11 +26,11 @@ pub struct TunInterface { impl TunInterface { #[throws] pub fn new() -> TunInterface { - Self::new_with_options(TunInterfaceOptions::new())? + Self::new_with_options(TunOptions::new())? } #[throws] - pub fn new_with_options(_: TunInterfaceOptions) -> TunInterface { + pub fn new_with_options(_: TunOptions) -> TunInterface { TunInterface::connect(0)? } diff --git a/tun/src/unix/linux/mod.rs b/tun/src/unix/linux/mod.rs index af2693d..cd3e4c0 100644 --- a/tun/src/unix/linux/mod.rs +++ b/tun/src/unix/linux/mod.rs @@ -12,7 +12,7 @@ use log::info; use libc::in6_ifreq; -use super::{ifname_to_string, string_to_ifname, TunInterfaceOptions}; +use super::{ifname_to_string, string_to_ifname, TunOptions}; mod sys; @@ -24,11 +24,11 @@ pub struct TunInterface { impl TunInterface { #[throws] pub fn new() -> TunInterface { - Self::new_with_options(TunInterfaceOptions::new())? + Self::new_with_options(TunOptions::new())? } #[throws] - pub(crate) fn new_with_options(options: TunInterfaceOptions) -> TunInterface { + pub(crate) fn new_with_options(options: TunOptions) -> TunInterface { let file = OpenOptions::new() .read(true) .write(true) diff --git a/tun/src/unix/mod.rs b/tun/src/unix/mod.rs index e4960da..550df4d 100644 --- a/tun/src/unix/mod.rs +++ b/tun/src/unix/mod.rs @@ -3,7 +3,7 @@ use std::{ os::fd::{AsRawFd, FromRawFd, IntoRawFd, RawFd}, }; -use super::TunInterfaceOptions; +use super::TunOptions; mod queue; diff --git a/tun/src/windows/mod.rs b/tun/src/windows/mod.rs index 757f629..c7b1ba5 100644 --- a/tun/src/windows/mod.rs +++ b/tun/src/windows/mod.rs @@ -5,7 +5,7 @@ use widestring::U16CString; use windows::Win32::Foundation::GetLastError; mod queue; -use super::TunInterfaceOptions; +use super::TunOptions; pub use queue::TunQueue; @@ -17,11 +17,11 @@ pub struct TunInterface { impl TunInterface { #[throws] pub fn new() -> TunInterface { - Self::new_with_options(TunInterfaceOptions::new())? + Self::new_with_options(TunOptions::new())? } #[throws] - pub(crate) fn new_with_options(options: TunInterfaceOptions) -> TunInterface { + pub(crate) fn new_with_options(options: TunOptions) -> TunInterface { let name_owned = options.name.unwrap_or("Burrow".to_owned()); let name = U16CString::from_str(&name_owned).unwrap();