mgmt: add LocalUri to ControlParameters
refs #4014
Change-Id: I474dc3f41021687b99804fc2d71dd6e72c5175c5
diff --git a/src/mgmt/nfd/control-parameters.cpp b/src/mgmt/nfd/control-parameters.cpp
index 4958749..a414567 100644
--- a/src/mgmt/nfd/control-parameters.cpp
+++ b/src/mgmt/nfd/control-parameters.cpp
@@ -78,6 +78,13 @@
totalLength += prependNonNegativeIntegerBlock(encoder,
tlv::nfd::LocalControlFeature, m_localControlFeature);
}
+ if (this->hasLocalUri()) {
+ size_t valLength = encoder.prependByteArray(
+ reinterpret_cast<const uint8_t*>(m_localUri.c_str()), m_localUri.size());
+ totalLength += valLength;
+ totalLength += encoder.prependVarNumber(valLength);
+ totalLength += encoder.prependVarNumber(tlv::nfd::LocalUri);
+ }
if (this->hasUri()) {
size_t valLength = encoder.prependByteArray(
reinterpret_cast<const uint8_t*>(m_uri.c_str()), m_uri.size());
@@ -147,6 +154,12 @@
m_uri.assign(reinterpret_cast<const char*>(val->value()), val->value_size());
}
+ val = m_wire.find(tlv::nfd::LocalUri);
+ m_hasFields[CONTROL_PARAMETER_LOCAL_URI] = val != m_wire.elements_end();
+ if (this->hasLocalUri()) {
+ m_localUri.assign(reinterpret_cast<const char*>(val->value()), val->value_size());
+ }
+
val = m_wire.find(tlv::nfd::LocalControlFeature);
m_hasFields[CONTROL_PARAMETER_LOCAL_CONTROL_FEATURE] = val != m_wire.elements_end();
if (this->hasLocalControlFeature()) {
@@ -292,6 +305,10 @@
os << "Uri: " << parameters.getUri() << ", ";
}
+ if (parameters.hasLocalUri()) {
+ os << "LocalUri: " << parameters.getLocalUri() << ", ";
+ }
+
if (parameters.hasLocalControlFeature()) {
os << "LocalControlFeature: " << parameters.getLocalControlFeature() << ", ";
}