blob: 660cf69a0dc151a0f68ca9a875ea9f897d3c01c6 [file] [log] [blame]
mukesh agrawal8a3188d2011-12-01 20:56:44 +00001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Paul Stewart75897df2011-04-27 09:05:53 -07002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Ben Chan19f83972012-10-03 23:25:56 -07005#ifndef SHILL_SERVICE_H_
6#define SHILL_SERVICE_H_
Paul Stewart75897df2011-04-27 09:05:53 -07007
Darin Petkov385b9bc2012-12-03 15:25:05 +01008#include <sys/time.h>
mukesh agrawal568b5c62012-02-28 14:44:47 -08009#include <time.h>
10
Darin Petkov385b9bc2012-12-03 15:25:05 +010011#include <deque>
Chris Masone8fe2c7e2011-06-09 15:51:19 -070012#include <map>
Paul Stewartcb59fed2012-03-21 21:14:46 -070013#include <set>
Darin Petkov385b9bc2012-12-03 15:25:05 +010014#include <string>
Chris Masone8fe2c7e2011-06-09 15:51:19 -070015#include <vector>
Chris Masone9be4a9d2011-05-16 15:44:09 -070016
Christopher Wiley0801d192012-09-24 11:57:15 -070017#include <base/cancelable_callback.h>
Chris Masone9be4a9d2011-05-16 15:44:09 -070018#include <base/memory/ref_counted.h>
Paul Stewartba41b992011-05-26 07:02:46 -070019#include <base/memory/scoped_ptr.h>
Christopher Wiley0801d192012-09-24 11:57:15 -070020#include <base/memory/weak_ptr.h>
Darin Petkovba40dd32011-07-11 20:06:39 -070021#include <gtest/gtest_prod.h> // for FRIEND_TEST
Paul Stewart75897df2011-04-27 09:05:53 -070022
Eric Shienbrood9a245532012-03-07 14:20:39 -050023#include "shill/adaptor_interfaces.h"
Chris Masone3bd3c8c2011-06-13 08:20:26 -070024#include "shill/accessor_interface.h"
Eric Shienbrood9a245532012-03-07 14:20:39 -050025#include "shill/callbacks.h"
Chris Masoneb925cc82011-06-22 15:39:57 -070026#include "shill/property_store.h"
Chris Masone7aa5f902011-07-11 11:13:35 -070027#include "shill/refptr_types.h"
Paul Stewart1062d9d2012-04-27 10:42:27 -070028#include "shill/static_ip_parameters.h"
Paul Stewart22aa71b2011-09-16 12:15:11 -070029#include "shill/technology.h"
Chris Masonec1e50412011-06-07 13:04:53 -070030
Thieu Leb84ba342012-03-02 15:15:19 -080031namespace chromeos_metrics {
32class Timer;
33}
34
Paul Stewart75897df2011-04-27 09:05:53 -070035namespace shill {
36
Chris Masone9be4a9d2011-05-16 15:44:09 -070037class ControlInterface;
Darin Petkov385b9bc2012-12-03 15:25:05 +010038class DiagnosticsReporter;
Paul Stewart75897df2011-04-27 09:05:53 -070039class Endpoint;
Chris Masone8fe2c7e2011-06-09 15:51:19 -070040class Error;
Chris Masone9be4a9d2011-05-16 15:44:09 -070041class EventDispatcher;
Paul Stewartbe5f5b32011-12-07 17:11:11 -080042class HTTPProxy;
mukesh agrawal7a4e4002011-09-06 11:26:05 -070043class KeyValueStore;
Chris Masone6791a432011-07-12 13:23:19 -070044class Manager;
Thieu Le48e6d6d2011-12-06 00:40:27 +000045class Metrics;
Chris Masone9be4a9d2011-05-16 15:44:09 -070046class ServiceAdaptorInterface;
Darin Petkov5eb05422012-05-11 15:45:25 +020047class Sockets;
Darin Petkovba40dd32011-07-11 20:06:39 -070048class StoreInterface;
Darin Petkov385b9bc2012-12-03 15:25:05 +010049class Time;
Paul Stewart75897df2011-04-27 09:05:53 -070050
Chris Masone7aa5f902011-07-11 11:13:35 -070051// A Service is a uniquely named entity, which the system can
52// connect in order to begin sending and receiving network traffic.
53// All Services are bound to an Entry, which represents the persistable
54// state of the Service. If the Entry is populated at the time of Service
55// creation, that information is used to prime the Service. If not, the Entry
56// becomes populated over time.
Chris Masone27c4aa52011-07-02 13:10:14 -070057class Service : public base::RefCounted<Service> {
Paul Stewart75897df2011-04-27 09:05:53 -070058 public:
Darin Petkovba40dd32011-07-11 20:06:39 -070059 static const char kCheckPortalAuto[];
60 static const char kCheckPortalFalse[];
61 static const char kCheckPortalTrue[];
62
Paul Stewart0756db92012-01-27 08:34:47 -080063 // TODO(pstew): Storage constants shouldn't need to be public
64 // crosbug.com/25813
65 static const char kStorageAutoConnect[];
66 static const char kStorageCheckPortal[];
67 static const char kStorageEapAnonymousIdentity[];
68 static const char kStorageEapCACert[];
69 static const char kStorageEapCACertID[];
Paul Stewartecf4cd12012-04-17 11:08:39 -070070 static const char kStorageEapCACertNSS[];
Paul Stewart0756db92012-01-27 08:34:47 -080071 static const char kStorageEapCertID[];
72 static const char kStorageEapClientCert[];
73 static const char kStorageEapEap[];
74 static const char kStorageEapIdentity[];
75 static const char kStorageEapInnerEap[];
76 static const char kStorageEapKeyID[];
77 static const char kStorageEapKeyManagement[];
78 static const char kStorageEapPIN[];
79 static const char kStorageEapPassword[];
80 static const char kStorageEapPrivateKey[];
81 static const char kStorageEapPrivateKeyPassword[];
82 static const char kStorageEapUseSystemCAs[];
83 static const char kStorageError[];
84 static const char kStorageFavorite[];
85 static const char kStorageGUID[];
mukesh agrawalcf24a242012-05-21 16:46:11 -070086 static const char kStorageHasEverConnected[];
Paul Stewart0756db92012-01-27 08:34:47 -080087 static const char kStorageName[];
88 static const char kStoragePriority[];
89 static const char kStorageProxyConfig[];
90 static const char kStorageSaveCredentials[];
91 static const char kStorageType[];
92 static const char kStorageUIData[];
93
mukesh agrawal8f3f7752012-02-17 19:42:09 -080094 static const uint8 kStrengthMax;
95 static const uint8 kStrengthMin;
96
Paul Stewart75897df2011-04-27 09:05:53 -070097 enum ConnectFailure {
Paul Stewart03dba0b2011-08-22 16:32:45 -070098 kFailureUnknown,
Paul Stewartf2d60912012-07-15 08:37:30 -070099 kFailureActivation,
Paul Stewart03dba0b2011-08-22 16:32:45 -0700100 kFailureOutOfRange,
101 kFailurePinMissing,
Paul Stewartf2d60912012-07-15 08:37:30 -0700102 kFailureDHCP,
103 kFailureBadPassphrase,
Paul Stewart03dba0b2011-08-22 16:32:45 -0700104 kFailureNeedEVDO,
105 kFailureNeedHomeNetwork,
Paul Stewartf2d60912012-07-15 08:37:30 -0700106 kFailureOTASP,
107 kFailureAAA,
108 kFailureBadWEPKey,
109 kFailureConnect,
110 kFailureDNSLookup,
111 kFailureHTTPGet,
112 kFailurePPPAuth,
Paul Stewartdb0f9172012-11-30 16:48:09 -0800113 kFailureEAPAuthentication,
114 kFailureEAPLocalTLS,
115 kFailureEAPRemoteTLS,
Thieu Le48e6d6d2011-12-06 00:40:27 +0000116 kFailureMax
Paul Stewart75897df2011-04-27 09:05:53 -0700117 };
Chris Masone9be4a9d2011-05-16 15:44:09 -0700118 enum ConnectState {
Paul Stewart03dba0b2011-08-22 16:32:45 -0700119 kStateUnknown,
120 kStateIdle,
121 kStateAssociating,
122 kStateConfiguring,
123 kStateConnected,
124 kStateDisconnected,
Thieu Le48e6d6d2011-12-06 00:40:27 +0000125 kStatePortal,
Gaurav Shahc6d6c722011-11-17 18:59:39 -0800126 kStateFailure,
127 kStateOnline
Chris Masone9be4a9d2011-05-16 15:44:09 -0700128 };
Chris Masoneb2e326b2011-07-12 13:28:51 -0700129 struct EapCredentials {
Paul Stewart20550982012-04-16 12:16:11 -0700130 EapCredentials() : use_system_cas(true) {}
Paul Stewartbc6e7392012-05-24 07:07:48 -0700131 // Who we identify ourselves as to the EAP authenticator.
Chris Masoneb2e326b2011-07-12 13:28:51 -0700132 std::string identity;
Paul Stewartbc6e7392012-05-24 07:07:48 -0700133 // The outer or only EAP authetnication type.
Chris Masoneb2e326b2011-07-12 13:28:51 -0700134 std::string eap;
Paul Stewartbc6e7392012-05-24 07:07:48 -0700135 // The inner EAP authentication type.
Chris Masoneb2e326b2011-07-12 13:28:51 -0700136 std::string inner_eap;
Paul Stewartbc6e7392012-05-24 07:07:48 -0700137 // When there is an inner EAP type, use this identity for the outer.
Chris Masoneb2e326b2011-07-12 13:28:51 -0700138 std::string anonymous_identity;
Paul Stewartbc6e7392012-05-24 07:07:48 -0700139 // Filename of the client certificate.
Chris Masoneb2e326b2011-07-12 13:28:51 -0700140 std::string client_cert;
Paul Stewartbc6e7392012-05-24 07:07:48 -0700141 // Locator for the client certificate within the security token.
Chris Masoneb2e326b2011-07-12 13:28:51 -0700142 std::string cert_id;
Paul Stewartbc6e7392012-05-24 07:07:48 -0700143 // Filename of the client private key.
Chris Masoneb2e326b2011-07-12 13:28:51 -0700144 std::string private_key;
Paul Stewartbc6e7392012-05-24 07:07:48 -0700145 // Password for decrypting the client private key file.
Chris Masoneb2e326b2011-07-12 13:28:51 -0700146 std::string private_key_password;
Paul Stewartbc6e7392012-05-24 07:07:48 -0700147 // Locator for the client private key within the security token.
Chris Masoneb2e326b2011-07-12 13:28:51 -0700148 std::string key_id;
Paul Stewartbc6e7392012-05-24 07:07:48 -0700149 // Filename of the certificate authority (CA) certificate.
Chris Masoneb2e326b2011-07-12 13:28:51 -0700150 std::string ca_cert;
Paul Stewartbc6e7392012-05-24 07:07:48 -0700151 // Locator for the CA certificate within the security token.
Chris Masoneb2e326b2011-07-12 13:28:51 -0700152 std::string ca_cert_id;
Paul Stewartbc6e7392012-05-24 07:07:48 -0700153 // Locator for the CA certificate within the user NSS database.
Paul Stewartecf4cd12012-04-17 11:08:39 -0700154 std::string ca_cert_nss;
Paul Stewartbc6e7392012-05-24 07:07:48 -0700155 // If true, use the system-wide CA database to authenticate the remote.
Chris Masoneb2e326b2011-07-12 13:28:51 -0700156 bool use_system_cas;
Paul Stewartbc6e7392012-05-24 07:07:48 -0700157 // PIN code for accessing the security token.
Chris Masoneb2e326b2011-07-12 13:28:51 -0700158 std::string pin;
Paul Stewartbc6e7392012-05-24 07:07:48 -0700159 // Password to use for EAP methods which require one.
Chris Masoneb2e326b2011-07-12 13:28:51 -0700160 std::string password;
Paul Stewartbc6e7392012-05-24 07:07:48 -0700161 // Key management algorithm to use after EAP succeeds.
Chris Masoneb2e326b2011-07-12 13:28:51 -0700162 std::string key_management;
Paul Stewartbc6e7392012-05-24 07:07:48 -0700163 // If non-empty, string to match remote subject against before connecting.
164 std::string subject_match;
165 // List of subject names reported by remote entity during TLS setup.
166 std::vector<std::string> remote_certification;
Chris Masoneb2e326b2011-07-12 13:28:51 -0700167 };
Chris Masone9be4a9d2011-05-16 15:44:09 -0700168
Paul Stewartac4ac002011-08-26 12:04:26 -0700169 static const int kPriorityNone;
170
Chris Masone9be4a9d2011-05-16 15:44:09 -0700171 // A constructor for the Service object
172 Service(ControlInterface *control_interface,
173 EventDispatcher *dispatcher,
Thieu Le3426c8f2012-01-11 17:35:11 -0800174 Metrics *metrics,
mukesh agrawal7a4e4002011-09-06 11:26:05 -0700175 Manager *manager,
Gaurav Shah435de2c2011-11-17 19:01:07 -0800176 Technology::Identifier technology);
Darin Petkovba40dd32011-07-11 20:06:39 -0700177
mukesh agrawal8a3188d2011-12-01 20:56:44 +0000178 // AutoConnect MAY choose to ignore the connection request in some
179 // cases. For example, if the corresponding Device only supports one
180 // concurrent connection, and another Service is already connected
181 // or connecting.
182 //
183 // AutoConnect MAY issue RPCs immediately. So AutoConnect MUST NOT
184 // be called from a D-Bus signal handler context.
185 virtual void AutoConnect();
186 // Queue up a connection attempt.
mukesh agrawaladb68482012-01-17 16:31:51 -0800187 virtual void Connect(Error *error);
Christopher Wileyabd3b502012-09-26 13:08:52 -0700188 // Disconnect this service. Override this method to add your service specific
189 // disconnect logic, but call the super class's Disconnect() first.
mukesh agrawaladb68482012-01-17 16:31:51 -0800190 virtual void Disconnect(Error *error);
Christopher Wileyabd3b502012-09-26 13:08:52 -0700191 // Disconnects this service via Disconnect(). Marks the service as having
192 // failed with |failure|. Do not override this method.
193 virtual void DisconnectWithFailure(ConnectFailure failure, Error *error);
194 // Disconnects this service via Disconnect(). The service will not be eligible
195 // for auto-connect until a subsequent call to Connect, or Load. Do not
196 // override this method.
197 virtual void UserInitiatedDisconnect(Error *error);
Chris Masonea82b7112011-05-25 15:16:29 -0700198
Eric Shienbrood5de44ab2011-12-05 10:46:27 -0500199 // The default implementation returns the error kInvalidArguments.
200 virtual void ActivateCellularModem(const std::string &carrier,
Eric Shienbrood9a245532012-03-07 14:20:39 -0500201 Error *error,
202 const ResultCallback &callback);
Darin Petkovc408e692011-08-17 13:47:15 -0700203
Gaurav Shah1b7a6162011-11-09 11:41:01 -0800204 virtual bool IsActive(Error *error);
Paul Stewart03dba0b2011-08-22 16:32:45 -0700205
Paul Stewart7fb09382012-07-18 17:32:27 -0700206 // Returns whether services of this type should be auto-connect by default.
207 virtual bool IsAutoConnectByDefault() const { return false; }
208
Paul Stewart03dba0b2011-08-22 16:32:45 -0700209 virtual ConnectState state() const { return state_; }
210 // Updates the state of the Service and alerts the manager. Also
211 // clears |failure_| if the new state isn't a failure.
212 virtual void SetState(ConnectState state);
Darin Petkov58f0b6d2012-06-12 12:52:30 +0200213 std::string GetStateString() const;
Paul Stewart03dba0b2011-08-22 16:32:45 -0700214
Paul Stewart22aa71b2011-09-16 12:15:11 -0700215 // State utility functions
Paul Stewart20088d82012-02-16 06:58:55 -0800216 virtual bool IsConnected() const {
217 return state() == kStateConnected || state() == kStatePortal ||
218 state() == kStateOnline;
219 }
Gaurav Shah435de2c2011-11-17 19:01:07 -0800220 virtual bool IsConnecting() const {
Paul Stewart22aa71b2011-09-16 12:15:11 -0700221 return state() == kStateAssociating || state() == kStateConfiguring;
222 }
mukesh agrawal8a3188d2011-12-01 20:56:44 +0000223 virtual bool IsFailed() const {
mukesh agrawal568b5c62012-02-28 14:44:47 -0800224 // We sometimes lie about the failure state, to keep Chrome happy
225 // (see comment in WiFi::HandleDisconnect). Hence, we check both
226 // state and |failed_time_|.
227 return state() == kStateFailure || failed_time_ > 0;
mukesh agrawal8a3188d2011-12-01 20:56:44 +0000228 }
Paul Stewartdf3c0a82012-11-09 15:54:33 -0800229
230 // Returns true if the connection for |this| depends on service |b|.
231 virtual bool IsDependentOn(const ServiceRefPtr &b) const;
232
Paul Stewarta121c442012-06-09 14:12:58 -0700233 virtual bool IsPortalled() const {
234 return state() == kStatePortal;
235 }
Paul Stewart22aa71b2011-09-16 12:15:11 -0700236
Paul Stewart03dba0b2011-08-22 16:32:45 -0700237 virtual ConnectFailure failure() const { return failure_; }
mukesh agrawal568b5c62012-02-28 14:44:47 -0800238 // Records the failure mode and time. Sets the Service state to "Failure".
Paul Stewart03dba0b2011-08-22 16:32:45 -0700239 virtual void SetFailure(ConnectFailure failure);
mukesh agrawal568b5c62012-02-28 14:44:47 -0800240 // Records the failure mode and time. Sets the Service state to "Idle".
241 // Avoids showing a failure mole in the UI.
242 virtual void SetFailureSilent(ConnectFailure failure);
Chris Masone3bd3c8c2011-06-13 08:20:26 -0700243
Darin Petkovba40dd32011-07-11 20:06:39 -0700244 // Returns a string that is guaranteed to uniquely identify this Service
245 // instance.
mukesh agrawald835b202011-10-07 15:26:47 -0700246 const std::string &UniqueName() const { return unique_name_; }
Darin Petkovafa6fc42011-06-21 16:21:08 -0700247
Chris Masone6791a432011-07-12 13:23:19 -0700248 virtual std::string GetRpcIdentifier() const;
Chris Masone3c3f6a12011-07-01 10:01:41 -0700249
Darin Petkovba40dd32011-07-11 20:06:39 -0700250 // Returns the unique persistent storage identifier for the service.
Chris Masone6515aab2011-10-12 16:19:09 -0700251 virtual std::string GetStorageIdentifier() const = 0;
Darin Petkovba40dd32011-07-11 20:06:39 -0700252
Paul Stewartbba6a5b2011-11-02 18:45:59 -0700253 // Returns whether the service configuration can be loaded from |storage|.
254 virtual bool IsLoadableFrom(StoreInterface *storage) const;
255
Paul Stewart81426132012-05-16 10:05:10 -0700256 // Returns true if the service uses 802.1x for key management.
257 virtual bool Is8021x() const { return false; };
258
Darin Petkovba40dd32011-07-11 20:06:39 -0700259 // Loads the service from persistent |storage|. Returns true on success.
Chris Masone9d779932011-08-25 16:33:41 -0700260 virtual bool Load(StoreInterface *storage);
Darin Petkovba40dd32011-07-11 20:06:39 -0700261
Paul Stewarta41e38d2011-11-11 07:47:29 -0800262 // Indicate to service that it is no longer persisted to storage. It
Paul Stewart65512e12012-03-26 18:01:08 -0700263 // should purge any stored profile state (e.g., credentials). Returns
264 // true to indicate that this service should also be unregistered from
265 // the manager, false otherwise.
266 virtual bool Unload();
Paul Stewarta41e38d2011-11-11 07:47:29 -0800267
Darin Petkovba40dd32011-07-11 20:06:39 -0700268 // Saves the service to persistent |storage|. Returns true on success.
Chris Masone9d779932011-08-25 16:33:41 -0700269 virtual bool Save(StoreInterface *storage);
Darin Petkovba40dd32011-07-11 20:06:39 -0700270
Thieu Led4e9e552012-02-16 16:26:07 -0800271 // Saves the service to the current profile.
Gary Moraind93615e2012-04-27 11:50:03 -0700272 virtual void SaveToCurrentProfile();
Thieu Led4e9e552012-02-16 16:26:07 -0800273
Paul Stewartcb59fed2012-03-21 21:14:46 -0700274 // Applies all the properties in |args| to this service object's mutable
275 // store, except for those in parameters_ignored_for_configure_.
276 // Returns an error in |error| if one or more parameter set attempts
277 // fails, but will only return the first error.
278 virtual void Configure(const KeyValueStore &args, Error *error);
279
Paul Stewartd215af62012-04-24 23:25:50 -0700280 // Returns whether portal detection is explicitly disabled on this service
281 // via a property set on it.
282 virtual bool IsPortalDetectionDisabled() const;
283
284 // Returns whether portal detection is set to follow the default setting
285 // of this service's technology via a property set on it.
286 virtual bool IsPortalDetectionAuto() const;
287
Paul Stewart10ccbb32012-04-26 15:59:30 -0700288 // Returns true if the service is persisted to a non-ephemeral profile.
289 virtual bool IsRemembered() const;
290
Paul Stewarta41e38d2011-11-11 07:47:29 -0800291 // Returns true if the service RPC identifier should be part of the
292 // manager's advertised services list, false otherwise.
293 virtual bool IsVisible() const { return true; }
294
Paul Stewart20088d82012-02-16 06:58:55 -0800295 // Returns true if there is a proxy configuration set on this service.
296 virtual bool HasProxyConfig() const { return !proxy_config_.empty(); }
297
mukesh agrawal00917ce2011-11-22 23:56:55 +0000298 virtual void MakeFavorite();
299
Darin Petkov5eb05422012-05-11 15:45:25 +0200300 // Set the connection for this service. If the connection is non-NULL, create
301 // an HTTP Proxy that will utilize this service's connection to serve
302 // requests.
303 virtual void SetConnection(const ConnectionRefPtr &connection);
304 virtual const ConnectionRefPtr &connection() const { return connection_; }
Paul Stewartbe5f5b32011-12-07 17:11:11 -0800305
Gaurav Shah10109f22011-11-11 20:16:22 -0800306 // Examines the EAP credentials for the service and returns true if a
307 // connection attempt can be made.
308 bool Is8021xConnectable() const;
309
Paul Stewartbc6e7392012-05-24 07:07:48 -0700310 // Add an EAP certification id |name| at position |depth| in the stack.
311 // Returns true if entry was added, false otherwise.
312 virtual bool AddEAPCertification(const std::string &name, size_t depth);
313 // Clear all EAP certification elements.
314 void ClearEAPCertification();
315
Thieu Le48e6d6d2011-12-06 00:40:27 +0000316 // The inherited class should register any custom metrics in this method.
317 virtual void InitializeCustomMetrics() const {}
318
319 // The inherited class that needs to send metrics after the service has
Thieu Leb84ba342012-03-02 15:15:19 -0800320 // transitioned to the ready state should override this method.
321 // |time_resume_to_ready_milliseconds| holds the elapsed time from when
322 // the system was resumed until when the service transitioned to the
323 // connected state. This value is non-zero for the first service transition
324 // to the connected state after a resume.
325 virtual void SendPostReadyStateMetrics(
326 int64 /*time_resume_to_ready_milliseconds*/) const {}
Thieu Le48e6d6d2011-12-06 00:40:27 +0000327
Darin Petkovafa6fc42011-06-21 16:21:08 -0700328 bool auto_connect() const { return auto_connect_; }
329 void set_auto_connect(bool connect) { auto_connect_ = connect; }
Paul Stewart75897df2011-04-27 09:05:53 -0700330
Gaurav Shah435de2c2011-11-17 19:01:07 -0800331 bool connectable() const { return connectable_; }
Darin Petkovb2ba39f2012-06-06 10:33:43 +0200332 // TODO(petkov): Remove this method in favor of SetConnectable.
mukesh agrawal29c13a12011-11-24 00:09:19 +0000333 void set_connectable(bool connectable);
Darin Petkovb2ba39f2012-06-06 10:33:43 +0200334 // Sets the connectable property of the service. Broadcasts the new value and
335 // alerts the manager if necessary.
336 void SetConnectable(bool connectable);
Gaurav Shah435de2c2011-11-17 19:01:07 -0800337
Thieu Le67370f62012-02-14 23:01:42 +0000338 virtual bool explicitly_disconnected() const {
339 return explicitly_disconnected_;
340 }
341
Paul Stewart22aa71b2011-09-16 12:15:11 -0700342 bool favorite() const { return favorite_; }
mukesh agrawal00917ce2011-11-22 23:56:55 +0000343 // Setter is deliberately omitted; use MakeFavorite.
Paul Stewart22aa71b2011-09-16 12:15:11 -0700344
mukesh agrawal15908392011-11-16 18:29:25 +0000345 const std::string &friendly_name() const { return friendly_name_; }
Darin Petkov7f060332012-03-14 11:46:47 +0100346 void set_friendly_name(const std::string &n) { friendly_name_ = n; }
mukesh agrawal15908392011-11-16 18:29:25 +0000347
Paul Stewart4c561612012-03-21 12:49:01 -0700348 const std::string &guid() const { return guid_; }
349 void set_guid(const std::string &guid) { guid_ = guid; }
350
mukesh agrawalcf24a242012-05-21 16:46:11 -0700351 bool has_ever_connected() const { return has_ever_connected_; }
352
Paul Stewart22aa71b2011-09-16 12:15:11 -0700353 int32 priority() const { return priority_; }
354 void set_priority(int32 priority) { priority_ = priority; }
355
Paul Stewart1ca3e852011-11-04 07:50:49 -0700356 int32 security_level() const { return security_level_; }
357 void set_security_level(int32 security) { security_level_ = security; }
Paul Stewart22aa71b2011-09-16 12:15:11 -0700358
Darin Petkovd78ee7e2012-01-12 11:21:10 +0100359 void SetStrength(uint8 strength);
mukesh agrawale1d90e92012-02-15 17:36:08 -0800360
361 // uint8 streams out as a char. Coerce to a larger type, so that
362 // it prints as a number.
363 uint16 strength() const { return strength_; }
Paul Stewart22aa71b2011-09-16 12:15:11 -0700364
Gaurav Shah435de2c2011-11-17 19:01:07 -0800365 virtual Technology::Identifier technology() const { return technology_; }
Darin Petkov58f0b6d2012-06-12 12:52:30 +0200366 std::string GetTechnologyString() const;
Gaurav Shah435de2c2011-11-17 19:01:07 -0800367
Gaurav Shah10109f22011-11-11 20:16:22 -0800368 const EapCredentials &eap() const { return eap_; }
369 virtual void set_eap(const EapCredentials &eap);
370
Darin Petkovcb715292012-04-25 13:04:37 +0200371 bool save_credentials() const { return save_credentials_; }
372 void set_save_credentials(bool save) { save_credentials_ = save; }
373
Darin Petkov51489002011-08-18 13:13:20 -0700374 const std::string &error() const { return error_; }
375 void set_error(const std::string &error) { error_ = error; }
376
Gaurav Shahc6d6c722011-11-17 18:59:39 -0800377 static const char *ConnectFailureToString(const ConnectFailure &state);
378 static const char *ConnectStateToString(const ConnectState &state);
379
Paul Stewart22aa71b2011-09-16 12:15:11 -0700380 // Compare two services. Returns true if Service a should be displayed
381 // above Service b
382 static bool Compare(ServiceRefPtr a,
383 ServiceRefPtr b,
mukesh agrawalddc378f2012-02-17 18:26:20 -0800384 const std::vector<Technology::Identifier> &tech_order,
385 const char **reason);
Paul Stewart22aa71b2011-09-16 12:15:11 -0700386
Chris Masone34af2182011-08-22 11:59:36 -0700387 // These are defined in service.cc so that we don't have to include profile.h
Chris Masone9d779932011-08-25 16:33:41 -0700388 // TODO(cmasone): right now, these are here only so that we can get the
389 // profile name as a property. Can we store just the name, and then handle
390 // setting the profile for this service via |manager_|?
Chris Masone6791a432011-07-12 13:23:19 -0700391 const ProfileRefPtr &profile() const;
Philipp Neubeck79173602012-11-13 21:10:09 +0100392
393 // Sets the profile property of this service. Broadcasts the new value if it's
394 // not NULL. If the new value is NULL, the service will either be set to
395 // another profile afterwards or it will not be visible and not monitored
396 // anymore.
397 void SetProfile(const ProfileRefPtr &p);
398
399 // This is called from tests and shouldn't be called otherwise. Use SetProfile
400 // instead.
Chris Masone6791a432011-07-12 13:23:19 -0700401 void set_profile(const ProfileRefPtr &p);
402
Paul Stewart4357f4e2012-04-26 17:39:26 -0700403 // Notification that occurs when a service now has profile data saved
404 // on its behalf. Some service types like WiFi can choose to register
405 // themselves at this point.
406 virtual void OnProfileConfigured() {}
407
Paul Stewartff14b022012-04-24 20:06:23 -0700408 // Notification that occurs when a single property has been changed via
409 // the RPC adaptor.
Paul Stewart81426132012-05-16 10:05:10 -0700410 virtual void OnPropertyChanged(const std::string &property);
Paul Stewartff14b022012-04-24 20:06:23 -0700411
Christopher Wiley0801d192012-09-24 11:57:15 -0700412 // Called by the manager once after a resume.
413 virtual void OnAfterResume();
414
mukesh agrawalde29fa82011-09-16 16:16:36 -0700415 PropertyStore *mutable_store() { return &store_; }
416 const PropertyStore &store() const { return store_; }
Paul Stewartdef189e2012-08-02 20:12:09 -0700417 StaticIPParameters *mutable_static_ip_parameters() {
418 return &static_ip_parameters_;
419 }
Paul Stewart1062d9d2012-04-27 10:42:27 -0700420 const StaticIPParameters &static_ip_parameters() const {
421 return static_ip_parameters_;
422 }
Chris Masone27c4aa52011-07-02 13:10:14 -0700423
mukesh agrawalb54601c2011-06-07 17:39:22 -0700424 protected:
Darin Petkov5eb05422012-05-11 15:45:25 +0200425 friend class base::RefCounted<Service>;
426
mukesh agrawal03c15ce2012-11-29 17:36:21 -0800427 static const char kAutoConnBusy[];
428
Darin Petkov5eb05422012-05-11 15:45:25 +0200429 virtual ~Service();
430
Chris Masone34af2182011-08-22 11:59:36 -0700431 // Returns true if a character is allowed to be in a service storage id.
432 static bool LegalChar(char a) { return isalnum(a) || a == '_'; }
433
Darin Petkov31332412012-01-28 01:50:02 +0100434 // Returns true if a character is disallowed to be in a service storage id.
435 static bool IllegalChar(char a) { return !LegalChar(a); }
436
Gaurav Shah1b7a6162011-11-09 11:41:01 -0800437 virtual std::string CalculateState(Error *error);
Darin Petkov58f0b6d2012-06-12 12:52:30 +0200438 std::string CalculateTechnology(Error *error);
Chris Masone3bd3c8c2011-06-13 08:20:26 -0700439
mukesh agrawal8a3188d2011-12-01 20:56:44 +0000440 // Returns whether this service is in a state conducive to auto-connect.
441 // This should include any tests used for computing connectable(),
442 // as well as other critera such as whether the device associated with
443 // this service is busy with another connection.
mukesh agrawalbf14e942012-03-02 14:36:34 -0800444 //
445 // If the service is not auto-connectable, |*reason| will be set to
446 // point to C-string explaining why the service is not auto-connectable.
447 virtual bool IsAutoConnectable(const char **reason) const;
mukesh agrawal8a3188d2011-12-01 20:56:44 +0000448
mukesh agrawal292dc0f2012-01-26 18:02:46 -0800449 // HelpRegisterDerived*: Expose a property over RPC, with the name |name|.
450 //
451 // Reads of the property will be handled by invoking |get|.
452 // Writes to the property will be handled by invoking |set|.
453 // Clearing the property will be handled by PropertyStore.
mukesh agrawalffa3d042011-10-06 15:26:10 -0700454 void HelpRegisterDerivedBool(
455 const std::string &name,
Hristo Stefanoved2c28c2011-11-29 15:37:30 -0800456 bool(Service::*get)(Error *error),
457 void(Service::*set)(const bool &value, Error *error));
mukesh agrawalffa3d042011-10-06 15:26:10 -0700458 void HelpRegisterDerivedString(
459 const std::string &name,
Hristo Stefanoved2c28c2011-11-29 15:37:30 -0800460 std::string(Service::*get)(Error *error),
461 void(Service::*set)(const std::string &value, Error *error));
Paul Stewartbe5f5b32011-12-07 17:11:11 -0800462 void HelpRegisterDerivedUint16(
463 const std::string &name,
464 uint16(Service::*get)(Error *error),
465 void(Service::*set)(const uint16 &value, Error *error));
Jason Glasgowacdc11f2012-03-30 14:12:22 -0400466 void HelpRegisterDerivedRpcIdentifier(
467 const std::string &name,
468 std::string(Service::*get)(Error *),
469 void(Service::*set)(const RpcIdentifier&, Error *));
mukesh agrawal292dc0f2012-01-26 18:02:46 -0800470 // Expose a property over RPC, with the name |name|.
471 //
472 // Reads of the property will be handled by invoking |get|.
473 // Writes to the property will be handled by invoking |set|.
474 //
475 // Clearing the property will be handled by invoking |clear|, or
476 // calling |set| with |default_value| (whichever is non-NULL). It
477 // is an error to call this method with both |clear| and
478 // |default_value| non-NULL.
479 void HelpRegisterWriteOnlyDerivedString(
480 const std::string &name,
481 void(Service::*set)(const std::string &value, Error *error),
482 void(Service::*clear)(Error *error),
483 const std::string *default_value);
Chris Masone3bd3c8c2011-06-13 08:20:26 -0700484
Darin Petkovb72cf402011-11-22 14:51:39 +0100485 ServiceAdaptorInterface *adaptor() const { return adaptor_.get(); }
486
Darin Petkovba40dd32011-07-11 20:06:39 -0700487 // Assigns |value| to |key| in |storage| if |value| is non-empty and |save| is
488 // true. Otherwise, removes |key| from |storage|. If |crypted| is true, the
489 // value is encrypted.
490 void SaveString(StoreInterface *storage,
Chris Masone34af2182011-08-22 11:59:36 -0700491 const std::string &id,
Darin Petkovba40dd32011-07-11 20:06:39 -0700492 const std::string &key,
493 const std::string &value,
494 bool crypted,
495 bool save);
496
Chris Masone34af2182011-08-22 11:59:36 -0700497 void LoadEapCredentials(StoreInterface *storage, const std::string &id);
498 void SaveEapCredentials(StoreInterface *storage, const std::string &id);
Paul Stewartd8ad3c42012-01-09 12:39:38 -0800499 void UnloadEapCredentials();
Darin Petkovba40dd32011-07-11 20:06:39 -0700500
Paul Stewartcb59fed2012-03-21 21:14:46 -0700501 // Ignore |parameter| when performing a Configure() operation.
502 void IgnoreParameterForConfigure(const std::string &parameter);
503
Paul Stewartf2d60912012-07-15 08:37:30 -0700504 // Update the service's string-based "Error" RPC property based on the
505 // failure_ enum.
506 void UpdateErrorProperty();
507
Paul Stewartcf199de2012-08-16 07:50:41 -0700508 // RPC setter for the the "AutoConnect" property.
509 virtual void SetAutoConnect(const bool &connect, Error *error);
510
Paul Stewartac4ac002011-08-26 12:04:26 -0700511 // Property accessors reserved for subclasses
512 EventDispatcher *dispatcher() const { return dispatcher_; }
513 const std::string &GetEAPKeyManagement() const;
514 void SetEAPKeyManagement(const std::string &key_management);
Paul Stewart9f32d192012-01-30 20:37:50 -0800515 void SetEAPPassword(const std::string &password, Error *error);
516 void SetEAPPrivateKeyPassword(const std::string &password, Error *error);
Paul Stewart65512e12012-03-26 18:01:08 -0700517 Manager *manager() const { return manager_; }
Thieu Le48e6d6d2011-12-06 00:40:27 +0000518 Metrics *metrics() const { return metrics_; }
mukesh agrawalb54601c2011-06-07 17:39:22 -0700519
Darin Petkov1d0080a2012-04-30 17:10:36 +0200520 void set_favorite(bool favorite) { favorite_ = favorite; }
521
Paul Stewart75897df2011-04-27 09:05:53 -0700522 private:
Paul Stewartcf199de2012-08-16 07:50:41 -0700523 friend class EthernetServiceTest;
Thieu Le48e6d6d2011-12-06 00:40:27 +0000524 friend class MetricsTest;
Paul Stewart0756db92012-01-27 08:34:47 -0800525 friend class ServiceAdaptorInterface;
Darin Petkov385b9bc2012-12-03 15:25:05 +0100526 friend class ServiceTest;
Darin Petkov5eb05422012-05-11 15:45:25 +0200527 friend class VPNServiceTest;
mukesh agrawale1d90e92012-02-15 17:36:08 -0800528 friend class WiFiServiceTest;
Darin Petkov6b9b2e12012-07-10 15:51:42 +0200529 friend class WiMaxServiceTest;
Christopher Wiley0801d192012-09-24 11:57:15 -0700530 FRIEND_TEST(AllMockServiceTest, AutoConnectWithFailures);
Ben Chan19f83972012-10-03 23:25:56 -0700531 FRIEND_TEST(CellularServiceTest, IsAutoConnectable);
mukesh agrawalcc0fded2012-05-09 13:40:58 -0700532 FRIEND_TEST(DeviceTest, IPConfigUpdatedFailureWithStatic);
mukesh agrawal03c15ce2012-11-29 17:36:21 -0800533 FRIEND_TEST(ServiceTest, AutoConnectLogging);
Darin Petkov58f0b6d2012-06-12 12:52:30 +0200534 FRIEND_TEST(ServiceTest, CalculateState);
535 FRIEND_TEST(ServiceTest, CalculateTechnology);
Paul Stewartbc6e7392012-05-24 07:07:48 -0700536 FRIEND_TEST(ServiceTest, Certification);
Paul Stewartcb59fed2012-03-21 21:14:46 -0700537 FRIEND_TEST(ServiceTest, ConfigureIgnoredProperty);
538 FRIEND_TEST(ServiceTest, ConfigureStringProperty);
Darin Petkovba40dd32011-07-11 20:06:39 -0700539 FRIEND_TEST(ServiceTest, Constructor);
Paul Stewart10241e32012-04-23 18:15:06 -0700540 FRIEND_TEST(ServiceTest, GetIPConfigRpcIdentifier);
Thieu Le284fe792012-01-31 17:53:19 -0800541 FRIEND_TEST(ServiceTest, GetProperties);
mukesh agrawal76d13882012-01-12 15:23:11 -0800542 FRIEND_TEST(ServiceTest, IsAutoConnectable);
Paul Stewartdf3c0a82012-11-09 15:54:33 -0800543 FRIEND_TEST(ServiceTest, IsDependentOn);
Paul Stewartd215af62012-04-24 23:25:50 -0700544 FRIEND_TEST(ServiceTest, RecheckPortal);
Darin Petkovba40dd32011-07-11 20:06:39 -0700545 FRIEND_TEST(ServiceTest, Save);
546 FRIEND_TEST(ServiceTest, SaveString);
547 FRIEND_TEST(ServiceTest, SaveStringCrypted);
548 FRIEND_TEST(ServiceTest, SaveStringDontSave);
549 FRIEND_TEST(ServiceTest, SaveStringEmpty);
mukesh agrawal6bb9e7c2012-01-30 14:57:54 -0800550 FRIEND_TEST(ServiceTest, SetProperty);
Paul Stewartd215af62012-04-24 23:25:50 -0700551 FRIEND_TEST(ServiceTest, SetCheckPortal);
Darin Petkovb2ba39f2012-06-06 10:33:43 +0200552 FRIEND_TEST(ServiceTest, SetConnectable);
mukesh agrawal568b5c62012-02-28 14:44:47 -0800553 FRIEND_TEST(ServiceTest, State);
Paul Stewartd8ad3c42012-01-09 12:39:38 -0800554 FRIEND_TEST(ServiceTest, Unload);
Christopher Wileyc68c8672012-11-20 16:52:21 -0800555 FRIEND_TEST(WiFiMainTest, NoScansWhileConnecting);
mukesh agrawalcf24a242012-05-21 16:46:11 -0700556 FRIEND_TEST(WiFiMainTest, SuspectCredentialsWPAPreviouslyConnected);
Christopher Wiley0801d192012-09-24 11:57:15 -0700557 FRIEND_TEST(WiFiTimerTest, ReconnectTimer);
Darin Petkovba40dd32011-07-11 20:06:39 -0700558
mukesh agrawalbf14e942012-03-02 14:36:34 -0800559 static const char kAutoConnConnected[];
560 static const char kAutoConnConnecting[];
561 static const char kAutoConnExplicitDisconnect[];
562 static const char kAutoConnNotConnectable[];
Christopher Wiley0801d192012-09-24 11:57:15 -0700563 static const char kAutoConnThrottled[];
mukesh agrawalbf14e942012-03-02 14:36:34 -0800564
Paul Stewartbc6e7392012-05-24 07:07:48 -0700565 static const size_t kEAPMaxCertificationElements;
566
Darin Petkov2f903b32012-04-18 12:56:43 +0200567 static const char kServiceSortAutoConnect[];
568 static const char kServiceSortConnectable[];
569 static const char kServiceSortFavorite[];
mukesh agrawalddc378f2012-02-17 18:26:20 -0800570 static const char kServiceSortIsConnected[];
Paul Stewartdf3c0a82012-11-09 15:54:33 -0800571 static const char kServiceSortDependency[];
mukesh agrawalddc378f2012-02-17 18:26:20 -0800572 static const char kServiceSortIsConnecting[];
573 static const char kServiceSortIsFailed[];
Paul Stewarta121c442012-06-09 14:12:58 -0700574 static const char kServiceSortIsPortalled[];
Darin Petkov2f903b32012-04-18 12:56:43 +0200575 static const char kServiceSortPriority[];
mukesh agrawalddc378f2012-02-17 18:26:20 -0800576 static const char kServiceSortSecurityEtc[];
Darin Petkov2f903b32012-04-18 12:56:43 +0200577 static const char kServiceSortTechnology[];
mukesh agrawalddc378f2012-02-17 18:26:20 -0800578 static const char kServiceSortUniqueName[];
579
Christopher Wiley0801d192012-09-24 11:57:15 -0700580 static const uint64 kMaxAutoConnectCooldownTimeMilliseconds;
581 static const uint64 kMinAutoConnectCooldownTimeMilliseconds;
582 static const uint64 kAutoConnectCooldownBackoffFactor;
583
Darin Petkov385b9bc2012-12-03 15:25:05 +0100584 static const int kDisconnectsMonitorSeconds;
585 static const int kMisconnectsMonitorSeconds;
586 static const int kReportDisconnectsThreshold;
587 static const int kReportMisconnectsThreshold;
588 static const int kMaxDisconnectEventHistory;
589
Thieu Le284fe792012-01-31 17:53:19 -0800590 bool GetAutoConnect(Error *error);
Thieu Le284fe792012-01-31 17:53:19 -0800591
Paul Stewartd215af62012-04-24 23:25:50 -0700592 std::string GetCheckPortal(Error *error);
593 void SetCheckPortal(const std::string &check_portal, Error *error);
594
Gaurav Shah1b7a6162011-11-09 11:41:01 -0800595 virtual std::string GetDeviceRpcId(Error *error) = 0;
Chris Masone95207da2011-06-29 16:50:49 -0700596
Paul Stewart10241e32012-04-23 18:15:06 -0700597 std::string GetIPConfigRpcIdentifier(Error *error);
598
Paul Stewart0c438332012-04-11 07:55:27 -0700599 std::string GetNameProperty(Error *error);
600 void AssertTrivialSetNameProperty(const std::string &name, Error *error);
601
Paul Stewart1b1a7f22012-01-06 16:24:06 -0800602 std::string GetProfileRpcId(Error *error);
603 void SetProfileRpcId(const std::string &profile, Error *error);
Chris Masone3bd3c8c2011-06-13 08:20:26 -0700604
Paul Stewartbe5f5b32011-12-07 17:11:11 -0800605 // Returns TCP port of service's HTTP proxy in host order.
606 uint16 GetHTTPProxyPort(Error *error);
607
Philipp Neubeck79173602012-11-13 21:10:09 +0100608 std::string GetProxyConfig(Error *error);
609 void SetProxyConfig(const std::string &proxy_config, Error *error);
610
Christopher Wiley0801d192012-09-24 11:57:15 -0700611 void ReEnableAutoConnectTask();
612 // Disables autoconnect and posts a task to re-enable it after a cooldown.
613 // Note that autoconnect could be disabled for other reasons as well.
614 void ThrottleFutureAutoConnects();
615
mukesh agrawalcf24a242012-05-21 16:46:11 -0700616 // Saves settings to profile, if we have one. Unlike
617 // SaveServiceToProfile, SaveToProfile never assigns this service
618 // into a profile.
619 void SaveToProfile();
620
Darin Petkov385b9bc2012-12-03 15:25:05 +0100621 void NoteDisconnectEvent();
622
Paul Stewart22aa71b2011-09-16 12:15:11 -0700623 // Utility function that returns true if a is different from b. When they
624 // are, "decision" is populated with the boolean value of "a > b".
625 static bool DecideBetween(int a, int b, bool *decision);
626
Paul Stewartac4ac002011-08-26 12:04:26 -0700627 ConnectState state_;
628 ConnectFailure failure_;
629 bool auto_connect_;
630 std::string check_portal_;
631 bool connectable_;
632 std::string error_;
mukesh agrawaladb68482012-01-17 16:31:51 -0800633 bool explicitly_disconnected_;
Paul Stewartac4ac002011-08-26 12:04:26 -0700634 bool favorite_;
635 int32 priority_;
Paul Stewart1ca3e852011-11-04 07:50:49 -0700636 int32 security_level_;
Darin Petkovd78ee7e2012-01-12 11:21:10 +0100637 uint8 strength_;
Paul Stewartac4ac002011-08-26 12:04:26 -0700638 std::string proxy_config_;
Paul Stewart987e71e2011-12-05 09:45:06 -0800639 std::string ui_data_;
Paul Stewart4c561612012-03-21 12:49:01 -0700640 std::string guid_;
Paul Stewartac4ac002011-08-26 12:04:26 -0700641 bool save_credentials_;
642 EapCredentials eap_; // Only saved if |save_credentials_| is true.
Gaurav Shah435de2c2011-11-17 19:01:07 -0800643 Technology::Identifier technology_;
mukesh agrawal568b5c62012-02-28 14:44:47 -0800644 // The time of the most recent failure. Value is 0 if the service is
645 // not currently failed.
646 time_t failed_time_;
mukesh agrawalcf24a242012-05-21 16:46:11 -0700647 // Whether or not this service has ever reached kStateConnected.
648 bool has_ever_connected_;
Paul Stewartac4ac002011-08-26 12:04:26 -0700649
Darin Petkov385b9bc2012-12-03 15:25:05 +0100650 // TODO(petkov): Expose these as read-only service properties
651 // (crosbug.com/36924).
652 std::deque<struct timeval> disconnects_; // Connection drops.
653 std::deque<struct timeval> misconnects_; // Failures to connect.
654
Christopher Wiley0801d192012-09-24 11:57:15 -0700655 base::CancelableClosure reenable_auto_connect_task_;
656 uint64 auto_connect_cooldown_milliseconds_ ;
657
Paul Stewartac4ac002011-08-26 12:04:26 -0700658 ProfileRefPtr profile_;
659 PropertyStore store_;
Paul Stewartcb59fed2012-03-21 21:14:46 -0700660 std::set<std::string> parameters_ignored_for_configure_;
Paul Stewartac4ac002011-08-26 12:04:26 -0700661
662 EventDispatcher *dispatcher_;
mukesh agrawal51a7e932011-07-27 16:18:26 -0700663 static unsigned int serial_number_;
mukesh agrawald835b202011-10-07 15:26:47 -0700664 std::string unique_name_; // MUST be unique amongst service instances
665 std::string friendly_name_; // MAY be same as |unique_name_|
Paul Stewartba41b992011-05-26 07:02:46 -0700666 scoped_ptr<ServiceAdaptorInterface> adaptor_;
Paul Stewartbe5f5b32011-12-07 17:11:11 -0800667 scoped_ptr<HTTPProxy> http_proxy_;
Paul Stewartc1dec4d2011-12-08 15:25:28 -0800668 ConnectionRefPtr connection_;
Paul Stewart1062d9d2012-04-27 10:42:27 -0700669 StaticIPParameters static_ip_parameters_;
Thieu Le3426c8f2012-01-11 17:35:11 -0800670 Metrics *metrics_;
Chris Masone6791a432011-07-12 13:23:19 -0700671 Manager *manager_;
Darin Petkov5eb05422012-05-11 15:45:25 +0200672 scoped_ptr<Sockets> sockets_;
Christopher Wiley0801d192012-09-24 11:57:15 -0700673 base::WeakPtrFactory<Service> weak_ptr_factory_;
Darin Petkov385b9bc2012-12-03 15:25:05 +0100674 Time *time_;
675 DiagnosticsReporter *diagnostics_reporter_;
Chris Masone3bd3c8c2011-06-13 08:20:26 -0700676
mukesh agrawalb54601c2011-06-07 17:39:22 -0700677 DISALLOW_COPY_AND_ASSIGN(Service);
Paul Stewart75897df2011-04-27 09:05:53 -0700678};
679
680} // namespace shill
681
Ben Chan19f83972012-10-03 23:25:56 -0700682#endif // SHILL_SERVICE_H_