Paul Stewart | b50f0b9 | 2011-05-16 16:31:42 -0700 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
| 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" |
| 11 | #include "shill/shill_event.h" |
Paul Stewart | f1ce5d2 | 2011-05-19 13:10:20 -0700 | [diff] [blame] | 12 | #include "shill/ethernet_service.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: |
| 18 | explicit Ethernet(ControlInterface *control_interface, |
| 19 | EventDispatcher *dispatcher, |
Paul Stewart | f1ce5d2 | 2011-05-19 13:10:20 -0700 | [diff] [blame] | 20 | Manager *manager, |
Chris Masone | 46eaaf5 | 2011-05-24 13:08:30 -0700 | [diff] [blame] | 21 | const std::string& link_name, |
Paul Stewart | b50f0b9 | 2011-05-16 16:31:42 -0700 | [diff] [blame] | 22 | int interface_index); |
| 23 | ~Ethernet(); |
Paul Stewart | f1ce5d2 | 2011-05-19 13:10:20 -0700 | [diff] [blame] | 24 | void Start(); |
| 25 | void Stop(); |
Paul Stewart | b50f0b9 | 2011-05-16 16:31:42 -0700 | [diff] [blame] | 26 | bool TechnologyIs(Device::Technology type); |
Paul Stewart | f1ce5d2 | 2011-05-19 13:10:20 -0700 | [diff] [blame] | 27 | void LinkEvent(unsigned flags, unsigned change); |
| 28 | bool link_up_; |
| 29 | |
Paul Stewart | b50f0b9 | 2011-05-16 16:31:42 -0700 | [diff] [blame] | 30 | private: |
Paul Stewart | f1ce5d2 | 2011-05-19 13:10:20 -0700 | [diff] [blame] | 31 | bool service_registered_; |
| 32 | scoped_refptr<EthernetService> service_; |
Paul Stewart | b50f0b9 | 2011-05-16 16:31:42 -0700 | [diff] [blame] | 33 | DISALLOW_COPY_AND_ASSIGN(Ethernet); |
| 34 | }; |
| 35 | |
| 36 | } // namespace shill |
| 37 | |
| 38 | #endif // SHILL_ETHERNET_ |