blob: 82c156d099b37b74bc1b59e8656a1ecfba7ba01a [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
Chris Masone34af2182011-08-22 11:59:36 -070030 // ethernet_<MAC>
Chris Masone6515aab2011-10-12 16:19:09 -070031 virtual std::string GetStorageIdentifier() const;
Paul Stewartcf199de2012-08-16 07:50:41 -070032 virtual bool IsAutoConnectByDefault() const { return true; }
33 virtual void SetAutoConnect(const bool &connect, Error *error);
Chris Masone34af2182011-08-22 11:59:36 -070034
Paul Stewartf1ce5d22011-05-19 13:10:20 -070035 private:
Chris Masone34af2182011-08-22 11:59:36 -070036 static const char kServiceType[];
37
Gaurav Shah1b7a6162011-11-09 11:41:01 -080038 std::string GetDeviceRpcId(Error *error);
Chris Masone95207da2011-06-29 16:50:49 -070039
Chris Masone2b105542011-06-22 10:58:09 -070040 EthernetRefPtr ethernet_;
Paul Stewartf1ce5d22011-05-19 13:10:20 -070041 DISALLOW_COPY_AND_ASSIGN(EthernetService);
42};
43
44} // namespace shill
45
46#endif // SHILL_ETHERNET_SERVICE_