Move platform specific code to platform directory
This commit is contained in:
@@ -1,20 +1,18 @@
|
||||
#![cfg_attr(not(target_os = "linux"), allow(dead_code))]
|
||||
|
||||
use nym_task::TaskClient;
|
||||
|
||||
pub use error::WgError;
|
||||
|
||||
mod error;
|
||||
#[cfg(target_os = "linux")]
|
||||
mod event;
|
||||
#[cfg(target_os = "linux")]
|
||||
mod platform;
|
||||
mod setup;
|
||||
#[cfg(target_os = "linux")]
|
||||
mod tun;
|
||||
#[cfg(target_os = "linux")]
|
||||
mod tun_device;
|
||||
#[cfg(target_os = "linux")]
|
||||
mod udp_listener;
|
||||
|
||||
// Currently the module related to setting up the virtual network device is platform specific.
|
||||
#[cfg(target_os = "linux")]
|
||||
use platform::linux::tun_device;
|
||||
|
||||
type ActivePeers =
|
||||
dashmap::DashMap<std::net::SocketAddr, tokio::sync::mpsc::UnboundedSender<crate::event::Event>>;
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
pub(crate) mod tun_device;
|
||||
@@ -0,0 +1,2 @@
|
||||
#[cfg(target_os = "linux")]
|
||||
pub(crate) mod linux;
|
||||
@@ -15,7 +15,7 @@ use tokio::{
|
||||
time::timeout,
|
||||
};
|
||||
|
||||
use crate::{event::Event, WgError};
|
||||
use crate::{error::WgError, event::Event};
|
||||
|
||||
const MAX_PACKET: usize = 65535;
|
||||
|
||||
|
||||
@@ -62,8 +62,6 @@ nym-statistics-common = { path = "../common/statistics" }
|
||||
nym-task = { path = "../common/task" }
|
||||
nym-types = { path = "../common/types" }
|
||||
nym-validator-client = { path = "../common/client-libs/validator-client" }
|
||||
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
nym-wireguard = { path = "../common/wireguard", optional = true }
|
||||
|
||||
[build-dependencies]
|
||||
|
||||
Reference in New Issue
Block a user