mgmt: declare cs/config command
refs #4050
Change-Id: I779d425d0ca89750cf923c84009c19b37eecc9cf
diff --git a/src/mgmt/nfd/control-parameters.cpp b/src/mgmt/nfd/control-parameters.cpp
index 61fb823..a98e807 100644
--- a/src/mgmt/nfd/control-parameters.cpp
+++ b/src/mgmt/nfd/control-parameters.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -68,6 +68,9 @@
if (this->hasFlags()) {
totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::Flags, m_flags);
}
+ if (this->hasCapacity()) {
+ totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::Capacity, m_capacity);
+ }
if (this->hasCost()) {
totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::Cost, m_cost);
}
@@ -156,6 +159,12 @@
m_cost = readNonNegativeInteger(*val);
}
+ val = m_wire.find(tlv::nfd::Capacity);
+ m_hasFields[CONTROL_PARAMETER_CAPACITY] = val != m_wire.elements_end();
+ if (this->hasCapacity()) {
+ m_capacity = readNonNegativeInteger(*val);
+ }
+
val = m_wire.find(tlv::nfd::Flags);
m_hasFields[CONTROL_PARAMETER_FLAGS] = val != m_wire.elements_end();
if (this->hasFlags()) {
@@ -295,6 +304,10 @@
os << "Cost: " << parameters.getCost() << ", ";
}
+ if (parameters.hasCapacity()) {
+ os << "Capacity: " << parameters.getCapacity() << ", ";
+ }
+
if (parameters.hasFlags()) {
os << "Flags: " << AsHex{parameters.getFlags()} << ", ";
}