tools: display Nack counters in nfd-status

refs #3569

Change-Id: I59e76d421502417a13efbf088284d278da07bae4
diff --git a/docs/manpages/nfd-status.rst b/docs/manpages/nfd-status.rst
index 4fabe2e..f22f326 100644
--- a/docs/manpages/nfd-status.rst
+++ b/docs/manpages/nfd-status.rst
@@ -55,45 +55,49 @@
     $ nfd-status
 
     General NFD status:
-                     nfdId=/chengyu/KEY/ksk-1405136377018/ID-CERT
-                   version=2000
-                 startTime=20140725T232341.374000
-               currentTime=20140725T233240
-                    uptime=538 seconds
-          nNameTreeEntries=10
-               nFibEntries=3
+                     nfdId=/tmp-identity/%80%80%BF%9A/KEY/ksk-1457726482439/ID-CERT
+                   version=0.4.1-10-g4f1afac
+                 startTime=20160426T224102.791000
+               currentTime=20160426T224108.813000
+                    uptime=6 seconds
+          nNameTreeEntries=11
+               nFibEntries=2
                nPitEntries=2
       nMeasurementsEntries=0
-                nCsEntries=56
-              nInInterests=55
-             nOutInterests=54
-                  nInDatas=56
-                 nOutDatas=47
+                nCsEntries=2
+              nInInterests=5
+             nOutInterests=5
+                  nInDatas=7
+                 nOutDatas=4
+                  nInNacks=0
+                 nOutNacks=0
     Channels:
-      ws://[::]:9696
-      unix:///private/var/run/nfd.sock
-      udp6://[::]:6363
-      udp4://0.0.0.0:6363
-      tcp6://[::]:6363
       tcp4://0.0.0.0:6363
+      tcp6://[::]:6363
+      udp4://0.0.0.0:6363
+      udp6://[::]:6363
+      unix:///private/var/run/nfd.sock
+      ws://[::]:9696
     Faces:
-      faceid=1 remote=internal:// local=internal:// counters={in={0i 52d 0B} out={51i 0d 0B}} local
-      faceid=254 remote=contentstore:// local=contentstore:// counters={in={0i 0d 0B} out={0i 0d 0B}} local
-      faceid=255 remote=null:// local=null:// counters={in={0i 0d 0B} out={0i 0d 0B}} local
-      faceid=256 remote=udp4://224.0.23.170:56363 local=udp4://129.82.138.211:56363 counters={in={0i 0d 0B} out={0i 0d 0B}}
-      faceid=257 remote=udp4://224.0.23.170:56363 local=udp4://127.0.0.1:56363 counters={in={0i 0d 0B} out={0i 0d 0B}}
-      faceid=258 remote=ether://[01:00:5e:00:17:aa] local=dev://bridge0 counters={in={0i 0d 0B} out={0i 0d 0B}}
-      faceid=259 remote=ether://[01:00:5e:00:17:aa] local=dev://en0 counters={in={0i 0d 0B} out={0i 0d 0B}}
-      faceid=260 remote=ether://[01:00:5e:00:17:aa] local=dev://en1 counters={in={0i 0d 0B} out={0i 0d 0B}}
-      faceid=261 remote=ether://[01:00:5e:00:17:aa] local=dev://en2 counters={in={0i 0d 0B} out={0i 0d 0B}}
-      faceid=262 remote=fd://30 local=unix:///private/var/run/nfd.sock counters={in={24i 6d 4880B} out={6i 16d 8417B}} local on-demand
-      faceid=268 remote=fd://31 local=unix:///private/var/run/nfd.sock counters={in={1i 0d 410B} out={0i 1d 764B}} local on-demand
-      faceid=269 remote=fd://32 local=unix:///private/var/run/nfd.sock counters={in={3i 0d 137B} out={0i 2d 925B}} local on-demand
+      faceid=1 remote=internal:// local=internal:// counters={in={0i 9d 0n 4830B} out={8i 0d 0n 1232B}} local permanent point-to-point
+      faceid=254 remote=contentstore:// local=contentstore:// counters={in={0i 0d 0n 0B} out={0i 0d 0n 0B}} local permanent point-to-point
+      faceid=255 remote=null:// local=null:// counters={in={0i 0d 0n 0B} out={0i 0d 0n 0B}} local permanent point-to-point
+      faceid=256 remote=udp4://224.0.23.170:56363 local=udp4://10.134.195.206:56363 counters={in={0i 0d 0n 0B} out={0i 0d 0n 0B}} non-local permanent multi-access
+      faceid=257 remote=udp4://224.0.23.170:56363 local=udp4://127.0.0.1:56363 counters={in={0i 0d 0n 0B} out={0i 0d 0n 0B}} non-local permanent multi-access
+      faceid=258 remote=ether://[01:00:5e:00:17:aa] local=dev://awdl0 counters={in={0i 0d 0n 0B} out={0i 0d 0n 0B}} non-local permanent multi-access
+      faceid=259 remote=ether://[01:00:5e:00:17:aa] local=dev://en2 counters={in={0i 0d 0n 0B} out={0i 0d 0n 0B}} non-local permanent multi-access
+      faceid=260 remote=ether://[01:00:5e:00:17:aa] local=dev://en1 counters={in={0i 0d 0n 0B} out={0i 0d 0n 0B}} non-local permanent multi-access
+      faceid=261 remote=ether://[01:00:5e:00:17:aa] local=dev://en0 counters={in={0i 0d 0n 0B} out={0i 0d 0n 0B}} non-local permanent multi-access
+      faceid=262 remote=ether://[01:00:5e:00:17:aa] local=dev://bridge0 counters={in={0i 0d 0n 0B} out={0i 0d 0n 0B}} non-local permanent multi-access
+      faceid=263 remote=fd://36 local=unix:///private/var/run/nfd.sock counters={in={5i 0d 0n 998B} out={0i 4d 0n 2511B}} local on-demand point-to-point
+      faceid=264 remote=fd://37 local=unix:///private/var/run/nfd.sock counters={in={3i 0d 0n 146B} out={0i 2d 0n 992B}} local on-demand point-to-point
     FIB:
+      /localhost/nfd/rib nexthops={faceid=263 (cost=0)}
       /localhost/nfd nexthops={faceid=1 (cost=0)}
-      /example/testApp nexthops={faceid=268 (cost=0)}
-      /localhost/nfd/rib nexthops={faceid=262 (cost=0)}
     RIB:
-      /example/testApp route={faceid=268 (origin=0 cost=0 flags=1)}
+      /localhost/nfd/rib route={faceid=263 (origin=0 cost=0 ChildInherit)}
     Strategy choices:
-      / strategy=/localhost/nfd/strategy/best-route
+      / strategy=/localhost/nfd/strategy/best-route/%FD%04
+      /localhost strategy=/localhost/nfd/strategy/multicast/%FD%01
+      /ndn/broadcast strategy=/localhost/nfd/strategy/multicast/%FD%01
+      /localhost/nfd strategy=/localhost/nfd/strategy/best-route/%FD%04
diff --git a/tools/nfd-status-http-server-files/nfd-status.xsl b/tools/nfd-status-http-server-files/nfd-status.xsl
index fcf128b..f8ba4c8 100644
--- a/tools/nfd-status-http-server-files/nfd-status.xsl
+++ b/tools/nfd-status-http-server-files/nfd-status.xsl
@@ -87,6 +87,8 @@
         <th>Out Interests</th>
         <th>In Data</th>
         <th>Out Data</th>
+        <th>In Nacks</th>
+        <th>Out Nacks</th>
       </tr>
     </thead>
     <tbody>
@@ -105,6 +107,8 @@
         <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nInterests"/></td>
         <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nDatas"/></td>
         <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nDatas"/></td>
+        <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nNacks"/></td>
+        <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nNacks"/></td>
       </tr>
     </tbody>
   </table>
@@ -150,9 +154,11 @@
         <th>Expires in</th>
         <th>In Interests</th>
         <th>In Data</th>
+        <th>In Nacks</th>
         <th>In Bytes</th>
         <th>Out Interests</th>
         <th>Out Data</th>
+        <th>Out Nacks</th>
         <th>Out Bytes</th>
       </tr>
     </thead>
@@ -185,9 +191,11 @@
         </td>
         <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nInterests"/></td>
         <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nDatas"/></td>
+        <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nNacks"/></td>
         <td><xsl:value-of select="nfd:byteCounters/nfd:incomingBytes"/></td>
         <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nInterests"/></td>
         <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nDatas"/></td>
+        <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nNacks"/></td>
         <td><xsl:value-of select="nfd:byteCounters/nfd:outgoingBytes"/></td>
       </tr>
       </xsl:for-each>
diff --git a/tools/nfd-status.cpp b/tools/nfd-status.cpp
index a904827..21c62a1 100644
--- a/tools/nfd-status.cpp
+++ b/tools/nfd-status.cpp
@@ -243,12 +243,16 @@
                 << "</nInterests>";
       std::cout << "<nDatas>"               << status.getNInDatas()
                 << "</nDatas>";
+      std::cout << "<nNacks>"               << status.getNInNacks()
+                << "</nNacks>";
       std::cout << "</incomingPackets>";
       std::cout << "<outgoingPackets>";
       std::cout << "<nInterests>"           << status.getNOutInterests()
                 << "</nInterests>";
       std::cout << "<nDatas>"               << status.getNOutDatas()
                 << "</nDatas>";
+      std::cout << "<nNacks>"               << status.getNOutNacks()
+                << "</nNacks>";
       std::cout << "</outgoingPackets>";
       std::cout << "</packetCounters>";
       std::cout << "</generalStatus>";
@@ -276,6 +280,8 @@
       std::cout << "         nOutInterests=" << status.getNOutInterests()        << std::endl;
       std::cout << "              nInDatas=" << status.getNInDatas()             << std::endl;
       std::cout << "             nOutDatas=" << status.getNOutDatas()            << std::endl;
+      std::cout << "              nInNacks=" << status.getNInNacks()             << std::endl;
+      std::cout << "             nOutNacks=" << status.getNOutNacks()            << std::endl;
     }
 
     runNextStep();
@@ -420,12 +426,16 @@
                   << "</nInterests>";
         std::cout << "<nDatas>"           << faceStatus.getNInDatas()
                   << "</nDatas>";
+        std::cout << "<nNacks>"           << faceStatus.getNInNacks()
+                  << "</nNacks>";
         std::cout << "</incomingPackets>";
         std::cout << "<outgoingPackets>";
         std::cout << "<nInterests>"       << faceStatus.getNOutInterests()
                   << "</nInterests>";
         std::cout << "<nDatas>"           << faceStatus.getNOutDatas()
                   << "</nDatas>";
+        std::cout << "<nNacks>"           << faceStatus.getNOutNacks()
+                  << "</nNacks>";
         std::cout << "</outgoingPackets>";
         std::cout << "</packetCounters>";
 
@@ -468,9 +478,11 @@
         std::cout << " counters={"
                   << "in={" << faceStatus.getNInInterests() << "i "
                   << faceStatus.getNInDatas() << "d "
+                  << faceStatus.getNInNacks() << "n "
                   << faceStatus.getNInBytes() << "B}"
                   << " out={" << faceStatus.getNOutInterests() << "i "
                   << faceStatus.getNOutDatas() << "d "
+                  << faceStatus.getNOutNacks() << "n "
                   << faceStatus.getNOutBytes() << "B}"
                   << "}";
         std::cout << " " << faceStatus.getFaceScope()