blob: a1d4182eeac30f12fb9d650d9127b14e08647611 [file] [log] [blame]
Darin Petkove02b3ca2011-05-31 16:00:44 -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
5#include "shill/ipconfig.h"
6
7#include <base/logging.h>
8
Chris Masonec6c6c132011-06-30 11:29:52 -07009#include "shill/adaptor_interfaces.h"
10
Darin Petkove02b3ca2011-05-31 16:00:44 -070011using std::string;
12
13namespace shill {
14
Darin Petkovf65e9282011-06-21 14:29:56 -070015IPConfig::IPConfig(const std::string &device_name) : device_name_(device_name) {
16 VLOG(2) << __func__ << " device: " << device_name;
Darin Petkove02b3ca2011-05-31 16:00:44 -070017}
18
19IPConfig::~IPConfig() {
Darin Petkovf65e9282011-06-21 14:29:56 -070020 VLOG(2) << __func__ << " device: " << device_name();
Darin Petkove02b3ca2011-05-31 16:00:44 -070021}
22
Chris Masone4e851612011-07-01 10:46:53 -070023string IPConfig::GetRpcIdentifier() {
24 return adaptor_->GetRpcIdentifier();
25}
26
Darin Petkov92c43902011-06-09 20:46:06 -070027bool IPConfig::RequestIP() {
Darin Petkove7cb7f82011-06-03 13:21:51 -070028 return false;
29}
30
Darin Petkov92c43902011-06-09 20:46:06 -070031bool IPConfig::RenewIP() {
32 return false;
33}
34
35bool IPConfig::ReleaseIP() {
Darin Petkove7cb7f82011-06-03 13:21:51 -070036 return false;
37}
38
Darin Petkovf9b0ca82011-06-20 12:10:23 -070039void IPConfig::UpdateProperties(const Properties &properties, bool success) {
Darin Petkove7cb7f82011-06-03 13:21:51 -070040 properties_ = properties;
Darin Petkovefb09c32011-06-07 20:24:17 -070041 if (update_callback_.get()) {
Darin Petkovf9b0ca82011-06-20 12:10:23 -070042 update_callback_->Run(this, success);
Darin Petkovefb09c32011-06-07 20:24:17 -070043 }
44}
45
46void IPConfig::RegisterUpdateCallback(
Chris Masone2b105542011-06-22 10:58:09 -070047 Callback2<const IPConfigRefPtr&, bool>::Type *callback) {
Darin Petkovefb09c32011-06-07 20:24:17 -070048 update_callback_.reset(callback);
Darin Petkove7cb7f82011-06-03 13:21:51 -070049}
50
Darin Petkove02b3ca2011-05-31 16:00:44 -070051} // namespace shill