face: link layer byte counts in FaceCounters
This commit declares the counters, but does not increment the new counters.
refs #1729
Change-Id: I9cd136fc65955192a92d567629a9aba2df8090f3
diff --git a/daemon/fw/forwarder-counter.hpp b/daemon/fw/forwarder-counter.hpp
deleted file mode 100644
index be74928..0000000
--- a/daemon/fw/forwarder-counter.hpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#ifndef NFD_DAEMON_FW_FORWARDER_COUNTER_HPP
-#define NFD_DAEMON_FW_FORWARDER_COUNTER_HPP
-
-#include "face/face-counter.hpp"
-
-namespace nfd {
-
-/** \class ForwarderCounter
- * \brief represents a counter on forwarder
- *
- * \todo This class should be noncopyable
- */
-typedef uint64_t ForwarderCounter;
-
-
-/** \brief contains counters on forwarder
- */
-class ForwarderCounters : public FaceCounters
-{
-};
-
-
-} // namespace nfd
-
-#endif // NFD_DAEMON_FW_FORWARDER_COUNTER_HPP
diff --git a/daemon/fw/forwarder-counters.hpp b/daemon/fw/forwarder-counters.hpp
new file mode 100644
index 0000000..7af679a
--- /dev/null
+++ b/daemon/fw/forwarder-counters.hpp
@@ -0,0 +1,42 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014, Regents of the University of California,
+ * Arizona Board of Regents,
+ * Colorado State University,
+ * University Pierre & Marie Curie, Sorbonne University,
+ * Washington University in St. Louis,
+ * Beijing Institute of Technology,
+ * The University of Memphis
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef NFD_DAEMON_FW_FORWARDER_COUNTERS_HPP
+#define NFD_DAEMON_FW_FORWARDER_COUNTERS_HPP
+
+#include "face/face-counters.hpp"
+
+namespace nfd {
+
+/** \brief contains counters on forwarder
+ */
+class ForwarderCounters : public NetworkLayerCounters
+{
+};
+
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_FW_FORWARDER_COUNTERS_HPP
diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
index 0e2f0d2..a57a756 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -59,7 +59,7 @@
NFD_LOG_DEBUG("onIncomingInterest face=" << inFace.getId() <<
" interest=" << interest.getName());
const_cast<Interest&>(interest).setIncomingFaceId(inFace.getId());
- m_counters.getNInInterests() ++;
+ ++m_counters.getNInInterests();
// /localhost scope control
bool isViolatingLocalhost = !inFace.isLocal() &&
@@ -187,7 +187,7 @@
// send Interest
outFace.sendInterest(*interest);
- m_counters.getNOutInterests() ++;
+ ++m_counters.getNOutInterests();
}
void
@@ -227,7 +227,7 @@
// receive Data
NFD_LOG_DEBUG("onIncomingData face=" << inFace.getId() << " data=" << data.getName());
const_cast<Data&>(data).setIncomingFaceId(inFace.getId());
- m_counters.getNInDatas() ++;
+ ++m_counters.getNInDatas();
// /localhost scope control
bool isViolatingLocalhost = !inFace.isLocal() &&
@@ -331,7 +331,7 @@
// send Data
outFace.sendData(data);
- m_counters.getNOutDatas() ++;
+ ++m_counters.getNOutDatas();
}
static inline bool
diff --git a/daemon/fw/forwarder.hpp b/daemon/fw/forwarder.hpp
index acb0451..8c5ed79 100644
--- a/daemon/fw/forwarder.hpp
+++ b/daemon/fw/forwarder.hpp
@@ -27,7 +27,7 @@
#include "common.hpp"
#include "core/scheduler.hpp"
-#include "forwarder-counter.hpp"
+#include "forwarder-counters.hpp"
#include "face-table.hpp"
#include "table/fib.hpp"
#include "table/pit.hpp"