blob: bd964beaaf59bff9369a2c890e7d86ab3b41e9e3 [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#ifndef SHILL_IPCONFIG_
6#define SHILL_IPCONFIG_
7
8#include <string>
9
10#include <base/memory/ref_counted.h>
11
12namespace shill {
13
14class Device;
15
16// IPConfig superclass. Individual IP configuration types will inherit from this
17// class.
18class IPConfig : public base::RefCounted<IPConfig> {
19 public:
Darin Petkov50308cd2011-06-01 18:25:07 -070020 explicit IPConfig(const Device &device);
Darin Petkove02b3ca2011-05-31 16:00:44 -070021 virtual ~IPConfig();
22
Darin Petkov50308cd2011-06-01 18:25:07 -070023 const Device &device() const { return device_; }
Darin Petkove02b3ca2011-05-31 16:00:44 -070024
25 const std::string &GetDeviceName() const;
26
Darin Petkovd1b715b2011-06-02 21:21:22 -070027 // Request or renew IP configuration. Return true on success, false otherwise.
28 virtual bool Request() { return false; }
29 virtual bool Renew() { return false; }
30
Darin Petkove02b3ca2011-05-31 16:00:44 -070031 private:
32 friend class base::RefCounted<IPConfig>;
33
Darin Petkov50308cd2011-06-01 18:25:07 -070034 const Device &device_;
Darin Petkove02b3ca2011-05-31 16:00:44 -070035
36 DISALLOW_COPY_AND_ASSIGN(IPConfig);
37};
38
39} // namespace shill
40
41#endif // SHILL_IPCONFIG_