mirror of
https://github.com/arampoire/onetun.git
synced 2025-12-01 02:00:25 -05:00
Implement IP sink interface
This commit is contained in:
parent
cfdbdc8f51
commit
2bcb9e714b
4 changed files with 82 additions and 6 deletions
|
|
@ -22,6 +22,14 @@ impl VirtualIpDevice {
|
|||
|
||||
Ok(Self { wg, ip_dispatch_rx })
|
||||
}
|
||||
|
||||
pub async fn new_sink(wg: Arc<WireGuardTunnel>) -> anyhow::Result<Self> {
|
||||
let ip_dispatch_rx = wg
|
||||
.register_sink_interface()
|
||||
.await
|
||||
.with_context(|| "Failed to register IP dispatch for sink virtual interface")?;
|
||||
Ok(Self { wg, ip_dispatch_rx })
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Device<'a> for VirtualIpDevice {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue