management: NACK counters

refs #3174

Change-Id: I647cddc777e079dce4b7c7574ec2cccb04da6630
diff --git a/src/management/nfd-face-status.cpp b/src/management/nfd-face-status.cpp
index 30af9fb..ca24a99 100644
--- a/src/management/nfd-face-status.cpp
+++ b/src/management/nfd-face-status.cpp
@@ -37,8 +37,10 @@
   : m_hasExpirationPeriod(false)
   , m_nInInterests(0)
   , m_nInDatas(0)
+  , m_nInNacks(0)
   , m_nOutInterests(0)
   , m_nOutDatas(0)
+  , m_nOutNacks(0)
   , m_nInBytes(0)
   , m_nOutBytes(0)
 {
@@ -60,10 +62,14 @@
   totalLength += prependNonNegativeIntegerBlock(encoder,
                  tlv::nfd::NInBytes, m_nInBytes);
   totalLength += prependNonNegativeIntegerBlock(encoder,
+                 tlv::nfd::NOutNacks, m_nOutNacks);
+  totalLength += prependNonNegativeIntegerBlock(encoder,
                  tlv::nfd::NOutDatas, m_nOutDatas);
   totalLength += prependNonNegativeIntegerBlock(encoder,
                  tlv::nfd::NOutInterests, m_nOutInterests);
   totalLength += prependNonNegativeIntegerBlock(encoder,
+                 tlv::nfd::NInNacks, m_nInNacks);
+  totalLength += prependNonNegativeIntegerBlock(encoder,
                  tlv::nfd::NInDatas, m_nInDatas);
   totalLength += prependNonNegativeIntegerBlock(encoder,
                  tlv::nfd::NInInterests, m_nInInterests);
@@ -195,6 +201,14 @@
     BOOST_THROW_EXCEPTION(Error("missing required NInDatas field"));
   }
 
+  if (val != m_wire.elements_end() && val->type() == tlv::nfd::NInNacks) {
+    m_nInNacks = readNonNegativeInteger(*val);
+    ++val;
+  }
+  else {
+    BOOST_THROW_EXCEPTION(Error("missing required NInNacks field"));
+  }
+
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NOutInterests) {
     m_nOutInterests = readNonNegativeInteger(*val);
     ++val;
@@ -211,6 +225,14 @@
     BOOST_THROW_EXCEPTION(Error("missing required NOutDatas field"));
   }
 
+  if (val != m_wire.elements_end() && val->type() == tlv::nfd::NOutNacks) {
+    m_nOutNacks = readNonNegativeInteger(*val);
+    ++val;
+  }
+  else {
+    BOOST_THROW_EXCEPTION(Error("missing required NOutNacks field"));
+  }
+
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NInBytes) {
     m_nInBytes = readNonNegativeInteger(*val);
     ++val;
@@ -254,6 +276,14 @@
 }
 
 FaceStatus&
+FaceStatus::setNInNacks(uint64_t nInNacks)
+{
+  m_wire.reset();
+  m_nInNacks = nInNacks;
+  return *this;
+}
+
+FaceStatus&
 FaceStatus::setNOutInterests(uint64_t nOutInterests)
 {
   m_wire.reset();
@@ -270,6 +300,14 @@
 }
 
 FaceStatus&
+FaceStatus::setNOutNacks(uint64_t nOutNacks)
+{
+  m_wire.reset();
+  m_nOutNacks = nOutNacks;
+  return *this;
+}
+
+FaceStatus&
 FaceStatus::setNInBytes(uint64_t nInBytes)
 {
   m_wire.reset();
@@ -313,6 +351,8 @@
      << "out: " << status.getNOutInterests() << "},\n"
      << "            Data: {in: " << status.getNInDatas() << ", "
      << "out: " << status.getNOutDatas() << "},\n"
+     << "            Nack: {in: " << status.getNInNacks() << ", "
+     << "out: " << status.getNOutNacks() << "},\n"
      << "            bytes: {in: " << status.getNInBytes() << ", "
      << "out: " << status.getNOutBytes() << "} }\n"
      << ")";