mirror of https://github.com/oxen-io/lokinet
Remove dead/redundant code
- win32_platform.cpp is dead - win32_platform.hpp is useless Style changes from clang-tidy warnings: - remove `virtual` from some definitions that already have `override` - remove virtual destructor from NetworkInterface because it already has a virtual destructor via the base type (and clang-tiny warns about it)pull/2045/head
parent
4103908a8d
commit
879e678771
@ -1,51 +0,0 @@
|
|||||||
#include "win32_platform.hpp"
|
|
||||||
#include <llarp/net/net.hpp>
|
|
||||||
|
|
||||||
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<llarp::win32::OneShotExec> 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<llarp::win32::OneShotExec> 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
|
|
@ -1,8 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "platform.hpp"
|
|
||||||
|
|
||||||
namespace llarp::dns
|
|
||||||
{
|
|
||||||
// TODO: implement me
|
|
||||||
using Win32_Platform_t = Null_Platform;
|
|
||||||
} // namespace llarp::dns
|
|
Loading…
Reference in New Issue