blob: d7c0b63a43c1e3c0535bd5256c978052e5ef6236 [file] [log] [blame]
Thieu Le3426c8f2012-01-11 17:35:11 -08001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Paul Stewartf1ce5d22011-05-19 13:10:20 -07002// 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_ETHERNET_SERVICE_
6#define SHILL_ETHERNET_SERVICE_
7
8#include <base/basictypes.h>
9
Paul Stewart26b327e2011-10-19 11:38:09 -070010#include "shill/event_dispatcher.h"
Chris Masone2b105542011-06-22 10:58:09 -070011#include "shill/refptr_types.h"
Paul Stewartf1ce5d22011-05-19 13:10:20 -070012#include "shill/service.h"
13
14namespace shill {
15
Chris Masone6791a432011-07-12 13:23:19 -070016class ControlInterface;
17class EventDispatcher;
18class Manager;
Thieu Le3426c8f2012-01-11 17:35:11 -080019class Metrics;
Chris Masone6791a432011-07-12 13:23:19 -070020
Paul Stewartf1ce5d22011-05-19 13:10:20 -070021class EthernetService : public Service {
22 public:
23 EthernetService(ControlInterface *control_interface,
24 EventDispatcher *dispatcher,
Thieu Le3426c8f2012-01-11 17:35:11 -080025 Metrics *metrics,
Chris Masone6791a432011-07-12 13:23:19 -070026 Manager *manager,
mukesh agrawal51a7e932011-07-27 16:18:26 -070027 const EthernetRefPtr &device);
Paul Stewartf1ce5d22011-05-19 13:10:20 -070028 ~EthernetService();
Darin Petkov4d6d9412011-08-24 13:19:54 -070029
Christopher Wiley2f1bbf02012-10-25 15:31:13 -070030 // Inherited from Service.
mukesh agrawaldc7b8442012-09-27 13:48:14 -070031 virtual void Connect(Error *error, const char *reason);
Christopher Wiley2f1bbf02012-10-25 15:31:13 -070032 virtual void Disconnect(Error *error);
33
Chris Masone34af2182011-08-22 11:59:36 -070034 // ethernet_<MAC>
Chris Masone6515aab2011-10-12 16:19:09 -070035 virtual std::string GetStorageIdentifier() const;
Paul Stewartcf199de2012-08-16 07:50:41 -070036 virtual bool IsAutoConnectByDefault() const { return true; }
mukesh agrawalbebf1b82013-04-23 15:06:33 -070037 virtual bool SetAutoConnectFull(const bool &connect, Error *error);
Chris Masone34af2182011-08-22 11:59:36 -070038
Albert Chaulk0e1cdea2013-02-27 15:32:55 -080039 virtual void Remove(Error *error);
40
Paul Stewartf1ce5d22011-05-19 13:10:20 -070041 private:
Chris Masone34af2182011-08-22 11:59:36 -070042 static const char kServiceType[];
43
Gaurav Shah1b7a6162011-11-09 11:41:01 -080044 std::string GetDeviceRpcId(Error *error);
Chris Masone95207da2011-06-29 16:50:49 -070045
Chris Masone2b105542011-06-22 10:58:09 -070046 EthernetRefPtr ethernet_;
Paul Stewartf1ce5d22011-05-19 13:10:20 -070047 DISALLOW_COPY_AND_ASSIGN(EthernetService);
48};
49
50} // namespace shill
51
52#endif // SHILL_ETHERNET_SERVICE_