working commit

This commit is contained in:
2026-05-17 12:41:25 +02:00
parent cfb8329741
commit f0aa8a7ff2
5 changed files with 55 additions and 26 deletions
+10
View File
@@ -284,6 +284,16 @@ std::expected<std::string, std::string> Interface::Read() {
return rdata;
}
std::expected<int, std::string> Interface::Write(std::string payload) {
int wsize = 0;
if ((wsize = write(tunfd, payload.data(), payload.size())) < 0) {
int errnocopy = errno;
std::string error = std::strerror(errnocopy);
return std::unexpected("Write interface error: " + error);
}
return wsize;
}
std::string Interface::Name() {
return ifname;
}