Darin Petkov | c64fe5e | 2012-01-11 12:46:13 +0100 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -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_DEVICE_ |
| 6 | #define SHILL_DEVICE_ |
| 7 | |
Chris Masone | 46eaaf5 | 2011-05-24 13:08:30 -0700 | [diff] [blame] | 8 | #include <string> |
Chris Masone | 9be4a9d | 2011-05-16 15:44:09 -0700 | [diff] [blame] | 9 | #include <vector> |
| 10 | |
Chris Masone | 8fe2c7e | 2011-06-09 15:51:19 -0700 | [diff] [blame] | 11 | #include <base/basictypes.h> |
Chris Masone | 487b8bf | 2011-05-13 16:27:57 -0700 | [diff] [blame] | 12 | #include <base/memory/ref_counted.h> |
Paul Stewart | b50f0b9 | 2011-05-16 16:31:42 -0700 | [diff] [blame] | 13 | #include <base/memory/scoped_ptr.h> |
Darin Petkov | afa6fc4 | 2011-06-21 16:21:08 -0700 | [diff] [blame] | 14 | #include <gtest/gtest_prod.h> // for FRIEND_TEST |
Paul Stewart | d584377 | 2011-05-11 15:40:42 -0700 | [diff] [blame] | 15 | |
Paul Stewart | 26b327e | 2011-10-19 11:38:09 -0700 | [diff] [blame] | 16 | #include "shill/event_dispatcher.h" |
Paul Stewart | 2bf1d35 | 2011-12-06 15:02:55 -0800 | [diff] [blame] | 17 | #include "shill/ip_address.h" |
Darin Petkov | afa6fc4 | 2011-06-21 16:21:08 -0700 | [diff] [blame] | 18 | #include "shill/ipconfig.h" |
Chris Masone | b925cc8 | 2011-06-22 15:39:57 -0700 | [diff] [blame] | 19 | #include "shill/property_store.h" |
Chris Masone | 2b10554 | 2011-06-22 10:58:09 -0700 | [diff] [blame] | 20 | #include "shill/refptr_types.h" |
Paul Stewart | 03dba0b | 2011-08-22 16:32:45 -0700 | [diff] [blame] | 21 | #include "shill/service.h" |
Paul Stewart | fdd1607 | 2011-09-16 12:41:35 -0700 | [diff] [blame] | 22 | #include "shill/technology.h" |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 23 | |
| 24 | namespace shill { |
| 25 | |
Chris Masone | 9be4a9d | 2011-05-16 15:44:09 -0700 | [diff] [blame] | 26 | class ControlInterface; |
Darin Petkov | 77cb681 | 2011-08-15 16:19:41 -0700 | [diff] [blame] | 27 | class DHCPProvider; |
Chris Masone | 9be4a9d | 2011-05-16 15:44:09 -0700 | [diff] [blame] | 28 | class DeviceAdaptorInterface; |
Paul Stewart | f1ce5d2 | 2011-05-19 13:10:20 -0700 | [diff] [blame] | 29 | class Endpoint; |
Chris Masone | 8fe2c7e | 2011-06-09 15:51:19 -0700 | [diff] [blame] | 30 | class Error; |
| 31 | class EventDispatcher; |
Paul Stewart | f1ce5d2 | 2011-05-19 13:10:20 -0700 | [diff] [blame] | 32 | class Manager; |
mukesh agrawal | 5c4dd0b | 2011-09-14 13:53:14 -0700 | [diff] [blame] | 33 | class RTNLHandler; |
Darin Petkov | e5bc2cb | 2011-12-07 14:47:32 +0100 | [diff] [blame] | 34 | class ReturnerInterface; |
Chris Masone | 9be4a9d | 2011-05-16 15:44:09 -0700 | [diff] [blame] | 35 | |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 36 | // Device superclass. Individual network interfaces types will inherit from |
| 37 | // this class. |
Chris Masone | 27c4aa5 | 2011-07-02 13:10:14 -0700 | [diff] [blame] | 38 | class Device : public base::RefCounted<Device> { |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 39 | public: |
Chris Masone | 9be4a9d | 2011-05-16 15:44:09 -0700 | [diff] [blame] | 40 | // A constructor for the Device object |
| 41 | Device(ControlInterface *control_interface, |
Paul Stewart | b50f0b9 | 2011-05-16 16:31:42 -0700 | [diff] [blame] | 42 | EventDispatcher *dispatcher, |
Paul Stewart | f1ce5d2 | 2011-05-19 13:10:20 -0700 | [diff] [blame] | 43 | Manager *manager, |
Darin Petkov | afa6fc4 | 2011-06-21 16:21:08 -0700 | [diff] [blame] | 44 | const std::string &link_name, |
Chris Masone | 626719f | 2011-08-18 16:58:48 -0700 | [diff] [blame] | 45 | const std::string &address, |
Gaurav Shah | 435de2c | 2011-11-17 19:01:07 -0800 | [diff] [blame] | 46 | int interface_index, |
| 47 | Technology::Identifier technology); |
Chris Masone | 9be4a9d | 2011-05-16 15:44:09 -0700 | [diff] [blame] | 48 | virtual ~Device(); |
| 49 | |
| 50 | virtual void Start(); |
mukesh agrawal | 5c4dd0b | 2011-09-14 13:53:14 -0700 | [diff] [blame] | 51 | |
| 52 | // Clear running state, especially any fields that hold a reference back |
| 53 | // to us. After a call to Stop(), the Device may be restarted (with a call |
| 54 | // to Start()), or destroyed (if its refcount falls to zero). |
Chris Masone | 9be4a9d | 2011-05-16 15:44:09 -0700 | [diff] [blame] | 55 | virtual void Stop(); |
| 56 | |
Gaurav Shah | 435de2c | 2011-11-17 19:01:07 -0800 | [diff] [blame] | 57 | |
| 58 | // TODO(gauravsh): We do not really need this since technology() can be used |
| 59 | // to get a device's technology for direct comparison. |
Darin Petkov | afa6fc4 | 2011-06-21 16:21:08 -0700 | [diff] [blame] | 60 | // Base method always returns false. |
Paul Stewart | fdd1607 | 2011-09-16 12:41:35 -0700 | [diff] [blame] | 61 | virtual bool TechnologyIs(const Technology::Identifier type) const; |
Darin Petkov | afa6fc4 | 2011-06-21 16:21:08 -0700 | [diff] [blame] | 62 | |
Paul Stewart | f1ce5d2 | 2011-05-19 13:10:20 -0700 | [diff] [blame] | 63 | virtual void LinkEvent(unsigned flags, unsigned change); |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 64 | |
Chris Masone | c1e5041 | 2011-06-07 13:04:53 -0700 | [diff] [blame] | 65 | virtual void ConfigIP() {} |
| 66 | |
Darin Petkov | 9ae310f | 2011-08-30 15:41:13 -0700 | [diff] [blame] | 67 | // The default implementation sets |error| to kNotSupported. |
Darin Petkov | c086531 | 2011-09-16 15:31:20 -0700 | [diff] [blame] | 68 | virtual void Scan(Error *error); |
Darin Petkov | 9ae310f | 2011-08-30 15:41:13 -0700 | [diff] [blame] | 69 | virtual void RegisterOnNetwork(const std::string &network_id, Error *error); |
Darin Petkov | c64fe5e | 2012-01-11 12:46:13 +0100 | [diff] [blame] | 70 | virtual void RequirePIN( |
| 71 | const std::string &pin, bool require, ReturnerInterface *returner); |
Darin Petkov | e5bc2cb | 2011-12-07 14:47:32 +0100 | [diff] [blame] | 72 | virtual void EnterPIN(const std::string &pin, ReturnerInterface *returner); |
Darin Petkov | e42e101 | 2011-08-31 12:35:04 -0700 | [diff] [blame] | 73 | virtual void UnblockPIN(const std::string &unblock_code, |
| 74 | const std::string &pin, |
Darin Petkov | c64fe5e | 2012-01-11 12:46:13 +0100 | [diff] [blame] | 75 | ReturnerInterface *returner); |
Darin Petkov | e42e101 | 2011-08-31 12:35:04 -0700 | [diff] [blame] | 76 | virtual void ChangePIN(const std::string &old_pin, |
| 77 | const std::string &new_pin, |
Darin Petkov | c64fe5e | 2012-01-11 12:46:13 +0100 | [diff] [blame] | 78 | ReturnerInterface *returner); |
Paul Stewart | 2bf1d35 | 2011-12-06 15:02:55 -0800 | [diff] [blame] | 79 | virtual void DisableIPv6(); |
| 80 | virtual void EnableIPv6(); |
| 81 | virtual void EnableIPv6Privacy(); |
Darin Petkov | 9ae310f | 2011-08-30 15:41:13 -0700 | [diff] [blame] | 82 | |
Paul Stewart | c8f4bef | 2011-12-13 09:45:51 -0800 | [diff] [blame] | 83 | // Request the removal of reverse-path filtering for this interface. |
| 84 | // This will allow packets destined for this interface to be accepted, |
| 85 | // even if this is not the default route for such a packet to arrive. |
| 86 | virtual void DisableReversePathFilter(); |
| 87 | |
| 88 | // Request reverse-path filtering for this interface. |
| 89 | virtual void EnableReversePathFilter(); |
| 90 | |
Gaurav Shah | 435de2c | 2011-11-17 19:01:07 -0800 | [diff] [blame] | 91 | // Returns true if the selected service on the device (if any) is connected. |
| 92 | // Returns false if there is no selected service, or if the selected service |
| 93 | // is not connected. |
| 94 | bool IsConnected() const; |
| 95 | |
Chris Masone | 27c4aa5 | 2011-07-02 13:10:14 -0700 | [diff] [blame] | 96 | std::string GetRpcIdentifier(); |
Chris Masone | 5dec5f4 | 2011-07-22 14:07:55 -0700 | [diff] [blame] | 97 | std::string GetStorageIdentifier(); |
Chris Masone | 8fe2c7e | 2011-06-09 15:51:19 -0700 | [diff] [blame] | 98 | |
Chris Masone | 9d77993 | 2011-08-25 16:33:41 -0700 | [diff] [blame] | 99 | const std::string &address() const { return hardware_address_; } |
Darin Petkov | e0a312e | 2011-07-20 13:45:28 -0700 | [diff] [blame] | 100 | const std::string &link_name() const { return link_name_; } |
| 101 | int interface_index() const { return interface_index_; } |
Paul Stewart | e613202 | 2011-08-16 09:11:02 -0700 | [diff] [blame] | 102 | const ConnectionRefPtr &connection() const { return connection_; } |
Paul Stewart | a41e38d | 2011-11-11 07:47:29 -0800 | [diff] [blame] | 103 | bool powered() const { return powered_; } |
Gaurav Shah | 435de2c | 2011-11-17 19:01:07 -0800 | [diff] [blame] | 104 | virtual Technology::Identifier technology() const { return technology_; } |
Darin Petkov | e0a312e | 2011-07-20 13:45:28 -0700 | [diff] [blame] | 105 | |
Chris Masone | 19e3040 | 2011-07-19 15:48:47 -0700 | [diff] [blame] | 106 | const std::string &FriendlyName() const; |
Chris Masone | 27c4aa5 | 2011-07-02 13:10:14 -0700 | [diff] [blame] | 107 | |
Darin Petkov | afa6fc4 | 2011-06-21 16:21:08 -0700 | [diff] [blame] | 108 | // Returns a string that is guaranteed to uniquely identify this Device |
| 109 | // instance. |
| 110 | const std::string &UniqueName() const; |
Chris Masone | a82b711 | 2011-05-25 15:16:29 -0700 | [diff] [blame] | 111 | |
mukesh agrawal | de29fa8 | 2011-09-16 16:16:36 -0700 | [diff] [blame] | 112 | PropertyStore *mutable_store() { return &store_; } |
| 113 | const PropertyStore &store() const { return store_; } |
mukesh agrawal | 5c4dd0b | 2011-09-14 13:53:14 -0700 | [diff] [blame] | 114 | RTNLHandler *rtnl_handler() { return rtnl_handler_; } |
Chris Masone | 19e3040 | 2011-07-19 15:48:47 -0700 | [diff] [blame] | 115 | |
Darin Petkov | b05315f | 2011-11-07 10:14:25 +0100 | [diff] [blame] | 116 | EventDispatcher *dispatcher() const { return dispatcher_; } |
| 117 | |
Paul Stewart | a41e38d | 2011-11-11 07:47:29 -0800 | [diff] [blame] | 118 | // Load configuration for the device from |storage|. This may include |
| 119 | // instantiating non-visible services for which configuration has been |
| 120 | // stored. |
| 121 | virtual bool Load(StoreInterface *storage); |
| 122 | |
| 123 | // Save configuration for the device to |storage|. |
Chris Masone | 877ff98 | 2011-09-21 16:18:24 -0700 | [diff] [blame] | 124 | virtual bool Save(StoreInterface *storage); |
Chris Masone | 5dec5f4 | 2011-07-22 14:07:55 -0700 | [diff] [blame] | 125 | |
Darin Petkov | 77cb681 | 2011-08-15 16:19:41 -0700 | [diff] [blame] | 126 | void set_dhcp_provider(DHCPProvider *provider) { dhcp_provider_ = provider; } |
| 127 | |
Darin Petkov | 3cfbf21 | 2011-11-21 16:02:09 +0100 | [diff] [blame] | 128 | DeviceAdaptorInterface *adaptor() const { return adaptor_.get(); } |
| 129 | |
Paul Stewart | d584377 | 2011-05-11 15:40:42 -0700 | [diff] [blame] | 130 | protected: |
Paul Stewart | 2bf1d35 | 2011-12-06 15:02:55 -0800 | [diff] [blame] | 131 | FRIEND_TEST(DeviceTest, AcquireIPConfig); |
Darin Petkov | afa6fc4 | 2011-06-21 16:21:08 -0700 | [diff] [blame] | 132 | FRIEND_TEST(DeviceTest, DestroyIPConfig); |
| 133 | FRIEND_TEST(DeviceTest, DestroyIPConfigNULL); |
Chris Masone | 95207da | 2011-06-29 16:50:49 -0700 | [diff] [blame] | 134 | FRIEND_TEST(DeviceTest, GetProperties); |
Paul Stewart | be5f5b3 | 2011-12-07 17:11:11 -0800 | [diff] [blame] | 135 | FRIEND_TEST(DeviceTest, IPConfigUpdatedFailure); |
| 136 | FRIEND_TEST(DeviceTest, IPConfigUpdatedSuccess); |
Chris Masone | 5dec5f4 | 2011-07-22 14:07:55 -0700 | [diff] [blame] | 137 | FRIEND_TEST(DeviceTest, Save); |
Paul Stewart | 03dba0b | 2011-08-22 16:32:45 -0700 | [diff] [blame] | 138 | FRIEND_TEST(DeviceTest, SelectedService); |
mukesh agrawal | 5c4dd0b | 2011-09-14 13:53:14 -0700 | [diff] [blame] | 139 | FRIEND_TEST(DeviceTest, Stop); |
Paul Stewart | a41e38d | 2011-11-11 07:47:29 -0800 | [diff] [blame] | 140 | FRIEND_TEST(ManagerTest, DeviceRegistrationAndStart); |
Gaurav Shah | 435de2c | 2011-11-17 19:01:07 -0800 | [diff] [blame] | 141 | FRIEND_TEST(ManagerTest, ConnectedTechnologies); |
| 142 | FRIEND_TEST(ManagerTest, DefaultTechnology); |
mukesh agrawal | 3239932 | 2011-09-01 10:53:43 -0700 | [diff] [blame] | 143 | FRIEND_TEST(WiFiMainTest, Connect); |
Darin Petkov | afa6fc4 | 2011-06-21 16:21:08 -0700 | [diff] [blame] | 144 | |
| 145 | // If there's an IP configuration in |ipconfig_|, releases the IP address and |
| 146 | // destroys the configuration instance. |
| 147 | void DestroyIPConfig(); |
| 148 | |
| 149 | // Creates a new DHCP IP configuration instance, stores it in |ipconfig_| and |
| 150 | // requests a new IP configuration. Registers a callback to |
| 151 | // IPConfigUpdatedCallback on IP configuration changes. Returns true if the IP |
| 152 | // request was successfully sent. |
Paul Stewart | 2bf1d35 | 2011-12-06 15:02:55 -0800 | [diff] [blame] | 153 | bool AcquireIPConfig(); |
Darin Petkov | afa6fc4 | 2011-06-21 16:21:08 -0700 | [diff] [blame] | 154 | |
Paul Stewart | e613202 | 2011-08-16 09:11:02 -0700 | [diff] [blame] | 155 | // Maintain connection state (Routes, IP Addresses and DNS) in the OS. |
| 156 | void CreateConnection(); |
| 157 | |
| 158 | // Remove connection state |
| 159 | void DestroyConnection(); |
| 160 | |
Paul Stewart | 03dba0b | 2011-08-22 16:32:45 -0700 | [diff] [blame] | 161 | // Selects a service to be "current" -- i.e. link-state or configuration |
| 162 | // events that happen to the device are attributed to this service. |
| 163 | void SelectService(const ServiceRefPtr &service); |
| 164 | |
| 165 | // Set the state of the selected service |
| 166 | void SetServiceState(Service::ConnectState state); |
| 167 | |
| 168 | // Set the failure of the selected service (implicitly sets the state to |
| 169 | // "failure") |
| 170 | void SetServiceFailure(Service::ConnectFailure failure_state); |
| 171 | |
Chris Masone | 27c4aa5 | 2011-07-02 13:10:14 -0700 | [diff] [blame] | 172 | void HelpRegisterDerivedStrings(const std::string &name, |
Gaurav Shah | 1b7a616 | 2011-11-09 11:41:01 -0800 | [diff] [blame] | 173 | Strings(Device::*get)(Error *), |
mukesh agrawal | ffa3d04 | 2011-10-06 15:26:10 -0700 | [diff] [blame] | 174 | void(Device::*set)(const Strings&, Error *)); |
Chris Masone | b925cc8 | 2011-06-22 15:39:57 -0700 | [diff] [blame] | 175 | |
Paul Stewart | ac4ac00 | 2011-08-26 12:04:26 -0700 | [diff] [blame] | 176 | // Property getters reserved for subclasses |
| 177 | ControlInterface *control_interface() const { return control_interface_; } |
Paul Stewart | ac4ac00 | 2011-08-26 12:04:26 -0700 | [diff] [blame] | 178 | Manager *manager() const { return manager_; } |
Paul Stewart | a41e38d | 2011-11-11 07:47:29 -0800 | [diff] [blame] | 179 | bool running() const { return running_; } |
Paul Stewart | d584377 | 2011-05-11 15:40:42 -0700 | [diff] [blame] | 180 | |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 181 | private: |
Chris Masone | 413a319 | 2011-05-09 17:10:05 -0700 | [diff] [blame] | 182 | friend class DeviceAdaptorInterface; |
mukesh agrawal | 5c4dd0b | 2011-09-14 13:53:14 -0700 | [diff] [blame] | 183 | friend class DeviceTest; |
| 184 | friend class CellularTest; |
| 185 | friend class WiFiMainTest; |
Darin Petkov | afa6fc4 | 2011-06-21 16:21:08 -0700 | [diff] [blame] | 186 | |
Paul Stewart | 2bf1d35 | 2011-12-06 15:02:55 -0800 | [diff] [blame] | 187 | static const char kIPFlagTemplate[]; |
| 188 | static const char kIPFlagVersion4[]; |
| 189 | static const char kIPFlagVersion6[]; |
| 190 | static const char kIPFlagDisableIPv6[]; |
| 191 | static const char kIPFlagUseTempAddr[]; |
| 192 | static const char kIPFlagUseTempAddrUsedAndDefault[]; |
Paul Stewart | c8f4bef | 2011-12-13 09:45:51 -0800 | [diff] [blame] | 193 | static const char kIPFlagReversePathFilter[]; |
| 194 | static const char kIPFlagReversePathFilterEnabled[]; |
| 195 | static const char kIPFlagReversePathFilterLooseMode[]; |
Chris Masone | 5dec5f4 | 2011-07-22 14:07:55 -0700 | [diff] [blame] | 196 | static const char kStoragePowered[]; |
| 197 | static const char kStorageIPConfigs[]; |
| 198 | |
Darin Petkov | afa6fc4 | 2011-06-21 16:21:08 -0700 | [diff] [blame] | 199 | // Callback invoked on every IP configuration update. |
Chris Masone | 2b10554 | 2011-06-22 10:58:09 -0700 | [diff] [blame] | 200 | void IPConfigUpdatedCallback(const IPConfigRefPtr &ipconfig, bool success); |
Darin Petkov | afa6fc4 | 2011-06-21 16:21:08 -0700 | [diff] [blame] | 201 | |
Chris Masone | 5dec5f4 | 2011-07-22 14:07:55 -0700 | [diff] [blame] | 202 | // Right now, Devices reference IPConfigs directly when persisted to disk |
| 203 | // It's not clear that this makes sense long-term, but that's how it is now. |
| 204 | // This call generates a string in the right format for this persisting. |
Chris Masone | 34af218 | 2011-08-22 11:59:36 -0700 | [diff] [blame] | 205 | // |suffix| is injected into the storage identifier used for the configs. |
| 206 | std::string SerializeIPConfigs(const std::string &suffix); |
Chris Masone | 5dec5f4 | 2011-07-22 14:07:55 -0700 | [diff] [blame] | 207 | |
Paul Stewart | 2bf1d35 | 2011-12-06 15:02:55 -0800 | [diff] [blame] | 208 | // Set an IP configuration flag on the device. |ip_version| should be |
| 209 | // "ipv6" or "ipv4". |flag| should be the name of the flag to be set |
| 210 | // and |value| is what this flag should be set to. |
| 211 | bool SetIPFlag(IPAddress::Family family, const std::string &flag, |
| 212 | const std::string &value); |
| 213 | |
Gaurav Shah | 1b7a616 | 2011-11-09 11:41:01 -0800 | [diff] [blame] | 214 | std::vector<std::string> AvailableIPConfigs(Error *error); |
Chris Masone | 4e85161 | 2011-07-01 10:46:53 -0700 | [diff] [blame] | 215 | std::string GetRpcConnectionIdentifier(); |
| 216 | |
Paul Stewart | ac4ac00 | 2011-08-26 12:04:26 -0700 | [diff] [blame] | 217 | // Properties |
Paul Stewart | a41e38d | 2011-11-11 07:47:29 -0800 | [diff] [blame] | 218 | bool powered_; // indicates whether the device is configured to operate |
Paul Stewart | ac4ac00 | 2011-08-26 12:04:26 -0700 | [diff] [blame] | 219 | bool reconnect_; |
| 220 | const std::string hardware_address_; |
| 221 | |
| 222 | PropertyStore store_; |
| 223 | |
Paul Stewart | ac4ac00 | 2011-08-26 12:04:26 -0700 | [diff] [blame] | 224 | const int interface_index_; |
Paul Stewart | a41e38d | 2011-11-11 07:47:29 -0800 | [diff] [blame] | 225 | bool running_; // indicates whether the device is actually in operation |
Paul Stewart | ac4ac00 | 2011-08-26 12:04:26 -0700 | [diff] [blame] | 226 | const std::string link_name_; |
| 227 | const std::string unique_id_; |
| 228 | ControlInterface *control_interface_; |
| 229 | EventDispatcher *dispatcher_; |
| 230 | Manager *manager_; |
| 231 | IPConfigRefPtr ipconfig_; |
| 232 | ConnectionRefPtr connection_; |
Darin Petkov | afa6fc4 | 2011-06-21 16:21:08 -0700 | [diff] [blame] | 233 | scoped_ptr<DeviceAdaptorInterface> adaptor_; |
Gaurav Shah | 435de2c | 2011-11-17 19:01:07 -0800 | [diff] [blame] | 234 | Technology::Identifier technology_; |
Darin Petkov | afa6fc4 | 2011-06-21 16:21:08 -0700 | [diff] [blame] | 235 | |
Paul Stewart | 03dba0b | 2011-08-22 16:32:45 -0700 | [diff] [blame] | 236 | // Maintain a reference to the connected / connecting service |
| 237 | ServiceRefPtr selected_service_; |
| 238 | |
mukesh agrawal | 5c4dd0b | 2011-09-14 13:53:14 -0700 | [diff] [blame] | 239 | // Cache singleton pointers for performance and test purposes. |
Darin Petkov | 77cb681 | 2011-08-15 16:19:41 -0700 | [diff] [blame] | 240 | DHCPProvider *dhcp_provider_; |
mukesh agrawal | 5c4dd0b | 2011-09-14 13:53:14 -0700 | [diff] [blame] | 241 | RTNLHandler *rtnl_handler_; |
Darin Petkov | 77cb681 | 2011-08-15 16:19:41 -0700 | [diff] [blame] | 242 | |
Chris Masone | 9be4a9d | 2011-05-16 15:44:09 -0700 | [diff] [blame] | 243 | DISALLOW_COPY_AND_ASSIGN(Device); |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 244 | }; |
| 245 | |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 246 | } // namespace shill |
| 247 | |
| 248 | #endif // SHILL_DEVICE_ |