fix: Fix build errors related to uds scheme

This commit is contained in:
Ibuki Omatsu
2025-07-19 18:13:15 +00:00
committed by Jeremy Soller
parent e7388ae2fb
commit 1004be449d
7 changed files with 29 additions and 180 deletions
-1
View File
@@ -8,7 +8,6 @@ name = "smolnetd"
path = "src/main.rs"
[dependencies]
netutils = { git = "https://gitlab.redox-os.org/redox-os/netutils.git" }
redox_event = "0.4.1"
redox-daemon = "0.1.2"
redox_syscall = { version = "0.5", features = ["std"] }
+7 -1
View File
@@ -5,7 +5,6 @@ use crate::router::route_table::{RouteTable, Rule};
use crate::router::Router;
use crate::scheme::smoltcp::iface::SocketSet as SmoltcpSocketSet;
use libredox::Fd;
use netutils::getcfg;
use smoltcp;
use smoltcp::iface::{Config, Interface as SmoltcpInterface};
use smoltcp::phy::Tracer;
@@ -43,6 +42,13 @@ type Interface = Rc<RefCell<SmoltcpInterface>>;
const MAX_DURATION: Duration = Duration::from_micros(u64::MAX);
const MIN_DURATION: Duration = Duration::from_micros(0);
fn getcfg(key: &str) -> Result<String> {
let mut value = String::new();
let mut file = File::open(format!("/etc/net/{key}"))?;
file.read_to_string(&mut value)?;
Ok(value.trim().to_string())
}
pub struct Smolnetd {
router_device: Tracer<Router>,
iface: Interface,