fw: Add default HopLimit to Interest when missing
Refs: #5171
Change-Id: I5973811b5ca7c7cf5ff344872afa51b253b9cae8
diff --git a/daemon/fw/forwarder.hpp b/daemon/fw/forwarder.hpp
index 6a245de..47c6e03 100644
--- a/daemon/fw/forwarder.hpp
+++ b/daemon/fw/forwarder.hpp
@@ -29,6 +29,7 @@
#include "face-table.hpp"
#include "forwarder-counters.hpp"
#include "unsolicited-data-policy.hpp"
+#include "common/config-file.hpp"
#include "face/face-endpoint.hpp"
#include "table/fib.hpp"
#include "table/pit.hpp"
@@ -125,6 +126,11 @@
return m_networkRegionTable;
}
+ /** \brief register handler for forwarder section of NFD configuration file
+ */
+ void
+ setConfigFile(ConfigFile& configFile);
+
NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE: // pipelines
/** \brief incoming Interest pipeline
* \param interest the incoming Interest, must be well-formed and created with make_shared
@@ -213,6 +219,22 @@
void
insertDeadNonceList(pit::Entry& pitEntry, const Face* upstream);
+ void
+ processConfig(const ConfigSection& configSection, bool isDryRun,
+ const std::string& filename);
+
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+ /**
+ * \brief Configuration options from "forwarder" section
+ */
+ struct Config
+ {
+ /// Initial value of HopLimit that should be added to Interests that don't have one.
+ /// A value of zero disables the feature.
+ uint8_t defaultHopLimit = 0;
+ };
+ Config m_config;
+
private:
ForwarderCounters m_counters;