face: LpFace counters
FaceCounters for LpFace consist of LinkService::Counters and
Transport::Counters. Old FaceCounters class from 2014 face architecture is
renamed as OldFaceCounters, and can be wrapped with new FaceCounters class.
OldFaceCounters is only used in old Face subclasses.
This commit also updates existing face test suites to use new FaceCounters,
updates ForwarderStatus so that it does not rely on FaceCounters,
and moves the logic of copying face properties and counters into management
structs from face system into FaceManager.
refs #3177
Change-Id: I587e8a32fa72bac3af9d750b2c88342740aa08d6
diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
index 20428c5..b2dc6bb 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -105,7 +105,7 @@
NFD_LOG_DEBUG("onIncomingInterest face=" << inFace.getId() <<
" interest=" << interest.getName());
const_cast<Interest&>(interest).setIncomingFaceId(inFace.getId());
- ++m_counters.getNInInterests();
+ ++m_counters.nInInterests;
// /localhost scope control
bool isViolatingLocalhost = !inFace.isLocal() &&
@@ -317,7 +317,7 @@
// send Interest
outFace.sendInterest(*interest);
- ++m_counters.getNOutInterests();
+ ++m_counters.nOutInterests;
}
void
@@ -371,7 +371,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.nInData;
// /localhost scope control
bool isViolatingLocalhost = !inFace.isLocal() &&
@@ -473,12 +473,14 @@
// send Data
outFace.sendData(data);
- ++m_counters.getNOutDatas();
+ ++m_counters.nOutData;
}
void
Forwarder::onIncomingNack(Face& inFace, const lp::Nack& nack)
{
+ ++m_counters.nInNacks;
+
// if multi-access face, drop
if (inFace.isMultiAccess()) {
NFD_LOG_DEBUG("onIncomingNack face=" << inFace.getId() <<
@@ -572,6 +574,7 @@
// send Nack on face
const_cast<Face&>(outFace).sendNack(nackPkt);
+ ++m_counters.nOutNacks;
}
static inline bool