apps+examples: Adjust Face creation and Face operations for NFD 0.4+ model

Change-Id: Ib0fb0f49a550c77a9bd94729cdf6fb3b11d1e8ab
Refs: #3560
diff --git a/apps/ndn-consumer-cbr.cpp b/apps/ndn-consumer-cbr.cpp
index fc5be6d..c5fbf88 100644
--- a/apps/ndn-consumer-cbr.cpp
+++ b/apps/ndn-consumer-cbr.cpp
@@ -29,8 +29,6 @@
 #include "ns3/integer.h"
 #include "ns3/double.h"
 
-#include "model/ndn-app-face.hpp"
-
 NS_LOG_COMPONENT_DEFINE("ndn.ConsumerCbr");
 
 namespace ns3 {
diff --git a/apps/ndn-consumer-zipf-mandelbrot.cpp b/apps/ndn-consumer-zipf-mandelbrot.cpp
index ac83022..c6358c0 100644
--- a/apps/ndn-consumer-zipf-mandelbrot.cpp
+++ b/apps/ndn-consumer-zipf-mandelbrot.cpp
@@ -21,7 +21,6 @@
 
 #include "ndn-consumer-zipf-mandelbrot.hpp"
 
-#include "model/ndn-app-face.hpp"
 #include "utils/ndn-fw-hop-count-tag.hpp"
 
 #include <math.h>
@@ -193,7 +192,7 @@
   m_rtt->SentSeq(SequenceNumber32(seq), 1);
 
   m_transmittedInterests(interest, this, m_face);
-  m_face->onReceiveInterest(*interest);
+  m_appLink->onReceiveInterest(*interest);
 
   ConsumerZipfMandelbrot::ScheduleNextPacket();
 }
diff --git a/apps/ndn-consumer.cpp b/apps/ndn-consumer.cpp
index 4d39bea..3a1ec45 100644
--- a/apps/ndn-consumer.cpp
+++ b/apps/ndn-consumer.cpp
@@ -30,7 +30,6 @@
 #include "ns3/double.h"
 
 #include "utils/ndn-ns3-packet-tag.hpp"
-#include "model/ndn-app-face.hpp"
 #include "utils/ndn-rtt-mean-deviation.hpp"
 
 #include <boost/lexical_cast.hpp>
@@ -198,7 +197,7 @@
   WillSendOutInterest(seq);
 
   m_transmittedInterests(interest, this, m_face);
-  m_face->onReceiveInterest(*interest);
+  m_appLink->onReceiveInterest(*interest);
 
   ScheduleNextPacket();
 }
diff --git a/apps/ndn-producer.cpp b/apps/ndn-producer.cpp
index a1a63ab..5be9241 100644
--- a/apps/ndn-producer.cpp
+++ b/apps/ndn-producer.cpp
@@ -24,7 +24,6 @@
 #include "ns3/packet.h"
 #include "ns3/simulator.h"
 
-#include "model/ndn-app-face.hpp"
 #include "model/ndn-ns3.hpp"
 #include "model/ndn-l3-protocol.hpp"
 #include "helper/ndn-fib-helper.hpp"
@@ -130,7 +129,7 @@
   data->wireEncode();
 
   m_transmittedDatas(data, this, m_face);
-  m_face->onReceiveData(*data);
+  m_appLink->onReceiveData(*data);
 }
 
 } // namespace ndn
diff --git a/examples/ndn-custom-apps/custom-app.cpp b/examples/ndn-custom-apps/custom-app.cpp
index 00e79a5..7984e28 100644
--- a/examples/ndn-custom-apps/custom-app.cpp
+++ b/examples/ndn-custom-apps/custom-app.cpp
@@ -85,7 +85,7 @@
   // Call trace (for logging purposes)
   m_transmittedInterests(interest, this, m_face);
 
-  m_face->onReceiveInterest(*interest);
+  m_appLink->onReceiveInterest(*interest);
 }
 
 // Callback that will be called when Interest arrives
@@ -108,7 +108,7 @@
   // Call trace (for logging purposes)
   m_transmittedDatas(data, this, m_face);
 
-  m_face->onReceiveData(*data);
+  m_appLink->onReceiveData(*data);
 }
 
 // Callback that will be called when Data arrives
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 3643408..35cd5fd 100644
--- a/examples/ndn-simple-with-content-freshness/one-interest-requester.cpp
+++ b/examples/ndn-simple-with-content-freshness/one-interest-requester.cpp
@@ -97,7 +97,7 @@
   NS_LOG_DEBUG(">> I: " << m_name);
 
   // Forward packet to lower (network) layer
-  m_face->onReceiveInterest(*interest);
+  m_appLink->onReceiveInterest(*interest);
 }
 
 void
diff --git a/examples/ndn-triangle-calculate-routes.cpp b/examples/ndn-triangle-calculate-routes.cpp
index b2b8138..614238e 100644
--- a/examples/ndn-triangle-calculate-routes.cpp
+++ b/examples/ndn-triangle-calculate-routes.cpp
@@ -23,7 +23,7 @@
 #include "ns3/network-module.h"
 #include "ns3/ndnSIM-module.h"
 
-#include "model/ndn-net-device-face.hpp"
+#include "ns3/ndnSIM/model/ndn-net-device-link-service.hpp"
 
 namespace ns3 {
 
@@ -83,15 +83,17 @@
       bool isFirst = true;
       for (auto& nextHop : entry.getNextHops()) {
         cout << *nextHop.getFace();
-        auto face = dynamic_pointer_cast<ndn::NetDeviceFace>(nextHop.getFace());
-        if (face == nullptr)
+        auto face = nextHop.getFace();
+        auto linkService = dynamic_cast<ndn::NetDeviceLinkService*>(face->getLinkService());
+        if (linkService == nullptr) {
           continue;
+        }
 
         cout << " towards ";
 
         if (!isFirst)
           cout << ", ";
-        cout << Names::FindName(face->GetNetDevice()->GetChannel()->GetDevice(1)->GetNode());
+        cout << Names::FindName(linkService->GetNetDevice()->GetChannel()->GetDevice(1)->GetNode());
         isFirst = false;
       }
       cout << ")" << endl;
diff --git a/wscript b/wscript
index 444f7ac..0a1f0d9 100644
--- a/wscript
+++ b/wscript
@@ -138,8 +138,6 @@
     module_dirs = ['apps', 'helper', 'model', 'utils']
     module.source = bld.path.ant_glob(['%s/**/*.cpp' % dir for dir in module_dirs],
                                       excl=[
-                                          'apps/ndn-consumer*.cpp',
-                                          'apps/ndn-producer*.cpp',
                                           'model/ip-faces/*']) + ndnCxxSrc + nfdSrc
 
     module_dirs = ['NFD/core', 'NFD/daemon', 'NFD/rib', 'apps', 'helper', 'model', 'utils']
@@ -148,8 +146,8 @@
 
     module.ndncxx_headers = bld.path.ant_glob(['ndn-cxx/src/**/*.hpp'],
                                               excl=['src/**/*-osx.hpp', 'src/detail/**/*'])
-    # if bld.env.ENABLE_EXAMPLES:
-    #     bld.recurse('examples')
+    if bld.env.ENABLE_EXAMPLES:
+        bld.recurse('examples')
 
     if bld.env.ENABLE_TESTS:
         bld.recurse('tests')