| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_H_ | 5 #ifndef NET_BASE_NETWORK_INTERFACES_H_ |
| 6 #define NET_BASE_NETWORK_INTERFACES_H_ | 6 #define NET_BASE_NETWORK_INTERFACES_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 // Returns list of network interfaces except loopback interface. If an | 73 // Returns list of network interfaces except loopback interface. If an |
| 74 // interface has more than one address, a separate entry is added to | 74 // interface has more than one address, a separate entry is added to |
| 75 // the list for each address. | 75 // the list for each address. |
| 76 // Can be called only on a thread that allows IO. | 76 // Can be called only on a thread that allows IO. |
| 77 NET_EXPORT bool GetNetworkList(NetworkInterfaceList* networks, | 77 NET_EXPORT bool GetNetworkList(NetworkInterfaceList* networks, |
| 78 int policy); | 78 int policy); |
| 79 | 79 |
| 80 // Gets the SSID of the currently associated WiFi access point if there is one. | 80 // Gets the SSID of the currently associated WiFi access point if there is one. |
| 81 // Otherwise, returns empty string. | 81 // Otherwise, returns empty string. |
| 82 // Currently only implemented on Linux, ChromeOS and Android. | 82 // Currently only implemented on Linux, ChromeOS, Android and Windows. |
| 83 NET_EXPORT std::string GetWifiSSID(); | 83 NET_EXPORT std::string GetWifiSSID(); |
| 84 | 84 |
| 85 // General category of the IEEE 802.11 (wifi) physical layer operating mode. | 85 // General category of the IEEE 802.11 (wifi) physical layer operating mode. |
| 86 enum WifiPHYLayerProtocol { | 86 enum WifiPHYLayerProtocol { |
| 87 // No wifi support or no associated AP. | 87 // No wifi support or no associated AP. |
| 88 WIFI_PHY_LAYER_PROTOCOL_NONE, | 88 WIFI_PHY_LAYER_PROTOCOL_NONE, |
| 89 // An obsolete modes introduced by the original 802.11, e.g. IR, FHSS. | 89 // An obsolete modes introduced by the original 802.11, e.g. IR, FHSS. |
| 90 WIFI_PHY_LAYER_PROTOCOL_ANCIENT, | 90 WIFI_PHY_LAYER_PROTOCOL_ANCIENT, |
| 91 // 802.11a, OFDM-based rates. | 91 // 802.11a, OFDM-based rates. |
| 92 WIFI_PHY_LAYER_PROTOCOL_A, | 92 WIFI_PHY_LAYER_PROTOCOL_A, |
| 93 // 802.11b, DSSS or HR DSSS. | 93 // 802.11b, DSSS or HR DSSS. |
| 94 WIFI_PHY_LAYER_PROTOCOL_B, | 94 WIFI_PHY_LAYER_PROTOCOL_B, |
| 95 // 802.11g, same rates as 802.11a but compatible with 802.11b. | 95 // 802.11g, same rates as 802.11a but compatible with 802.11b. |
| 96 WIFI_PHY_LAYER_PROTOCOL_G, | 96 WIFI_PHY_LAYER_PROTOCOL_G, |
| 97 // 802.11n, HT rates. | 97 // 802.11n, HT rates. |
| 98 WIFI_PHY_LAYER_PROTOCOL_N, | 98 WIFI_PHY_LAYER_PROTOCOL_N, |
| 99 // Unclassified mode or failure to identify. | 99 // Unclassified mode or failure to identify. |
| 100 WIFI_PHY_LAYER_PROTOCOL_UNKNOWN | 100 WIFI_PHY_LAYER_PROTOCOL_UNKNOWN |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 // Characterize the PHY mode of the currently associated access point. | 103 // Characterize the PHY mode of the currently associated access point. |
| 104 // Currently only available on OS_WIN. | 104 // Currently only available on Windows. |
| 105 NET_EXPORT WifiPHYLayerProtocol GetWifiPHYLayerProtocol(); | 105 NET_EXPORT WifiPHYLayerProtocol GetWifiPHYLayerProtocol(); |
| 106 | 106 |
| 107 enum WifiOptions { | 107 enum WifiOptions { |
| 108 // Disables background SSID scans. | 108 // Disables background SSID scans. |
| 109 WIFI_OPTIONS_DISABLE_SCAN = 1 << 0, | 109 WIFI_OPTIONS_DISABLE_SCAN = 1 << 0, |
| 110 // Enables media streaming mode. | 110 // Enables media streaming mode. |
| 111 WIFI_OPTIONS_MEDIA_STREAMING_MODE = 1 << 1 | 111 WIFI_OPTIONS_MEDIA_STREAMING_MODE = 1 << 1 |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 class NET_EXPORT ScopedWifiOptions { | 114 class NET_EXPORT ScopedWifiOptions { |
| 115 public: | 115 public: |
| 116 ScopedWifiOptions() {} | 116 ScopedWifiOptions() {} |
| 117 virtual ~ScopedWifiOptions(); | 117 virtual ~ScopedWifiOptions(); |
| 118 | 118 |
| 119 private: | 119 private: |
| 120 DISALLOW_COPY_AND_ASSIGN(ScopedWifiOptions); | 120 DISALLOW_COPY_AND_ASSIGN(ScopedWifiOptions); |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 // Set temporary options on all wifi interfaces. | 123 // Set temporary options on all wifi interfaces. |
| 124 // |options| is an ORed bitfield of WifiOptions. | 124 // |options| is an ORed bitfield of WifiOptions. |
| 125 // Options are automatically disabled when the scoped pointer | 125 // Options are automatically disabled when the scoped pointer |
| 126 // is freed. Currently only available on OS_WIN. | 126 // is freed. Currently only available on Windows. |
| 127 NET_EXPORT scoped_ptr<ScopedWifiOptions> SetWifiOptions(int options); | 127 NET_EXPORT scoped_ptr<ScopedWifiOptions> SetWifiOptions(int options); |
| 128 | 128 |
| 129 } // namespace net | 129 } // namespace net |
| 130 | 130 |
| 131 #endif // NET_BASE_NETWORK_INTERFACES_H_ | 131 #endif // NET_BASE_NETWORK_INTERFACES_H_ |
| OLD | NEW |