blob: 8db66cb6743f5e87f2ac161180515ea419b33191 [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 Masone34af2182011-08-22 11:59:36 -070015#include <base/stringprintf.h>
Chris Masone3bd3c8c2011-06-13 08:20:26 -070016#include <chromeos/dbus/service_constants.h>
Paul Stewartf1ce5d22011-05-19 13:10:20 -070017
18#include "shill/control_interface.h"
19#include "shill/device.h"
20#include "shill/device_info.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
Chris Masone34af2182011-08-22 11:59:36 -070030// static
31const char EthernetService::kServiceType[] = "ethernet";
32
Paul Stewartf1ce5d22011-05-19 13:10:20 -070033EthernetService::EthernetService(ControlInterface *control_interface,
34 EventDispatcher *dispatcher,
Chris Masone6791a432011-07-12 13:23:19 -070035 Manager *manager,
mukesh agrawal51a7e932011-07-27 16:18:26 -070036 const EthernetRefPtr &device)
37 : Service(control_interface, dispatcher, manager),
Chris Masone3bd3c8c2011-06-13 08:20:26 -070038 ethernet_(device),
39 type_(flimflam::kTypeEthernet) {
Darin Petkovafa6fc42011-06-21 16:21:08 -070040 set_auto_connect(true);
Chris Masone3bd3c8c2011-06-13 08:20:26 -070041
Paul Stewartac4ac002011-08-26 12:04:26 -070042 store()->RegisterConstString(flimflam::kTypeProperty, &type_);
Paul Stewartf1ce5d22011-05-19 13:10:20 -070043}
44
45EthernetService::~EthernetService() { }
46
Darin Petkov4d6d9412011-08-24 13:19:54 -070047void EthernetService::Connect(Error *error) { }
Paul Stewartf1ce5d22011-05-19 13:10:20 -070048
49void EthernetService::Disconnect() { }
50
Chris Masone95207da2011-06-29 16:50:49 -070051std::string EthernetService::GetDeviceRpcId() {
52 return ethernet_->GetRpcIdentifier();
53}
54
Chris Masone34af2182011-08-22 11:59:36 -070055string EthernetService::GetStorageIdentifier(const string &mac) {
56 return base::StringPrintf("%s_%s", kServiceType, mac.c_str());
57}
58
Paul Stewartf1ce5d22011-05-19 13:10:20 -070059} // namespace shill