blob: 4d26593ef410993f0684cbabc701ffe9395128de [file] [log] [blame]
Paul Stewartf1ce5d22011-05-19 13:10:20 -07001// 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
Darin Petkovafa6fc42011-06-21 16:21:08 -07005#include "shill/ethernet_service.h"
6
Paul Stewartf1ce5d22011-05-19 13:10:20 -07007#include <time.h>
8#include <stdio.h>
9#include <netinet/ether.h>
10#include <linux/if.h>
11
12#include <string>
13
14#include <base/logging.h>
Chris Masone3bd3c8c2011-06-13 08:20:26 -070015#include <chromeos/dbus/service_constants.h>
Paul Stewartf1ce5d22011-05-19 13:10:20 -070016
17#include "shill/control_interface.h"
18#include "shill/device.h"
19#include "shill/device_info.h"
Chris Masone7aa5f902011-07-11 11:13:35 -070020#include "shill/entry.h"
Darin Petkovafa6fc42011-06-21 16:21:08 -070021#include "shill/ethernet.h"
Paul Stewartf1ce5d22011-05-19 13:10:20 -070022#include "shill/manager.h"
Chris Masone7aa5f902011-07-11 11:13:35 -070023#include "shill/profile.h"
Paul Stewartf1ce5d22011-05-19 13:10:20 -070024#include "shill/shill_event.h"
25
Paul Stewartf1ce5d22011-05-19 13:10:20 -070026using std::string;
27
28namespace shill {
Darin Petkovafa6fc42011-06-21 16:21:08 -070029
Paul Stewartf1ce5d22011-05-19 13:10:20 -070030EthernetService::EthernetService(ControlInterface *control_interface,
31 EventDispatcher *dispatcher,
Chris Masone2b105542011-06-22 10:58:09 -070032 const EthernetRefPtr &device,
Chris Masone7aa5f902011-07-11 11:13:35 -070033 const ProfileRefPtr &profile,
34 const EntryRefPtr &entry,
Darin Petkovafa6fc42011-06-21 16:21:08 -070035 const string &name)
Chris Masone7aa5f902011-07-11 11:13:35 -070036 : Service(control_interface, dispatcher, profile, entry, name),
Chris Masone3bd3c8c2011-06-13 08:20:26 -070037 ethernet_(device),
38 type_(flimflam::kTypeEthernet) {
Darin Petkovafa6fc42011-06-21 16:21:08 -070039 set_auto_connect(true);
Chris Masone3bd3c8c2011-06-13 08:20:26 -070040
Chris Masone27c4aa52011-07-02 13:10:14 -070041 store_.RegisterConstString(flimflam::kTypeProperty, &type_);
Paul Stewartf1ce5d22011-05-19 13:10:20 -070042}
43
44EthernetService::~EthernetService() { }
45
46void EthernetService::Connect() { }
47
48void EthernetService::Disconnect() { }
49
Chris Masone95207da2011-06-29 16:50:49 -070050std::string EthernetService::GetDeviceRpcId() {
51 return ethernet_->GetRpcIdentifier();
52}
53
Paul Stewartf1ce5d22011-05-19 13:10:20 -070054} // namespace shill