fw: use per-upstream suppression in ASF strategy
Refs: #5140
Change-Id: I49b27ce6b55d01724d0eafa792785d081c6009f7
diff --git a/daemon/fw/asf-measurements.cpp b/daemon/fw/asf-measurements.cpp
index 0e7ab48..2eb81dd 100644
--- a/daemon/fw/asf-measurements.cpp
+++ b/daemon/fw/asf-measurements.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -92,22 +92,21 @@
}
FaceInfo*
-AsfMeasurements::getFaceInfo(const fib::Entry& fibEntry, const Interest& interest, FaceId faceId)
+AsfMeasurements::getFaceInfo(const fib::Entry& fibEntry, const Name& interestName, FaceId faceId)
{
- return getOrCreateNamespaceInfo(fibEntry, interest).getFaceInfo(faceId);
+ return getOrCreateNamespaceInfo(fibEntry, interestName).getFaceInfo(faceId);
}
FaceInfo&
-AsfMeasurements::getOrCreateFaceInfo(const fib::Entry& fibEntry, const Interest& interest,
- FaceId faceId)
+AsfMeasurements::getOrCreateFaceInfo(const fib::Entry& fibEntry, const Name& interestName, FaceId faceId)
{
- return getOrCreateNamespaceInfo(fibEntry, interest).getOrCreateFaceInfo(faceId);
+ return getOrCreateNamespaceInfo(fibEntry, interestName).getOrCreateFaceInfo(faceId);
}
NamespaceInfo*
AsfMeasurements::getNamespaceInfo(const Name& prefix)
{
- measurements::Entry* me = m_measurements.findLongestPrefixMatch(prefix);
+ auto* me = m_measurements.findLongestPrefixMatch(prefix);
if (me == nullptr) {
return nullptr;
}
@@ -121,15 +120,16 @@
}
NamespaceInfo&
-AsfMeasurements::getOrCreateNamespaceInfo(const fib::Entry& fibEntry, const Interest& interest)
+AsfMeasurements::getOrCreateNamespaceInfo(const fib::Entry& fibEntry, const Name& prefix)
{
- measurements::Entry* me = m_measurements.get(fibEntry);
+ auto* me = m_measurements.get(fibEntry);
// If the FIB entry is not under the strategy's namespace, find a part of the prefix
// that falls under the strategy's namespace
for (size_t prefixLen = fibEntry.getPrefix().size() + 1;
- me == nullptr && prefixLen <= interest.getName().size(); ++prefixLen) {
- me = m_measurements.get(interest.getName().getPrefix(prefixLen));
+ me == nullptr && prefixLen <= prefix.size();
+ ++prefixLen) {
+ me = m_measurements.get(prefix.getPrefix(prefixLen));
}
// Either the FIB entry or the Interest's name must be under this strategy's namespace