summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Jennison <tjennison@google.com>2015-12-03 14:05:16 -0500
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-12-11 17:13:34 +0000
commitcb71bae66c810ca0d37aaa70b98f04082d32cf08 (patch)
tree3a88d82d53afcedf9845cc169cc854663bf5db2d
parent8ce932a8ebf3af11f17b814c4e544a305607afca (diff)
downloadshill-cb71bae66c810ca0d37aaa70b98f04082d32cf08.tar.gz
shill: expose DHCPv6 lease duration
Bug: 25849838 TEST=unit tests CQ-DEPEND=CL:316411 Change-Id: I8bc816e48c42411ce61dc819a76506d0994771d8
-rw-r--r--ipconfig.cc2
-rw-r--r--property_store.cc8
-rw-r--r--property_store.h1
3 files changed, 11 insertions, 0 deletions
diff --git a/ipconfig.cc b/ipconfig.cc
index 15693865..7bfa5ee5 100644
--- a/ipconfig.cc
+++ b/ipconfig.cc
@@ -99,6 +99,8 @@ void IPConfig::Init() {
&properties_.delegated_prefix);
store_.RegisterConstInt32(kDelegatedPrefixLengthProperty,
&properties_.delegated_prefix_length);
+ store_.RegisterConstUint32(kLeaseDurationSecondsProperty,
+ &properties_.lease_duration_seconds);
time_ = Time::GetInstance();
current_lease_expiration_time_ = {kDefaultLeaseExpirationTime, 0};
SLOG(this, 2) << __func__ << " device: " << device_name();
diff --git a/property_store.cc b/property_store.cc
index 9555088e..0c3ce642 100644
--- a/property_store.cc
+++ b/property_store.cc
@@ -722,6 +722,14 @@ void PropertyStore::RegisterUint32(const std::string& name, uint32_t* prop) {
Uint32Accessor(new PropertyAccessor<uint32_t>(prop));
}
+void PropertyStore::RegisterConstUint32(const string& name,
+ const uint32_t* prop) {
+ DCHECK(!Contains(name) || ContainsKey(uint32_properties_, name))
+ << "(Already registered " << name << ")";
+ uint32_properties_[name] =
+ Uint32Accessor(new ConstPropertyAccessor<uint32_t>(prop));
+}
+
void PropertyStore::RegisterConstUint16(const string& name,
const uint16_t* prop) {
DCHECK(!Contains(name) || ContainsKey(uint16_properties_, name))
diff --git a/property_store.h b/property_store.h
index 00c6f39e..175b97a3 100644
--- a/property_store.h
+++ b/property_store.h
@@ -210,6 +210,7 @@ class PropertyStore {
void RegisterConstInt32(const std::string& name, const int32_t* prop);
void RegisterWriteOnlyInt32(const std::string& name, int32_t* prop);
void RegisterUint32(const std::string& name, uint32_t* prop);
+ void RegisterConstUint32(const std::string& name, const uint32_t* prop);
void RegisterString(const std::string& name, std::string* prop);
void RegisterConstString(const std::string& name, const std::string* prop);
void RegisterWriteOnlyString(const std::string& name, std::string* prop);