Implement sending commands via Unix sockets

This commit is contained in:
dav 2023-07-01 09:44:13 -07:00 committed by David Zhong
parent c8df4b860d
commit f869cbdb53
14 changed files with 555 additions and 177 deletions

View file

@ -11,10 +11,12 @@ socket2 = "0.4"
tokio = { version = "1.28", features = [] }
byteorder = "1.4"
log = "0.4"
serde = { version = "1", features = ["derive"], optional = true }
futures = { version = "0.3.28", optional = true }
[features]
serde = ["dep:serde"]
tokio = ["tokio/net", "dep:futures"]
[target.'cfg(feature = "tokio")'.dev-dependencies]

View file

@ -3,7 +3,8 @@ use std::io::Error;
use super::TunInterface;
#[derive(Default)]
#[derive(Debug, Clone, Default)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct TunOptions {
/// (Windows + Linux) Name the tun interface.
pub(crate) name: Option<String>,