change dataCallback to have two parameters: name and content
diff --git a/model/sync-logic.cc b/model/sync-logic.cc
index 5d6703a..a565003 100644
--- a/model/sync-logic.cc
+++ b/model/sync-logic.cc
@@ -42,24 +42,39 @@
}
-void SyncLogic::processSyncData(string dataBuffer)
+void SyncLogic::processSyncData(string name, string dataBuffer)
{
}
-void SyncLogic::addLocalNames(string prefix, uint32_t seq)
+void SyncLogic::addLocalNames(string prefix, uint32_t session, uint32_t seq)
{
-
+ NameInfoConstPtr info = StdNameInfo::FindOrCreate(prefix);
+ SeqNo seqN(session, seq);
+ m_state.update(info, seqN);
}
void SyncLogic::respondSyncInterest(string interest)
{
+ string hash = interest.substr(interest.find_last_of("/") + 1);
+
+ Digest digest;
+
+ digest << hash;
}
void SyncLogic::sendSyncInterest()
{
-
+ function<void (string, string)> f = bind(&SyncLogic::processSyncData, this, _1, _2);
+ stringstream os;
+ os << m_syncPrefix;
+ os << "/";
+ DigestConstPtr digest = m_state.getDigest();
+ os << digest;
+ string name;
+ os >> name;
+ m_ccnxHandle->sendInterest(name, f);
}
}
\ No newline at end of file