mgmt: add congestion marking parameters

refs #4465

Change-Id: I5090d93b59fe3fc425e5ce529c4f66b8211155dd
diff --git a/src/mgmt/nfd/control-parameters.cpp b/src/mgmt/nfd/control-parameters.cpp
index a98e807..1e4d9fe 100644
--- a/src/mgmt/nfd/control-parameters.cpp
+++ b/src/mgmt/nfd/control-parameters.cpp
@@ -51,6 +51,14 @@
 {
   size_t totalLength = 0;
 
+  if (this->hasDefaultCongestionThreshold()) {
+    totalLength += prependNonNegativeIntegerBlock(encoder,
+                   tlv::nfd::DefaultCongestionThreshold, m_defaultCongestionThreshold);
+  }
+  if (this->hasBaseCongestionMarkingInterval()) {
+    totalLength += prependNonNegativeIntegerBlock(encoder,
+                   tlv::nfd::BaseCongestionMarkingInterval, m_baseCongestionMarkingInterval.count());
+  }
   if (this->hasFacePersistency()) {
     totalLength += prependNonNegativeIntegerBlock(encoder,
                    tlv::nfd::FacePersistency, m_facePersistency);
@@ -200,6 +208,18 @@
   if (this->hasFacePersistency()) {
     m_facePersistency = readNonNegativeIntegerAs<FacePersistency>(*val);
   }
+
+  val = m_wire.find(tlv::nfd::BaseCongestionMarkingInterval);
+  m_hasFields[CONTROL_PARAMETER_BASE_CONGESTION_MARKING_INTERVAL] = val != m_wire.elements_end();
+  if (this->hasBaseCongestionMarkingInterval()) {
+    m_baseCongestionMarkingInterval = time::nanoseconds(readNonNegativeInteger(*val));
+  }
+
+  val = m_wire.find(tlv::nfd::DefaultCongestionThreshold);
+  m_hasFields[CONTROL_PARAMETER_DEFAULT_CONGESTION_THRESHOLD] = val != m_wire.elements_end();
+  if (this->hasDefaultCongestionThreshold()) {
+    m_defaultCongestionThreshold = readNonNegativeInteger(*val);
+  }
 }
 
 bool
@@ -328,6 +348,14 @@
     os << "FacePersistency: " << parameters.getFacePersistency() << ", ";
   }
 
+  if (parameters.hasBaseCongestionMarkingInterval()) {
+    os << "BaseCongestionMarkingInterval: " << parameters.getBaseCongestionMarkingInterval() << ", ";
+  }
+
+  if (parameters.hasDefaultCongestionThreshold()) {
+    os << "DefaultCongestionThreshold: " << parameters.getDefaultCongestionThreshold() << ", ";
+  }
+
   os << ")";
   return os;
 }