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;