diff --git a/daemon/lokinet.cpp b/daemon/lokinet.cpp index 8eb799f29..4230846de 100644 --- a/daemon/lokinet.cpp +++ b/daemon/lokinet.cpp @@ -373,9 +373,8 @@ lokinet_main(int argc, char** argv) if (startWinsock()) return -1; SetConsoleCtrlHandler(handle_signal_win32, TRUE); - - // SetUnhandledExceptionFilter(win32_signal_handler); #endif + cxxopts::Options options( "lokinet", "LokiNET is a free, open source, private, " diff --git a/llarp/dns/server.cpp b/llarp/dns/server.cpp index 49e4fef14..4ef4ce919 100644 --- a/llarp/dns/server.cpp +++ b/llarp/dns/server.cpp @@ -16,7 +16,6 @@ #include "oxen/log.hpp" #include "sd_platform.hpp" #include "nm_platform.hpp" -#include "win32_platform.hpp" namespace llarp::dns { @@ -570,10 +569,6 @@ namespace llarp::dns plat->add_impl(std::make_unique()); plat->add_impl(std::make_unique()); } - if constexpr (llarp::platform::is_windows) - { - plat->add_impl(std::make_unique()); - } return plat; } diff --git a/llarp/dns/win32_platform.cpp b/llarp/dns/win32_platform.cpp deleted file mode 100644 index 6c268b05c..000000000 --- a/llarp/dns/win32_platform.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include "win32_platform.hpp" -#include - -namespace llarp::dns::win32 -{ - void - Platform::set_resolver(unsigned int index, llarp::SockAddr dns, bool) - { -#ifdef _WIN32 - - // clear any previous dns settings - m_UndoDNS.clear(); - - auto interfaces = m_Loop->Net_ptr()->AllNetworkInterfaces(); - // remove dns - { - std::vector jobs; - for (const auto& ent : interfaces) - { - if (ent.index == index) - continue; - jobs.emplace_back( - "netsh.exe", fmt::format("interface ipv4 delete dns \"{}\" all", ent.name)); - jobs.emplace_back( - "netsh.exe", fmt::format("interface ipv6 delete dns \"{}\" all", ent.name)); - } - } - // add new dns - { - std::vector jobs; - for (const auto& ent : interfaces) - { - if (ent.index == index) - continue; - jobs.emplace_back( - "netsh.exe", - fmt::format("interface ipv4 add dns \"{}\" {} validate=no", ent.name, dns.asIPv4())); - jobs.emplace_back( - "netsh.exe", - fmt::format("interface ipv6 add dns \"{}\" {} validate=no", ent.name, dns.asIPv6())); - m_UndoDNS.emplace_back("netsh.exe", fmt::format("", index)); - } - m_UndoDNS.emplace_back("netsh.exe", "winsock reset"); - } - // flush dns - llarp::win32::Exec("ipconfig.exe", "/flushdns"); - -#endif - } - -} // namespace llarp::dns::win32 diff --git a/llarp/dns/win32_platform.hpp b/llarp/dns/win32_platform.hpp deleted file mode 100644 index cb57a206c..000000000 --- a/llarp/dns/win32_platform.hpp +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once -#include "platform.hpp" - -namespace llarp::dns -{ - // TODO: implement me - using Win32_Platform_t = Null_Platform; -} // namespace llarp::dns diff --git a/llarp/vpn/platform.hpp b/llarp/vpn/platform.hpp index ebba6dee8..9ae880bb9 100644 --- a/llarp/vpn/platform.hpp +++ b/llarp/vpn/platform.hpp @@ -59,8 +59,6 @@ namespace llarp::vpn NetworkInterface(const NetworkInterface&) = delete; NetworkInterface(NetworkInterface&&) = delete; - virtual ~NetworkInterface() = default; - const InterfaceInfo& Info() const { diff --git a/llarp/win32/windivert.cpp b/llarp/win32/windivert.cpp index 7dc181e91..739e15638 100644 --- a/llarp/win32/windivert.cpp +++ b/llarp/win32/windivert.cpp @@ -125,13 +125,13 @@ namespace llarp::win32 return -1; } - virtual bool + bool WritePacket(net::IPPacket) override { return false; } - virtual net::IPPacket + net::IPPacket ReadNextPacket() override { auto w_pkt = m_RecvQueue.tryPopFront(); @@ -144,7 +144,7 @@ namespace llarp::win32 return pkt; } - virtual void + void Start() override { L::info(cat, "starting windivert"); @@ -172,7 +172,7 @@ namespace llarp::win32 m_Runner = std::thread{std::move(read_loop)}; } - virtual void + void Stop() override { L::info(cat, "stopping windivert"); diff --git a/llarp/win32/wintun.cpp b/llarp/win32/wintun.cpp index b6fb30ba0..0a48b3207 100644 --- a/llarp/win32/wintun.cpp +++ b/llarp/win32/wintun.cpp @@ -233,11 +233,9 @@ namespace llarp::win32 [[nodiscard]] std::pair, bool> ReadPacket() const { - // typedef so the return statement fits on 1 line :^D - using Pkt_ptr = std::unique_ptr; DWORD sz; if (auto* ptr = read_packet(_impl, &sz)) - return {Pkt_ptr{new PacketWrapper{ptr, sz, _impl}}, false}; + return {std::unique_ptr{new PacketWrapper{ptr, sz, _impl}}, false}; const auto err = GetLastError(); if (err == ERROR_NO_MORE_ITEMS or err == ERROR_HANDLE_EOF) {