mukesh agrawal | 8a3188d | 2011-12-01 20:56:44 +0000 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
Paul Stewart | b50f0b9 | 2011-05-16 16:31:42 -0700 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef SHILL_WIFI_ |
| 6 | #define SHILL_WIFI_ |
| 7 | |
Gary Morain | 22601da | 2012-03-16 10:48:39 -0700 | [diff] [blame] | 8 | // A WiFi device represents a wireless network interface implemented as an IEEE |
| 9 | // 802.11 station. An Access Point (AP) (or, more correctly, a Basic Service |
| 10 | // Set(BSS)) is represented by a WiFiEndpoint. An AP provides a WiFiService, |
| 11 | // which is the same concept as Extended Service Set (ESS) in 802.11, |
| 12 | // identified by an SSID. A WiFiService includes zero or more WiFiEndpoints |
| 13 | // that provide that service. |
| 14 | // |
| 15 | // A WiFi device interacts with a real device through WPA Supplicant. |
| 16 | // Wifi::Start() creates a connection to WPA Supplicant, represented by |
| 17 | // |supplicant_interface_proxy_|. [1] |
| 18 | // |
| 19 | // A WiFi device becomes aware of WiFiEndpoints through BSSAdded signals from |
| 20 | // WPA Supplicant, which identifies them by a "path". The WiFi object maintains |
| 21 | // an EndpointMap in |endpoint_by_rpcid_|, in which the key is the "path" and |
| 22 | // the value is a pointer to a WiFiEndpoint object. When a WiFiEndpoint is |
| 23 | // added, it is associated with a WiFiService. |
| 24 | // |
| 25 | // A WiFi device becomes aware of a WiFiService in three different ways. 1) |
| 26 | // When a WiFiEndpoint is added through the BSSAdded signal, the WiFiEndpoint is |
| 27 | // providing a service, and if that service is unknown to the WiFi device, it is |
| 28 | // added at that point. 2) The Manager can add a WiFiService by calling |
| 29 | // WiFi::GetService(). 3) Services are loaded from the profile through a call |
| 30 | // to WiFi::Load(). |
| 31 | // |
| 32 | // The WiFi device connects to a WiFiService, not a WiFiEndpoint, through WPA |
| 33 | // Supplicant. It is the job of WPA Supplicant to select a BSS (aka |
| 34 | // WiFiEndpoint) to connect to. The protocol for establishing a connection is |
| 35 | // as follows: |
| 36 | // |
| 37 | // 1. The WiFi device sends AddNetwork to WPA Supplicant, which returns a |
| 38 | // "network path" when done. |
| 39 | // |
| 40 | // 2. The WiFi device sends SelectNetwork, indicating the network path |
| 41 | // received in 1, to WPA Supplicant, which begins the process of associating |
| 42 | // with an AP in the ESS. At this point the WiFiService which is being |
| 43 | // connected is called the |pending_service_|. |
| 44 | // |
| 45 | // 3. When association is complete, WPA Supplicant sends a PropertiesChanged |
| 46 | // signal to the WiFi device, indicating a change in the CurrentBSS. The |
| 47 | // WiFiService indicated by the new value of CurrentBSS is set as the |
| 48 | // |current_service_|, and |pending_service_| is (normally) cleared. |
| 49 | // |
| 50 | // Some key things to notice are 1) WPA Supplicant does the work of selecting |
| 51 | // the AP (aka WiFiEndpoint) and it tells the WiFi device which AP it selected. |
| 52 | // 2) The process of connecting is asynchronous. There is a |current_service_| |
| 53 | // to which the WiFi device is presently using and a |pending_service_| to which |
| 54 | // the WiFi device has initiated a connection. |
| 55 | // |
| 56 | // A WiFi device is notified that an AP has gone away via the BSSRemoved signal. |
| 57 | // When the last WiFiEndpoint of a WiFiService is removed, the WiFiService |
| 58 | // itself is deleted. |
| 59 | // |
| 60 | // TODO(gmorain): Add explanation of hidden SSIDs. |
| 61 | // |
| 62 | // WPA Supplicant's PropertiesChanged signal communicates changes in the state |
| 63 | // of WPA Supplicant's current service. This state is stored in |
| 64 | // |supplicant_state_| and reflects WPA Supplicant's view of the state of the |
| 65 | // connection to an AP. Changes in this state sometimes cause state changes in |
| 66 | // the WiFiService to which a WiFi device is connected. For example, when WPA |
| 67 | // Supplicant signals the new state to be "completed", then the WiFiService |
| 68 | // state gets changed to "configuring". State change notifications are not |
| 69 | // reliable because WPA Supplicant may coalesce state changes in quick |
| 70 | // succession so that only the last of the changes is signaled. |
| 71 | // |
| 72 | // Notes: |
| 73 | // |
| 74 | // 1. Shill's definition of the interface is described in |
| 75 | // shill/dbus_bindings/supplicant-interface.xml, and the WPA Supplicant's |
| 76 | // description of the same interface is in |
| 77 | // third_party/wpa_supplicant/doc/dbus.doxygen. |
| 78 | |
mukesh agrawal | 5c05b29 | 2012-03-07 10:12:52 -0800 | [diff] [blame] | 79 | #include <time.h> |
| 80 | |
mukesh agrawal | ab87ea4 | 2011-05-18 11:44:49 -0700 | [diff] [blame] | 81 | #include <map> |
Chris Masone | 46eaaf5 | 2011-05-24 13:08:30 -0700 | [diff] [blame] | 82 | #include <string> |
mukesh agrawal | ab87ea4 | 2011-05-18 11:44:49 -0700 | [diff] [blame] | 83 | #include <vector> |
Chris Masone | 46eaaf5 | 2011-05-24 13:08:30 -0700 | [diff] [blame] | 84 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 85 | #include <base/callback_forward.h> |
| 86 | #include <base/memory/weak_ptr.h> |
mukesh agrawal | af57195 | 2011-07-14 14:31:12 -0700 | [diff] [blame] | 87 | #include <dbus-c++/dbus.h> |
Paul Stewart | 6ab23a9 | 2011-11-09 17:17:47 -0800 | [diff] [blame] | 88 | #include <gtest/gtest_prod.h> // for FRIEND_TEST |
mukesh agrawal | af57195 | 2011-07-14 14:31:12 -0700 | [diff] [blame] | 89 | |
Paul Stewart | b50f0b9 | 2011-05-16 16:31:42 -0700 | [diff] [blame] | 90 | #include "shill/device.h" |
Paul Stewart | 26b327e | 2011-10-19 11:38:09 -0700 | [diff] [blame] | 91 | #include "shill/event_dispatcher.h" |
Gary Morain | ac1bdb4 | 2012-02-16 17:42:29 -0800 | [diff] [blame] | 92 | #include "shill/power_manager.h" |
Chris Masone | 2b10554 | 2011-06-22 10:58:09 -0700 | [diff] [blame] | 93 | #include "shill/refptr_types.h" |
Paul Stewart | b50f0b9 | 2011-05-16 16:31:42 -0700 | [diff] [blame] | 94 | |
| 95 | namespace shill { |
| 96 | |
mukesh agrawal | 7a4e400 | 2011-09-06 11:26:05 -0700 | [diff] [blame] | 97 | class Error; |
| 98 | class KeyValueStore; |
Darin Petkov | ab565bb | 2011-10-06 02:55:51 -0700 | [diff] [blame] | 99 | class ProxyFactory; |
mukesh agrawal | af57195 | 2011-07-14 14:31:12 -0700 | [diff] [blame] | 100 | class SupplicantInterfaceProxyInterface; |
| 101 | class SupplicantProcessProxyInterface; |
mukesh agrawal | 445e72c | 2011-06-22 11:13:50 -0700 | [diff] [blame] | 102 | class WiFiService; |
mukesh agrawal | b54601c | 2011-06-07 17:39:22 -0700 | [diff] [blame] | 103 | |
mukesh agrawal | ab87ea4 | 2011-05-18 11:44:49 -0700 | [diff] [blame] | 104 | // WiFi class. Specialization of Device for WiFi. |
Paul Stewart | b50f0b9 | 2011-05-16 16:31:42 -0700 | [diff] [blame] | 105 | class WiFi : public Device { |
| 106 | public: |
Paul Stewart | f1ce5d2 | 2011-05-19 13:10:20 -0700 | [diff] [blame] | 107 | WiFi(ControlInterface *control_interface, |
| 108 | EventDispatcher *dispatcher, |
Thieu Le | 3426c8f | 2012-01-11 17:35:11 -0800 | [diff] [blame] | 109 | Metrics *metrics, |
Paul Stewart | f1ce5d2 | 2011-05-19 13:10:20 -0700 | [diff] [blame] | 110 | Manager *manager, |
Chris Masone | 626719f | 2011-08-18 16:58:48 -0700 | [diff] [blame] | 111 | const std::string &link, |
| 112 | const std::string &address, |
Paul Stewart | f1ce5d2 | 2011-05-19 13:10:20 -0700 | [diff] [blame] | 113 | int interface_index); |
mukesh agrawal | ab87ea4 | 2011-05-18 11:44:49 -0700 | [diff] [blame] | 114 | virtual ~WiFi(); |
Darin Petkov | c086531 | 2011-09-16 15:31:20 -0700 | [diff] [blame] | 115 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 116 | virtual void Start(Error *error, const EnabledStateChangedCallback &callback); |
| 117 | virtual void Stop(Error *error, const EnabledStateChangedCallback &callback); |
Paul Stewart | a41e38d | 2011-11-11 07:47:29 -0800 | [diff] [blame] | 118 | virtual bool Load(StoreInterface *storage); |
Darin Petkov | c086531 | 2011-09-16 15:31:20 -0700 | [diff] [blame] | 119 | virtual void Scan(Error *error); |
Paul Stewart | fdd1607 | 2011-09-16 12:41:35 -0700 | [diff] [blame] | 120 | virtual bool TechnologyIs(const Technology::Identifier type) const; |
mukesh agrawal | 8a3188d | 2011-12-01 20:56:44 +0000 | [diff] [blame] | 121 | virtual bool IsConnectingTo(const WiFiService &service) const; |
mukesh agrawal | ab87ea4 | 2011-05-18 11:44:49 -0700 | [diff] [blame] | 122 | |
mukesh agrawal | 1590839 | 2011-11-16 18:29:25 +0000 | [diff] [blame] | 123 | // Called by SupplicantInterfaceProxy, in response to events from |
mukesh agrawal | ab87ea4 | 2011-05-18 11:44:49 -0700 | [diff] [blame] | 124 | // wpa_supplicant. |
| 125 | void BSSAdded(const ::DBus::Path &BSS, |
Chris Masone | a82b711 | 2011-05-25 15:16:29 -0700 | [diff] [blame] | 126 | const std::map<std::string, ::DBus::Variant> &properties); |
mukesh agrawal | 261daca | 2011-12-02 18:56:56 +0000 | [diff] [blame] | 127 | void BSSRemoved(const ::DBus::Path &BSS); |
mukesh agrawal | 7ec7131 | 2011-11-10 02:08:26 +0000 | [diff] [blame] | 128 | void PropertiesChanged( |
| 129 | const std::map<std::string, ::DBus::Variant> &properties); |
mukesh agrawal | ab87ea4 | 2011-05-18 11:44:49 -0700 | [diff] [blame] | 130 | void ScanDone(); |
| 131 | |
mukesh agrawal | 1590839 | 2011-11-16 18:29:25 +0000 | [diff] [blame] | 132 | // Called by WiFiService. |
mukesh agrawal | 6e27777 | 2011-09-29 15:04:23 -0700 | [diff] [blame] | 133 | virtual void ConnectTo( |
| 134 | WiFiService *service, |
mukesh agrawal | 6489632 | 2011-12-01 01:13:10 +0000 | [diff] [blame] | 135 | std::map<std::string, ::DBus::Variant> service_params); |
mukesh agrawal | 0ed0f2e | 2011-12-05 20:36:17 +0000 | [diff] [blame] | 136 | virtual void DisconnectFrom(WiFiService *service); |
mukesh agrawal | 8a3188d | 2011-12-01 20:56:44 +0000 | [diff] [blame] | 137 | virtual bool IsIdle() const; |
Paul Stewart | 66c8600 | 2012-01-30 18:00:52 -0800 | [diff] [blame] | 138 | virtual void ClearCachedCredentials(); |
mukesh agrawal | b54601c | 2011-06-07 17:39:22 -0700 | [diff] [blame] | 139 | |
mukesh agrawal | b20776f | 2012-02-10 16:00:36 -0800 | [diff] [blame] | 140 | // Called by WiFiEndpoint. |
| 141 | virtual void NotifyEndpointChanged(const WiFiEndpoint &endpoint); |
| 142 | |
mukesh agrawal | 1590839 | 2011-11-16 18:29:25 +0000 | [diff] [blame] | 143 | // Called by Manager. |
mukesh agrawal | 7a4e400 | 2011-09-06 11:26:05 -0700 | [diff] [blame] | 144 | virtual WiFiServiceRefPtr GetService(const KeyValueStore &args, Error *error); |
| 145 | |
mukesh agrawal | 16bc1b8 | 2012-02-09 18:38:26 -0800 | [diff] [blame] | 146 | // Utility, used by WiFiService and WiFiEndpoint. |
| 147 | // Replace non-ASCII characters with '?'. Return true if one or more |
| 148 | // characters were changed. |
| 149 | static bool SanitizeSSID(std::string *ssid); |
| 150 | |
Paul Stewart | b50f0b9 | 2011-05-16 16:31:42 -0700 | [diff] [blame] | 151 | private: |
mukesh agrawal | 7ec7131 | 2011-11-10 02:08:26 +0000 | [diff] [blame] | 152 | friend class WiFiMainTest; // access to supplicant_*_proxy_, link_up_ |
mukesh agrawal | 7ec7131 | 2011-11-10 02:08:26 +0000 | [diff] [blame] | 153 | FRIEND_TEST(WiFiMainTest, InitialSupplicantState); // kInterfaceStateUnknown |
Thieu Le | e41a72d | 2012-02-06 20:46:51 +0000 | [diff] [blame] | 154 | FRIEND_TEST(WiFiMainTest, ScanResults); // EndpointMap |
mukesh agrawal | 165e614 | 2011-11-22 02:22:56 +0000 | [diff] [blame] | 155 | FRIEND_TEST(WiFiMainTest, ScanResultsWithUpdates); // EndpointMap |
mukesh agrawal | 5c05b29 | 2012-03-07 10:12:52 -0800 | [diff] [blame] | 156 | FRIEND_TEST(WiFiMainTest, FlushBSSOnResume); // kMaxBSSResumeAgeSeconds |
mukesh agrawal | 8abd2f6 | 2012-01-30 14:56:14 -0800 | [diff] [blame] | 157 | FRIEND_TEST(WiFiPropertyTest, ClearDerivedProperty); // bgscan_method_ |
Paul Stewart | 6ab23a9 | 2011-11-09 17:17:47 -0800 | [diff] [blame] | 158 | |
mukesh agrawal | b54601c | 2011-06-07 17:39:22 -0700 | [diff] [blame] | 159 | typedef std::map<const std::string, WiFiEndpointRefPtr> EndpointMap; |
mukesh agrawal | 1590839 | 2011-11-16 18:29:25 +0000 | [diff] [blame] | 160 | typedef std::map<WiFiService *, std::string> ReverseServiceMap; |
mukesh agrawal | b54601c | 2011-06-07 17:39:22 -0700 | [diff] [blame] | 161 | |
mukesh agrawal | 4d0401c | 2012-01-06 16:05:31 -0800 | [diff] [blame] | 162 | static const char *kDefaultBgscanMethod; |
| 163 | static const uint16 kDefaultBgscanShortIntervalSeconds; |
| 164 | static const int32 kDefaultBgscanSignalThresholdDbm; |
| 165 | static const uint16 kDefaultScanIntervalSeconds; |
mukesh agrawal | 7a4e400 | 2011-09-06 11:26:05 -0700 | [diff] [blame] | 166 | static const char kManagerErrorPassphraseRequired[]; |
| 167 | static const char kManagerErrorSSIDTooLong[]; |
| 168 | static const char kManagerErrorSSIDTooShort[]; |
| 169 | static const char kManagerErrorSSIDRequired[]; |
mukesh agrawal | 7a4e400 | 2011-09-06 11:26:05 -0700 | [diff] [blame] | 170 | static const char kManagerErrorUnsupportedSecurityMode[]; |
mukesh agrawal | 7a4e400 | 2011-09-06 11:26:05 -0700 | [diff] [blame] | 171 | static const char kManagerErrorUnsupportedServiceMode[]; |
mukesh agrawal | 5c05b29 | 2012-03-07 10:12:52 -0800 | [diff] [blame] | 172 | static const time_t kMaxBSSResumeAgeSeconds; |
mukesh agrawal | 7ec7131 | 2011-11-10 02:08:26 +0000 | [diff] [blame] | 173 | static const char kInterfaceStateUnknown[]; |
mukesh agrawal | f202817 | 2012-03-13 14:20:22 -0700 | [diff] [blame] | 174 | // Delay between scans when supplicant finds "No suitable network". |
| 175 | static const time_t kRescanIntervalSeconds; |
mukesh agrawal | ab87ea4 | 2011-05-18 11:44:49 -0700 | [diff] [blame] | 176 | |
mukesh agrawal | 4d0401c | 2012-01-06 16:05:31 -0800 | [diff] [blame] | 177 | std::string CreateBgscanConfigString(); |
| 178 | std::string GetBgscanMethod(Error */* error */) { return bgscan_method_; } |
| 179 | uint16 GetBgscanShortInterval(Error */* error */) { |
| 180 | return bgscan_short_interval_seconds_; |
| 181 | } |
| 182 | int32 GetBgscanSignalThreshold(Error */* error */) { |
| 183 | return bgscan_signal_threshold_dbm_; |
| 184 | } |
| 185 | uint16 GetScanInterval(Error */* error */) { return scan_interval_seconds_; } |
| 186 | void SetBgscanMethod(const std::string &method, Error *error); |
| 187 | void SetBgscanShortInterval(const uint16 &seconds, Error *error); |
| 188 | void SetBgscanSignalThreshold(const int32 &dbm, Error *error); |
| 189 | void SetScanInterval(const uint16 &seconds, Error *error); |
| 190 | |
mukesh agrawal | 1590839 | 2011-11-16 18:29:25 +0000 | [diff] [blame] | 191 | WiFiServiceRefPtr CreateServiceForEndpoint( |
| 192 | const WiFiEndpoint &endpoint, bool hidden_ssid); |
| 193 | void CurrentBSSChanged(const ::DBus::Path &new_bss); |
Paul Stewart | 6ab23a9 | 2011-11-09 17:17:47 -0800 | [diff] [blame] | 194 | WiFiServiceRefPtr FindService(const std::vector<uint8_t> &ssid, |
| 195 | const std::string &mode, |
| 196 | const std::string &security) const; |
mukesh agrawal | 165e614 | 2011-11-22 02:22:56 +0000 | [diff] [blame] | 197 | WiFiServiceRefPtr FindServiceForEndpoint(const WiFiEndpoint &endpoint); |
Paul Stewart | ced6a0b | 2011-11-08 15:32:04 -0800 | [diff] [blame] | 198 | ByteArrays GetHiddenSSIDList(); |
mukesh agrawal | 1590839 | 2011-11-16 18:29:25 +0000 | [diff] [blame] | 199 | void HandleDisconnect(); |
| 200 | void HandleRoam(const ::DBus::Path &new_bssid); |
Paul Stewart | a41e38d | 2011-11-11 07:47:29 -0800 | [diff] [blame] | 201 | // Create services for hidden networks stored in |storage|. Returns true |
| 202 | // if any were found, otherwise returns false. |
| 203 | bool LoadHiddenServices(StoreInterface *storage); |
mukesh agrawal | b4bc57d | 2011-12-07 01:07:47 +0000 | [diff] [blame] | 204 | void BSSAddedTask(const ::DBus::Path &BSS, |
| 205 | const std::map<std::string, ::DBus::Variant> &properties); |
| 206 | void BSSRemovedTask(const ::DBus::Path &BSS); |
Paul Stewart | 66c8600 | 2012-01-30 18:00:52 -0800 | [diff] [blame] | 207 | void ClearCachedCredentialsTask(); |
mukesh agrawal | 1590839 | 2011-11-16 18:29:25 +0000 | [diff] [blame] | 208 | void PropertiesChangedTask( |
| 209 | const std::map<std::string, ::DBus::Variant> &properties); |
mukesh agrawal | dc42bb3 | 2011-07-28 10:40:26 -0700 | [diff] [blame] | 210 | void ScanDoneTask(); |
mukesh agrawal | 3239932 | 2011-09-01 10:53:43 -0700 | [diff] [blame] | 211 | void ScanTask(); |
mukesh agrawal | 7ec7131 | 2011-11-10 02:08:26 +0000 | [diff] [blame] | 212 | void StateChanged(const std::string &new_state); |
mukesh agrawal | b54601c | 2011-06-07 17:39:22 -0700 | [diff] [blame] | 213 | |
mukesh agrawal | 4d0401c | 2012-01-06 16:05:31 -0800 | [diff] [blame] | 214 | void HelpRegisterDerivedInt32( |
| 215 | PropertyStore *store, |
| 216 | const std::string &name, |
| 217 | int32(WiFi::*get)(Error *error), |
| 218 | void(WiFi::*set)(const int32 &value, Error *error)); |
| 219 | void HelpRegisterDerivedString( |
| 220 | PropertyStore *store, |
| 221 | const std::string &name, |
| 222 | std::string(WiFi::*get)(Error *error), |
| 223 | void(WiFi::*set)(const std::string &value, Error *error)); |
| 224 | void HelpRegisterDerivedUint16( |
| 225 | PropertyStore *store, |
| 226 | const std::string &name, |
| 227 | uint16(WiFi::*get)(Error *error), |
| 228 | void(WiFi::*set)(const uint16 &value, Error *error)); |
| 229 | |
Gary Morain | ac1bdb4 | 2012-02-16 17:42:29 -0800 | [diff] [blame] | 230 | // If this WiFi device is idle and |new_state| indicates a resume event, a |
| 231 | // scan is initiated. |
| 232 | void HandlePowerStateChange(PowerManager::SuspendState new_state); |
| 233 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 234 | base::WeakPtrFactory<WiFi> weak_ptr_factory_; |
| 235 | |
Darin Petkov | ab565bb | 2011-10-06 02:55:51 -0700 | [diff] [blame] | 236 | // Store cached copies of singletons for speed/ease of testing. |
| 237 | ProxyFactory *proxy_factory_; |
mukesh agrawal | 5c05b29 | 2012-03-07 10:12:52 -0800 | [diff] [blame] | 238 | Time *time_; |
Darin Petkov | ab565bb | 2011-10-06 02:55:51 -0700 | [diff] [blame] | 239 | |
mukesh agrawal | af57195 | 2011-07-14 14:31:12 -0700 | [diff] [blame] | 240 | scoped_ptr<SupplicantProcessProxyInterface> supplicant_process_proxy_; |
| 241 | scoped_ptr<SupplicantInterfaceProxyInterface> supplicant_interface_proxy_; |
mukesh agrawal | 1590839 | 2011-11-16 18:29:25 +0000 | [diff] [blame] | 242 | // The rpcid used as the key is wpa_supplicant's D-Bus path for the |
| 243 | // Endpoint (BSS, in supplicant parlance). |
| 244 | EndpointMap endpoint_by_rpcid_; |
mukesh agrawal | 1590839 | 2011-11-16 18:29:25 +0000 | [diff] [blame] | 245 | // Map from Services to the D-Bus path for the corresponding wpa_supplicant |
| 246 | // Network. |
| 247 | ReverseServiceMap rpcid_by_service_; |
mukesh agrawal | 1590839 | 2011-11-16 18:29:25 +0000 | [diff] [blame] | 248 | std::vector<WiFiServiceRefPtr> services_; |
| 249 | // The Service we are presently connected to. May be NULL is we're not |
| 250 | // not connected to any Service. |
| 251 | WiFiServiceRefPtr current_service_; |
| 252 | // The Service we're attempting to connect to. May be NULL if we're |
| 253 | // not attempting to connect to a new Service. If non-NULL, should |
| 254 | // be distinct from |current_service_|. (A service should not |
| 255 | // simultaneously be both pending, and current.) |
| 256 | WiFiServiceRefPtr pending_service_; |
| 257 | std::string supplicant_state_; |
| 258 | std::string supplicant_bss_; |
Paul Stewart | 66c8600 | 2012-01-30 18:00:52 -0800 | [diff] [blame] | 259 | // Signifies that ClearCachedCredentialsTask() is pending. |
| 260 | bool clear_cached_credentials_pending_; |
mukesh agrawal | 5c05b29 | 2012-03-07 10:12:52 -0800 | [diff] [blame] | 261 | // Indicates that we should flush supplicant's BSS cache after the |
| 262 | // next scan completes. |
| 263 | bool need_bss_flush_; |
| 264 | struct timeval resumed_at_; |
mukesh agrawal | ab87ea4 | 2011-05-18 11:44:49 -0700 | [diff] [blame] | 265 | |
Chris Masone | 853b81b | 2011-06-24 14:11:41 -0700 | [diff] [blame] | 266 | // Properties |
| 267 | std::string bgscan_method_; |
mukesh agrawal | 4d0401c | 2012-01-06 16:05:31 -0800 | [diff] [blame] | 268 | uint16 bgscan_short_interval_seconds_; |
| 269 | int32 bgscan_signal_threshold_dbm_; |
Chris Masone | 853b81b | 2011-06-24 14:11:41 -0700 | [diff] [blame] | 270 | bool scan_pending_; |
mukesh agrawal | 4d0401c | 2012-01-06 16:05:31 -0800 | [diff] [blame] | 271 | uint16 scan_interval_seconds_; |
Chris Masone | 853b81b | 2011-06-24 14:11:41 -0700 | [diff] [blame] | 272 | |
Paul Stewart | b50f0b9 | 2011-05-16 16:31:42 -0700 | [diff] [blame] | 273 | DISALLOW_COPY_AND_ASSIGN(WiFi); |
| 274 | }; |
| 275 | |
| 276 | } // namespace shill |
| 277 | |
| 278 | #endif // SHILL_WIFI_ |