OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_BASE_NETWORK_INTERFACES_LINUX_H_ | 5 #ifndef NET_BASE_NETWORK_INTERFACES_LINUX_H_ |
6 #define NET_BASE_NETWORK_INTERFACES_LINUX_H_ | 6 #define NET_BASE_NETWORK_INTERFACES_LINUX_H_ |
7 | 7 |
8 // This file is only used to expose some of the internals | 8 // This file is only used to expose some of the internals |
9 // of network_interfaces_linux.cc to address_tracker_linux and tests. | 9 // of network_interfaces_linux.cc to address_tracker_linux and tests. |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 #include <unordered_set> | 12 #include <unordered_set> |
13 | 13 |
14 #include "net/base/address_tracker_linux.h" | 14 #include "net/base/address_tracker_linux.h" |
15 #include "net/base/net_export.h" | 15 #include "net/base/net_export.h" |
16 #include "net/base/network_interfaces.h" | 16 #include "net/base/network_interfaces.h" |
17 | 17 |
18 namespace net { | 18 namespace net { |
19 namespace internal { | 19 namespace internal { |
20 | 20 |
21 typedef char* (*GetInterfaceNameFunction)(int interface_index, char* ifname); | 21 typedef char* (*GetInterfaceNameFunction)(int interface_index, char* ifname); |
22 | 22 |
23 typedef std::string (*GetInterfaceSSIDFunction)(const std::string& ifname); | 23 typedef std::string (*GetInterfaceSSIDFunction)(const std::string& ifname); |
24 | 24 |
| 25 NET_EXPORT std::string GetInterfaceSSID(const std::string& ifname); |
| 26 |
25 NET_EXPORT bool GetNetworkListImpl( | 27 NET_EXPORT bool GetNetworkListImpl( |
26 NetworkInterfaceList* networks, | 28 NetworkInterfaceList* networks, |
27 int policy, | 29 int policy, |
28 const std::unordered_set<int>& online_links, | 30 const std::unordered_set<int>& online_links, |
29 const internal::AddressTrackerLinux::AddressMap& address_map, | 31 const internal::AddressTrackerLinux::AddressMap& address_map, |
30 GetInterfaceNameFunction get_interface_name); | 32 GetInterfaceNameFunction get_interface_name); |
31 | 33 |
32 // Gets the current Wi-Fi SSID based on |interfaces|. Returns | 34 // Gets the current Wi-Fi SSID based on |interfaces|. Returns |
33 // empty string if there are no interfaces or if two interfaces have different | 35 // empty string if there are no interfaces or if two interfaces have different |
34 // connection types. Otherwise returns the SSID of all interfaces if they have | 36 // connection types. Otherwise returns the SSID of all interfaces if they have |
35 // the same SSID. This is adapted from | 37 // the same SSID. This is adapted from |
36 // NetworkChangeNotifier::ConnectionTypeFromInterfaceList. | 38 // NetworkChangeNotifier::ConnectionTypeFromInterfaceList. |
37 NET_EXPORT std::string GetWifiSSIDFromInterfaceListInternal( | 39 NET_EXPORT std::string GetWifiSSIDFromInterfaceListInternal( |
38 const NetworkInterfaceList& interfaces, | 40 const NetworkInterfaceList& interfaces, |
39 internal::GetInterfaceSSIDFunction get_interface_ssid); | 41 internal::GetInterfaceSSIDFunction get_interface_ssid); |
40 | 42 |
41 } // namespace internal | 43 } // namespace internal |
42 } // namespace net | 44 } // namespace net |
43 | 45 |
44 #endif // NET_BASE_NETWORK_INTERFACES_LINUX_H_ | 46 #endif // NET_BASE_NETWORK_INTERFACES_LINUX_H_ |
OLD | NEW |