mgmt/tools: fix build errors
Replace deprecated FaceStatus elements.
Fix unused-result warning in ndn-tlv-peek.
refs #1417
Change-Id: I6a8dcbfce1e0a112041ed2fedc2d485ff67ccf7d
diff --git a/daemon/mgmt/face-status-publisher.cpp b/daemon/mgmt/face-status-publisher.cpp
index 6bc8c72..89c731e 100644
--- a/daemon/mgmt/face-status-publisher.cpp
+++ b/daemon/mgmt/face-status-publisher.cpp
@@ -41,19 +41,19 @@
size_t statusLength = 0;
statusLength += prependNonNegativeIntegerBlock(outBuffer,
- ndn::tlv::nfd::TotalOutgoingDataCounter,
+ ndn::tlv::nfd::NOutDatas,
counters.getOutData());
statusLength += prependNonNegativeIntegerBlock(outBuffer,
- ndn::tlv::nfd::TotalOutgoingInterestCounter,
+ ndn::tlv::nfd::NOutInterests,
counters.getOutInterest());
statusLength += prependNonNegativeIntegerBlock(outBuffer,
- ndn::tlv::nfd::TotalIncomingDataCounter,
+ ndn::tlv::nfd::NInDatas,
counters.getInData());
statusLength += prependNonNegativeIntegerBlock(outBuffer,
- ndn::tlv::nfd::TotalIncomingInterestCounter,
+ ndn::tlv::nfd::NInInterests,
counters.getInInterest());
statusLength += prependByteArrayBlock(outBuffer,
diff --git a/tests/mgmt/face-status-publisher-common.hpp b/tests/mgmt/face-status-publisher-common.hpp
index 9df73b1..59e99f8 100644
--- a/tests/mgmt/face-status-publisher-common.hpp
+++ b/tests/mgmt/face-status-publisher-common.hpp
@@ -139,26 +139,26 @@
inInterest =
checkedReadNonNegativeIntegerType(i,
status.elements_end(),
- ndn::tlv::nfd::TotalIncomingInterestCounter);
+ ndn::tlv::nfd::NInInterests);
BOOST_REQUIRE_EQUAL(inInterest, counters.getInInterest());
inData =
checkedReadNonNegativeIntegerType(i,
status.elements_end(),
- ndn::tlv::nfd::TotalIncomingDataCounter);
+ ndn::tlv::nfd::NInDatas);
BOOST_REQUIRE_EQUAL(inData, counters.getInData());
outInterest =
checkedReadNonNegativeIntegerType(i,
status.elements_end(),
- ndn::tlv::nfd::TotalOutgoingInterestCounter);
+ ndn::tlv::nfd::NOutInterests);
BOOST_REQUIRE_EQUAL(outInterest, counters.getOutInterest());
outData =
readNonNegativeIntegerType(*i,
- ndn::tlv::nfd::TotalOutgoingDataCounter);
+ ndn::tlv::nfd::NOutDatas);
BOOST_REQUIRE_EQUAL(outData, counters.getOutData());
}
diff --git a/tools/ndn-tlv-peek.cpp b/tools/ndn-tlv-peek.cpp
index f84116d..00e0bdb 100644
--- a/tools/ndn-tlv-peek.cpp
+++ b/tools/ndn-tlv-peek.cpp
@@ -4,7 +4,7 @@
*
* Author: Jerald Paul Abraham <jeraldabraham@email.arizona.edu>
*/
-
+
#include <boost/asio.hpp>
#include <ndn-cpp-dev/face.hpp>
@@ -137,13 +137,13 @@
m_isDataReceived = true;
if (m_isPayloadOnlySet)
{
- ndn::Block block = data.getContent();
- write(1, block.value(), block.value_size());
+ const ndn::Block& block = data.getContent();
+ std::cout.write(reinterpret_cast<const char*>(block.value()), block.value_size());
}
else
{
- ndn::Block block = data.wireEncode();
- write(1, block.wire(), block.size());
+ const ndn::Block& block = data.wireEncode();
+ std::cout.write(reinterpret_cast<const char*>(block.wire()), block.size());
}
}