blob: f17bdef121af5c8e57c5ebe7cf6f121fbe33147c [file] [log] [blame]
Thieu Le3426c8f2012-01-11 17:35:11 -08001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Paul Stewartb50f0b92011-05-16 16:31:42 -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_
6#define SHILL_ETHERNET_
7
Chris Masone46eaaf52011-05-24 13:08:30 -07008#include <string>
9
Paul Stewartb50f0b92011-05-16 16:31:42 -070010#include "shill/device.h"
Paul Stewart26b327e2011-10-19 11:38:09 -070011#include "shill/event_dispatcher.h"
Chris Masone2b105542011-06-22 10:58:09 -070012#include "shill/refptr_types.h"
Paul Stewartb50f0b92011-05-16 16:31:42 -070013
14namespace shill {
15
Paul Stewartb50f0b92011-05-16 16:31:42 -070016class Ethernet : public Device {
17 public:
Darin Petkovafa6fc42011-06-21 16:21:08 -070018 Ethernet(ControlInterface *control_interface,
19 EventDispatcher *dispatcher,
Thieu Le3426c8f2012-01-11 17:35:11 -080020 Metrics *metrics,
Darin Petkovafa6fc42011-06-21 16:21:08 -070021 Manager *manager,
22 const std::string& link_name,
Chris Masone626719f2011-08-18 16:58:48 -070023 const std::string &address,
Darin Petkovafa6fc42011-06-21 16:21:08 -070024 int interface_index);
mukesh agrawal93a29ed2012-04-17 16:13:01 -070025 virtual ~Ethernet();
Darin Petkovafa6fc42011-06-21 16:21:08 -070026
mukesh agrawal93a29ed2012-04-17 16:13:01 -070027 virtual void Start(Error *error, const EnabledStateChangedCallback &callback);
28 virtual void Stop(Error *error, const EnabledStateChangedCallback &callback);
mukesh agrawal93a29ed2012-04-17 16:13:01 -070029 virtual void LinkEvent(unsigned int flags, unsigned int change);
Paul Stewartf1ce5d22011-05-19 13:10:20 -070030
Paul Stewartb50f0b92011-05-16 16:31:42 -070031 private:
Paul Stewartf1ce5d22011-05-19 13:10:20 -070032 bool service_registered_;
Chris Masonec1e50412011-06-07 13:04:53 -070033 ServiceRefPtr service_;
Darin Petkovafa6fc42011-06-21 16:21:08 -070034 bool link_up_;
35
Paul Stewartb50f0b92011-05-16 16:31:42 -070036 DISALLOW_COPY_AND_ASSIGN(Ethernet);
37};
38
39} // namespace shill
40
41#endif // SHILL_ETHERNET_