examples: Use the cs of NFD

Change-Id: I6864b52b6b9c44e590b3f6cfcd46754c8c1251c9
Signed-off-by: Xinyu Ma <bitmxy@gmail.com>
diff --git a/examples/ndn-simple-with-content-freshness.cpp b/examples/ndn-simple-with-content-freshness.cpp
index 9cac54d..5f0130d 100644
--- a/examples/ndn-simple-with-content-freshness.cpp
+++ b/examples/ndn-simple-with-content-freshness.cpp
@@ -66,8 +66,8 @@
   // Install Ndn stack on all nodes
   ndn::StackHelper ndnHelper;
   ndnHelper.SetDefaultRoutes(true);
-  ndnHelper.SetOldContentStore("ns3::ndn::cs::Freshness::Lru", "MaxSize",
-                               "2"); // allow just 2 entries to be cached
+  ndnHelper.setCsSize(2); // allow just 2 entries to be cached
+  ndnHelper.setPolicy("nfd::cs::lru");
   ndnHelper.InstallAll();
 
   // Installing applications
@@ -99,7 +99,7 @@
   ndn::AppHelper producerHelper("ns3::ndn::Producer");
   producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
 
-  producerHelper.SetAttribute("Freshness", TimeValue(Seconds(-1.0))); // unlimited freshness
+  producerHelper.SetAttribute("Freshness", TimeValue(Years(100))); // freshness long enough
   producerHelper.SetPrefix("/no-freshness");
   producerHelper.Install(nodes.Get(2)); // last node
 
diff --git a/examples/ndn-simple-with-content-freshness/one-interest-requester.cpp b/examples/ndn-simple-with-content-freshness/one-interest-requester.cpp
index 35cd5fd..0662580 100644
--- a/examples/ndn-simple-with-content-freshness/one-interest-requester.cpp
+++ b/examples/ndn-simple-with-content-freshness/one-interest-requester.cpp
@@ -88,6 +88,7 @@
   Ptr<UniformRandomVariable> rand = CreateObject<UniformRandomVariable>();
   interest->setNonce(rand->GetValue(0, std::numeric_limits<uint32_t>::max()));
   interest->setInterestLifetime(ndn::time::seconds(1));
+  interest->setMustBeFresh(true);
 
   NS_LOG_DEBUG("Sending Interest packet for " << m_name);
 
@@ -103,6 +104,7 @@
 void
 OneInterestRequester::OnData(std::shared_ptr<const ndn::Data> data)
 {
+  App::OnData(data);
   NS_LOG_DEBUG("<< D: " << data->getName());
 }