face: increment link layer byte counters in EthernetFace

refs #1780

Change-Id: I27b9c19ef70b976c83f35bcd569dc7eb7f9802cd
diff --git a/daemon/face/ethernet-face.cpp b/daemon/face/ethernet-face.cpp
index 9e34c66..66957db 100644
--- a/daemon/face/ethernet-face.cpp
+++ b/daemon/face/ethernet-face.cpp
@@ -216,7 +216,8 @@
     }
 
   NFD_LOG_TRACE("[id:" << getId() << ",endpoint:" << m_interfaceName
-                << "] Successfully sent: " << buffer.size() << " bytes");
+                << "] Successfully sent: " << block.size() << " bytes");
+  this->getMutableCounters().getNOutBytes() += block.size();
 }
 
 void
@@ -249,8 +250,6 @@
 
       packet += ethernet::HDR_LEN;
       length -= ethernet::HDR_LEN;
-      NFD_LOG_TRACE("[id:" << getId() << ",endpoint:" << m_interfaceName
-                    << "] Received: " << length << " bytes");
 
       /// \todo Reserve space in front and at the back
       ///       of the underlying buffer
@@ -258,6 +257,10 @@
       bool isOk = Block::fromBuffer(packet, length, element);
       if (isOk)
         {
+          NFD_LOG_TRACE("[id:" << getId() << ",endpoint:" << m_interfaceName
+                        << "] Received: " << element.size() << " bytes");
+          this->getMutableCounters().getNInBytes() += element.size();
+
           if (!decodeAndDispatchInput(element))
             {
               NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
@@ -299,7 +302,7 @@
     }
   else
     {
-      msg = "Receive operation failed, closing face: " + error.category().message(error.value());
+      msg = "Receive operation failed, closing face: " + error.message();
       NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName << "] " << msg);
     }
 
diff --git a/tests/daemon/face/ethernet.cpp b/tests/daemon/face/ethernet.cpp
index 905e2e7..b5c0cc4 100644
--- a/tests/daemon/face/ethernet.cpp
+++ b/tests/daemon/face/ethernet.cpp
@@ -25,10 +25,8 @@
 
 #include "face/ethernet-factory.hpp"
 #include "core/network-interface.hpp"
-#include "tests/test-common.hpp"
 
-#include <ndn-cxx/security/key-chain.hpp>
-#include <pcap/pcap.h>
+#include "tests/test-common.hpp"
 
 namespace nfd {
 namespace tests {