Graceful shutdown. Docs.

This commit is contained in:
Aram 🍐 2021-10-15 19:26:26 -04:00
parent 8243945970
commit 006a1b0b4e
4 changed files with 40 additions and 2 deletions

View file

@ -3,9 +3,13 @@ use smoltcp::phy::{Device, DeviceCapabilities, Medium};
use smoltcp::time::Instant;
use std::sync::Arc;
/// A virtual device that processes IP packets. IP packets received from the WireGuard endpoint
/// are made available to this device using a broadcast channel receiver. IP packets sent from this device
/// are asynchronously sent out to the WireGuard tunnel.
pub struct VirtualIpDevice {
/// Tunnel to send IP packets to.
wg: Arc<WireGuardTunnel>,
/// Broadcast channel receiver for received IP packets.
ip_broadcast_rx: tokio::sync::broadcast::Receiver<Vec<u8>>,
}