Compare commits
No commits in common. "b53def2613befaad3b61b18b766426dd31af3394" and "d9f6b53fa66b53e5ea7c85c548bb2d9a3a64eabb" have entirely different histories.
b53def2613
...
d9f6b53fa6
1 changed files with 0 additions and 14 deletions
14
src/main.rs
14
src/main.rs
|
|
@ -6,7 +6,6 @@ use serde::{Deserialize, Serialize};
|
||||||
// RETICULUM INCLUDES
|
// RETICULUM INCLUDES
|
||||||
use reticulum::iface::tcp_client::TcpClient;
|
use reticulum::iface::tcp_client::TcpClient;
|
||||||
use reticulum::iface::tcp_server::TcpServer;
|
use reticulum::iface::tcp_server::TcpServer;
|
||||||
use reticulum::iface::udp::UdpInterface;
|
|
||||||
use reticulum::transport::{Transport, TransportConfig};
|
use reticulum::transport::{Transport, TransportConfig};
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
|
|
@ -19,17 +18,10 @@ struct TcpClientConfig {
|
||||||
bind_addr: String,
|
bind_addr: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
|
||||||
struct UdpConfig {
|
|
||||||
bind_addr: String,
|
|
||||||
forward_addr: Option<String>,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
enum InterfaceConfig {
|
enum InterfaceConfig {
|
||||||
TcpServer(TcpServerConfig),
|
TcpServer(TcpServerConfig),
|
||||||
TcpClient(TcpClientConfig),
|
TcpClient(TcpClientConfig),
|
||||||
Udp(UdpConfig),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
|
|
@ -78,12 +70,6 @@ async fn main() {
|
||||||
.await
|
.await
|
||||||
.spawn(TcpClient::new(cfg.bind_addr), TcpClient::spawn);
|
.spawn(TcpClient::new(cfg.bind_addr), TcpClient::spawn);
|
||||||
}
|
}
|
||||||
InterfaceConfig::Udp(cfg) => {
|
|
||||||
let _ = transport.iface_manager().lock().await.spawn(
|
|
||||||
UdpInterface::new(cfg.bind_addr, cfg.forward_addr),
|
|
||||||
UdpInterface::spawn,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue