Clean up URLFetcher unit tests, part 8.
[chromium-blink-merge.git] / net / base / net_util_linux.h
blob0b556bc08d1e6ba74bbd685b0388e203f20451c0
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef NET_BASE_NET_UTIL_LINUX_H_
6 #define NET_BASE_NET_UTIL_LINUX_H_
8 // This file is only used to expose some of the internals
9 // of net_util_linux.cc to address_tracker_linux and tests.
11 #include <string>
13 #include "base/containers/hash_tables.h"
14 #include "net/base/address_tracker_linux.h"
15 #include "net/base/net_util.h"
17 namespace net {
18 namespace internal {
20 typedef char* (*GetInterfaceNameFunction)(int interface_index, char* ifname);
22 typedef std::string (*GetInterfaceSSIDFunction)(const std::string& ifname);
24 NET_EXPORT bool GetNetworkListImpl(
25 NetworkInterfaceList* networks,
26 int policy,
27 const base::hash_set<int>& online_links,
28 const internal::AddressTrackerLinux::AddressMap& address_map,
29 GetInterfaceNameFunction get_interface_name);
31 // Gets the current Wi-Fi SSID based on |interfaces|. Returns
32 // empty string if there are no interfaces or if two interfaces have different
33 // connection types. Otherwise returns the SSID of all interfaces if they have
34 // the same SSID. This is adapted from
35 // NetworkChangeNotifier::ConnectionTypeFromInterfaceList.
36 NET_EXPORT std::string GetWifiSSIDFromInterfaceListInternal(
37 const NetworkInterfaceList& interfaces,
38 internal::GetInterfaceSSIDFunction get_interface_ssid);
40 } // namespace internal
41 } // namespace net
43 #endif // NET_BASE_NET_UTIL_LINUX_H_