#include "net/base/network_interfaces_linux.h"
#include <memory>
#include <optional>
#include "build/build_config.h"
#if !BUILDFLAG(IS_ANDROID)
#include <linux/ethtool.h>
#endif
#include <linux/if.h>
#include <linux/sockios.h>
#include <linux/wireless.h>
#include <set>
#include <sys/ioctl.h>
#include <sys/types.h>
#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/files/scoped_file.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_tokenizer.h"
#include "base/strings/string_util.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "net/base/address_map_linux.h"
#include "net/base/address_tracker_linux.h"
#include "net/base/features.h"
#include "net/base/ip_endpoint.h"
#include "net/base/net_errors.h"
#include "net/base/network_interfaces_posix.h"
#include "url/gurl.h"
#if BUILDFLAG(IS_ANDROID)
#include <string_view>
#include "base/android/build_info.h"
#include "net/android/network_library.h"
#include "net/base/network_interfaces_getifaddrs.h"
#endif
namespace net {
namespace {
bool TryConvertNativeToNetIPAttributes(int native_attributes,
int* net_attributes) { … }
}
namespace internal {
NetworkChangeNotifier::ConnectionType GetInterfaceConnectionType(
const std::string& ifname) { … }
std::string GetInterfaceSSID(const std::string& ifname) { … }
bool GetNetworkListImpl(
NetworkInterfaceList* networks,
int policy,
const std::unordered_set<int>& online_links,
const internal::AddressTrackerLinux::AddressMap& address_map,
GetInterfaceNameFunction get_interface_name) { … }
std::string GetWifiSSIDFromInterfaceListInternal(
const NetworkInterfaceList& interfaces,
internal::GetInterfaceSSIDFunction get_interface_ssid) { … }
base::ScopedFD GetSocketForIoctl() { … }
}
bool GetNetworkList(NetworkInterfaceList* networks, int policy) { … }
std::string GetWifiSSID() { … }
}