Making everything compile. Now everything seems to work, but more
checking is necessary
diff --git a/helper/ccnx-forwarding-helper.cc b/helper/ccnx-forwarding-helper.cc
index 6a8d3fb..31ffecb 100644
--- a/helper/ccnx-forwarding-helper.cc
+++ b/helper/ccnx-forwarding-helper.cc
@@ -32,37 +32,28 @@
m_strategy = Ccnx::NDN_FLOODING;
}
-CcnxForwardingHelper::CcnxForwardingHelper(Ccnx::ForwardingStrategy strategy)
+CcnxForwardingHelper::CcnxForwardingHelper (Ccnx::ForwardingStrategy strategy)
{
m_strategy = strategy;
}
-CcnxForwardingHelper::~CcnxForwardingHelper ()
-{
-
-}
-
void
-CcnxForwardingHelper::SetForwarding(Ptr<Ccnx> ccnx, Ptr<CcnxPit> pit) const
+CcnxForwardingHelper::SetForwarding (Ptr<Ccnx> ccnx) const
{
if(m_strategy == Ccnx::NDN_FLOODING)
{
Ptr<CcnxFloodingStrategy> ccnxForwarding = CreateObject<CcnxFloodingStrategy> ();
- //ccnxForwarding->SetCcnx(ccnx);
- ccnxForwarding->SetPit(pit);
ccnx->SetForwardingStrategy (ccnxForwarding);
}
else if(m_strategy == Ccnx::NDN_BESTROUTE)
{
Ptr<CcnxBestRouteStrategy> ccnxForwarding = CreateObject<CcnxBestRouteStrategy> ();
- //ccnxForwarding->SetCcnx(ccnx);
- ccnxForwarding->SetPit(pit);
ccnx->SetForwardingStrategy (ccnxForwarding);
}
else if (m_strategy == Ccnx::NDN_RANKING)
{}
}
-
+
// void
// CcnxForwardingHelper::PrintForwardingTableAllAt (Time printTime, Ptr<OutputStreamWrapper> stream) const
// {
diff --git a/helper/ccnx-forwarding-helper.h b/helper/ccnx-forwarding-helper.h
index fe9f9d4..d75a35a 100644
--- a/helper/ccnx-forwarding-helper.h
+++ b/helper/ccnx-forwarding-helper.h
@@ -42,7 +42,6 @@
class CcnxForwardingHelper
{
public:
-
/*
* \brief Default constructor, which sets NDN_FLOODING forwarding strategy
*/
@@ -52,16 +51,11 @@
* \brief This constructor sets a specified forwarding strategy
*/
CcnxForwardingHelper(Ccnx::ForwardingStrategy strategy);
-
- /*
- * Destroy an instance of an CcnxForwardingHelper
- */
- ~CcnxForwardingHelper ();
/*
- * \brief creates a specified ForwardingStrategy object and binds it to Pit
+ * \brief creates a specified ForwardingStrategy object
*/
- void SetForwarding(Ptr<Ccnx> ccnx, Ptr<CcnxPit> pit) const;
+ void SetForwarding(Ptr<Ccnx> ccnx) const;
/**
* \brief prints the forwarding tables of all nodes at a particular time.
diff --git a/helper/ccnx-stack-helper.cc b/helper/ccnx-stack-helper.cc
index 3bc5ce9..f965fc7 100644
--- a/helper/ccnx-stack-helper.cc
+++ b/helper/ccnx-stack-helper.cc
@@ -204,8 +204,7 @@
Ptr<CcnxL3Protocol> ccnx = CreateObject<CcnxL3Protocol> ();
node->AggregateObject (ccnx);
- Ptr<CcnxPit> pit = ccnx->GetPit();
- NS_LOG_INFO("NODE->GetNDevices()="<<node->GetNDevices());
+ NS_LOG_INFO("NODE->GetNDevices()=" << node->GetNDevices());
for (uint32_t index=0; index < node->GetNDevices (); index++)
{
@@ -213,28 +212,28 @@
if(device == 0)
continue;
- Ptr<CcnxNetDeviceFace> face = Create<CcnxNetDeviceFace> (node->GetDevice (index));
- face->SetNode (node);
+ Ptr<CcnxNetDeviceFace> face = Create<CcnxNetDeviceFace> (node, node->GetDevice (index));
+
uint32_t __attribute__ ((unused)) face_id = ccnx->AddFace (face);
NS_LOG_LOGIC ("Node " << node->GetId () << ": added CcnxNetDeviceFace as face #" << face_id);
// Setup bucket filtering
// Assume that we know average data packet size, and this size is equal default size
// Set maximum buckets (averaging over 1 second)
- DataRateValue dataRate;
- device->GetAttribute ("DataRate", dataRate);
- NS_LOG_INFO("DataRate for this link is " << dataRate.Get());
- pit->maxBucketsPerFace[face->GetId()] = 0.1 * dataRate.Get().GetBitRate () /(NDN_DEFAULT_DATA_SIZE + sizeof(CcnxInterestHeader));
- NS_LOG_INFO("maxBucketsPerFace["<<face->GetId()<<"] = " << pit->maxBucketsPerFace[face->GetId()]);
- pit->leakSize[face->GetId()] = 0.97 * NDN_INTEREST_RESET_PERIOD.ToDouble(Time::S) * dataRate.Get().GetBitRate () / (NDN_DEFAULT_DATA_SIZE + sizeof(CcnxInterestHeader));
- NS_LOG_INFO("pit->leakSize["<<face->GetId()<<"] = " << pit->leakSize[face->GetId()]);
+ // DataRateValue dataRate;
+ // device->GetAttribute ("DataRate", dataRate);
+ // NS_LOG_INFO("DataRate for this link is " << dataRate.Get());
+ // pit->maxBucketsPerFace[face->GetId()] = 0.1 * dataRate.Get().GetBitRate () /(NDN_DEFAULT_DATA_SIZE + sizeof(CcnxInterestHeader));
+ // NS_LOG_INFO("maxBucketsPerFace["<<face->GetId()<<"] = " << pit->maxBucketsPerFace[face->GetId()]);
+ // pit->leakSize[face->GetId()] = 0.97 * NDN_INTEREST_RESET_PERIOD.ToDouble(Time::S) * dataRate.Get().GetBitRate () / (NDN_DEFAULT_DATA_SIZE + sizeof(CcnxInterestHeader));
+ // NS_LOG_INFO("pit->leakSize["<<face->GetId()<<"] = " << pit->leakSize[face->GetId()]);
NS_LOG_INFO("Face #" << face_id << " is turned on");
face->SetUp ();
faces->Add (face);
}
- m_forwardingHelper.SetForwarding (ccnx, pit);
+ m_forwardingHelper.SetForwarding (ccnx);
// ccnx->ScheduleLeakage ();