Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to smoltcp 0.11 #59

Merged
merged 2 commits into from
Dec 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 7 additions & 49 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ rand = "0.8"
nom = "7"
async-trait = "0.1"
priority-queue = "1.3"
smoltcp = { version = "0.10", default-features = false, features = [
smoltcp = { version = "0.11", default-features = false, features = [
"std",
"log",
"medium-ip",
Expand Down
8 changes: 4 additions & 4 deletions src/virtual_iface/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ use std::{
const MAX_PACKET: usize = 65536;

/// A virtual interface for proxying Layer 7 data to Layer 3 packets, and vice-versa.
pub struct TcpVirtualInterface<'a> {
pub struct TcpVirtualInterface {
source_peer_ip: IpAddr,
port_forwards: Vec<PortForwardConfig>,
bus: Bus,
sockets: SocketSet<'a>,
sockets: SocketSet<'static>,
}

impl<'a> TcpVirtualInterface<'a> {
impl TcpVirtualInterface {
/// Initialize the parameters for a new virtual interface.
/// Use the `poll_loop()` future to start the virtual interface poll loop.
pub fn new(port_forwards: Vec<PortForwardConfig>, bus: Bus, source_peer_ip: IpAddr) -> Self {
Expand Down Expand Up @@ -84,7 +84,7 @@ impl<'a> TcpVirtualInterface<'a> {
}

#[async_trait]
impl VirtualInterfacePoll for TcpVirtualInterface<'_> {
impl VirtualInterfacePoll for TcpVirtualInterface {
async fn poll_loop(mut self, mut device: VirtualIpDevice) -> anyhow::Result<()> {
// Create CIDR block for source peer IP + each port forward IP
let addresses = self.addresses();
Expand Down
8 changes: 4 additions & 4 deletions src/virtual_iface/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ use std::{

const MAX_PACKET: usize = 65536;

pub struct UdpVirtualInterface<'a> {
pub struct UdpVirtualInterface {
source_peer_ip: IpAddr,
port_forwards: Vec<PortForwardConfig>,
bus: Bus,
sockets: SocketSet<'a>,
sockets: SocketSet<'static>,
}

impl<'a> UdpVirtualInterface<'a> {
impl UdpVirtualInterface {
/// Initialize the parameters for a new virtual interface.
/// Use the `poll_loop()` future to start the virtual interface poll loop.
pub fn new(port_forwards: Vec<PortForwardConfig>, bus: Bus, source_peer_ip: IpAddr) -> Self {
Expand Down Expand Up @@ -96,7 +96,7 @@ impl<'a> UdpVirtualInterface<'a> {
}

#[async_trait]
impl<'a> VirtualInterfacePoll for UdpVirtualInterface<'a> {
impl VirtualInterfacePoll for UdpVirtualInterface {
async fn poll_loop(mut self, mut device: VirtualIpDevice) -> anyhow::Result<()> {
// Create CIDR block for source peer IP + each port forward IP
let addresses = self.addresses();
Expand Down
Loading