summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Jennison <tjennison@google.com>2015-12-11 10:58:05 -0800
committerandroid-build-merger <android-build-merger@google.com>2015-12-11 10:58:05 -0800
commit1e1b20da26bc775402ab76079e038ea4f761cde0 (patch)
tree3a88d82d53afcedf9845cc169cc854663bf5db2d
parenta4338aeddf7b14dc6276cac6a60c69d3987da8d7 (diff)
parentcb71bae66c810ca0d37aaa70b98f04082d32cf08 (diff)
downloadshill-1e1b20da26bc775402ab76079e038ea4f761cde0.tar.gz
shill: expose DHCPv6 lease duration
am: cb71bae66c * commit 'cb71bae66c810ca0d37aaa70b98f04082d32cf08': shill: expose DHCPv6 lease duration
-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);