Darin Petkov | e02b3ca | 2011-05-31 16:00:44 -0700 | [diff] [blame] | 1 | // 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 | |
| 12 | namespace shill { |
| 13 | |
| 14 | class Device; |
| 15 | |
| 16 | // IPConfig superclass. Individual IP configuration types will inherit from this |
| 17 | // class. |
| 18 | class IPConfig : public base::RefCounted<IPConfig> { |
| 19 | public: |
Darin Petkov | 50308cd | 2011-06-01 18:25:07 -0700 | [diff] [blame] | 20 | explicit IPConfig(const Device &device); |
Darin Petkov | e02b3ca | 2011-05-31 16:00:44 -0700 | [diff] [blame] | 21 | virtual ~IPConfig(); |
| 22 | |
Darin Petkov | 50308cd | 2011-06-01 18:25:07 -0700 | [diff] [blame] | 23 | const Device &device() const { return device_; } |
Darin Petkov | e02b3ca | 2011-05-31 16:00:44 -0700 | [diff] [blame] | 24 | |
| 25 | const std::string &GetDeviceName() const; |
| 26 | |
Darin Petkov | d1b715b | 2011-06-02 21:21:22 -0700 | [diff] [blame^] | 27 | // 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 Petkov | e02b3ca | 2011-05-31 16:00:44 -0700 | [diff] [blame] | 31 | private: |
| 32 | friend class base::RefCounted<IPConfig>; |
| 33 | |
Darin Petkov | 50308cd | 2011-06-01 18:25:07 -0700 | [diff] [blame] | 34 | const Device &device_; |
Darin Petkov | e02b3ca | 2011-05-31 16:00:44 -0700 | [diff] [blame] | 35 | |
| 36 | DISALLOW_COPY_AND_ASSIGN(IPConfig); |
| 37 | }; |
| 38 | |
| 39 | } // namespace shill |
| 40 | |
| 41 | #endif // SHILL_IPCONFIG_ |