Thieu Le | 3426c8f | 2012-01-11 17:35:11 -0800 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
Paul Stewart | b50f0b9 | 2011-05-16 16:31:42 -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_ETHERNET_ |
| 6 | #define SHILL_ETHERNET_ |
| 7 | |
Chris Masone | 46eaaf5 | 2011-05-24 13:08:30 -0700 | [diff] [blame] | 8 | #include <string> |
| 9 | |
Paul Stewart | b50f0b9 | 2011-05-16 16:31:42 -0700 | [diff] [blame] | 10 | #include "shill/device.h" |
Paul Stewart | 26b327e | 2011-10-19 11:38:09 -0700 | [diff] [blame] | 11 | #include "shill/event_dispatcher.h" |
Chris Masone | 2b10554 | 2011-06-22 10:58:09 -0700 | [diff] [blame] | 12 | #include "shill/refptr_types.h" |
Paul Stewart | b50f0b9 | 2011-05-16 16:31:42 -0700 | [diff] [blame] | 13 | |
| 14 | namespace shill { |
| 15 | |
Paul Stewart | b50f0b9 | 2011-05-16 16:31:42 -0700 | [diff] [blame] | 16 | class Ethernet : public Device { |
| 17 | public: |
Darin Petkov | afa6fc4 | 2011-06-21 16:21:08 -0700 | [diff] [blame] | 18 | Ethernet(ControlInterface *control_interface, |
| 19 | EventDispatcher *dispatcher, |
Thieu Le | 3426c8f | 2012-01-11 17:35:11 -0800 | [diff] [blame] | 20 | Metrics *metrics, |
Darin Petkov | afa6fc4 | 2011-06-21 16:21:08 -0700 | [diff] [blame] | 21 | Manager *manager, |
| 22 | const std::string& link_name, |
Chris Masone | 626719f | 2011-08-18 16:58:48 -0700 | [diff] [blame] | 23 | const std::string &address, |
Darin Petkov | afa6fc4 | 2011-06-21 16:21:08 -0700 | [diff] [blame] | 24 | int interface_index); |
mukesh agrawal | 93a29ed | 2012-04-17 16:13:01 -0700 | [diff] [blame] | 25 | virtual ~Ethernet(); |
Darin Petkov | afa6fc4 | 2011-06-21 16:21:08 -0700 | [diff] [blame] | 26 | |
mukesh agrawal | 93a29ed | 2012-04-17 16:13:01 -0700 | [diff] [blame] | 27 | virtual void Start(Error *error, const EnabledStateChangedCallback &callback); |
| 28 | virtual void Stop(Error *error, const EnabledStateChangedCallback &callback); |
mukesh agrawal | 93a29ed | 2012-04-17 16:13:01 -0700 | [diff] [blame] | 29 | virtual void LinkEvent(unsigned int flags, unsigned int change); |
Christopher Wiley | 2f1bbf0 | 2012-10-25 15:31:13 -0700 | [diff] [blame] | 30 | virtual void ConnectTo(EthernetService *service); |
| 31 | virtual void DisconnectFrom(EthernetService *service); |
Paul Stewart | f1ce5d2 | 2011-05-19 13:10:20 -0700 | [diff] [blame] | 32 | |
Paul Stewart | b50f0b9 | 2011-05-16 16:31:42 -0700 | [diff] [blame] | 33 | private: |
Chris Masone | c1e5041 | 2011-06-07 13:04:53 -0700 | [diff] [blame] | 34 | ServiceRefPtr service_; |
Darin Petkov | afa6fc4 | 2011-06-21 16:21:08 -0700 | [diff] [blame] | 35 | bool link_up_; |
| 36 | |
Paul Stewart | b50f0b9 | 2011-05-16 16:31:42 -0700 | [diff] [blame] | 37 | DISALLOW_COPY_AND_ASSIGN(Ethernet); |
| 38 | }; |
| 39 | |
| 40 | } // namespace shill |
| 41 | |
| 42 | #endif // SHILL_ETHERNET_ |