CcnxInterestSender and its helper fixes
diff --git a/apps/ccnx-interest-sender.cc b/apps/ccnx-interest-sender.cc
index 6ca40a3..239d7cb 100644
--- a/apps/ccnx-interest-sender.cc
+++ b/apps/ccnx-interest-sender.cc
@@ -37,6 +37,10 @@
TimeValue (Seconds (0.1)),
MakeTimeAccessor (&CcnxInterestSender::m_offTime),
MakeTimeChecker ())
+ .AddAttribute ("Face","Local face to be used",
+ PointerValue (CreateObject<CcnxLocalFace> ()),
+ MakePointerAccessor (&CcnxInterestSender::m_face),
+ MakePointerChecker<CcnxLocalFace> ())
/*.AddAttribute ("NameComponents","CcnxName of the Interest (use CcnxNameComponents)",
CcnxNameComponentsValue(CcnxNameComponents()),
MakeCcnxNameComponentsAccessor(&CcnxInterestSender::m_interestName),
@@ -130,7 +134,7 @@
{
NS_LOG_FUNCTION_NOARGS ();
- Time nextTime = Seconds(m_offTime); //send now
+ Time nextTime = Seconds(m_offTime);
m_sendEvent = Simulator::Schedule (nextTime, &CcnxInterestSender::SendPacket, this);
}
diff --git a/apps/ccnx-interest-sender.h b/apps/ccnx-interest-sender.h
index 345da02..04e9801 100644
--- a/apps/ccnx-interest-sender.h
+++ b/apps/ccnx-interest-sender.h
@@ -78,6 +78,7 @@
void Construct (Ptr<Node> n,
std::string tid,
const Time& offtime,
+ Ptr<CcnxLocalFace> face,
Ptr<CcnxNameComponents> nameComponents,
const Time& lifetime,
const int32_t& minSuffixComponents,
diff --git a/helper/ccnx-interest-sender-helper.cc b/helper/ccnx-interest-sender-helper.cc
index ca0b9f0..c182207 100644
--- a/helper/ccnx-interest-sender-helper.cc
+++ b/helper/ccnx-interest-sender-helper.cc
@@ -40,20 +40,20 @@
}
ApplicationContainer
-CcnxInterestSenderHelper::Install (Ptr<Node> node) const
+CcnxInterestSenderHelper::Install (Ptr<Node> node)
{
return ApplicationContainer (InstallPriv (node));
}
ApplicationContainer
-CcnxInterestSenderHelper::Install (std::string nodeName) const
+CcnxInterestSenderHelper::Install (std::string nodeName)
{
Ptr<Node> node = Names::Find<Node> (nodeName);
return ApplicationContainer (InstallPriv (node));
}
ApplicationContainer
-CcnxInterestSenderHelper::Install (NodeContainer c) const
+CcnxInterestSenderHelper::Install (NodeContainer c)
{
ApplicationContainer apps;
for (NodeContainer::Iterator i = c.Begin (); i != c.End (); ++i)
@@ -65,8 +65,13 @@
}
Ptr<Application>
-CcnxInterestSenderHelper::InstallPriv (Ptr<Node> node) const
+CcnxInterestSenderHelper::InstallPriv (Ptr<Node> node)
{
+ Ptr<CcnxLocalFace> localFace = Create<CcnxLocalFace> ();
+ localFace->SetNode(node);
+ localFace->SetUp();
+ m_factory.Set ("Face", PointerValue (localFace));
+
Ptr<Application> app = m_factory.Create<Application> ();
node->AddApplication (app);
diff --git a/helper/ccnx-interest-sender-helper.h b/helper/ccnx-interest-sender-helper.h
index 58af8ff..2ff46cc 100644
--- a/helper/ccnx-interest-sender-helper.h
+++ b/helper/ccnx-interest-sender-helper.h
@@ -31,6 +31,7 @@
#include "ns3/application-container.h"
#include "ns3/name-components.h"
#include "ns3/pointer.h"
+#include "ns3/ccnx-local-face.h"
namespace ns3
{
@@ -65,7 +66,7 @@
* will be installed.
* \returns Container of Ptr to the applications installed.
*/
- ApplicationContainer Install (NodeContainer c) const;
+ ApplicationContainer Install (NodeContainer c);
/**
* Install an ns3::CcnxInterestSender on the node configured with all the
@@ -74,7 +75,7 @@
* \param node The node on which an CcnxInterestSender will be installed.
* \returns Container of Ptr to the applications installed.
*/
- ApplicationContainer Install (Ptr<Node> node) const;
+ ApplicationContainer Install (Ptr<Node> node);
/**
* Install an ns3::CcnxInterestSender on the node configured with all the
@@ -83,7 +84,7 @@
* \param nodeName The node on which an CcnxInterestSender will be installed.
* \returns Container of Ptr to the applications installed.
*/
- ApplicationContainer Install (std::string nodeName) const;
+ ApplicationContainer Install (std::string nodeName);
private:
/**
@@ -94,7 +95,7 @@
* \param node The node on which an CcnxInterestSender will be installed.
* \returns Ptr to the application installed.
*/
- Ptr<Application> InstallPriv (Ptr<Node> node) const;
+ Ptr<Application> InstallPriv (Ptr<Node> node);
ObjectFactory m_factory;
};
}