MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / GetDNS

Method GetDNS

pcsx2/DEV9/AdapterUtils.cpp:531–550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

529// DNS.
530#ifdef _WIN32
531std::vector<IP_Address> AdapterUtils::GetDNS(const Adapter* adapter)
532{
533 if (adapter == nullptr)
534 return {};
535
536 std::vector<IP_Address> collection;
537
538 PIP_ADAPTER_DNS_SERVER_ADDRESS address = adapter->FirstDnsServerAddress;
539 while (address != nullptr)
540 {
541 if (ReadAddressFamily(address->Address.lpSockaddr) == AF_INET)
542 {
543 const sockaddr_in* sockaddr = reinterpret_cast<sockaddr_in*>(address->Address.lpSockaddr);
544 collection.push_back(std::bit_cast<IP_Address>(sockaddr->sin_addr));
545 }
546 address = address->Next;
547 }
548
549 return collection;
550}
551#elif defined(__POSIX__)
552std::vector<IP_Address> AdapterUtils::GetDNS(const Adapter* adapter)
553{

Callers

nothing calls this directly

Calls 7

rfindMethod · 0.80
SplitStringFunction · 0.50
push_backMethod · 0.45
closeMethod · 0.45
ErrorMethod · 0.45
sizeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected