Lines Matching refs:std
84 using namespace std::chrono_literals;
117 std::pair<ScopedAddrinfo, int> safe_getaddrinfo_time_taken(const char* node, const char* service, in safe_getaddrinfo_time_taken()
121 return {std::move(result), s.timeTakenUs() / 1000}; in safe_getaddrinfo_time_taken()
126 NameserverStats(const std::string server) : server(server) {} in NameserverStats()
144 const std::string server;
153 ScopedSystemProperties(const std::string& key, const std::string& value) : mStoredKey(key) { in ScopedSystemProperties()
160 std::string mStoredKey;
161 std::string mStoredValue;
222 void StartDns(test::DNSResponder& dns, const std::vector<DnsRecord>& records) { in StartDns()
236 EXPECT_EQ(mDnsClient.resolvService()->dump(fd, querylogCmd, std::size(querylogCmd)), 0); in DumpResolverService()
240 std::chrono::milliseconds timeout = std::chrono::milliseconds(1000)) { in WaitForNat64Prefix()
244 bool WaitForPrivateDnsValidation(std::string serverAddr, bool validated) { in WaitForPrivateDnsValidation()
248 bool hasUncaughtPrivateDnsValidation(const std::string& serverAddr) { in hasUncaughtPrivateDnsValidation()
252 void ExpectDnsEvent(int32_t eventType, int32_t returnCode, const std::string& hostname, in ExpectDnsEvent()
253 const std::vector<std::string>& ipAddresses) { in ExpectDnsEvent()
268 bool expectStatsNotGreaterThan(const std::vector<NameserverStats>& nameserversStats) { in expectStatsNotGreaterThan()
272 bool expectStatsEqualTo(const std::vector<NameserverStats>& nameserversStats) { in expectStatsEqualTo()
276 bool expectStatsFromGetResolverInfo(const std::vector<NameserverStats>& nameserversStats, in expectStatsFromGetResolverInfo()
278 std::vector<std::string> res_servers; in expectStatsFromGetResolverInfo()
279 std::vector<std::string> res_domains; in expectStatsFromGetResolverInfo()
280 std::vector<std::string> res_tls_servers; in expectStatsFromGetResolverInfo()
282 std::vector<ResolverStats> res_stats; in expectStatsFromGetResolverInfo()
306 const auto it = std::find(res_servers.begin(), res_servers.end(), stats.server); in expectStatsFromGetResolverInfo()
312 const int index = std::distance(res_servers.begin(), it); in expectStatsFromGetResolverInfo()
344 static std::string getUniqueIPv4Address() { in getUniqueIPv4Address()
358 static std::shared_ptr<DnsMetricsListener>
367 std::shared_ptr<DnsMetricsListener> ResolverTest::sDnsMetricsListener;
398 const std::vector<DnsRecord> records = { in TEST_F()
418 std::string domain_name = records[i].host_name.substr(0, records[i].host_name.size() - 1); in TEST_F()
436 std::string domain_name = records[i].host_name.substr(0, records[i].host_name.size() - 1); in TEST_F()
451 const std::vector<DnsRecord> records = { in TEST_F()
566 std::vector<int> params_offsets = { in TEST_F()
576 std::sort(params_offsets.begin(), params_offsets.end()); in TEST_F()
583 std::vector<std::string> domains = {"example.com"}; in TEST_F()
584 std::vector<std::unique_ptr<test::DNSResponder>> dns; in TEST_F()
585 std::vector<std::string> servers; in TEST_F()
586 std::vector<DnsResponderClient::Mapping> mappings; in TEST_F()
596 std::accumulate(dns.begin(), dns.end(), 0, [&mapping](size_t total, auto& d) { in TEST_F()
607 std::vector<std::string> res_servers; in TEST_F()
608 std::vector<std::string> res_domains; in TEST_F()
609 std::vector<std::string> res_tls_servers; in TEST_F()
611 std::vector<ResolverStats> res_stats; in TEST_F()
639 const std::vector<DnsRecord> records = { in TEST_F()
657 std::string result_str = ToString(result); in TEST_F()
766 const std::vector<std::string> servers_for_t1 = {listen_addr1}; in TEST_F()
767 const std::vector<std::string> servers_for_t2 = {listen_addr2}; in TEST_F()
768 const std::vector<std::string> servers_for_t3 = {listen_addr3}; in TEST_F()
770 const std::vector<int> params = {300, 25, 8, 8, 5000}; in TEST_F()
774 std::thread t1([&, this]() { in TEST_F()
787 std::thread t2([&, this]() { in TEST_F()
796 std::vector<std::string> res_servers; in TEST_F()
797 std::vector<std::string> res_domains; in TEST_F()
798 std::vector<std::string> res_tls_servers; in TEST_F()
800 std::vector<ResolverStats> res_stats; in TEST_F()
810 std::thread t3([&, this]() { in TEST_F()
831 const std::vector<DnsRecord> records = { in TEST_F()
858 const std::vector<DnsRecord> records = { in TEST_F()
876 const std::vector<DnsRecord> records = { in TEST_F()
894 std::vector<std::string> searchDomains = {"example1.com", "example2.com", "example3.com"}; in TEST_F()
944 std::vector<std::string> servers = {listen_addr0, listen_addr1}; in TEST_F()
947 const std::vector<int> params = {300, 25, sample_count, sample_count}; in TEST_F()
956 std::string domain = StringPrintf("nonexistent%d", i); in TEST_F()
975 const std::vector<std::string> defaultSearchDomain = {"example.com"}; in TEST_F()
978 const std::vector<int> reduceRetryParams = { in TEST_F()
985 const std::vector<DnsRecord> records0 = { in TEST_F()
989 const std::vector<DnsRecord> records1 = { in TEST_F()
1039 const std::vector<std::string> servers = {listen_addr0, listen_addr1, listen_addr2}; in TEST_F()
1040 std::vector<std::thread> threads(10); in TEST_F()
1041 for (std::thread& thread : threads) { in TEST_F()
1042 thread = std::thread([this, &servers]() { in TEST_F()
1045 std::vector<std::string> serverSubset; in TEST_F()
1063 for (std::thread& thread : threads) { in TEST_F()
1067 std::vector<std::string> res_servers; in TEST_F()
1068 std::vector<std::string> res_domains; in TEST_F()
1069 std::vector<std::string> res_tls_servers; in TEST_F()
1071 std::vector<ResolverStats> res_stats; in TEST_F()
1080 const std::string kSortNameserversFlag("persist.device_config.netd_native.sort_nameservers"); in TEST_F()
1104 std::string hostName = StringPrintf("hello%d.com.", counter++); in TEST_F()
1110 const std::vector<NameserverStats> targetStats = { in TEST_F()
1128 const std::string kSortNameserversFlag("persist.device_config.netd_native.sort_nameservers"); in TEST_F()
1156 std::string hostName = StringPrintf("hello%d.com.", counter++); in TEST_F()
1163 const std::vector<NameserverStats> targetStats = { in TEST_F()
1185 const std::vector<aidl::android::net::ResolverHostsParcel> invalidCustHosts = { in TEST_F()
1213 const std::vector<aidl::android::net::ResolverHostsParcel> custHostV4 = { in TEST_F()
1216 const std::vector<aidl::android::net::ResolverHostsParcel> custHostV6 = { in TEST_F()
1219 const std::vector<aidl::android::net::ResolverHostsParcel> custHostV4V6 = { in TEST_F()
1223 const std::vector<DnsRecord> dnsSvHostV4 = { in TEST_F()
1226 const std::vector<DnsRecord> dnsSvHostV6 = { in TEST_F()
1229 const std::vector<DnsRecord> dnsSvHostV4V6 = { in TEST_F()
1234 const std::string name; in TEST_F()
1235 const std::vector<aidl::android::net::ResolverHostsParcel> customizedHosts; in TEST_F()
1236 const std::vector<DnsRecord> dnsserverHosts; in TEST_F()
1237 const std::vector<std::string> queryResult; in TEST_F()
1238 std::string asParameters() const { in TEST_F()
1291 const std::vector<DnsRecord> dnsSvHostV4V6 = { in TEST_F()
1295 const std::vector<aidl::android::net::ResolverHostsParcel> custHostV4V6 = { in TEST_F()
1320 std::vector<std::string> servers; in TEST_F()
1321 std::vector<std::string> domains; in TEST_F()
1323 std::vector<std::string> res_servers; in TEST_F()
1324 std::vector<std::string> res_domains; in TEST_F()
1325 std::vector<std::string> res_tls_servers; in TEST_F()
1327 std::vector<ResolverStats> res_stats; in TEST_F()
1351 std::vector<std::string> servers = {listen_addr}; in TEST_F()
1352 std::vector<std::string> domains = {"domain1.org"}; in TEST_F()
1354 const std::vector<DnsRecord> records = { in TEST_F()
1383 std::vector<std::string> getResolverDomains(aidl::android::net::IDnsResolver* dnsResolverService, in getResolverDomains()
1385 std::vector<std::string> res_servers; in getResolverDomains()
1386 std::vector<std::string> res_domains; in getResolverDomains()
1387 std::vector<std::string> res_tls_servers; in getResolverDomains()
1389 std::vector<ResolverStats> res_stats; in getResolverDomains()
1406 std::vector<std::string> servers = {listen_addr}; in TEST_F()
1408 std::vector<std::string> testDomains1; in TEST_F()
1409 std::vector<std::string> testDomains2; in TEST_F()
1414 testDomains1.push_back(std::string(300, i + '0')); in TEST_F()
1426 const std::vector<DnsRecord> records = { in TEST_F()
1464 std::vector<std::string>({"domain0.org", "domain1.org", "domain2.org", domian_name2}), in TEST_F()
1470 static void setupTlsServers(const std::vector<std::string>& servers, in setupTlsServers()
1471 std::vector<std::unique_ptr<test::DnsTlsFrontend>>* tls) { in setupTlsServers()
1476 auto t = std::make_unique<test::DnsTlsFrontend>(server, listen_tls, server, listen_udp); in setupTlsServers()
1477 t = std::make_unique<test::DnsTlsFrontend>(server, listen_tls, server, listen_udp); in setupTlsServers()
1479 tls->push_back(std::move(t)); in setupTlsServers()
1484 std::vector<std::string> domains; in TEST_F()
1485 std::vector<std::unique_ptr<test::DNSResponder>> dns; in TEST_F()
1486 std::vector<std::unique_ptr<test::DnsTlsFrontend>> tls; in TEST_F()
1487 std::vector<std::string> servers; in TEST_F()
1488 std::vector<DnsResponderClient::Mapping> mappings; in TEST_F()
1510 std::vector<std::string> res_servers; in TEST_F()
1511 std::vector<std::string> res_domains; in TEST_F()
1512 std::vector<std::string> res_tls_servers; in TEST_F()
1514 std::vector<ResolverStats> res_stats; in TEST_F()
1524 EXPECT_TRUE(std::equal(servers.begin(), servers.begin() + MAXNS, res_servers.begin())); in TEST_F()
1525 EXPECT_TRUE(std::equal(servers.begin(), servers.begin() + MAXNS, res_tls_servers.begin())); in TEST_F()
1526 EXPECT_TRUE(std::equal(domains.begin(), domains.begin() + MAXDNSRCH, res_domains.begin())); in TEST_F()
1549 std::vector<std::string> servers = {listen_addr1, listen_addr2, listen_addr3}; in TEST_F()
1557 std::string result_str = ToString(result); in TEST_F()
1560 const std::vector<NameserverStats> expectedCleartextDnsStats = { in TEST_F()
1598 std::thread t1([&hostname]() { in TEST_F()
1618 const std::vector<NameserverStats> expectedCleartextDnsStats = { in TEST_F()
1633 std::vector<std::string> servers = {listen_addr}; in TEST_F()
1654 const std::vector<DnsRecord> records = { in TEST_F()
1661 std::vector<std::string> servers = {listen_addr}; in TEST_F()
1693 std::string garbage = "definitely not a valid TLS ServerHello"; in TEST_F()
1715 const std::vector<DnsRecord> records = { in TEST_F()
1723 std::vector<std::string> servers = {listen_addr}; in TEST_F()
1766 const std::vector<DnsRecord> records1 = { in TEST_F()
1770 const std::vector<DnsRecord> records2 = { in TEST_F()
1780 std::vector<std::string> servers = {listen_addr1, listen_addr2}; in TEST_F()
1825 std::vector<std::string> servers = {listen_addr}; in TEST_F()
1848 const std::vector<DnsRecord> records = { in TEST_F()
1855 std::vector<std::string> servers = {listen_addr}; in TEST_F()
1869 std::string result_str = ToString(result); in TEST_F()
1896 const std::vector<std::string> servers = {cleartext_addr}; in TEST_F()
1906 const std::string mode; in TEST_F()
1908 const std::string method; in TEST_F()
1910 std::string asHostName() const { in TEST_F()
1937 const std::string testHostName = config.asHostName(); in TEST_F()
1992 const std::string result_str = ToString(ai_result); in TEST_F()
2004 const std::string result_str = ToString(ai_result); in TEST_F()
2019 const std::vector<std::string> servers = {cleartext_addr}; in TEST_F()
2021 const std::vector<DnsRecord> records = { in TEST_F()
2059 std::string toString(uint8_t* buf, int bufLen, int ipType) { in toString()
2099 void expectAnswersValid(int fd, int ipType, const std::string& expectedAnswer) { in expectAnswersValid()
2121 const std::vector<DnsRecord> records = { in TEST_F()
2128 std::vector<std::string> servers = {listen_addr}; in TEST_F()
2169 const std::vector<DnsRecord> records = { in TEST_F()
2176 std::vector<std::string> servers = {listen_addr}; in TEST_F()
2212 const std::vector<DnsRecord> records = { in TEST_F()
2219 std::vector<std::string> servers = {listen_addr}; in TEST_F()
2228 std::unique_lock lk(cvMutex); in TEST_F()
2231 EXPECT_EQ(std::cv_status::no_timeout, cv.wait_for(lk, std::chrono::seconds(1))); in TEST_F()
2279 const std::vector<DnsRecord> records = { in TEST_F()
2286 std::vector<std::string> servers = {listen_addr}; in TEST_F()
2292 const std::string badMsg = "16-52512#"; in TEST_F()
2294 const std::string cmd; in TEST_F()
2302 {"resnsend " + std::to_string(TEST_NETID) + " 0 " + badMsg + '\0', -EILSEQ}, in TEST_F()
2305 for (unsigned int i = 0; i < std::size(kTestData); i++) { in TEST_F()
2318 std::string query = "81sBAAABAAAAAAAABWhvd2R5B2V4YW1wbGUDY29tAAABAAE="; in TEST_F()
2319 std::string cmd = "resnsend " + std::to_string(TEST_NETID) + " 0 " + query + '\0'; in TEST_F()
2343 const std::vector<DnsRecord> records = { in TEST_F()
2351 std::vector<std::string> servers = {listen_addr}; in TEST_F()
2481 const std::vector<DnsRecord> records = { in TEST_F()
2487 std::vector<std::string> servers = {listen_addr}; in TEST_F()
2528 const std::vector<DnsRecord> records = { in TEST_F()
2585 const std::vector<DnsRecord> records = { in TEST_F()
2592 std::vector<std::string> servers = {listen_addr}; in TEST_F()
2683 const std::vector<std::string> servers = {CLEARTEXT_ADDR}; in TEST_F()
2695 std::string mode; in TEST_F()
2696 std::string method; in TEST_F()
2700 std::string asHostName() const { in TEST_F()
2766 const std::string testHostName = config.asHostName(); in TEST_F()
2830 const std::string result_str = ToString(ai_result); in TEST_F()
2861 const std::vector<std::string> servers = {CLEARTEXT_ADDR}; in TEST_F()
2893 const std::vector<std::string> servers = {CLEARTEXT_ADDR}; in TEST_F()
2921 const std::vector<DnsRecord> records = { in TEST_F()
2929 std::vector<std::string> servers = {listen_addr}; in TEST_F()
2945 std::string result_str = ToString(result); in TEST_F()
2968 const std::vector<DnsRecord> records = { in TEST_F()
2975 const std::vector<std::string> servers = {listen_addr}; in TEST_F()
2989 std::string result_str = ToString(result); in TEST_F()
3004 const std::vector<DnsRecord> records = { in TEST_F()
3012 const std::vector<std::string> servers = {listen_addr}; in TEST_F()
3025 const std::vector<std::string> result_strs = ToStrings(result); in TEST_F()
3036 const std::vector<DnsRecord> records = { in TEST_F()
3043 const std::vector<std::string> servers = {listen_addr}; in TEST_F()
3056 std::string result_str = ToString(result); in TEST_F()
3078 const std::vector<std::string> servers = {listen_addr}; in TEST_F()
3087 std::string name; in TEST_F()
3088 std::string addr; in TEST_F()
3090 std::string asHostName() const { return StringPrintf("%s.example.com.", name.c_str()); } in TEST_F()
3101 const std::string testHostName = config.asHostName(); in TEST_F()
3123 std::string result_str = ToString(result); in TEST_F()
3134 const std::vector<DnsRecord> records = { in TEST_F()
3143 const std::vector<std::string> servers = {listen_addr}; in TEST_F()
3155 std::string result_str = ToString(result); in TEST_F()
3163 std::vector<std::string> result_strs = ToStrings(result); in TEST_F()
3184 const std::vector<std::string> servers = {listen_addr}; in TEST_F()
3197 std::string addr_v4; in TEST_F()
3198 std::string addr_v6; in TEST_F()
3200 std::string asParameters() const { in TEST_F()
3225 std::vector<std::string> result_strs = ToStrings(result); in TEST_F()
3258 const std::vector<DnsRecord> records = { in TEST_F()
3266 const std::vector<std::string> servers = {listen_addr}; in TEST_F()
3277 std::string result_str = result->h_name ? result->h_name : "null"; in TEST_F()
3301 const std::vector<DnsRecord> records = { in TEST_F()
3310 const std::vector<std::string> servers = {listen_addr}; in TEST_F()
3327 std::string result_str = result->h_name ? result->h_name : "null"; in TEST_F()
3356 const std::vector<std::string> servers = {listen_addr}; in TEST_F()
3375 std::string result_str = ToString(result); in TEST_F()
3388 const static std::vector<DnsRecord> records = { in TEST_F()
3422 const std::vector<DnsRecord> records = { in TEST_F()
3430 const std::vector<std::string> servers = {listen_addr}; in TEST_F()
3441 std::string addr; in TEST_F()
3442 std::string host; in TEST_F()
3444 std::string asParameters() const { in TEST_F()
3484 std::string result_str = host; in TEST_F()
3503 const std::vector<DnsRecord> records = { in TEST_F()
3511 const std::vector<std::string> servers = {listen_addr}; in TEST_F()
3522 std::string addr; in TEST_F()
3523 std::string host; in TEST_F()
3525 std::string asParameters() const { in TEST_F()
3568 std::string result_str = host; in TEST_F()
3584 const std::vector<std::string> servers = {listen_addr}; in TEST_F()
3603 std::string result_str = host; in TEST_F()
3614 const static std::vector<DnsRecord> records = { in TEST_F()
3645 const std::vector<DnsRecord> records = { in TEST_F()
3652 const std::vector<std::string> servers = {listen_addr}; in TEST_F()
3663 std::string result_str = ToString(result); in TEST_F()
3671 const std::vector<DnsRecord> records = { in TEST_F()
3679 const std::vector<std::string> servers = {listen_addr}; in TEST_F()
3690 std::string result_str = ToString(result); in TEST_F()
3720 const std::vector<std::string> servers = {listen_addr}; in TEST_F()
3729 std::string name; in TEST_F()
3730 std::string addr; in TEST_F()
3732 std::string asHostName() const { in TEST_F()
3745 const std::string testHostName = config.asHostName(); in TEST_F()
3767 const std::vector<std::string> servers = {listen_addr}; in TEST_F()
3812 const std::vector<DnsRecord> records = { in TEST_F()
3815 const std::string kNat64Prefix1 = "64:ff9b::/96"; in TEST_F()
3816 const std::string kNat64Prefix2 = "2001:db8:6464::/96"; in TEST_F()
3820 const std::vector<std::string> servers = {listen_addr}; in TEST_F()
3910 const std::vector<DnsRecord> newRecords = { in TEST_F()
3967 void sendCommand(int fd, const std::string& cmd) { in sendCommand()
4099 const std::vector<DnsRecord> records = { in TEST_F()
4110 std::vector<std::string> servers = {listen_addr1, listen_addr2}; in TEST_F()
4141 const std::vector<DnsRecord> records = { in TEST_F()
4201 const std::string kDotConnectTimeoutMsFlag( in TEST_F()
4206 const std::vector<DnsRecord> records = { in TEST_F()
4250 std::tie(result, timeTakenMs) = safe_getaddrinfo_time_taken(hostname2, nullptr, hints); in TEST_F()
4288 std::thread t([this]() { in TEST_F()
4317 std::thread t1([&listen_addr1, &hints, this]() { in TEST_F()
4331 std::thread t2([&listen_addr2, &hints, &dns2, this]() { in TEST_F()
4374 const std::string query = in TEST_F()
4385 const std::string cmd = in TEST_F()
4386 "resnsend " + std::to_string(TEST_NETID) + " 0 " /* ResNsendFlags */ + query + '\0'; in TEST_F()
4407 const std::optional<int32_t> tcMode; in TEST_F()
4410 std::string asParameters() const { in TEST_F()
4416 {std::nullopt, true, 0}, /* mode unset */ in TEST_F()
4481 const std::vector<NameserverStats> expectedCleartextDnsStats = { in TEST_F()
4490 std::vector<std::string> servers; in TEST_F()
4491 std::vector<std::string> tlsServers; in TEST_F()
4492 std::string tlsName; in TEST_F()
4538 const std::string addr1 = getUniqueIPv4Address(); // For a workable DNS server. in TEST_F()
4539 const std::string addr2 = getUniqueIPv4Address(); // For an unresponsive DNS server. in TEST_F()
4540 const std::string unusable_addr = getUniqueIPv4Address(); in TEST_F()
4549 std::this_thread::sleep_for(20ms); in TEST_F()
4574 std::vector<std::string> tlsServers; in TEST_F()
4575 std::string tlsName; in TEST_F()
4583 std::string TlsNameLastTime; in TEST_F()
4648 const std::string addr1 = getUniqueIPv4Address(); in TEST_F()
4649 const std::string addr2 = getUniqueIPv4Address(); in TEST_F()
4653 std::this_thread::sleep_for(20ms); in TEST_F()
4666 std::string tlsServer; in TEST_F()
4667 std::string tlsName; in TEST_F()
4670 std::string asTestName() const { in TEST_F()
4724 std::this_thread::sleep_for(100ms); in TEST_F()
4738 std::this_thread::sleep_for(100ms); in TEST_F()
4841 header.questions.push_back(std::move(question)); in TEST_P()
4851 header.answers.push_back(std::move(recordAnswer)); in TEST_P()
4861 header.authorities.push_back(std::move(recordAuthority)); in TEST_P()
4871 header.additionals.push_back(std::move(recordAdditional)); in TEST_P()
4916 const std::vector<uint8_t> kResponseAPointer = { in TEST_P()
4974 const std::vector<uint8_t> kResponseLabelEndingWithAPointer = { in TEST_P()
5027 const std::vector<DnsRecord> records = { in TEST_F()
5030 const std::vector<int> params = {300, 25, 8, 8, 1000 /* BASE_TIMEOUT_MSEC */, in TEST_F()
5061 std::string result_str = ToString(result); in TEST_F()
5070 const std::vector<DnsRecord> records = { in TEST_F()
5074 const std::vector<int> params = {300, 25, 8, 8, DNS_TIMEOUT_MS /* BASE_TIMEOUT_MSEC */, in TEST_F()
5106 const std::vector<DnsRecord> records = { in TEST_F()
5110 const std::vector<int> params = {300, 25, 8, 8, 1000 /* BASE_TIMEOUT_MSEC */, in TEST_F()
5119 std::to_string(PARALLEL_LOOKUP_SLEEP_TIME_MS)); in TEST_F()
5140 std::tie(result, timeTakenMs) = safe_getaddrinfo_time_taken(kHelloExampleCom, nullptr, hints); in TEST_F()
5160 std::vector<std::string> servers = {listen_addr1, listen_addr2}; in TEST_F()
5168 std::string hostName = fmt::format("blocked{}.com", i); in TEST_F()
5174 const std::vector<NameserverStats> expectedEmptyDnsStats = { in TEST_F()
5213 std::string dnsAddr; // The DNS server address used for setResolverConfiguration().
5238 std::string makeIpv4AddrString(unsigned n) const { in makeIpv4AddrString()
5241 std::string makeIpv6AddrString(unsigned n) const { in makeIpv6AddrString()
5250 std::string mIfname;
5251 std::unique_ptr<TunForwarder> mTunForwarder;
5252 std::vector<std::unique_ptr<test::DNSResponder>> mDnsServers;
5265 void StartDns(test::DNSResponder& dns, const std::vector<DnsRecord>& records);
5286 mTunForwarder = std::make_unique<TunForwarder>(std::move(ufd)); in init()
5299 const std::string v4Addr = makeIpv4AddrString(1); in init()
5308 const std::string v6Addr = makeIpv6AddrString(1); in init()
5326 const std::vector<DnsRecord>& records) { in StartDns()
5330 if (std::optional<unsigned> netId = dns.getNetwork(); netId.has_value()) { in StartDns()
5341 const std::function<std::string(unsigned)> makeIpString = in addDns()
5342 std::bind((type == ConnectivityType::V4) ? &ScopedNetwork::makeIpv4AddrString in addDns()
5344 this, std::placeholders::_1); in addDns()
5346 std::string src1 = makeIpString(1); // The address from which the resolver will send. in addDns()
5347 std::string dst1 = makeIpString(index + 100); // The address to which the resolver will send. in addDns()
5348 std::string src2 = dst1; // The address translated from src1. in addDns()
5349 std::string dst2 = makeIpString(index + 200); // The address translated from dst2. in addDns()
5361 auto& dnsPtr = mDnsServers.emplace_back(std::make_unique<test::DNSResponder>(dst2)); in addDns()
5372 const std::array<ConnectivityType, 3> allTypes = { in TEST_F()
5408 std::vector<std::string> result_strs = ToStrings(ai_result); in TEST_F()
5409 std::vector<std::string> expectedResult; in TEST_F()
5430 std::make_unique<ScopedNetwork>(getFreeNetId(), ConnectivityType::V4V6, in TEST_F()
5453 std::thread lookup([&]() { in TEST_F()