mgmt: StatusServer uses ndn::nfd::ForwarderStatus
refs #1422
Change-Id: Iea201b62391ecb2e4376ad85c5dcfefed4500515
diff --git a/daemon/mgmt/status-server.cpp b/daemon/mgmt/status-server.cpp
index df9309d..5c4bd1a 100644
--- a/daemon/mgmt/status-server.cpp
+++ b/daemon/mgmt/status-server.cpp
@@ -31,19 +31,17 @@
shared_ptr<Data> data = make_shared<Data>(name);
data->setFreshnessPeriod(RESPONSE_FRESHNESS);
- shared_ptr<ndn::nfd::Status> payload = this->collectStatus();
- ndn::EncodingBuffer payloadBuffer;
- payload->wireEncode(payloadBuffer);
- data->setContent(payloadBuffer.buf(), payloadBuffer.size());
+ shared_ptr<ndn::nfd::ForwarderStatus> status = this->collectStatus();
+ data->setContent(status->wireEncode());
m_face->sign(*data);
m_face->put(*data);
}
-shared_ptr<ndn::nfd::Status>
+shared_ptr<ndn::nfd::ForwarderStatus>
StatusServer::collectStatus() const
{
- shared_ptr<ndn::nfd::Status> status = make_shared<ndn::nfd::Status>();
+ shared_ptr<ndn::nfd::ForwarderStatus> status = make_shared<ndn::nfd::ForwarderStatus>();
status->setNfdVersion(NFD_VERSION);
status->setStartTimestamp(m_startTimestamp);
@@ -57,8 +55,8 @@
const ForwarderCounters& counters = m_forwarder.getCounters();
status->setNInInterests(counters.getInInterest());
- status->setNOutInterests(counters.getOutInterest());
status->setNInDatas(counters.getInData());
+ status->setNOutInterests(counters.getOutInterest());
status->setNOutDatas(counters.getOutData());
return status;
diff --git a/daemon/mgmt/status-server.hpp b/daemon/mgmt/status-server.hpp
index c9a14f5..de0b810 100644
--- a/daemon/mgmt/status-server.hpp
+++ b/daemon/mgmt/status-server.hpp
@@ -8,7 +8,7 @@
#define NFD_MGMT_STATUS_SERVER_HPP
#include "mgmt/app-face.hpp"
-#include <ndn-cpp-dev/management/nfd-status.hpp>
+#include <ndn-cpp-dev/management/nfd-forwarder-status.hpp>
namespace nfd {
@@ -23,7 +23,7 @@
void
onInterest(const Interest& interest) const;
- shared_ptr<ndn::nfd::Status>
+ shared_ptr<ndn::nfd::ForwarderStatus>
collectStatus() const;
private:
diff --git a/tests/mgmt/status-server.cpp b/tests/mgmt/status-server.cpp
index 59a283e..972d8a3 100644
--- a/tests/mgmt/status-server.cpp
+++ b/tests/mgmt/status-server.cpp
@@ -61,7 +61,7 @@
BOOST_REQUIRE(static_cast<bool>(g_response));
// verify
- ndn::nfd::Status status;
+ ndn::nfd::ForwarderStatus status;
BOOST_REQUIRE_NO_THROW(status.wireDecode(g_response->getContent()));
BOOST_CHECK_EQUAL(status.getNfdVersion(), NFD_VERSION);
diff --git a/tools/nfd-status.cpp b/tools/nfd-status.cpp
index b15df61..f1e5afd 100644
--- a/tools/nfd-status.cpp
+++ b/tools/nfd-status.cpp
@@ -11,7 +11,7 @@
#include <ndn-cpp-dev/management/nfd-fib-entry.hpp>
#include <ndn-cpp-dev/management/nfd-face-status.hpp>
-#include <ndn-cpp-dev/management/nfd-status.hpp>
+#include <ndn-cpp-dev/management/nfd-forwarder-status.hpp>
namespace ndn {
@@ -92,7 +92,7 @@
{
std::cout << "General NFD status:" << std::endl;
- nfd::Status status(data.getContent());
+ nfd::ForwarderStatus status(data.getContent());
std::cout << " version="
<< status.getNfdVersion() << std::endl;
std::cout << " startTime="