nlsrc: demarcate LS and HR routing table in dry run mode
refs: #4452
Change-Id: I522493e473810f90e4e982b35a58310154816cae
diff --git a/src/lsdb.cpp b/src/lsdb.cpp
index 1507a08..43b86bc 100644
--- a/src/lsdb.cpp
+++ b/src/lsdb.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014-2018, The University of Memphis,
+ * Copyright (c) 2014-2019, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
@@ -994,7 +994,7 @@
m_fetchers.erase(it);
});
- fetcher->onError.connect([this, interestName, timeoutCount, deadline, lsaName, seqNo, &fetcher, it]
+ fetcher->onError.connect([this, interestName, timeoutCount, deadline, lsaName, seqNo, it]
(uint32_t errorCode, const std::string& msg) {
onFetchLsaError(errorCode, msg, interestName,
timeoutCount, deadline, lsaName, seqNo);
diff --git a/tools/nlsrc.cpp b/tools/nlsrc.cpp
index 56b1d77..f4e5965 100644
--- a/tools/nlsrc.cpp
+++ b/tools/nlsrc.cpp
@@ -406,9 +406,21 @@
Nlsrc::recordRtable(const nlsr::tlv::RoutingTableStatus& rts)
{
std::ostringstream os;
+
+ ndn::Name firstDes;
for (const auto& rt : rts.getRoutingtable()) {
+ if (firstDes.empty()) {
+ firstDes = rt.getDestination().getName();
+ os << rt << std::endl;
+ continue;
+ }
+
+ if (firstDes == rt.getDestination().getName()) {
+ os << "\n------Dry-run Hyperbolic Routing Tables:------- \n " << std::endl;
+ }
os << rt << std::endl;
}
+
m_rtString = os.str();
}