Track link status in Ethernet and register service
Add link status tracking (and setting IFF_UP) to ethernet devices.
When the interface is running, register a service with the manager.
BUG=chromium-os:12933
TEST=Manual -- unit tests and plug/unplug ethernet USB and RJ45 sides.
Change-Id: I1233ce5a63efddb7606183dc4daad4d2624d864a
Reviewed-on: http://gerrit.chromium.org/gerrit/1196
Tested-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
diff --git a/ethernet_service.h b/ethernet_service.h
new file mode 100644
index 0000000..abf488b
--- /dev/null
+++ b/ethernet_service.h
@@ -0,0 +1,35 @@
+// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SHILL_ETHERNET_SERVICE_
+#define SHILL_ETHERNET_SERVICE_
+
+#include <base/basictypes.h>
+
+#include "shill/ethernet.h"
+#include "shill/device.h"
+#include "shill/shill_event.h"
+#include "shill/service.h"
+
+namespace shill {
+
+
+class Ethernet;
+
+class EthernetService : public Service {
+ public:
+ EthernetService(ControlInterface *control_interface,
+ EventDispatcher *dispatcher,
+ Ethernet *device);
+ ~EthernetService();
+ void Connect();
+ void Disconnect();
+ private:
+ Ethernet *ethernet_;
+ DISALLOW_COPY_AND_ASSIGN(EthernetService);
+};
+
+} // namespace shill
+
+#endif // SHILL_ETHERNET_SERVICE_