Lines Matching refs:netconfig
1495 static void free_nameservers_locked(NetConfig* netconfig);
1500 static void res_cache_clear_stats_locked(NetConfig* netconfig);
1529 NetConfig* netconfig = find_netconfig_locked(netid); in resolv_flush_cache_for_net() local
1530 if (netconfig == nullptr) { in resolv_flush_cache_for_net()
1533 netconfig->cache->flush(); in resolv_flush_cache_for_net()
1536 res_cache_clear_stats_locked(netconfig); in resolv_flush_cache_for_net()
1565 NetConfig* netconfig = find_netconfig_locked(netid); in resolv_get_network_types_for_net() local
1566 if (netconfig == nullptr) return android::net::NT_UNKNOWN; in resolv_get_network_types_for_net()
1567 return convert_network_type(netconfig->transportTypes); in resolv_get_network_types_for_net()
1581 NetConfig* netconfig = find_netconfig_locked(netid); in is_mdns_supported_network() local
1582 if (netconfig == nullptr) return false; in is_mdns_supported_network()
1583 return is_mdns_supported_transport_types(netconfig->transportTypes); in is_mdns_supported_network()
1633 NetConfig* netconfig = find_netconfig_locked(netid); in getCustomizedTableByName() local
1636 if (netconfig != nullptr) { in getCustomizedTableByName()
1637 const auto& hosts = netconfig->customizedTable.equal_range(hostname); in getCustomizedTableByName()
1648 NetConfig* netconfig = find_netconfig_locked(netid); in resolv_get_interface_names() local
1649 if (netconfig != nullptr) return netconfig->interfaceNames; in resolv_get_interface_names()
1670 NetConfig* netconfig = find_netconfig_locked(netid); in resolv_set_nameservers() local
1672 if (netconfig == nullptr) return -ENONET; in resolv_set_nameservers()
1674 uint8_t old_max_samples = netconfig->params.max_samples; in resolv_set_nameservers()
1676 memset(&netconfig->params, 0, sizeof(netconfig->params)); in resolv_set_nameservers()
1677 netconfig->params.sample_validity = params.sampleValiditySeconds; in resolv_set_nameservers()
1678 netconfig->params.success_threshold = params.successThreshold; in resolv_set_nameservers()
1679 netconfig->params.min_samples = params.minSamples; in resolv_set_nameservers()
1680 netconfig->params.max_samples = params.maxSamples; in resolv_set_nameservers()
1681 netconfig->params.base_timeout_msec = params.baseTimeoutMsec; in resolv_set_nameservers()
1682 netconfig->params.retry_count = params.retryCount; in resolv_set_nameservers()
1686 if (netconfig->params.retry_count == 0) { in resolv_set_nameservers()
1688 netconfig->params.retry_count = (retryCount <= 0) ? RES_DFLRETRY : retryCount; in resolv_set_nameservers()
1690 if (netconfig->params.base_timeout_msec == 0) { in resolv_set_nameservers()
1693 netconfig->params.base_timeout_msec = in resolv_set_nameservers()
1697 if (!resolv_is_nameservers_equal(netconfig->nameservers, params.servers)) { in resolv_set_nameservers()
1699 free_nameservers_locked(netconfig); in resolv_set_nameservers()
1700 netconfig->nameservers = std::move(nameservers); in resolv_set_nameservers()
1703 << ", addr = " << netconfig->nameservers[i]; in resolv_set_nameservers()
1705 netconfig->nameserverSockAddrs = std::move(ipSockAddrs); in resolv_set_nameservers()
1707 if (netconfig->params.max_samples != old_max_samples) { in resolv_set_nameservers()
1713 res_cache_clear_stats_locked(netconfig); in resolv_set_nameservers()
1719 netconfig->search_domains = filter_domains(params.domains); in resolv_set_nameservers()
1722 if (!netconfig->dnsStats.setAddrs(netconfig->nameserverSockAddrs, PROTO_TCP) || in resolv_set_nameservers()
1723 !netconfig->dnsStats.setAddrs(netconfig->nameserverSockAddrs, PROTO_UDP)) { in resolv_set_nameservers()
1727 netconfig->transportTypes = std::move(params.transportTypes); in resolv_set_nameservers()
1728 netconfig->metered = params.meteredNetwork; in resolv_set_nameservers()
1729 netconfig->interfaceNames = std::move(params.interfaceNames); in resolv_set_nameservers()
1732 return netconfig->setOptions(params.resolverOptions.value()); in resolv_set_nameservers()
1740 NetConfig* netconfig = find_netconfig_locked(netid); in resolv_set_options() local
1742 if (netconfig == nullptr) return -ENONET; in resolv_set_options()
1743 return netconfig->setOptions(options); in resolv_set_options()
1759 static void free_nameservers_locked(NetConfig* netconfig) { in free_nameservers_locked() argument
1760 netconfig->nameservers.clear(); in free_nameservers_locked()
1761 netconfig->nameserverSockAddrs.clear(); in free_nameservers_locked()
1762 res_cache_clear_stats_locked(netconfig); in free_nameservers_locked()
1801 static void res_cache_clear_stats_locked(NetConfig* netconfig) { in res_cache_clear_stats_locked() argument
1803 netconfig->nsstats[i].sample_count = 0; in res_cache_clear_stats_locked()
1804 netconfig->nsstats[i].sample_next = 0; in res_cache_clear_stats_locked()
1811 ++netconfig->revision_id; in res_cache_clear_stats_locked()
1849 NetConfig* netconfig = find_netconfig_locked(netid); in resolv_cache_dump_subsampling_map() local
1850 if (netconfig == nullptr) return {}; in resolv_cache_dump_subsampling_map()
1852 const auto& subsampling_map = (!is_mdns) ? netconfig->dns_event_subsampling_map in resolv_cache_dump_subsampling_map()
1853 : netconfig->mdns_event_subsampling_map; in resolv_cache_dump_subsampling_map()
1871 NetConfig* netconfig = find_netconfig_locked(netid); in resolv_cache_get_subsampling_denom() local
1872 if (netconfig == nullptr) return 0; // Don't log anything at all. in resolv_cache_get_subsampling_denom()
1873 const auto& subsampling_map = (!is_mdns) ? netconfig->dns_event_subsampling_map in resolv_cache_get_subsampling_denom()
1874 : netconfig->mdns_event_subsampling_map; in resolv_cache_get_subsampling_denom()