model: Removing more legacy code and make code to compile
diff --git a/helper/ndn-stack-helper.cpp b/helper/ndn-stack-helper.cpp
index 5559d2e..b548844 100644
--- a/helper/ndn-stack-helper.cpp
+++ b/helper/ndn-stack-helper.cpp
@@ -39,11 +39,6 @@
#include "../model/ndn-net-device-face.hpp"
#include "../model/ndn-l3-protocol.hpp"
-#include "ns3/ndn-forwarding-strategy.hpp"
-#include "ns3/ndn-fib.hpp"
-#include "ns3/ndn-pit.hpp"
-#include "ns3/ndn-content-store.hpp"
-
#include "ns3/node-list.h"
#include "ns3/data-rate.h"
@@ -218,17 +213,17 @@
Ptr<L3Protocol> ndn = m_ndnFactory.Create<L3Protocol>();
// Create and aggregate FIB
- Ptr<Fib> fib = m_fibFactory.Create<Fib>();
- ndn->AggregateObject(fib);
+ // Ptr<Fib> fib = m_fibFactory.Create<Fib> ();
+ // ndn->AggregateObject (fib);
// Create and aggregate PIT
- ndn->AggregateObject(m_pitFactory.Create<Pit>());
+ // ndn->AggregateObject (m_pitFactory.Create<Pit> ());
// Create and aggregate forwarding strategy
- ndn->AggregateObject(m_strategyFactory.Create<ForwardingStrategy>());
+ // ndn->AggregateObject (m_strategyFactory.Create<ForwardingStrategy> ());
// Create and aggregate content store
- ndn->AggregateObject(m_contentStoreFactory.Create<ContentStore>());
+ // ndn->AggregateObject (m_contentStoreFactory.Create<ContentStore> ());
// Aggregate L3Protocol on node
node->AggregateObject(ndn);
@@ -240,7 +235,7 @@
// if (DynamicCast<LoopbackNetDevice> (device) != 0)
// continue; // don't create face for a LoopbackNetDevice
- Ptr<NetDeviceFace> face;
+ shared_ptr<NetDeviceFace> face;
for (std::list<std::pair<TypeId, NetDeviceFaceCreateCallback>>::const_iterator item =
m_netDeviceCallbacks.begin();
@@ -301,13 +296,13 @@
}
}
-Ptr<NetDeviceFace>
+shared_ptr<NetDeviceFace>
StackHelper::DefaultNetDeviceCallback(Ptr<Node> node, Ptr<L3Protocol> ndn,
Ptr<NetDevice> netDevice) const
{
NS_LOG_DEBUG("Creating default NetDeviceFace on node " << node->GetId());
- Ptr<NetDeviceFace> face = CreateObject<NetDeviceFace>(node, netDevice);
+ shared_ptr<NetDeviceFace> face = CreateObject<NetDeviceFace>(node, netDevice);
ndn->AddFace(face);
NS_LOG_LOGIC("Node " << node->GetId() << ": added NetDeviceFace as face #" << *face);
@@ -315,24 +310,25 @@
return face;
}
-Ptr<NetDeviceFace>
+shared_ptr<NetDeviceFace>
StackHelper::PointToPointNetDeviceCallback(Ptr<Node> node, Ptr<L3Protocol> ndn,
Ptr<NetDevice> device) const
{
NS_LOG_DEBUG("Creating point-to-point NetDeviceFace on node " << node->GetId());
- Ptr<NetDeviceFace> face = CreateObject<NetDeviceFace>(node, device);
+ shared_ptr<NetDeviceFace> face = CreateObject<NetDeviceFace>(node, device);
ndn->AddFace(face);
NS_LOG_LOGIC("Node " << node->GetId() << ": added NetDeviceFace as face #" << *face);
if (m_limitsEnabled) {
- Ptr<Limits> limits = face->GetObject<Limits>();
- if (limits == 0) {
- NS_FATAL_ERROR("Limits are enabled, but the selected forwarding strategy does not support "
- "limits. Please revise your scenario");
- exit(1);
- }
+ // Ptr<Limits> limits = face->GetObject<Limits> ();
+ /*if (limits == 0)
+ {
+ NS_FATAL_ERROR ("Limits are enabled, but the selected forwarding strategy does not support
+ limits. Please revise your scenario");
+ exit (1);
+ }*/
NS_LOG_INFO("Limits are enabled");
Ptr<PointToPointNetDevice> p2p = DynamicCast<PointToPointNetDevice>(device);
@@ -352,11 +348,12 @@
1.0 * dataRate.Get().GetBitRate() / 8.0 / (m_avgDataSize + m_avgInterestSize);
// NS_LOG_INFO ("Max packets per second: " << maxInterestPackets);
// NS_LOG_INFO ("Max burst: " << m_avgRtt.ToDouble (Time::S) * maxInterestPackets);
- NS_LOG_INFO("MaxLimit: " << (int)(m_avgRtt.ToDouble(Time::S) * maxInterestPackets));
-
+ // NS_LOG_INFO ("MaxLimit: " << (int)(m_avgRtt.ToDouble (Time::S) *
+ // maxInterestPackets));
+ /*
// Set max to BDP
- limits->SetLimits(maxInterestPackets, m_avgRtt.ToDouble(Time::S));
- limits->SetLinkDelay(linkDelay.Get().ToDouble(Time::S));
+ limits->SetLimits (maxInterestPackets, m_avgRtt.ToDouble (Time::S));
+ limits->SetLinkDelay (linkDelay.Get ().ToDouble (Time::S)); */
}
}
@@ -371,16 +368,17 @@
}
void
-StackHelper::AddRoute(Ptr<Node> node, const std::string& prefix, Ptr<Face> face, int32_t metric)
+StackHelper::AddRoute(Ptr<Node> node, const std::string& prefix, shared_ptr<Face> face, int32_t metric)
{
NS_LOG_LOGIC("[" << node->GetId() << "]$ route add " << prefix << " via " << *face << " metric "
<< metric);
- Ptr<Fib> fib = node->GetObject<Fib>();
+ // Ptr<Fib> fib = node->GetObject<Fib> ();
- NameValue prefixValue;
- prefixValue.DeserializeFromString(prefix, MakeNameChecker());
- fib->Add(prefixValue.Get(), face, metric);
+ // NameValue prefixValue;
+ // prefixValue.DeserializeFromString (prefix, MakeNameChecker ());
+ ::ndn::Name name(prefix);
+ // fib->Add (name, face, metric);
}
void
@@ -389,7 +387,7 @@
Ptr<L3Protocol> ndn = node->GetObject<L3Protocol>();
NS_ASSERT_MSG(ndn != 0, "Ndn stack should be installed on the node");
- Ptr<Face> face = ndn->GetFace(faceId);
+ shared_ptr<Face> face = ndn->GetFace(faceId);
NS_ASSERT_MSG(face != 0, "Face with ID [" << faceId << "] does not exist on node ["
<< node->GetId() << "]");
@@ -406,7 +404,7 @@
Ptr<L3Protocol> ndn = node->GetObject<L3Protocol>();
NS_ASSERT_MSG(ndn != 0, "Ndn stack should be installed on the node");
- Ptr<Face> face = ndn->GetFace(faceId);
+ shared_ptr<Face> face = ndn->GetFace(faceId);
NS_ASSERT_MSG(face != 0, "Face with ID [" << faceId << "] does not exist on node [" << nodeName
<< "]");
@@ -432,7 +430,7 @@
Ptr<L3Protocol> ndn = node->GetObject<L3Protocol>();
NS_ASSERT_MSG(ndn != 0, "Ndn stack should be installed on the node");
- Ptr<Face> face = ndn->GetFaceByNetDevice(netDevice);
+ shared_ptr<Face> face = ndn->GetFaceByNetDevice(netDevice);
NS_ASSERT_MSG(face != 0, "There is no face associated with the p2p link");
AddRoute(node, prefix, face, metric);