use super::*;
pub struct TunDevice {
name: String,
mtu: u16,
address: FipsAddress,
}
impl TunDevice {
pub async fn create(config: &TunConfig, address: FipsAddress) -> Result<Self, TunError> {
let _ = (config, address);
Err(TunError::UnsupportedPlatform)
}
pub fn name(&self) -> &str {
&self.name
}
pub fn mtu(&self) -> u16 {
self.mtu
}
pub fn address(&self) -> &FipsAddress {
&self.address
}
pub fn create_writer(
&self,
max_mss: u16,
path_mtu_lookup: PathMtuLookup,
) -> Result<(TunWriter, TunTx), TunError> {
let _ = (max_mss, path_mtu_lookup);
Err(TunError::UnsupportedPlatform)
}
}
impl std::fmt::Debug for TunDevice {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("TunDevice")
.field("name", &self.name)
.field("mtu", &self.mtu)
.field("address", &self.address)
.finish()
}
}
pub struct TunWriter;
impl TunWriter {
pub fn run(self) {}
}
pub(crate) fn run_tun_reader(runtime: super::TunReaderRuntime) {
let _ = runtime;
}
pub async fn shutdown_tun_interface(name: &str) -> Result<(), TunError> {
let _ = name;
Ok(())
}