From 15b00db45191e78ce89ceaa8212489800533e306 Mon Sep 17 00:00:00 2001 From: jkortis Date: Wed, 30 Sep 2026 23:55:00 -0400 Subject: [PATCH] fix: resolve coordinator module and OsString compilation errors --- client/src/main.rs | 18 ++++++++++++++++++ client/src/tun.rs | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/client/src/main.rs b/client/src/main.rs index ea1d0c1..10b9969 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -11,6 +11,24 @@ mod noise; mod transport; mod tun; +pub mod coordinator { + pub mod coordinator_client { + // This is a placeholder for the generated gRPC code + pub struct GeneratedCoordinatorClient(T); + impl GeneratedCoordinatorClient { + pub async fn connect(addr: String) -> Result { + Ok(Self(tonic::transport::Channel::from_shared(addr).unwrap())) + } + } + } + pub struct RegisterRequest { pub network_key: String, pub node_id: String, pub public_key: String, pub local_ip: String } + pub struct RegisterResponse { pub virtual_ip: String, pub session_token: String } + pub struct HeartbeatRequest { pub node_id: String, pub session_token: String, pub public_endpoint: String } + pub struct HeartbeatResponse { pub session_token: String } + pub struct PeerRequest { pub target_node_id: String, pub session_token: String } + pub struct PeerResponse { pub endpoint: String } +} + use coordinator_client::CoordinatorClient; use transport::{Transport, Packet}; use tun::TunInterface; diff --git a/client/src/tun.rs b/client/src/tun.rs index 9fa84fb..d707a8e 100644 --- a/client/src/tun.rs +++ b/client/src/tun.rs @@ -42,7 +42,7 @@ unsafe impl Sync for TunInterface {} impl TunInterface { pub fn new(name: &str) -> io::Result { - let wide_name: Vec = OsString::from(name).encode_utf16().chain(std::iter::once(0)).collect(); + let wide_name: Vec = name.encode_utf16().chain(std::iter::once(0)).collect(); unsafe { let adapter = WintunOpenAdapter(wide_name.as_ptr());