summaryrefslogtreecommitdiffhomepage
path: root/windows
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2022-06-23 17:32:05 +0200
committerDavid Lönnhager <david.l@mullvad.net>2022-07-20 15:03:50 +0200
commit2958c5dc60cd34dc283854bb8bc6124a09f73f9b (patch)
tree265efe91f3064bd75cc51e0de9b2d3bfca8bf486 /windows
parent678733d46c6ebcee7ce1df376fb1e2e9c4238c07 (diff)
downloadmullvadvpn-2958c5dc60cd34dc283854bb8bc6124a09f73f9b.tar.xz
mullvadvpn-2958c5dc60cd34dc283854bb8bc6124a09f73f9b.zip
Remove WinNet_InterfaceLuidToIpAddress
Diffstat (limited to 'windows')
-rw-r--r--windows/winnet/src/winnet/winnet.cpp69
-rw-r--r--windows/winnet/src/winnet/winnet.def1
-rw-r--r--windows/winnet/src/winnet/winnet.h12
3 files changed, 0 insertions, 82 deletions
diff --git a/windows/winnet/src/winnet/winnet.cpp b/windows/winnet/src/winnet/winnet.cpp
index 1c0555a10c..072a3b432e 100644
--- a/windows/winnet/src/winnet/winnet.cpp
+++ b/windows/winnet/src/winnet/winnet.cpp
@@ -79,75 +79,6 @@ WinNet_GetBestDefaultRoute(
extern "C"
WINNET_LINKAGE
-WINNET_STATUS
-WINNET_API
-WinNet_InterfaceLuidToIpAddress(
- WINNET_ADDR_FAMILY family,
- uint64_t interfaceLuid,
- WINNET_IP *ip,
- MullvadLogSink logSink,
- void *logSinkContext
-)
-{
- try
- {
- if (nullptr == ip)
- {
- THROW_ERROR("Invalid argument: ip");
- }
-
- static const std::pair<WINNET_ADDR_FAMILY, ADDRESS_FAMILY> familyMap[] =
- {
- { WINNET_ADDR_FAMILY_IPV4, static_cast<ADDRESS_FAMILY>(AF_INET) },
- { WINNET_ADDR_FAMILY_IPV6, static_cast<ADDRESS_FAMILY>(AF_INET6) }
- };
- const auto win_family = common::ValueMapper::Map<>(family, familyMap);
-
- MIB_UNICASTIPADDRESS_TABLE *table = nullptr;
- const auto status = GetUnicastIpAddressTable(win_family, &table);
-
- if (NO_ERROR != status)
- {
- THROW_WINDOWS_ERROR(status, "GetUnicastIpAddressTable");
- }
-
- common::memory::ScopeDestructor destructor;
-
- destructor += [table]() {
- FreeMibTable(table);
- };
-
- for (ULONG i = 0; i < table->NumEntries; i++)
- {
- const auto entry = table->Table[i];
-
- if (interfaceLuid != entry.InterfaceLuid.Value)
- {
- continue;
- }
-
- // Found IP address
- const auto ips = winnet::ConvertNativeAddresses(&entry.Address, 1);
- *ip = ips[0];
-
- return WINNET_STATUS_SUCCESS;
- }
-
- return WINNET_STATUS_NOT_FOUND;
- }
- catch (const std::exception & err)
- {
- shared::logging::UnwindAndLog(logSink, logSinkContext, err);
- return WINNET_STATUS_FAILURE;
- }
- catch (...)
- {
- return WINNET_STATUS_FAILURE;
- }
-}
-
-extern "C"
-WINNET_LINKAGE
bool
WINNET_API
WinNet_ActivateRouteManager(
diff --git a/windows/winnet/src/winnet/winnet.def b/windows/winnet/src/winnet/winnet.def
index a5f9a63863..100a5d0313 100644
--- a/windows/winnet/src/winnet/winnet.def
+++ b/windows/winnet/src/winnet/winnet.def
@@ -4,4 +4,3 @@ EXPORTS
WinNet_DeactivateRouteManager
WinNet_AddDeviceIpAddresses
WinNet_GetBestDefaultRoute
- WinNet_InterfaceLuidToIpAddress
diff --git a/windows/winnet/src/winnet/winnet.h b/windows/winnet/src/winnet/winnet.h
index 0c72c91eb8..69aff79523 100644
--- a/windows/winnet/src/winnet/winnet.h
+++ b/windows/winnet/src/winnet/winnet.h
@@ -134,18 +134,6 @@ WinNet_GetBestDefaultRoute(
void *logSinkContext
);
-extern "C"
-WINNET_LINKAGE
-WINNET_STATUS
-WINNET_API
-WinNet_InterfaceLuidToIpAddress(
- WINNET_ADDR_FAMILY family,
- uint64_t interfaceLuid,
- WINNET_IP *ip,
- MullvadLogSink logSink,
- void *logSinkContext
-);
-
enum WINNET_DEFAULT_ROUTE_CHANGED_EVENT_TYPE
{
// Best default route changed.