Compilation fixes after upgrade to NFD 0.6.6 and removal of old-style CS
Change-Id: I5472ae71675d8419d8d6c70990182ef028803087
diff --git a/docs/source/cs.rst b/docs/source/cs.rst
index d3ae9e8..989a595 100644
--- a/docs/source/cs.rst
+++ b/docs/source/cs.rst
@@ -6,7 +6,7 @@
The Contest Store (CS) is implemented as a set of :ndnsim:`CS entries <nfd::cs::EntryImpl>`),
ordered by the full data name including the implicit digest. To manage entries, CS adopts a cache policy interface (:ndnsim:`nfd::cs::Policy`), invoked any time a CS entry is added, removed, updated, or used.
-By default, ndnSIM uses NFD's Content Store with an option to use an old-style ndnSIM-specific content store implementations (see :ref:`old_cs`). The supported cache replacement policies are the following:
+The supported cache replacement policies are the following:
+----------------------------------------------+----------------------------------------------------------+
| **NFD's Content Store Policies** |
@@ -55,8 +55,7 @@
- To effectively disable NFD content store an all nodes
- Minimum allowed value for NFD content store maximum size is 1. If 0 is specified, it will be assumed
- that the old content store implementation should be used.
+ Minimum allowed value for NFD content store maximum size is 1.
.. code-block:: c++
@@ -75,131 +74,9 @@
- flag indicating whether the Data packet is unsolicited
- the timestamp at which the cached Data becomes stale
-.. _old_cs:
-
-Old Content Store Implementations
-+++++++++++++++++++++++++++++++++
-
-We have also ported the old ndnSIM 1.0 content store implementations to the new code base.
-These implementations feature different cache replacement policies, but have very limited
-support for Interest selectors. If your scenario relies on proper selector processing,
-do not use these implementations as the simulation results most likely be incorrect.
-
-To select old content store implementations, use :ndnsim:`StackHelper::SetOldContentStore`:
-
-.. code-block:: c++
-
- ndnHelper.SetOldContentStore("<content store implementation>",
- ["<optional parameter>", "<optional parameter's value>" [, ...]]);
- ...
- ndnHelper.Install (nodes);
-
-Available old content store implementations are listed in the following table:
-
-
-+----------------------------------------------+----------------------------------------------------------+
-| **Simple content stores** |
-+----------------------------------------------+----------------------------------------------------------+
-| ``ns3::ndn::cs::Lru`` | **Least recently used (LRU) (default)** |
-+----------------------------------------------+----------------------------------------------------------+
-| ``ns3::ndn::cs::Fifo`` | First-in-first-Out (FIFO) |
-+----------------------------------------------+----------------------------------------------------------+
-| ``ns3::ndn::cs::Lfu`` | Least frequently used (LFU) |
-+----------------------------------------------+----------------------------------------------------------+
-| ``ns3::ndn::cs::Random`` | Random |
-+----------------------------------------------+----------------------------------------------------------+
-| ``ns3::ndn::cs::Nocache`` | Policy that completely disables caching |
-+----------------------------------------------+----------------------------------------------------------+
-+----------------------------------------------+----------------------------------------------------------+
-| **Content stores with entry lifetime tracking** |
-| |
-| These policies allow evaluation of CS enties lifetime (i.e., how long entries stay in CS) |
-+----------------------------------------------+----------------------------------------------------------+
-| ``ns3::ndn::cs::Stats::Lru`` | Least recently used (LRU) |
-+----------------------------------------------+----------------------------------------------------------+
-| ``ns3::ndn::cs::Stats::Fifo`` | Least frequently used (LFU) |
-+----------------------------------------------+----------------------------------------------------------+
-| ``ns3::ndn::cs::Stats::Lfu`` | Random |
-+----------------------------------------------+----------------------------------------------------------+
-| ``ns3::ndn::cs::Stats::Random`` | Policy that completely disables caching |
-+----------------------------------------------+----------------------------------------------------------+
-+----------------------------------------------+----------------------------------------------------------+
-| **Content stores respecting freshness field of Data packets** |
-| |
-| These policies cache Data packets only for the time indicated by FreshnessPeriod. |
-+----------------------------------------------+----------------------------------------------------------+
-| ``ns3::ndn::cs::Freshness::Lru`` | Least recently used (LRU) |
-+----------------------------------------------+----------------------------------------------------------+
-| ``ns3::ndn::cs::Freshness::Fifo`` | Least frequently used (LFU) |
-+----------------------------------------------+----------------------------------------------------------+
-| ``ns3::ndn::cs::Freshness::Lfu`` | Random |
-+----------------------------------------------+----------------------------------------------------------+
-| ``ns3::ndn::cs::Freshness::Random`` | Policy that completely disables caching |
-+----------------------------------------------+----------------------------------------------------------+
-+----------------------------------------------+----------------------------------------------------------+
-| **Content store realization that probabilistically accepts data packet into CS (placement policy)** |
-+----------------------------------------------+----------------------------------------------------------+
-| ``ns3::ndn::cs::Probability::Lru`` | Least recently used (LRU) |
-+----------------------------------------------+----------------------------------------------------------+
-| ``ns3::ndn::cs::Probability::Fifo`` | Least frequently used (LFU) |
-+----------------------------------------------+----------------------------------------------------------+
-| ``ns3::ndn::cs::Probability::Lfu`` | Random |
-+----------------------------------------------+----------------------------------------------------------+
-| ``ns3::ndn::cs::Probability::Random`` | Policy that completely disables caching |
-+----------------------------------------------+----------------------------------------------------------+
-
-Examples:
-
-
-- Select simple LRU policy on node1, simple FIFO policy on node2, and simple random policy on
- other nodes with maximum CS sizes of 10000 packets:
-
- .. code-block:: c++
-
- ndnHelper.SetOldContentStore("ns3::ndn::cs::Lru", "MaxSize", "10000");
- ndnHelper.Install(node1);
-
- ndnHelper.SetOldContentStore("ns3::ndn::cs::Fifo", "MaxSize", "10000");
- ndnHelper.Install(node2);
-
- ndnHelper.SetOldContentStore("ns3::ndn::cs::Random", "MaxSize", "10000");
- ...
- ndnHelper.Install(otherNodes);
-
-.. note::
-
- If ``MaxSize`` parameter is omitted, then will be used a default value (100).
-
-.. note::
-
- If ``MaxSize`` is set to 0, then no limit on ContentStore will be enforced
-
-- Disable CS on node2
-
- .. code-block:: c++
-
- ndnHelper.SetOldContentStore("ns3::ndn::cs::Nocache");
- ndnHelper.Install(node3);
-
-- Track lifetime of CS entries (must use ``ns3::ndn::cs::*::LifetimeStats`` policy):
-
- .. code-block:: c++
-
- void
- CacheEntryRemoved(std::string context, Ptr<const ndn::cs::Entry> entry, Time lifetime)
- {
- std::cout << entry->GetName() << " " << lifetime.ToDouble(Time::S) << "s" << std::endl;
- }
-
- ...
-
- ndnHelper.SetOldContentStore("ns3::ndn::cs::Stats::Lru", "MaxSize", "10000");
- ...
- ndnHelper.Install(nodes);
-
- // connect to lifetime trace
- Config::Connect("/NodeList/*/$ns3::ndn::cs::Stats::Lru/WillRemoveEntry", MakeCallback(CacheEntryRemoved));
-
+Misc
+~~~~
+
- Get aggregate statistics of CS hit/miss ratio (works with any policy)
The simplest way tro track CS hit/miss statistics is to use :ndnsim:`CsTracer`, in more
diff --git a/docs/source/helpers.rst b/docs/source/helpers.rst
index 4595c0b..5613a6f 100644
--- a/docs/source/helpers.rst
+++ b/docs/source/helpers.rst
@@ -161,22 +161,6 @@
.. note::
- NFD's content store implementation takes full consideration of Interest selectors.
- In contrast to that, the old ndnSIM 1.0 content store implementations have very limited
- support for Interest selectors, but features a number of different replacement policies.
- If your scenario relies on proper selector processing, do not use these implementations as
- the simulation results most likely be incorrect.
-
- To select old content store implementations, use :ndnsim:`SetOldContentStore
- <StackHelper::SetOldContentStore>` StackHelper method:
-
- .. code-block:: c++
-
- ndnHelper.SetOldContentStore("<content store implementation>",
- ["<optional parameter>", "<optional parameter's value>" [, ...]]);
- ...
- ndnHelper.Install (nodes);
-
In simulation scenarios it is possible to select one of :ref:`the existing implementations
of the content store or implement your own <content store>`.
diff --git a/docs/source/metric.rst b/docs/source/metric.rst
index 09d8bc6..716ad93 100644
--- a/docs/source/metric.rst
+++ b/docs/source/metric.rst
@@ -248,8 +248,6 @@
Content store trace helper
--------------------------
-NOTE: This tracer works ONLY when the OldContentStore structure is used!
-
- :ndnsim:`ndn::CsTracer`
With the use of :ndnsim:`ndn::CsTracer` it is possible to obtain statistics of cache hits/cache misses on simulation nodes.
diff --git a/examples/ndn-congestion-alt-topo-plugin.cpp b/examples/ndn-congestion-alt-topo-plugin.cpp
index 8779944..9f3775e 100644
--- a/examples/ndn-congestion-alt-topo-plugin.cpp
+++ b/examples/ndn-congestion-alt-topo-plugin.cpp
@@ -69,8 +69,8 @@
// Install NDN stack on all nodes
ndn::StackHelper ndnHelper;
- ndnHelper.SetOldContentStore("ns3::ndn::cs::Lru", "MaxSize",
- "1"); // ! Attention ! If set to 0, then MaxSize is infinite
+ ndnHelper.setPolicy("nfd::cs::lru");
+ ndnHelper.setCsSize(1);
ndnHelper.InstallAll();
// Set BestRoute strategy
diff --git a/examples/ndn-congestion-topo-plugin.cpp b/examples/ndn-congestion-topo-plugin.cpp
index fa72462..427620b 100644
--- a/examples/ndn-congestion-topo-plugin.cpp
+++ b/examples/ndn-congestion-topo-plugin.cpp
@@ -57,7 +57,8 @@
// Install NDN stack on all nodes
ndn::StackHelper ndnHelper;
- ndnHelper.SetOldContentStore("ns3::ndn::cs::Lru", "MaxSize", "10000");
+ ndnHelper.setPolicy("nfd::cs::lru");
+ ndnHelper.setCsSize(10000);
ndnHelper.InstallAll();
// Choosing forwarding strategy
diff --git a/examples/ndn-load-balancer/random-load-balancer-strategy.cpp b/examples/ndn-load-balancer/random-load-balancer-strategy.cpp
index 4f61162..27756cd 100644
--- a/examples/ndn-load-balancer/random-load-balancer-strategy.cpp
+++ b/examples/ndn-load-balancer/random-load-balancer-strategy.cpp
@@ -1,12 +1,12 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
+/*
+ * Copyright (c) 2014-2019, Regents of the University of California,
+ * Arizona Board of Regents,
+ * Colorado State University,
+ * University Pierre & Marie Curie, Sorbonne University,
+ * Washington University in St. Louis,
+ * Beijing Institute of Technology,
+ * The University of Memphis
*
* This file is part of NFD (Named Data Networking Forwarding Daemon).
* See AUTHORS.md for complete list of NFD authors and contributors.
@@ -29,7 +29,7 @@
#include <ndn-cxx/util/random.hpp>
-#include "core/logger.hpp"
+#include "daemon/common/logger.hpp"
NFD_LOG_INIT("RandomLoadBalancerStrategy");
@@ -61,7 +61,7 @@
}
void
-RandomLoadBalancerStrategy::afterReceiveInterest(const Face& inFace, const Interest& interest,
+RandomLoadBalancerStrategy::afterReceiveInterest(const FaceEndpoint& ingress, const Interest& interest,
const shared_ptr<pit::Entry>& pitEntry)
{
NFD_LOG_TRACE("afterReceiveInterest");
@@ -75,7 +75,7 @@
const fib::NextHopList& nexthops = fibEntry.getNextHops();
// Ensure there is at least 1 Face is available for forwarding
- if (!hasFaceForForwarding(inFace, nexthops, pitEntry)) {
+ if (!hasFaceForForwarding(ingress.face, nexthops, pitEntry)) {
this->rejectPendingInterest(pitEntry);
return;
}
@@ -90,9 +90,9 @@
for (selected = nexthops.begin(); selected != nexthops.end() && currentIndex != randomIndex;
++selected, ++currentIndex) {
}
- } while (!canForwardToNextHop(inFace, pitEntry, *selected));
+ } while (!canForwardToNextHop(ingress.face, pitEntry, *selected));
- this->sendInterest(pitEntry, selected->getFace(), interest);
+ this->sendInterest(pitEntry, FaceEndpoint(selected->getFace(), 0), interest);
}
const Name&
diff --git a/examples/ndn-load-balancer/random-load-balancer-strategy.hpp b/examples/ndn-load-balancer/random-load-balancer-strategy.hpp
index ef11ae8..1a2e2c0 100644
--- a/examples/ndn-load-balancer/random-load-balancer-strategy.hpp
+++ b/examples/ndn-load-balancer/random-load-balancer-strategy.hpp
@@ -38,10 +38,11 @@
public:
RandomLoadBalancerStrategy(Forwarder& forwarder, const Name& name = getStrategyName());
- virtual ~RandomLoadBalancerStrategy() override;
+ virtual
+ ~RandomLoadBalancerStrategy() override;
- virtual void
- afterReceiveInterest(const Face& inFace, const Interest& interest,
+ void
+ afterReceiveInterest(const FaceEndpoint& ingress, const Interest& interest,
const shared_ptr<pit::Entry>& pitEntry) override;
static const Name&
diff --git a/examples/ndn-simple-wifi.cpp b/examples/ndn-simple-wifi.cpp
index 3d6891e..d89db34 100644
--- a/examples/ndn-simple-wifi.cpp
+++ b/examples/ndn-simple-wifi.cpp
@@ -105,7 +105,8 @@
ndn::StackHelper ndnHelper;
// ndnHelper.AddNetDeviceFaceCreateCallback (WifiNetDevice::GetTypeId (), MakeCallback
// (MyNetDeviceFaceCallback));
- ndnHelper.SetOldContentStore("ns3::ndn::cs::Lru", "MaxSize", "1000");
+ ndnHelper.setPolicy("nfd::cs::lru");
+ ndnHelper.setCsSize(1000);
ndnHelper.SetDefaultRoutes(true);
ndnHelper.Install(nodes);
diff --git a/examples/ndn-simple-with-different-sizes-content-store.cpp b/examples/ndn-simple-with-different-sizes-content-store.cpp
deleted file mode 100644
index 355d37d..0000000
--- a/examples/ndn-simple-with-different-sizes-content-store.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2011-2015 Regents of the University of California.
- *
- * This file is part of ndnSIM. See AUTHORS for complete list of ndnSIM authors and
- * contributors.
- *
- * ndnSIM is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * ndnSIM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * ndnSIM, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-// ndn-simple-with-different-sizes-content-store.cc
-
-#include "ns3/core-module.h"
-#include "ns3/network-module.h"
-#include "ns3/point-to-point-module.h"
-#include "ns3/ndnSIM-module.h"
-
-namespace ns3 {
-
-/**
- * This scenario simulates a very simple network topology:
- *
- *
- * +----------+ 1Mbps +--------+ 1Mbps +----------+
- * | consumer | <------------> | router | <------------> | producer |
- * +----------+ 10ms +--------+ 10ms +----------+
- *
- * This scenario demonstrates how to use content store that responds to Freshness parameter set in
- *Datas.
- * That is, if producer set Freshness field to 2 seconds, the corresponding content object will not
- *be cached
- * more than 2 seconds (can be cached for a shorter time, if entry is evicted earlier)
- *
- * NS_LOG=ndn.Consumer ./waf --run ndn-simple-with-different-sizes-content-store
- */
-
-int
-main(int argc, char* argv[])
-{
- // setting default parameters for PointToPoint links and channels
- Config::SetDefault("ns3::PointToPointNetDevice::DataRate", StringValue("1Mbps"));
- Config::SetDefault("ns3::PointToPointChannel::Delay", StringValue("10ms"));
- Config::SetDefault("ns3::QueueBase::MaxSize", StringValue("20p"));
-
- // Read optional command-line parameters (e.g., enable visualizer with ./waf --run=<> --visualize
- CommandLine cmd;
- cmd.Parse(argc, argv);
-
- // Creating nodes
- NodeContainer nodes;
- nodes.Create(3);
-
- // Connecting nodes using two links
- PointToPointHelper p2p;
- p2p.Install(nodes.Get(0), nodes.Get(1));
- p2p.Install(nodes.Get(1), nodes.Get(2));
-
- // Install NDN stack on all nodes
- ndn::StackHelper ndnHelper;
- ndnHelper.SetDefaultRoutes(true);
- ndnHelper.SetOldContentStore(
- "ns3::ndn::cs::Freshness::Lru"); // don't set up max size here, will use default value = 100
- ndnHelper.InstallAll();
-
- // set up max sizes, after NDN stack is installed
- Config::Set("/NodeList/0/$ns3::ndn::ContentStore/MaxSize",
- UintegerValue(
- 1)); // number after nodeList is global ID of the node (= node->GetId ())
- Config::Set("/NodeList/1/$ns3::ndn::ContentStore/MaxSize", UintegerValue(2));
- Config::Set("/NodeList/2/$ns3::ndn::ContentStore/MaxSize", UintegerValue(200));
-
- // Installing applications
-
- // Consumer
- ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");
- // Consumer will request /prefix/0, /prefix/1, ...
- consumerHelper.SetPrefix("/prefix");
- consumerHelper.SetAttribute("Frequency", StringValue("10")); // 10 interests a second
- consumerHelper.Install(nodes.Get(0)); // first node
-
- // Producer
- ndn::AppHelper producerHelper("ns3::ndn::Producer");
- // Producer will reply to all requests starting with /prefix
- producerHelper.SetPrefix("/prefix");
- producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
- producerHelper.Install(nodes.Get(2)); // last node
-
- Simulator::Stop(Seconds(20.0));
-
- Simulator::Run();
- Simulator::Destroy();
-
- return 0;
-}
-
-} // namespace ns3
-
-int
-main(int argc, char* argv[])
-{
- return ns3::main(argc, argv);
-}
diff --git a/examples/ndn-tree-cs-tracers.cpp b/examples/ndn-tree-cs-tracers.cpp
index cee7302..5cac62b 100644
--- a/examples/ndn-tree-cs-tracers.cpp
+++ b/examples/ndn-tree-cs-tracers.cpp
@@ -69,8 +69,8 @@
// Install NDN stack on all nodes
ndn::StackHelper ndnHelper;
- ndnHelper.SetOldContentStore("ns3::ndn::cs::Lru", "MaxSize",
- "100"); // default ContentStore parameters
+ ndnHelper.setPolicy("nfd::cs::lru");
+ ndnHelper.setCsSize(100);
ndnHelper.InstallAll();
// Choosing forwarding strategy
diff --git a/examples/ndn-tree-with-l2tracer.cpp b/examples/ndn-tree-with-l2tracer.cpp
index ab80675..200ae1a 100644
--- a/examples/ndn-tree-with-l2tracer.cpp
+++ b/examples/ndn-tree-with-l2tracer.cpp
@@ -38,7 +38,8 @@
/****************************************************************************/
// Install NDN stack on all nodes
ndn::StackHelper ndnHelper;
- ndnHelper.SetOldContentStore("ns3::ndn::cs::Lru", "MaxSize", "1000");
+ ndnHelper.setPolicy("nfd::cs::lru");
+ ndnHelper.setCsSize(1000);
ndnHelper.InstallAll();
/****************************************************************************/
// Installing global routing interface on all nodes
diff --git a/helper/ndn-stack-helper.cpp b/helper/ndn-stack-helper.cpp
index 09f0d8c..cf60551 100644
--- a/helper/ndn-stack-helper.cpp
+++ b/helper/ndn-stack-helper.cpp
@@ -53,7 +53,6 @@
: m_isForwarderStatusManagerDisabled(false)
, m_isStrategyChoiceManagerDisabled(false)
, m_needSetDefaultRoutes(false)
- , m_maxCsSize(100)
{
setCustomNdnCxxClocks();
@@ -173,7 +172,7 @@
ndn->getConfig().put("ndnSIM.disable_strategy_choice_manager", true);
}
- ndn->getConfig().put("tables.cs_max_packets", (m_maxCsSize == 0) ? 1 : m_maxCsSize);
+ ndn->getConfig().put("tables.cs_max_packets", m_maxCsSize);
ndn->setCsReplacementPolicy(m_csPolicyCreationFunc);
diff --git a/helper/ndn-stack-helper.hpp b/helper/ndn-stack-helper.hpp
index c2ab6f0..f9ff0f8 100644
--- a/helper/ndn-stack-helper.hpp
+++ b/helper/ndn-stack-helper.hpp
@@ -255,7 +255,7 @@
ObjectFactory m_ndnFactory;
bool m_needSetDefaultRoutes;
- size_t m_maxCsSize;
+ size_t m_maxCsSize = 100;
typedef std::function<std::unique_ptr<nfd::cs::Policy>()> PolicyCreationCallback;
PolicyCreationCallback m_csPolicyCreationFunc;
diff --git a/model/ndn-block-header.cpp b/model/ndn-block-header.cpp
index 78d4f5c..fbab70f 100644
--- a/model/ndn-block-header.cpp
+++ b/model/ndn-block-header.cpp
@@ -139,8 +139,13 @@
::ndn::Buffer::const_iterator first, last;
std::tie(first, last) = p.get<lp::FragmentField>(0);
- Block fragmentBlock(&*first, std::distance(first, last));
- decodeAndPrint(fragmentBlock);
+ try {
+ Block fragmentBlock(&*first, std::distance(first, last));
+ decodeAndPrint(fragmentBlock);
+ }
+ catch (const tlv::Error& error) {
+ os << "Non-TLV bytes (size: " << std::distance(first, last) << ")";
+ }
}
os << ")";
break;
diff --git a/tests/other/ndn-test.cpp b/tests/other/ndn-test.cpp
index c720bd6..da86f31 100644
--- a/tests/other/ndn-test.cpp
+++ b/tests/other/ndn-test.cpp
@@ -26,7 +26,6 @@
#include <sys/time.h>
#include "ns3/ndnSIM/utils/mem-usage.hpp"
-#include "ns3/ndnSIM/model/cs/ndn-content-store.hpp"
#include "ns3/ndnSIM/utils/mem-usage.hpp"
namespace ns3 {
@@ -63,7 +62,6 @@
printStats(std::ostream& os, Time nextPrintTime, double beginRealTime);
private:
- std::string m_oldContentStore;
size_t m_csSize;
double m_interestRate;
bool m_shouldEvaluatePit;
@@ -110,16 +108,9 @@
if (pitSize != 0)
pitCount += pitSize;
- if (true != true) {
- Ptr<ndn::ContentStore> cs = (*node)->GetObject<ndn::ContentStore>();
- if (cs != 0)
- csCount += cs->GetSize();
- }
- else {
- auto csSize = (*node)->GetObject<ndn::L3Protocol>()->getForwarder()->getCs().size();
- if (csSize != 0)
- csCount += csSize;
- }
+ auto csSize = (*node)->GetObject<ndn::L3Protocol>()->getForwarder()->getCs().size();
+ if (csSize != 0)
+ csCount += csSize;
}
os << "pit:" << pitCount << "\t";
@@ -163,9 +154,6 @@
// Read optional command-line parameters (e.g., enable visualizer with ./waf --run=<> --visualize
CommandLine cmd;
- cmd.AddValue("old-cs", "Old content store to use "
- "(e.g., ns3::ndn::cs::Lru, ns3::ndn::cs::Lfu, ...)",
- m_oldContentStore);
cmd.AddValue("cs-size", "Maximum number of cached packets per node", m_csSize);
cmd.AddValue("rate", "Interest rate", m_interestRate);
cmd.AddValue("pit", "Perform PIT evaluation if this parameter is true",
@@ -189,10 +177,6 @@
ndn::StackHelper ndnHelper;
ndnHelper.setCsSize(m_csSize);
- if (!m_oldContentStore.empty()) {
- ndnHelper.SetOldContentStore(m_oldContentStore, "MaxSize", std::to_string(m_csSize));
- }
-
ndnHelper.InstallAll();
ndn::FibHelper::AddRoute(nodes.Get(0), "/", nodes.Get(1), 10);
diff --git a/tests/unit-tests/helper/ndn-link-control-helper.t.cpp b/tests/unit-tests/helper/ndn-link-control-helper.t.cpp
index 1e59f14..3d79ffa 100644
--- a/tests/unit-tests/helper/ndn-link-control-helper.t.cpp
+++ b/tests/unit-tests/helper/ndn-link-control-helper.t.cpp
@@ -18,7 +18,7 @@
**/
#include "helper/ndn-link-control-helper.hpp"
-#include "NFD/core/scheduler.hpp"
+#include "daemon/common/global.hpp"
#include "../tests-common.hpp"
@@ -54,16 +54,16 @@
Simulator::Schedule(Seconds(5.1), ndn::LinkControlHelper::FailLink, getNode("1"), getNode("2"));
Simulator::Schedule(Seconds(10.1), ndn::LinkControlHelper::UpLink, getNode("1"), getNode("2"));
- nfd::scheduler::schedule(time::milliseconds(5200), [&] {
+ nfd::getScheduler().schedule(time::milliseconds(5200), [&] {
BOOST_CHECK_EQUAL(getFace("2", "1")->getCounters().nInInterests, 6);
BOOST_CHECK_EQUAL(getFace("1", "2")->getCounters().nInData, 6);
});
- nfd::scheduler::schedule(time::milliseconds(10200), [&] {
+ nfd::getScheduler().schedule(time::milliseconds(10200), [&] {
BOOST_CHECK_EQUAL(getFace("2", "1")->getCounters().nInInterests, 6);
BOOST_CHECK_EQUAL(getFace("1", "2")->getCounters().nInData, 6);
});
- nfd::scheduler::schedule(time::milliseconds(15100), [&] {
+ nfd::getScheduler().schedule(time::milliseconds(15100), [&] {
BOOST_CHECK_EQUAL(getFace("2", "1")->getCounters().nInInterests, 11);
BOOST_CHECK_EQUAL(getFace("1", "2")->getCounters().nInData, 11);
});
@@ -119,27 +119,27 @@
"0s", "100s"}
});
- nfd::scheduler::schedule(time::milliseconds(10100), [&] {
+ nfd::getScheduler().schedule(time::milliseconds(10100), [&] {
LinkControlHelper::FailLink(getNode("1"), getNode("2"));
});
// just before link failure
- nfd::scheduler::schedule(time::milliseconds(10050), [&] {
+ nfd::getScheduler().schedule(time::milliseconds(10050), [&] {
BOOST_CHECK_EQUAL(getFace("2", "1")->getCounters().nInInterests, 11);
BOOST_CHECK_EQUAL(getFace("3", "1")->getCounters().nInInterests, 11);
});
// just before link recovery
- nfd::scheduler::schedule(time::milliseconds(20050), [&] {
+ nfd::getScheduler().schedule(time::milliseconds(20050), [&] {
BOOST_CHECK_EQUAL(getFace("2", "1")->getCounters().nInInterests, 11);
BOOST_CHECK_EQUAL(getFace("3", "1")->getCounters().nInInterests, 21);
});
- nfd::scheduler::schedule(time::milliseconds(20100), [&] {
+ nfd::getScheduler().schedule(time::milliseconds(20100), [&] {
LinkControlHelper::UpLink(getNode("1"), getNode("2"));
});
- nfd::scheduler::schedule(time::milliseconds(30050), [&] {
+ nfd::getScheduler().schedule(time::milliseconds(30050), [&] {
BOOST_CHECK_EQUAL(getFace("2", "1")->getCounters().nInInterests, 21);
BOOST_CHECK_EQUAL(getFace("3", "1")->getCounters().nInInterests, 31);
});
diff --git a/tests/unit-tests/helper/ndn-strategy-choice-helper.t.cpp b/tests/unit-tests/helper/ndn-strategy-choice-helper.t.cpp
index cbcec2e..f1a8a14 100644
--- a/tests/unit-tests/helper/ndn-strategy-choice-helper.t.cpp
+++ b/tests/unit-tests/helper/ndn-strategy-choice-helper.t.cpp
@@ -149,9 +149,9 @@
this->setInstanceName(name);
}
- virtual void
- afterReceiveInterest(const Face& inFace, const Interest& interest,
- const shared_ptr<nfd::pit::Entry>& pitEntry)
+ void
+ afterReceiveInterest(const nfd::FaceEndpoint& ingress, const Interest& interest,
+ const shared_ptr<nfd::pit::Entry>& pitEntry) override
{
// this strategy doesn't forward interests
}
diff --git a/tests/unit-tests/model/ndn-old-content-store.t.cpp b/tests/unit-tests/model/ndn-old-content-store.t.cpp
deleted file mode 100644
index c2e9c43..0000000
--- a/tests/unit-tests/model/ndn-old-content-store.t.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2011-2016 Regents of the University of California.
- *
- * This file is part of ndnSIM. See AUTHORS for complete list of ndnSIM authors and
- * contributors.
- *
- * ndnSIM is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * ndnSIM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * ndnSIM, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-
-#include "../tests-common.hpp"
-
-namespace ns3 {
-namespace ndn {
-
-BOOST_FIXTURE_TEST_SUITE(ModelNdnOldContentStore, ScenarioHelperWithCleanupFixture)
-
-BOOST_AUTO_TEST_CASE(RandomPolicy)
-{
- Config::SetDefault("ns3::PointToPointNetDevice::DataRate", StringValue("10Mbps"));
- Config::SetDefault("ns3::PointToPointChannel::Delay", StringValue("10ms"));
- Config::SetDefault("ns3::QueueBase::MaxSize", StringValue("20p"));
-
- getStackHelper().SetOldContentStore("ns3::ndn::cs::Random", "MaxSize", "10");
-
- createTopology({
- {"1", "2"},
- });
-
- addRoutes({
- {"1", "2", "/prefix", 1},
- });
-
- addApps({
- {"1", "ns3::ndn::ConsumerCbr",
- {{"Prefix", "/prefix"}, {"Frequency", "10"}},
- "0s", "9.99s"},
- {"2", "ns3::ndn::Producer",
- {{"Prefix", "/prefix"}, {"PayloadSize", "1024"}},
- "0s", "100s"}
- });
-
- Simulator::Stop(Seconds(20.001));
- Simulator::Run();
-
- std::map<std::string, std::vector<Name>> entries;
- for (const std::string& node : {"1", "2"}) {
- auto cs = getNode(node)->GetObject<ContentStore>();
- auto& nodeCs = entries[node];
- for (auto it = cs->Begin(); it != cs->End(); it = cs->Next(it)) {
- nodeCs.push_back(it->GetName());
- }
- }
-
- BOOST_CHECK_EQUAL(entries["1"].size(), 10);
- BOOST_CHECK_EQUAL(entries["2"].size(), 10);
- BOOST_CHECK(entries["1"] != entries["2"]); // this test has a small chance of failing
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace ndn
-} // namespace ns3
diff --git a/tests/unit-tests/ndn-cxx/face.t.cpp b/tests/unit-tests/ndn-cxx/face.t.cpp
index 6eb39c2..32a1c1c 100644
--- a/tests/unit-tests/ndn-cxx/face.t.cpp
+++ b/tests/unit-tests/ndn-cxx/face.t.cpp
@@ -220,9 +220,9 @@
m_face.expressInterest(Interest(Name(name).appendSegment(seqNo)).setCanBePrefix(true), std::bind([=] (const Data& data) {
onData(data.getName());
- m_event = m_scheduler.scheduleEvent(time::seconds(1),
- std::bind(&MultipleInterest::expressNextInterest, this,
- name, seqNo + 1, onData, onTimeout, onNack));
+ m_event = m_scheduler.schedule(time::seconds(1),
+ std::bind(&MultipleInterest::expressNextInterest, this,
+ name, seqNo + 1, onData, onTimeout, onNack));
}, _2),
std::bind(onNack),
std::bind(onTimeout));