mirror of
https://github.com/arampoire/onetun.git
synced 2025-12-01 01:00:24 -05:00
Index ports with protocol in WG. Start writing UDP tunnel code with plans.
This commit is contained in:
parent
703f261344
commit
5cec6d4943
10 changed files with 156 additions and 91 deletions
|
|
@ -1,3 +1,4 @@
|
|||
use crate::virtual_iface::VirtualPort;
|
||||
use crate::wg::WireGuardTunnel;
|
||||
use anyhow::Context;
|
||||
use smoltcp::phy::{Device, DeviceCapabilities, Medium};
|
||||
|
|
@ -15,7 +16,7 @@ pub struct VirtualIpDevice {
|
|||
}
|
||||
|
||||
impl VirtualIpDevice {
|
||||
pub fn new(virtual_port: u16, wg: Arc<WireGuardTunnel>) -> anyhow::Result<Self> {
|
||||
pub fn new(virtual_port: VirtualPort, wg: Arc<WireGuardTunnel>) -> anyhow::Result<Self> {
|
||||
let ip_dispatch_rx = wg
|
||||
.register_virtual_interface(virtual_port)
|
||||
.with_context(|| "Failed to register IP dispatch for virtual interface")?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue