MCPcopy Create free account
hub / github.com/YtFlow/Maple / SniffBestInterface

Method SniffBestInterface

Maple.App/Model/Netif.cpp:199–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197 }
198
199 std::optional<DWORD> Netif::SniffBestInterface()
200 {
201 sockaddr saddr{};
202 saddr.sa_family = AF_INET;
203 saddr.sa_data[0] = 0;
204 saddr.sa_data[1] = 53;
205 memset(&saddr.sa_data[2], 8, 4);
206
207 DWORD bestIfInd;
208 if (FAILED(GetBestInterfaceEx(&saddr, &bestIfInd))) {
209 return std::nullopt;
210 }
211 return { bestIfInd };
212 }
213
214}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected