First simple NS-3 scenario that seems to work
diff --git a/model/sync-logic.cc b/model/sync-logic.cc
index 17a0935..528f212 100644
--- a/model/sync-logic.cc
+++ b/model/sync-logic.cc
@@ -61,6 +61,11 @@
#endif
#endif
#endif
+
+ _LOG_DEBUG ("syncPrefix");
+
+#ifndef NS3_MODULE
+ // In NS3 module these functions are moved to StartApplication method
m_ccnxHandle->setInterestFilter (m_syncPrefix,
bind (&SyncLogic::respondSyncInterest, this, _1));
@@ -68,6 +73,7 @@
m_scheduler.schedule (TIME_SECONDS (0),
bind (&SyncLogic::sendSyncInterest, this),
REEXPRESSING_INTEREST);
+#endif
}
SyncLogic::~SyncLogic ()
@@ -78,6 +84,29 @@
m_ccnxHandle.reset ();
}
+#ifdef NS3_MODULE
+void
+SyncLogic::StartApplication ()
+{
+ m_ccnxHandle->SetNode (GetNode ());
+ m_ccnxHandle->StartApplication ();
+
+ m_ccnxHandle->setInterestFilter (m_syncPrefix,
+ bind (&SyncLogic::respondSyncInterest, this, _1));
+
+ m_scheduler.schedule (TIME_SECONDS (0),
+ bind (&SyncLogic::sendSyncInterest, this),
+ REEXPRESSING_INTEREST);
+}
+
+void
+SyncLogic::StopApplication ()
+{
+ m_ccnxHandle->StopApplication ();
+}
+#endif
+
+
void
SyncLogic::respondSyncInterest (const string &interest)
{
@@ -410,20 +439,4 @@
REEXPRESSING_INTEREST);
}
-#ifdef NS3_MODULE
-void
-SyncLogic::StartApplication ()
-{
- m_ccnxHandle->SetNode (GetNode ());
- m_ccnxHandle->StartApplication ();
-}
-
-void
-SyncLogic::StopApplication ()
-{
- m_ccnxHandle->StopApplication ();
-}
-#endif
-
-
}