fw: Add ASF strategy parameters n-silent-timeouts & probing-interval
refs: #4193
Change-Id: I9572425a2fdcbf67b9886c2a5b6b50a10a0856e2
diff --git a/daemon/fw/asf-probing-module.cpp b/daemon/fw/asf-probing-module.cpp
index f29d0e7..24b4577 100644
--- a/daemon/fw/asf-probing-module.cpp
+++ b/daemon/fw/asf-probing-module.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,7 +31,8 @@
namespace fw {
namespace asf {
-constexpr time::seconds ProbingModule::DEFAULT_PROBING_INTERVAL;
+constexpr time::milliseconds ProbingModule::DEFAULT_PROBING_INTERVAL;
+constexpr time::milliseconds ProbingModule::MIN_PROBING_INTERVAL;
static_assert(ProbingModule::DEFAULT_PROBING_INTERVAL < AsfMeasurements::MEASUREMENTS_LIFETIME,
"ProbingModule::DEFAULT_PROBING_INTERVAL must be less than AsfMeasurements::MEASUREMENTS_LIFETIME");
@@ -91,7 +92,7 @@
continue;
}
- FaceInfo* info = m_measurements.getFaceInfo(fibEntry, interest, hopFace);
+ FaceInfo* info = m_measurements.getFaceInfo(fibEntry, interest, hopFace.getId());
// If no RTT has been recorded, probe this face
if (info == nullptr || !info->hasSrttMeasurement()) {
@@ -189,6 +190,19 @@
return dist(getGlobalRng());
}
+void
+ProbingModule::setProbingInterval(size_t probingInterval)
+{
+ if (time::milliseconds(probingInterval) >= MIN_PROBING_INTERVAL) {
+ m_probingInterval = time::milliseconds(probingInterval);
+ }
+ else {
+ BOOST_THROW_EXCEPTION(std::invalid_argument("Probing interval should be >= "
+ + to_string(MIN_PROBING_INTERVAL.count())
+ + " milliseconds"));
+ }
+}
+
} // namespace asf
} // namespace fw
} // namespace nfd