blob: 5e42eb251ae22e98d872d3f3ca4fdeb51463fd2f [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
Darin Petkove02b3ca2011-05-31 16:00:44 -07009using std::string;
10
11namespace shill {
12
Darin Petkovf65e9282011-06-21 14:29:56 -070013IPConfig::IPConfig(const std::string &device_name) : device_name_(device_name) {
14 VLOG(2) << __func__ << " device: " << device_name;
Darin Petkove02b3ca2011-05-31 16:00:44 -070015}
16
17IPConfig::~IPConfig() {
Darin Petkovf65e9282011-06-21 14:29:56 -070018 VLOG(2) << __func__ << " device: " << device_name();
Darin Petkove02b3ca2011-05-31 16:00:44 -070019}
20
Darin Petkov92c43902011-06-09 20:46:06 -070021bool IPConfig::RequestIP() {
Darin Petkove7cb7f82011-06-03 13:21:51 -070022 return false;
23}
24
Darin Petkov92c43902011-06-09 20:46:06 -070025bool IPConfig::RenewIP() {
26 return false;
27}
28
29bool IPConfig::ReleaseIP() {
Darin Petkove7cb7f82011-06-03 13:21:51 -070030 return false;
31}
32
Darin Petkovf9b0ca82011-06-20 12:10:23 -070033void IPConfig::UpdateProperties(const Properties &properties, bool success) {
Darin Petkove7cb7f82011-06-03 13:21:51 -070034 properties_ = properties;
Darin Petkovefb09c32011-06-07 20:24:17 -070035 if (update_callback_.get()) {
Darin Petkovf9b0ca82011-06-20 12:10:23 -070036 update_callback_->Run(this, success);
Darin Petkovefb09c32011-06-07 20:24:17 -070037 }
38}
39
40void IPConfig::RegisterUpdateCallback(
Chris Masone2b105542011-06-22 10:58:09 -070041 Callback2<const IPConfigRefPtr&, bool>::Type *callback) {
Darin Petkovefb09c32011-06-07 20:24:17 -070042 update_callback_.reset(callback);
Darin Petkove7cb7f82011-06-03 13:21:51 -070043}
44
Darin Petkove02b3ca2011-05-31 16:00:44 -070045} // namespace shill