Switch from NDNx to CCNx
Change-Id: Icc2e6dd95d9c4e0ba22b7efb9933c1db7194842e
diff --git a/src/action-log.cc b/src/action-log.cc
index eb21b0d..a680dbe 100644
--- a/src/action-log.cc
+++ b/src/action-log.cc
@@ -26,7 +26,7 @@
using namespace boost;
using namespace std;
-using namespace Ccnx;
+using namespace Ndnx;
INIT_LOGGER ("ActionLog");
@@ -88,13 +88,13 @@
// _LOG_TRACE ("SQLITE: " << q);
// }
-ActionLog::ActionLog (Ccnx::CcnxWrapperPtr ccnx, const boost::filesystem::path &path,
+ActionLog::ActionLog (Ndnx::NdnxWrapperPtr ndnx, const boost::filesystem::path &path,
SyncLogPtr syncLog,
const std::string &sharedFolder, const std::string &appName,
OnFileAddedOrChangedCallback onFileAddedOrChanged, OnFileRemovedCallback onFileRemoved)
: DbHelper (path / ".chronoshare", "action-log.db")
, m_syncLog (syncLog)
- , m_ccnx (ccnx)
+ , m_ndnx (ndnx)
, m_sharedFolderName (sharedFolder)
, m_appName (appName)
, m_onFileAddedOrChanged (onFileAddedOrChanged)
@@ -118,7 +118,7 @@
m_fileState = make_shared<FileState> (path);
}
-tuple<sqlite3_int64 /*version*/, Ccnx::CcnxCharbufPtr /*device name*/, sqlite3_int64 /*seq_no*/>
+tuple<sqlite3_int64 /*version*/, Ndnx::NdnxCharbufPtr /*device name*/, sqlite3_int64 /*seq_no*/>
ActionLog::GetLatestActionForFile (const std::string &filename)
{
// check if something already exists
@@ -134,7 +134,7 @@
}
sqlite3_int64 version = -1;
- CcnxCharbufPtr parent_device_name;
+ NdnxCharbufPtr parent_device_name;
sqlite3_int64 parent_seq_no = -1;
sqlite3_bind_text (stmt, 1, filename.c_str (), filename.size (), SQLITE_STATIC);
@@ -144,7 +144,7 @@
if (sqlite3_column_int (stmt, 3) == 0) // prevent "linking" if the file was previously deleted
{
- parent_device_name = make_shared<CcnxCharbuf> (sqlite3_column_blob (stmt, 1), sqlite3_column_bytes (stmt, 1));
+ parent_device_name = make_shared<NdnxCharbuf> (sqlite3_column_blob (stmt, 1), sqlite3_column_bytes (stmt, 1));
parent_seq_no = sqlite3_column_int64 (stmt, 2);
}
}
@@ -163,10 +163,10 @@
{
sqlite3_exec (m_db, "BEGIN TRANSACTION;", 0,0,0);
- CcnxCharbufPtr device_name = m_syncLog->GetLocalName ().toCcnxCharbuf ();
+ NdnxCharbufPtr device_name = m_syncLog->GetLocalName ().toNdnxCharbuf ();
sqlite3_int64 seq_no = m_syncLog->GetNextLocalSeqNo ();
sqlite3_int64 version;
- CcnxCharbufPtr parent_device_name;
+ NdnxCharbufPtr parent_device_name;
sqlite3_int64 parent_seq_no = -1;
sqlite3_int64 action_time = time (0);
@@ -245,8 +245,8 @@
Name actionName = Name ("/")(m_syncLog->GetLocalName ())(m_appName)("action")(m_sharedFolderName)(seq_no);
_LOG_DEBUG ("ActionName: " << actionName);
- Bytes actionData = m_ccnx->createContentObject (actionName, item_msg.c_str (), item_msg.size ());
- CcnxCharbufPtr namePtr = actionName.toCcnxCharbuf ();
+ Bytes actionData = m_ndnx->createContentObject (actionName, item_msg.c_str (), item_msg.size ());
+ NdnxCharbufPtr namePtr = actionName.toNdnxCharbuf ();
// _LOG_DEBUG (" >>>>>>> " << Name (namePtr->buf () << " " << namePtr->length ());
@@ -293,9 +293,9 @@
sqlite3_exec (m_db, "BEGIN TRANSACTION;", 0,0,0);
- CcnxCharbufPtr device_name = m_syncLog->GetLocalName ().toCcnxCharbuf ();
+ NdnxCharbufPtr device_name = m_syncLog->GetLocalName ().toNdnxCharbuf ();
sqlite3_int64 version;
- CcnxCharbufPtr parent_device_name;
+ NdnxCharbufPtr parent_device_name;
sqlite3_int64 parent_seq_no = -1;
sqlite3_int64 action_time = time (0);
@@ -358,8 +358,8 @@
Name actionName = Name ("/")(m_syncLog->GetLocalName ())(m_appName)("action")(m_sharedFolderName)(seq_no);
_LOG_DEBUG ("ActionName: " << actionName);
- Bytes actionData = m_ccnx->createContentObject (actionName, item_msg.c_str (), item_msg.size ());
- CcnxCharbufPtr namePtr = actionName.toCcnxCharbuf ();
+ Bytes actionData = m_ndnx->createContentObject (actionName, item_msg.c_str (), item_msg.size ());
+ NdnxCharbufPtr namePtr = actionName.toNdnxCharbuf ();
sqlite3_bind_blob (stmt, 9, namePtr->buf (), namePtr->length (), SQLITE_STATIC);
sqlite3_bind_blob (stmt, 10, &actionData[0], actionData.size (), SQLITE_STATIC);
@@ -368,7 +368,7 @@
_LOG_DEBUG_COND (sqlite3_errcode (m_db) != SQLITE_DONE, sqlite3_errmsg (m_db));
- // cout << Ccnx::Name (parent_device_name) << endl;
+ // cout << Ndnx::Name (parent_device_name) << endl;
// assign name to the action, serialize action, and create content object
@@ -392,12 +392,12 @@
PcoPtr
-ActionLog::LookupActionPco (const Ccnx::Name &deviceName, sqlite3_int64 seqno)
+ActionLog::LookupActionPco (const Ndnx::Name &deviceName, sqlite3_int64 seqno)
{
sqlite3_stmt *stmt;
sqlite3_prepare_v2 (m_db, "SELECT action_content_object FROM ActionLog WHERE device_name=? AND seq_no=?", -1, &stmt, 0);
- CcnxCharbufPtr name = deviceName.toCcnxCharbuf ();
+ NdnxCharbufPtr name = deviceName.toNdnxCharbuf ();
sqlite3_bind_blob (stmt, 1, name->buf (), name->length (), SQLITE_STATIC);
sqlite3_bind_int64 (stmt, 2, seqno);
@@ -419,7 +419,7 @@
}
ActionItemPtr
-ActionLog::LookupAction (const Ccnx::Name &deviceName, sqlite3_int64 seqno)
+ActionLog::LookupAction (const Ndnx::Name &deviceName, sqlite3_int64 seqno)
{
PcoPtr pco = LookupActionPco (deviceName, seqno);
if (!pco) return ActionItemPtr ();
@@ -429,14 +429,14 @@
return action;
}
-Ccnx::PcoPtr
-ActionLog::LookupActionPco (const Ccnx::Name &actionName)
+Ndnx::PcoPtr
+ActionLog::LookupActionPco (const Ndnx::Name &actionName)
{
sqlite3_stmt *stmt;
sqlite3_prepare_v2 (m_db, "SELECT action_content_object FROM ActionLog WHERE action_name=?", -1, &stmt, 0);
_LOG_DEBUG (actionName);
- CcnxCharbufPtr name = actionName.toCcnxCharbuf ();
+ NdnxCharbufPtr name = actionName.toNdnxCharbuf ();
_LOG_DEBUG (" <<<<<<< " << name->buf () << " " << name->length ());
@@ -459,7 +459,7 @@
}
ActionItemPtr
-ActionLog::LookupAction (const Ccnx::Name &actionName)
+ActionLog::LookupAction (const Ndnx::Name &actionName)
{
PcoPtr pco = LookupActionPco (actionName);
if (!pco) return ActionItemPtr ();
@@ -508,7 +508,7 @@
ActionItemPtr
-ActionLog::AddRemoteAction (const Ccnx::Name &deviceName, sqlite3_int64 seqno, Ccnx::PcoPtr actionPco)
+ActionLog::AddRemoteAction (const Ndnx::Name &deviceName, sqlite3_int64 seqno, Ndnx::PcoPtr actionPco)
{
if (!actionPco)
{
@@ -537,7 +537,7 @@
" ?, ?);", -1, &stmt, 0);
_LOG_DEBUG_COND (sqlite3_errcode (m_db) != SQLITE_OK, sqlite3_errmsg (m_db));
- CcnxCharbufPtr device_name = deviceName.toCcnxCharbuf ();
+ NdnxCharbufPtr device_name = deviceName.toNdnxCharbuf ();
sqlite3_bind_blob (stmt, 1, device_name->buf (), device_name->length (), SQLITE_STATIC);
sqlite3_bind_int64 (stmt, 2, seqno);
@@ -565,7 +565,7 @@
}
Name actionName = Name (deviceName)("action")(m_sharedFolderName)(seqno);
- CcnxCharbufPtr namePtr = actionName.toCcnxCharbuf ();
+ NdnxCharbufPtr namePtr = actionName.toNdnxCharbuf ();
sqlite3_bind_blob (stmt, 15, namePtr->buf (), namePtr->length (), SQLITE_STATIC);
sqlite3_bind_blob (stmt, 16, head (actionPco->buf ()), actionPco->buf ().size (), SQLITE_STATIC);
@@ -592,7 +592,7 @@
}
ActionItemPtr
-ActionLog::AddRemoteAction (Ccnx::PcoPtr actionPco)
+ActionLog::AddRemoteAction (Ndnx::PcoPtr actionPco)
{
Name name = actionPco->name ();
// action name: /<device_name>/<appname>/action/<shared-folder>/<action-seq>
@@ -645,7 +645,7 @@
bool
-ActionLog::LookupActionsInFolderRecursively (const boost::function<void (const Ccnx::Name &name, sqlite3_int64 seq_no, const ActionItem &)> &visitor,
+ActionLog::LookupActionsInFolderRecursively (const boost::function<void (const Ndnx::Name &name, sqlite3_int64 seq_no, const ActionItem &)> &visitor,
const std::string &folder, int offset/*=0*/, int limit/*=-1*/)
{
_LOG_DEBUG ("LookupActionsInFolderRecursively: [" << folder << "]");
@@ -696,7 +696,7 @@
ActionItem action;
- Ccnx::Name device_name (sqlite3_column_blob (stmt, 0), sqlite3_column_bytes (stmt, 0));
+ Ndnx::Name device_name (sqlite3_column_blob (stmt, 0), sqlite3_column_bytes (stmt, 0));
sqlite3_int64 seq_no = sqlite3_column_int64 (stmt, 1);
action.set_action (static_cast<ActionItem_ActionType> (sqlite3_column_int (stmt, 2)));
action.set_filename (reinterpret_cast<const char *> (sqlite3_column_text (stmt, 3)), sqlite3_column_bytes (stmt, 3));
@@ -732,7 +732,7 @@
* @todo Figure out the way to minimize code duplication
*/
bool
-ActionLog::LookupActionsForFile (const boost::function<void (const Ccnx::Name &name, sqlite3_int64 seq_no, const ActionItem &)> &visitor,
+ActionLog::LookupActionsForFile (const boost::function<void (const Ndnx::Name &name, sqlite3_int64 seq_no, const ActionItem &)> &visitor,
const std::string &file, int offset/*=0*/, int limit/*=-1*/)
{
_LOG_DEBUG ("LookupActionsInFolderRecursively: [" << file << "]");
@@ -768,7 +768,7 @@
ActionItem action;
- Ccnx::Name device_name (sqlite3_column_blob (stmt, 0), sqlite3_column_bytes (stmt, 0));
+ Ndnx::Name device_name (sqlite3_column_blob (stmt, 0), sqlite3_column_bytes (stmt, 0));
sqlite3_int64 seq_no = sqlite3_column_int64 (stmt, 1);
action.set_action (static_cast<ActionItem_ActionType> (sqlite3_column_int (stmt, 2)));
action.set_filename (reinterpret_cast<const char *> (sqlite3_column_text (stmt, 3)), sqlite3_column_bytes (stmt, 3));
@@ -849,7 +849,7 @@
return;
}
- CcnxCharbuf device_name (sqlite3_value_blob (argv[0]), sqlite3_value_bytes (argv[0]));
+ NdnxCharbuf device_name (sqlite3_value_blob (argv[0]), sqlite3_value_bytes (argv[0]));
sqlite3_int64 seq_no = sqlite3_value_int64 (argv[1]);
int action = sqlite3_value_int (argv[2]);
string filename = reinterpret_cast<const char*> (sqlite3_value_text (argv[3]));
diff --git a/src/action-log.h b/src/action-log.h
index 96ccd51..2002b4c 100644
--- a/src/action-log.h
+++ b/src/action-log.h
@@ -27,8 +27,8 @@
#include "sync-log.h"
#include "action-item.pb.h"
#include "file-item.pb.h"
-#include "ccnx-wrapper.h"
-#include "ccnx-pco.h"
+#include "ndnx-wrapper.h"
+#include "ndnx-pco.h"
#include <boost/tuple/tuple.hpp>
@@ -39,13 +39,13 @@
class ActionLog : public DbHelper
{
public:
- typedef boost::function<void (std::string /*filename*/, Ccnx::Name /*device_name*/, sqlite3_int64 /*seq_no*/,
+ typedef boost::function<void (std::string /*filename*/, Ndnx::Name /*device_name*/, sqlite3_int64 /*seq_no*/,
HashPtr /*hash*/, time_t /*m_time*/, int /*mode*/, int /*seg_num*/)> OnFileAddedOrChangedCallback;
typedef boost::function<void (std::string /*filename*/)> OnFileRemovedCallback;
public:
- ActionLog (Ccnx::CcnxWrapperPtr ccnx, const boost::filesystem::path &path,
+ ActionLog (Ndnx::NdnxWrapperPtr ndnx, const boost::filesystem::path &path,
SyncLogPtr syncLog,
const std::string &sharedFolder, const std::string &appName,
OnFileAddedOrChangedCallback onFileAddedOrChanged, OnFileRemovedCallback onFileRemoved);
@@ -73,7 +73,7 @@
//////////////////////////
ActionItemPtr
- AddRemoteAction (const Ccnx::Name &deviceName, sqlite3_int64 seqno, Ccnx::PcoPtr actionPco);
+ AddRemoteAction (const Ndnx::Name &deviceName, sqlite3_int64 seqno, Ndnx::PcoPtr actionPco);
/**
* @brief Add remote action using just action's parsed content object
@@ -81,23 +81,23 @@
* This function extracts device name and sequence number from the content object's and calls the overloaded method
*/
ActionItemPtr
- AddRemoteAction (Ccnx::PcoPtr actionPco);
+ AddRemoteAction (Ndnx::PcoPtr actionPco);
///////////////////////////
// General operations //
///////////////////////////
- Ccnx::PcoPtr
- LookupActionPco (const Ccnx::Name &deviceName, sqlite3_int64 seqno);
+ Ndnx::PcoPtr
+ LookupActionPco (const Ndnx::Name &deviceName, sqlite3_int64 seqno);
- Ccnx::PcoPtr
- LookupActionPco (const Ccnx::Name &actionName);
+ Ndnx::PcoPtr
+ LookupActionPco (const Ndnx::Name &actionName);
ActionItemPtr
- LookupAction (const Ccnx::Name &deviceName, sqlite3_int64 seqno);
+ LookupAction (const Ndnx::Name &deviceName, sqlite3_int64 seqno);
ActionItemPtr
- LookupAction (const Ccnx::Name &actionName);
+ LookupAction (const Ndnx::Name &actionName);
FileItemPtr
LookupAction (const std::string &filename, sqlite3_int64 version, const Hash &filehash);
@@ -106,11 +106,11 @@
* @brief Lookup up to [limit] actions starting [offset] in decreasing order (by timestamp) and calling visitor(device_name,seqno,action) for each action
*/
bool
- LookupActionsInFolderRecursively (const boost::function<void (const Ccnx::Name &name, sqlite3_int64 seq_no, const ActionItem &)> &visitor,
+ LookupActionsInFolderRecursively (const boost::function<void (const Ndnx::Name &name, sqlite3_int64 seq_no, const ActionItem &)> &visitor,
const std::string &folder, int offset=0, int limit=-1);
bool
- LookupActionsForFile (const boost::function<void (const Ccnx::Name &name, sqlite3_int64 seq_no, const ActionItem &)> &visitor,
+ LookupActionsForFile (const boost::function<void (const Ndnx::Name &name, sqlite3_int64 seq_no, const ActionItem &)> &visitor,
const std::string &file, int offset=0, int limit=-1);
void
@@ -126,7 +126,7 @@
LogSize ();
private:
- boost::tuple<sqlite3_int64 /*version*/, Ccnx::CcnxCharbufPtr /*device name*/, sqlite3_int64 /*seq_no*/>
+ boost::tuple<sqlite3_int64 /*version*/, Ndnx::NdnxCharbufPtr /*device name*/, sqlite3_int64 /*seq_no*/>
GetLatestActionForFile (const std::string &filename);
static void
@@ -136,7 +136,7 @@
SyncLogPtr m_syncLog;
FileStatePtr m_fileState;
- Ccnx::CcnxWrapperPtr m_ccnx;
+ Ndnx::NdnxWrapperPtr m_ndnx;
std::string m_sharedFolderName;
std::string m_appName;
diff --git a/src/content-server.cc b/src/content-server.cc
index 7199222..850803e 100644
--- a/src/content-server.cc
+++ b/src/content-server.cc
@@ -30,18 +30,18 @@
INIT_LOGGER ("ContentServer");
-using namespace Ccnx;
+using namespace Ndnx;
using namespace std;
using namespace boost;
static const int DB_CACHE_LIFETIME = 60;
-ContentServer::ContentServer(CcnxWrapperPtr ccnx, ActionLogPtr actionLog,
+ContentServer::ContentServer(NdnxWrapperPtr ndnx, ActionLogPtr actionLog,
const boost::filesystem::path &rootDir,
- const Ccnx::Name &userName, const std::string &sharedFolderName,
+ const Ndnx::Name &userName, const std::string &sharedFolderName,
const std::string &appName,
int freshness)
- : m_ccnx(ccnx)
+ : m_ndnx(ndnx)
, m_actionLog(actionLog)
, m_dbFolder(rootDir / ".chronoshare")
, m_freshness(freshness)
@@ -62,7 +62,7 @@
ScopedLock lock (m_mutex);
for (PrefixIt forwardingHint = m_prefixes.begin(); forwardingHint != m_prefixes.end(); ++forwardingHint)
{
- m_ccnx->clearInterestFilter (*forwardingHint);
+ m_ndnx->clearInterestFilter (*forwardingHint);
}
m_prefixes.clear ();
@@ -76,7 +76,7 @@
_LOG_DEBUG (">> content server: register " << forwardingHint);
- m_ccnx->setInterestFilter (forwardingHint, bind(&ContentServer::filterAndServe, this, forwardingHint, _1));
+ m_ndnx->setInterestFilter (forwardingHint, bind(&ContentServer::filterAndServe, this, forwardingHint, _1));
ScopedLock lock (m_mutex);
m_prefixes.insert(forwardingHint);
@@ -86,7 +86,7 @@
ContentServer::deregisterPrefix (const Name &forwardingHint)
{
_LOG_DEBUG ("<< content server: deregister " << forwardingHint);
- m_ccnx->clearInterestFilter(forwardingHint);
+ m_ndnx->clearInterestFilter(forwardingHint);
ScopedLock lock (m_mutex);
m_prefixes.erase (forwardingHint);
@@ -121,10 +121,10 @@
}
}
}
- catch (Ccnx::NameException &ne)
+ catch (Ndnx::NameException &ne)
{
// ignore any unexpected interests and errors
- _LOG_ERROR(boost::get_error_info<Ccnx::error_info_str>(ne));
+ _LOG_ERROR(boost::get_error_info<Ndnx::error_info_str>(ne));
}
}
@@ -142,10 +142,10 @@
filterAndServeImpl (forwardingHint, interest.getPartialName (forwardingHint.size()), interest); // always try with hint... :( have to
}
- catch (Ccnx::NameException &ne)
+ catch (Ndnx::NameException &ne)
{
// ignore any unexpected interests and errors
- _LOG_ERROR(boost::get_error_info<Ccnx::error_info_str>(ne));
+ _LOG_ERROR(boost::get_error_info<Ndnx::error_info_str>(ne));
}
}
@@ -154,7 +154,7 @@
{
_LOG_DEBUG (">> content server serving ACTION, hint: " << forwardingHint << ", interest: " << interest);
m_scheduler->scheduleOneTimeTask (m_scheduler, 0, bind (&ContentServer::serve_Action_Execute, this, forwardingHint, name, interest), boost::lexical_cast<string>(name));
- // need to unlock ccnx mutex... or at least don't lock it
+ // need to unlock ndnx mutex... or at least don't lock it
}
void
@@ -163,7 +163,7 @@
_LOG_DEBUG (">> content server serving FILE, hint: " << forwardingHint << ", interest: " << interest);
m_scheduler->scheduleOneTimeTask (m_scheduler, 0, bind (&ContentServer::serve_File_Execute, this, forwardingHint, name, interest), boost::lexical_cast<string>(name));
- // need to unlock ccnx mutex... or at least don't lock it
+ // need to unlock ndnx mutex... or at least don't lock it
}
void
@@ -212,17 +212,17 @@
if (forwardingHint.size () == 0)
{
_LOG_DEBUG (ParsedContentObject (*co).name ());
- m_ccnx->putToCcnd (*co);
+ m_ndnx->putToNdnd (*co);
}
else
{
if (m_freshness > 0)
{
- m_ccnx->publishData(interest, *co, m_freshness);
+ m_ndnx->publishData(interest, *co, m_freshness);
}
else
{
- m_ccnx->publishData(interest, *co);
+ m_ndnx->publishData(interest, *co);
}
}
@@ -252,18 +252,18 @@
{
if (forwardingHint.size () == 0)
{
- m_ccnx->putToCcnd (pco->buf ());
+ m_ndnx->putToNdnd (pco->buf ());
}
else
{
const Bytes &content = pco->buf ();
if (m_freshness > 0)
{
- m_ccnx->publishData(interest, content, m_freshness);
+ m_ndnx->publishData(interest, content, m_freshness);
}
else
{
- m_ccnx->publishData(interest, content);
+ m_ndnx->publishData(interest, content);
}
}
}
diff --git a/src/content-server.h b/src/content-server.h
index 55037b7..84a0bc7 100644
--- a/src/content-server.h
+++ b/src/content-server.h
@@ -22,7 +22,7 @@
#ifndef CONTENT_SERVER_H
#define CONTENT_SERVER_H
-#include "ccnx-wrapper.h"
+#include "ndnx-wrapper.h"
#include "object-db.h"
#include "action-log.h"
#include <set>
@@ -34,8 +34,8 @@
class ContentServer
{
public:
- ContentServer(Ccnx::CcnxWrapperPtr ccnx, ActionLogPtr actionLog, const boost::filesystem::path &rootDir,
- const Ccnx::Name &userName, const std::string &sharedFolderName, const std::string &appName,
+ ContentServer(Ndnx::NdnxWrapperPtr ndnx, ActionLogPtr actionLog, const boost::filesystem::path &rootDir,
+ const Ndnx::Name &userName, const std::string &sharedFolderName, const std::string &appName,
int freshness = -1);
~ContentServer();
@@ -43,39 +43,39 @@
// /some-prefix/topology-independent-name
// currently /topology-independent-name must begin with /action or /file
// so that ContentServer knows where to look for the content object
- void registerPrefix(const Ccnx::Name &prefix);
- void deregisterPrefix(const Ccnx::Name &prefix);
+ void registerPrefix(const Ndnx::Name &prefix);
+ void deregisterPrefix(const Ndnx::Name &prefix);
private:
void
- filterAndServe (Ccnx::Name forwardingHint, const Ccnx::Name &interest);
+ filterAndServe (Ndnx::Name forwardingHint, const Ndnx::Name &interest);
void
- filterAndServeImpl (const Ccnx::Name &forwardingHint, const Ccnx::Name &name, const Ccnx::Name &interest);
+ filterAndServeImpl (const Ndnx::Name &forwardingHint, const Ndnx::Name &name, const Ndnx::Name &interest);
void
- serve_Action (const Ccnx::Name &forwardingHint, const Ccnx::Name &name, const Ccnx::Name &interest);
+ serve_Action (const Ndnx::Name &forwardingHint, const Ndnx::Name &name, const Ndnx::Name &interest);
void
- serve_File (const Ccnx::Name &forwardingHint, const Ccnx::Name &name, const Ccnx::Name &interest);
+ serve_File (const Ndnx::Name &forwardingHint, const Ndnx::Name &name, const Ndnx::Name &interest);
void
- serve_Action_Execute(const Ccnx::Name &forwardingHint, const Ccnx::Name &name, const Ccnx::Name &interest);
+ serve_Action_Execute(const Ndnx::Name &forwardingHint, const Ndnx::Name &name, const Ndnx::Name &interest);
void
- serve_File_Execute(const Ccnx::Name &forwardingHint, const Ccnx::Name &name, const Ccnx::Name &interest);
+ serve_File_Execute(const Ndnx::Name &forwardingHint, const Ndnx::Name &name, const Ndnx::Name &interest);
void
flushStaleDbCache();
private:
- Ccnx::CcnxWrapperPtr m_ccnx;
+ Ndnx::NdnxWrapperPtr m_ndnx;
ActionLogPtr m_actionLog;
typedef boost::shared_mutex Mutex;
typedef boost::unique_lock<Mutex> ScopedLock;
- typedef std::set<Ccnx::Name>::iterator PrefixIt;
- std::set<Ccnx::Name> m_prefixes;
+ typedef std::set<Ndnx::Name>::iterator PrefixIt;
+ std::set<Ndnx::Name> m_prefixes;
Mutex m_mutex;
boost::filesystem::path m_dbFolder;
int m_freshness;
@@ -85,7 +85,7 @@
DbCache m_dbCache;
Mutex m_dbCacheMutex;
- Ccnx::Name m_userName;
+ Ndnx::Name m_userName;
std::string m_sharedFolderName;
std::string m_appName;
};
diff --git a/src/dispatcher.cc b/src/dispatcher.cc
index 46e0e1b..98613cf 100644
--- a/src/dispatcher.cc
+++ b/src/dispatcher.cc
@@ -21,13 +21,13 @@
#include "dispatcher.h"
#include "logging.h"
-#include "ccnx-discovery.h"
+#include "ndnx-discovery.h"
#include "fetch-task-db.h"
#include <boost/make_shared.hpp>
#include <boost/lexical_cast.hpp>
-using namespace Ccnx;
+using namespace Ndnx;
using namespace std;
using namespace boost;
@@ -42,21 +42,21 @@
Dispatcher::Dispatcher(const std::string &localUserName
, const std::string &sharedFolder
, const filesystem::path &rootDir
- , Ccnx::CcnxWrapperPtr ccnx
+ , Ndnx::NdnxWrapperPtr ndnx
, bool enablePrefixDiscovery
)
- : m_ccnx(ccnx)
+ : m_ndnx(ndnx)
, m_core(NULL)
, m_rootDir(rootDir)
, m_executor(1) // creates problems with file assembly. need to ensure somehow that FinishExectute is called after all Segment_Execute finished
- , m_objectManager(ccnx, rootDir, CHRONOSHARE_APP)
+ , m_objectManager(ndnx, rootDir, CHRONOSHARE_APP)
, m_localUserName(localUserName)
, m_sharedFolder(sharedFolder)
, m_server(NULL)
, m_enablePrefixDiscovery(enablePrefixDiscovery)
{
m_syncLog = make_shared<SyncLog>(m_rootDir, localUserName);
- m_actionLog = make_shared<ActionLog>(m_ccnx, m_rootDir, m_syncLog, sharedFolder, CHRONOSHARE_APP,
+ m_actionLog = make_shared<ActionLog>(m_ndnx, m_rootDir, m_syncLog, sharedFolder, CHRONOSHARE_APP,
// bind (&Dispatcher::Did_ActionLog_ActionApply_AddOrModify, this, _1, _2, _3, _4, _5, _6, _7),
ActionLog::OnFileAddedOrChangedCallback (), // don't really need this callback
bind (&Dispatcher::Did_ActionLog_ActionApply_Delete, this, _1));
@@ -65,25 +65,25 @@
Name syncPrefix = Name(BROADCAST_DOMAIN)(CHRONOSHARE_APP)(sharedFolder);
- // m_server needs a different ccnx face
- m_server = new ContentServer(make_shared<CcnxWrapper>(), m_actionLog, rootDir, m_localUserName, m_sharedFolder, CHRONOSHARE_APP, CONTENT_FRESHNESS);
+ // m_server needs a different ndnx face
+ m_server = new ContentServer(make_shared<NdnxWrapper>(), m_actionLog, rootDir, m_localUserName, m_sharedFolder, CHRONOSHARE_APP, CONTENT_FRESHNESS);
m_server->registerPrefix(Name("/"));
m_server->registerPrefix(Name(BROADCAST_DOMAIN));
- m_stateServer = new StateServer (make_shared<CcnxWrapper>(), m_actionLog, rootDir, m_localUserName, m_sharedFolder, CHRONOSHARE_APP, m_objectManager, CONTENT_FRESHNESS);
+ m_stateServer = new StateServer (make_shared<NdnxWrapper>(), m_actionLog, rootDir, m_localUserName, m_sharedFolder, CHRONOSHARE_APP, m_objectManager, CONTENT_FRESHNESS);
// no need to register, right now only listening on localhost prefix
m_core = new SyncCore (m_syncLog, localUserName, Name("/"), syncPrefix,
- bind(&Dispatcher::Did_SyncLog_StateChange, this, _1), ccnx, DEFAULT_SYNC_INTEREST_INTERVAL);
+ bind(&Dispatcher::Did_SyncLog_StateChange, this, _1), ndnx, DEFAULT_SYNC_INTEREST_INTERVAL);
FetchTaskDbPtr actionTaskDb = make_shared<FetchTaskDb>(m_rootDir, "action");
- m_actionFetcher = make_shared<FetchManager> (m_ccnx, bind (&SyncLog::LookupLocator, &*m_syncLog, _1),
+ m_actionFetcher = make_shared<FetchManager> (m_ndnx, bind (&SyncLog::LookupLocator, &*m_syncLog, _1),
Name(BROADCAST_DOMAIN), // no appname suffix now
3,
bind (&Dispatcher::Did_FetchManager_ActionFetch, this, _1, _2, _3, _4), FetchManager::FinishCallback(), actionTaskDb);
FetchTaskDbPtr fileTaskDb = make_shared<FetchTaskDb>(m_rootDir, "file");
- m_fileFetcher = make_shared<FetchManager> (m_ccnx, bind (&SyncLog::LookupLocator, &*m_syncLog, _1),
+ m_fileFetcher = make_shared<FetchManager> (m_ndnx, bind (&SyncLog::LookupLocator, &*m_syncLog, _1),
Name(BROADCAST_DOMAIN), // no appname suffix now
3,
bind (&Dispatcher::Did_FetchManager_FileSegmentFetch, this, _1, _2, _3, _4),
@@ -95,7 +95,7 @@
{
_LOG_DEBUG("registering prefix discovery in Dispatcher");
string tag = "dispatcher" + m_localUserName.toString();
- Ccnx::CcnxDiscovery::registerCallback (TaggedFunction (bind (&Dispatcher::Did_LocalPrefix_Updated, this, _1), tag));
+ Ndnx::NdnxDiscovery::registerCallback (TaggedFunction (bind (&Dispatcher::Did_LocalPrefix_Updated, this, _1), tag));
}
m_executor.start ();
@@ -112,7 +112,7 @@
{
_LOG_DEBUG("deregistering prefix discovery in Dispatcher");
string tag = "dispatcher" + m_localUserName.toString();
- Ccnx::CcnxDiscovery::deregisterCallback (TaggedFunction (bind (&Dispatcher::Did_LocalPrefix_Updated, this, _1), tag));
+ Ndnx::NdnxDiscovery::deregisterCallback (TaggedFunction (bind (&Dispatcher::Did_LocalPrefix_Updated, this, _1), tag));
}
if (m_core != NULL)
@@ -135,7 +135,7 @@
}
void
-Dispatcher::Did_LocalPrefix_Updated (const Ccnx::Name &forwardingHint)
+Dispatcher::Did_LocalPrefix_Updated (const Ndnx::Name &forwardingHint)
{
Name effectiveForwardingHint;
if (m_localUserName.size () >= forwardingHint.size () &&
@@ -323,7 +323,7 @@
void
-Dispatcher::Did_FetchManager_ActionFetch (const Ccnx::Name &deviceName, const Ccnx::Name &actionBaseName, uint32_t seqno, Ccnx::PcoPtr actionPco)
+Dispatcher::Did_FetchManager_ActionFetch (const Ndnx::Name &deviceName, const Ndnx::Name &actionBaseName, uint32_t seqno, Ndnx::PcoPtr actionPco)
{
/// @todo Errors and exception checking
_LOG_DEBUG ("Received action deviceName: " << deviceName << ", actionBaseName: " << actionBaseName << ", seqno: " << seqno);
@@ -406,13 +406,13 @@
}
void
-Dispatcher::Did_FetchManager_FileSegmentFetch (const Ccnx::Name &deviceName, const Ccnx::Name &fileSegmentBaseName, uint32_t segment, Ccnx::PcoPtr fileSegmentPco)
+Dispatcher::Did_FetchManager_FileSegmentFetch (const Ndnx::Name &deviceName, const Ndnx::Name &fileSegmentBaseName, uint32_t segment, Ndnx::PcoPtr fileSegmentPco)
{
m_executor.execute (bind (&Dispatcher::Did_FetchManager_FileSegmentFetch_Execute, this, deviceName, fileSegmentBaseName, segment, fileSegmentPco));
}
void
-Dispatcher::Did_FetchManager_FileSegmentFetch_Execute (Ccnx::Name deviceName, Ccnx::Name fileSegmentBaseName, uint32_t segment, Ccnx::PcoPtr fileSegmentPco)
+Dispatcher::Did_FetchManager_FileSegmentFetch_Execute (Ndnx::Name deviceName, Ndnx::Name fileSegmentBaseName, uint32_t segment, Ndnx::PcoPtr fileSegmentPco)
{
// fileSegmentBaseName: /<device_name>/<appname>/file/<hash>
@@ -438,13 +438,13 @@
}
void
-Dispatcher::Did_FetchManager_FileFetchComplete (const Ccnx::Name &deviceName, const Ccnx::Name &fileBaseName)
+Dispatcher::Did_FetchManager_FileFetchComplete (const Ndnx::Name &deviceName, const Ndnx::Name &fileBaseName)
{
m_executor.execute (bind (&Dispatcher::Did_FetchManager_FileFetchComplete_Execute, this, deviceName, fileBaseName));
}
void
-Dispatcher::Did_FetchManager_FileFetchComplete_Execute (Ccnx::Name deviceName, Ccnx::Name fileBaseName)
+Dispatcher::Did_FetchManager_FileFetchComplete_Execute (Ndnx::Name deviceName, Ndnx::Name fileBaseName)
{
// fileBaseName: /<device_name>/<appname>/file/<hash>
@@ -472,7 +472,7 @@
{
m_fileStateCow->UpdateFile (file->filename(), file->version(),
Hash(file->file_hash ().c_str(), file->file_hash ().size ()),
- CcnxCharbuf (file->device_name().c_str(), file->device_name().size()), file->seq_no(),
+ NdnxCharbuf (file->device_name().c_str(), file->device_name().size()), file->seq_no(),
file->mtime(), file->mtime(), file->mtime(),
file->mode(), file->seg_num());
diff --git a/src/dispatcher.h b/src/dispatcher.h
index d5c0f30..4938174 100644
--- a/src/dispatcher.h
+++ b/src/dispatcher.h
@@ -24,7 +24,7 @@
#include "action-log.h"
#include "sync-core.h"
-#include "ccnx-wrapper.h"
+#include "ndnx-wrapper.h"
#include "executor.h"
#include "object-db.h"
#include "object-manager.h"
@@ -50,7 +50,7 @@
Dispatcher(const std::string &localUserName
, const std::string &sharedFolder
, const boost::filesystem::path &rootDir
- , Ccnx::CcnxWrapperPtr ccnx
+ , Ndnx::NdnxWrapperPtr ndnx
, bool enablePrefixDiscovery = true
);
~Dispatcher();
@@ -113,7 +113,7 @@
Did_SyncLog_StateChange_Execute (SyncStateMsgPtr stateMsg);
void
- Did_FetchManager_ActionFetch (const Ccnx::Name &deviceName, const Ccnx::Name &actionName, uint32_t seqno, Ccnx::PcoPtr actionPco);
+ Did_FetchManager_ActionFetch (const Ndnx::Name &deviceName, const Ndnx::Name &actionName, uint32_t seqno, Ndnx::PcoPtr actionPco);
void
Did_ActionLog_ActionApply_Delete (const std::string &filename);
@@ -122,27 +122,27 @@
Did_ActionLog_ActionApply_Delete_Execute (std::string filename);
// void
- // Did_ActionLog_ActionApply_AddOrModify (const std::string &filename, Ccnx::Name device_name, sqlite3_int64 seq_no,
+ // Did_ActionLog_ActionApply_AddOrModify (const std::string &filename, Ndnx::Name device_name, sqlite3_int64 seq_no,
// HashPtr hash, time_t m_time, int mode, int seg_num);
void
- Did_FetchManager_FileSegmentFetch (const Ccnx::Name &deviceName, const Ccnx::Name &fileSegmentName, uint32_t segment, Ccnx::PcoPtr fileSegmentPco);
+ Did_FetchManager_FileSegmentFetch (const Ndnx::Name &deviceName, const Ndnx::Name &fileSegmentName, uint32_t segment, Ndnx::PcoPtr fileSegmentPco);
void
- Did_FetchManager_FileSegmentFetch_Execute (Ccnx::Name deviceName, Ccnx::Name fileSegmentName, uint32_t segment, Ccnx::PcoPtr fileSegmentPco);
+ Did_FetchManager_FileSegmentFetch_Execute (Ndnx::Name deviceName, Ndnx::Name fileSegmentName, uint32_t segment, Ndnx::PcoPtr fileSegmentPco);
void
- Did_FetchManager_FileFetchComplete (const Ccnx::Name &deviceName, const Ccnx::Name &fileBaseName);
+ Did_FetchManager_FileFetchComplete (const Ndnx::Name &deviceName, const Ndnx::Name &fileBaseName);
void
- Did_FetchManager_FileFetchComplete_Execute (Ccnx::Name deviceName, Ccnx::Name fileBaseName);
+ Did_FetchManager_FileFetchComplete_Execute (Ndnx::Name deviceName, Ndnx::Name fileBaseName);
void
- Did_LocalPrefix_Updated (const Ccnx::Name &prefix);
+ Did_LocalPrefix_Updated (const Ndnx::Name &prefix);
private:
void
- AssembleFile_Execute (const Ccnx::Name &deviceName, const Hash &filehash, const boost::filesystem::path &relativeFilepath);
+ AssembleFile_Execute (const Ndnx::Name &deviceName, const Hash &filehash, const boost::filesystem::path &relativeFilepath);
// void
// fileChanged(const boost::filesystem::path &relativeFilepath, ActionType type);
@@ -154,13 +154,13 @@
// actionReceived(const ActionItemPtr &actionItem);
// void
- // fileSegmentReceived(const Ccnx::Name &name, const Ccnx::Bytes &content);
+ // fileSegmentReceived(const Ndnx::Name &name, const Ndnx::Bytes &content);
// void
- // fileReady(const Ccnx::Name &fileNamePrefix);
+ // fileReady(const Ndnx::Name &fileNamePrefix);
private:
- Ccnx::CcnxWrapperPtr m_ccnx;
+ Ndnx::NdnxWrapperPtr m_ndnx;
SyncCore *m_core;
SyncLogPtr m_syncLog;
ActionLogPtr m_actionLog;
@@ -170,7 +170,7 @@
boost::filesystem::path m_rootDir;
Executor m_executor;
ObjectManager m_objectManager;
- Ccnx::Name m_localUserName;
+ Ndnx::Name m_localUserName;
// maintain object db ptrs so that we don't need to create them
// for every fetched segment of a file
diff --git a/src/fetch-manager.cc b/src/fetch-manager.cc
index a5a2bc2..034b9d6 100644
--- a/src/fetch-manager.cc
+++ b/src/fetch-manager.cc
@@ -32,14 +32,14 @@
using namespace boost;
using namespace std;
-using namespace Ccnx;
+using namespace Ndnx;
//The disposer object function
struct fetcher_disposer { void operator() (Fetcher *delete_this) { delete delete_this; } };
static const string SCHEDULE_FETCHES_TAG = "ScheduleFetches";
-FetchManager::FetchManager (Ccnx::CcnxWrapperPtr ccnx,
+FetchManager::FetchManager (Ndnx::NdnxWrapperPtr ndnx,
const Mapping &mapping,
const Name &broadcastForwardingHint,
uint32_t parallelFetches, // = 3
@@ -47,7 +47,7 @@
const FinishCallback &defaultFinishCallback,
const FetchTaskDbPtr &taskDb
)
- : m_ccnx (ccnx)
+ : m_ndnx (ndnx)
, m_mapping (mapping)
, m_maxParallelFetches (parallelFetches)
, m_currentParallelFetches (0)
@@ -76,21 +76,21 @@
m_scheduler->shutdown ();
m_executor->shutdown();
- m_ccnx.reset ();
+ m_ndnx.reset ();
m_fetchList.clear_and_dispose (fetcher_disposer ());
}
// Enqueue using default callbacks
void
-FetchManager::Enqueue (const Ccnx::Name &deviceName, const Ccnx::Name &baseName,
+FetchManager::Enqueue (const Ndnx::Name &deviceName, const Ndnx::Name &baseName,
uint64_t minSeqNo, uint64_t maxSeqNo, int priority)
{
Enqueue(deviceName, baseName, m_defaultSegmentCallback, m_defaultFinishCallback, minSeqNo, maxSeqNo, priority);
}
void
-FetchManager::Enqueue (const Ccnx::Name &deviceName, const Ccnx::Name &baseName,
+FetchManager::Enqueue (const Ndnx::Name &deviceName, const Ndnx::Name &baseName,
const SegmentCallback &segmentCallback, const FinishCallback &finishCallback,
uint64_t minSeqNo, uint64_t maxSeqNo, int priority/*PRIORITY_NORMAL*/)
{
@@ -112,7 +112,7 @@
unique_lock<mutex> lock (m_parellelFetchMutex);
_LOG_TRACE ("++++ Create fetcher: " << baseName);
- Fetcher *fetcher = new Fetcher (m_ccnx,
+ Fetcher *fetcher = new Fetcher (m_ndnx,
m_executor,
segmentCallback,
finishCallback,
diff --git a/src/fetch-manager.h b/src/fetch-manager.h
index ecf2286..06f6687 100644
--- a/src/fetch-manager.h
+++ b/src/fetch-manager.h
@@ -30,7 +30,7 @@
#include <stdint.h>
#include "scheduler.h"
#include "executor.h"
-#include "ccnx-wrapper.h"
+#include "ndnx-wrapper.h"
#include "fetch-task-db.h"
#include "fetcher.h"
@@ -44,12 +44,12 @@
PRIORITY_HIGH
};
- typedef boost::function<Ccnx::Name(const Ccnx::Name &)> Mapping;
- typedef boost::function<void(Ccnx::Name &deviceName, Ccnx::Name &baseName, uint64_t seq, Ccnx::PcoPtr pco)> SegmentCallback;
- typedef boost::function<void(Ccnx::Name &deviceName, Ccnx::Name &baseName)> FinishCallback;
- FetchManager (Ccnx::CcnxWrapperPtr ccnx,
+ typedef boost::function<Ndnx::Name(const Ndnx::Name &)> Mapping;
+ typedef boost::function<void(Ndnx::Name &deviceName, Ndnx::Name &baseName, uint64_t seq, Ndnx::PcoPtr pco)> SegmentCallback;
+ typedef boost::function<void(Ndnx::Name &deviceName, Ndnx::Name &baseName)> FinishCallback;
+ FetchManager (Ndnx::NdnxWrapperPtr ndnx,
const Mapping &mapping,
- const Ccnx::Name &broadcastForwardingHint,
+ const Ndnx::Name &broadcastForwardingHint,
uint32_t parallelFetches = 3,
const SegmentCallback &defaultSegmentCallback = SegmentCallback(),
const FinishCallback &defaultFinishCallback = FinishCallback(),
@@ -58,30 +58,30 @@
virtual ~FetchManager ();
void
- Enqueue (const Ccnx::Name &deviceName, const Ccnx::Name &baseName,
+ Enqueue (const Ndnx::Name &deviceName, const Ndnx::Name &baseName,
const SegmentCallback &segmentCallback, const FinishCallback &finishCallback,
uint64_t minSeqNo, uint64_t maxSeqNo, int priority=PRIORITY_NORMAL);
// Enqueue using default callbacks
void
- Enqueue (const Ccnx::Name &deviceName, const Ccnx::Name &baseName,
+ Enqueue (const Ndnx::Name &deviceName, const Ndnx::Name &baseName,
uint64_t minSeqNo, uint64_t maxSeqNo, int priority=PRIORITY_NORMAL);
// only for Fetcher
- inline Ccnx::CcnxWrapperPtr
- GetCcnx ();
+ inline Ndnx::NdnxWrapperPtr
+ GetNdnx ();
private:
// Fetch Events
void
- DidDataSegmentFetched (Fetcher &fetcher, uint64_t seqno, const Ccnx::Name &basename,
- const Ccnx::Name &name, Ccnx::PcoPtr data);
+ DidDataSegmentFetched (Fetcher &fetcher, uint64_t seqno, const Ndnx::Name &basename,
+ const Ndnx::Name &name, Ndnx::PcoPtr data);
void
DidNoDataTimeout (Fetcher &fetcher);
void
- DidFetchComplete (Fetcher &fetcher, const Ccnx::Name &deviceName, const Ccnx::Name &baseName);
+ DidFetchComplete (Fetcher &fetcher, const Ndnx::Name &deviceName, const Ndnx::Name &baseName);
void
ScheduleFetches ();
@@ -90,7 +90,7 @@
TimedWait (Fetcher &fetcher);
private:
- Ccnx::CcnxWrapperPtr m_ccnx;
+ Ndnx::NdnxWrapperPtr m_ndnx;
Mapping m_mapping;
uint32_t m_maxParallelFetches;
@@ -110,13 +110,13 @@
FinishCallback m_defaultFinishCallback;
FetchTaskDbPtr m_taskDb;
- const Ccnx::Name m_broadcastHint;
+ const Ndnx::Name m_broadcastHint;
};
-Ccnx::CcnxWrapperPtr
-FetchManager::GetCcnx ()
+Ndnx::NdnxWrapperPtr
+FetchManager::GetNdnx ()
{
- return m_ccnx;
+ return m_ndnx;
}
typedef boost::error_info<struct tag_errmsg, std::string> errmsg_info_str;
diff --git a/src/fetch-task-db.cc b/src/fetch-task-db.cc
index 11ae6c9..3141048 100644
--- a/src/fetch-task-db.cc
+++ b/src/fetch-task-db.cc
@@ -23,7 +23,7 @@
using namespace std;
using namespace boost;
-using namespace Ccnx;
+using namespace Ndnx;
namespace fs = boost::filesystem;
const string INIT_DATABASE = "\
@@ -76,8 +76,8 @@
{
sqlite3_stmt *stmt;
sqlite3_prepare_v2(m_db, "INSERT OR IGNORE INTO Task (deviceName, baseName, minSeqNo, maxSeqNo, priority) VALUES (?, ?, ?, ?, ?)", -1, &stmt, 0);
- CcnxCharbufPtr deviceBuf = CcnxCharbufPtr(deviceName);
- CcnxCharbufPtr baseBuf = CcnxCharbufPtr(baseName);
+ NdnxCharbufPtr deviceBuf = NdnxCharbufPtr(deviceName);
+ NdnxCharbufPtr baseBuf = NdnxCharbufPtr(baseName);
sqlite3_bind_blob(stmt, 1, deviceBuf->buf(), deviceBuf->length(), SQLITE_STATIC);
sqlite3_bind_blob(stmt, 2, baseBuf->buf(), baseBuf->length(), SQLITE_STATIC);
sqlite3_bind_int64(stmt, 3, minSeqNo);
@@ -96,8 +96,8 @@
{
sqlite3_stmt *stmt;
sqlite3_prepare_v2(m_db, "DELETE FROM Task WHERE deviceName = ? AND baseName = ?;", -1, &stmt, 0);
- CcnxCharbufPtr deviceBuf = CcnxCharbufPtr(deviceName);
- CcnxCharbufPtr baseBuf = CcnxCharbufPtr(baseName);
+ NdnxCharbufPtr deviceBuf = NdnxCharbufPtr(deviceName);
+ NdnxCharbufPtr baseBuf = NdnxCharbufPtr(baseName);
sqlite3_bind_blob(stmt, 1, deviceBuf->buf(), deviceBuf->length(), SQLITE_STATIC);
sqlite3_bind_blob(stmt, 2, baseBuf->buf(), baseBuf->length(), SQLITE_STATIC);
int res = sqlite3_step(stmt);
diff --git a/src/fetch-task-db.h b/src/fetch-task-db.h
index 1f8e16a..46140d6 100644
--- a/src/fetch-task-db.h
+++ b/src/fetch-task-db.h
@@ -22,8 +22,8 @@
#define FETCH_TASK_DB_H
#include <sqlite3.h>
-#include <ccnx-common.h>
-#include <ccnx-name.h>
+#include <ndnx-common.h>
+#include <ndnx-name.h>
#include <boost/filesystem.hpp>
#include <boost/shared_ptr.hpp>
@@ -36,12 +36,12 @@
// task with same deviceName and baseName combination will be added only once
// if task already exists, this call does nothing
void
- addTask(const Ccnx::Name &deviceName, const Ccnx::Name &baseName, uint64_t minSeqNo, uint64_t maxSeqNo, int priority);
+ addTask(const Ndnx::Name &deviceName, const Ndnx::Name &baseName, uint64_t minSeqNo, uint64_t maxSeqNo, int priority);
void
- deleteTask(const Ccnx::Name &deviceName, const Ccnx::Name &baseName);
+ deleteTask(const Ndnx::Name &deviceName, const Ndnx::Name &baseName);
- typedef boost::function<void(const Ccnx::Name &, const Ccnx::Name &, uint64_t, uint64_t, int)> FetchTaskCallback;
+ typedef boost::function<void(const Ndnx::Name &, const Ndnx::Name &, uint64_t, uint64_t, int)> FetchTaskCallback;
void
foreachTask(const FetchTaskCallback &callback);
diff --git a/src/fetcher.cc b/src/fetcher.cc
index 87b0898..0991bbe 100644
--- a/src/fetcher.cc
+++ b/src/fetcher.cc
@@ -21,7 +21,7 @@
#include "fetcher.h"
#include "fetch-manager.h"
-#include "ccnx-pco.h"
+#include "ndnx-pco.h"
#include "logging.h"
#include <boost/make_shared.hpp>
@@ -33,17 +33,17 @@
using namespace boost;
using namespace std;
-using namespace Ccnx;
+using namespace Ndnx;
-Fetcher::Fetcher (Ccnx::CcnxWrapperPtr ccnx,
+Fetcher::Fetcher (Ndnx::NdnxWrapperPtr ndnx,
ExecutorPtr executor,
const SegmentCallback &segmentCallback,
const FinishCallback &finishCallback,
OnFetchCompleteCallback onFetchComplete, OnFetchFailedCallback onFetchFailed,
- const Ccnx::Name &deviceName, const Ccnx::Name &name, int64_t minSeqNo, int64_t maxSeqNo,
+ const Ndnx::Name &deviceName, const Ndnx::Name &name, int64_t minSeqNo, int64_t maxSeqNo,
boost::posix_time::time_duration timeout/* = boost::posix_time::seconds (30)*/,
- const Ccnx::Name &forwardingHint/* = Ccnx::Name ()*/)
- : m_ccnx (ccnx)
+ const Ndnx::Name &forwardingHint/* = Ndnx::Name ()*/)
+ : m_ndnx (ndnx)
, m_segmentCallback (segmentCallback)
, m_onFetchComplete (onFetchComplete)
@@ -93,7 +93,7 @@
}
void
-Fetcher::SetForwardingHint (const Ccnx::Name &forwardingHint)
+Fetcher::SetForwardingHint (const Ndnx::Name &forwardingHint)
{
m_forwardingHint = forwardingHint;
}
@@ -116,7 +116,7 @@
_LOG_DEBUG (" >>> i " << Name (m_forwardingHint)(m_name) << ", seq = " << (m_minSendSeqNo + 1 ));
// cout << ">>> " << m_minSendSeqNo+1 << endl;
- m_ccnx->sendInterest (Name (m_forwardingHint)(m_name)(m_minSendSeqNo+1),
+ m_ndnx->sendInterest (Name (m_forwardingHint)(m_name)(m_minSendSeqNo+1),
Closure (bind(&Fetcher::OnData, this, m_minSendSeqNo+1, _1, _2),
bind(&Fetcher::OnTimeout, this, m_minSendSeqNo+1, _1, _2, _3)),
Selectors().interestLifetime (m_rto)); // Alex: this lifetime should be changed to RTO
@@ -127,13 +127,13 @@
}
void
-Fetcher::OnData (uint64_t seqno, const Ccnx::Name &name, PcoPtr data)
+Fetcher::OnData (uint64_t seqno, const Ndnx::Name &name, PcoPtr data)
{
m_executor->execute (bind (&Fetcher::OnData_Execute, this, seqno, name, data));
}
void
-Fetcher::OnData_Execute (uint64_t seqno, Ccnx::Name name, Ccnx::PcoPtr data)
+Fetcher::OnData_Execute (uint64_t seqno, Ndnx::Name name, Ndnx::PcoPtr data)
{
_LOG_DEBUG (" <<< d " << name.getPartialName (0, name.size () - 1) << ", seq = " << seqno);
@@ -156,7 +156,7 @@
}
else
{
- // in this case we don't care whether "data" is verified, in fact, we expect it is unverified
+ // in this case we don't care whether "data" is verified, in fact, we expect it is unverified
try {
PcoPtr pco = make_shared<ParsedContentObject> (*data->contentPtr ());
@@ -260,14 +260,14 @@
}
void
-Fetcher::OnTimeout (uint64_t seqno, const Ccnx::Name &name, const Closure &closure, Selectors selectors)
+Fetcher::OnTimeout (uint64_t seqno, const Ndnx::Name &name, const Closure &closure, Selectors selectors)
{
_LOG_DEBUG (this << ", " << m_executor.get ());
m_executor->execute (bind (&Fetcher::OnTimeout_Execute, this, seqno, name, closure, selectors));
}
void
-Fetcher::OnTimeout_Execute (uint64_t seqno, Ccnx::Name name, Ccnx::Closure closure, Ccnx::Selectors selectors)
+Fetcher::OnTimeout_Execute (uint64_t seqno, Ndnx::Name name, Ndnx::Closure closure, Ndnx::Selectors selectors)
{
_LOG_DEBUG (" <<< :( timeout " << name.getPartialName (0, name.size () - 1) << ", seq = " << seqno);
@@ -318,11 +318,11 @@
{
m_rto = m_maxRto;
_LOG_DEBUG ("RTO is max: " << m_rto);
- }
+ }
else
{
_LOG_DEBUG ("RTO is doubled: " << m_rto);
- }
+}
}
{
@@ -333,6 +333,6 @@
m_slowStart = true;
}
- m_ccnx->sendInterest (name, closure, selectors.interestLifetime (m_rto));
+ m_ndnx->sendInterest (name, closure, selectors.interestLifetime (m_rto));
}
}
diff --git a/src/fetcher.h b/src/fetcher.h
index 1bc5d03..c62a4b4 100644
--- a/src/fetcher.h
+++ b/src/fetcher.h
@@ -22,8 +22,8 @@
#ifndef FETCHER_H
#define FETCHER_H
-#include "ccnx-wrapper.h"
-#include "ccnx-name.h"
+#include "ndnx-wrapper.h"
+#include "ndnx-name.h"
#include "executor.h"
#include <boost/intrusive/list.hpp>
@@ -37,20 +37,20 @@
class Fetcher
{
public:
- typedef boost::function<void(Ccnx::Name &deviceName, Ccnx::Name &baseName, uint64_t seq, Ccnx::PcoPtr pco)> SegmentCallback;
- typedef boost::function<void(Ccnx::Name &deviceName, Ccnx::Name &baseName)> FinishCallback;
- typedef boost::function<void (Fetcher &, const Ccnx::Name &deviceName, const Ccnx::Name &baseName)> OnFetchCompleteCallback;
+ typedef boost::function<void(Ndnx::Name &deviceName, Ndnx::Name &baseName, uint64_t seq, Ndnx::PcoPtr pco)> SegmentCallback;
+ typedef boost::function<void(Ndnx::Name &deviceName, Ndnx::Name &baseName)> FinishCallback;
+ typedef boost::function<void (Fetcher &, const Ndnx::Name &deviceName, const Ndnx::Name &baseName)> OnFetchCompleteCallback;
typedef boost::function<void (Fetcher &)> OnFetchFailedCallback;
- Fetcher (Ccnx::CcnxWrapperPtr ccnx,
+ Fetcher (Ndnx::NdnxWrapperPtr ndnx,
ExecutorPtr executor,
const SegmentCallback &segmentCallback, // callback passed by caller of FetchManager
const FinishCallback &finishCallback, // callback passed by caller of FetchManager
OnFetchCompleteCallback onFetchComplete, OnFetchFailedCallback onFetchFailed, // callbacks provided by FetchManager
- const Ccnx::Name &deviceName, const Ccnx::Name &name, int64_t minSeqNo, int64_t maxSeqNo,
+ const Ndnx::Name &deviceName, const Ndnx::Name &name, int64_t minSeqNo, int64_t maxSeqNo,
boost::posix_time::time_duration timeout = boost::posix_time::seconds (30), // this time is not precise, but sets min bound
// actual time depends on how fast Interests timeout
- const Ccnx::Name &forwardingHint = Ccnx::Name ());
+ const Ndnx::Name &forwardingHint = Ndnx::Name ());
virtual ~Fetcher ();
inline bool
@@ -63,15 +63,15 @@
RestartPipeline ();
void
- SetForwardingHint (const Ccnx::Name &forwardingHint);
+ SetForwardingHint (const Ndnx::Name &forwardingHint);
- const Ccnx::Name &
+ const Ndnx::Name &
GetForwardingHint () const { return m_forwardingHint; }
- const Ccnx::Name &
+ const Ndnx::Name &
GetName () const { return m_name; }
- const Ccnx::Name &
+ const Ndnx::Name &
GetDeviceName () const { return m_deviceName; }
double
@@ -91,22 +91,22 @@
FillPipeline ();
void
- OnData (uint64_t seqno, const Ccnx::Name &name, Ccnx::PcoPtr data);
+ OnData (uint64_t seqno, const Ndnx::Name &name, Ndnx::PcoPtr data);
void
- OnData_Execute (uint64_t seqno, Ccnx::Name name, Ccnx::PcoPtr data);
+ OnData_Execute (uint64_t seqno, Ndnx::Name name, Ndnx::PcoPtr data);
void
- OnTimeout (uint64_t seqno, const Ccnx::Name &name, const Ccnx::Closure &closure, Ccnx::Selectors selectors);
+ OnTimeout (uint64_t seqno, const Ndnx::Name &name, const Ndnx::Closure &closure, Ndnx::Selectors selectors);
void
- OnTimeout_Execute (uint64_t seqno, Ccnx::Name name, Ccnx::Closure closure, Ccnx::Selectors selectors);
+ OnTimeout_Execute (uint64_t seqno, Ndnx::Name name, Ndnx::Closure closure, Ndnx::Selectors selectors);
public:
boost::intrusive::list_member_hook<> m_managerListHook;
private:
- Ccnx::CcnxWrapperPtr m_ccnx;
+ Ndnx::NdnxWrapperPtr m_ndnx;
SegmentCallback m_segmentCallback;
OnFetchCompleteCallback m_onFetchComplete;
@@ -117,9 +117,9 @@
bool m_active;
bool m_timedwait;
- Ccnx::Name m_name;
- Ccnx::Name m_deviceName;
- Ccnx::Name m_forwardingHint;
+ Ndnx::Name m_name;
+ Ndnx::Name m_deviceName;
+ Ndnx::Name m_forwardingHint;
boost::posix_time::time_duration m_maximumNoActivityPeriod;
diff --git a/src/file-state.cc b/src/file-state.cc
index fa998de..6affed9 100644
--- a/src/file-state.cc
+++ b/src/file-state.cc
@@ -65,7 +65,7 @@
void
FileState::UpdateFile (const std::string &filename, sqlite3_int64 version,
- const Hash &hash, const Ccnx::CcnxCharbuf &device_name, sqlite3_int64 seq_no,
+ const Hash &hash, const Ndnx::NdnxCharbuf &device_name, sqlite3_int64 seq_no,
time_t atime, time_t mtime, time_t ctime, int mode, int seg_num)
{
sqlite3_stmt *stmt;
diff --git a/src/file-state.h b/src/file-state.h
index b0890a2..f5617d4 100644
--- a/src/file-state.h
+++ b/src/file-state.h
@@ -24,7 +24,7 @@
#include "db-helper.h"
-#include "ccnx-name.h"
+#include "ndnx-name.h"
#include "file-item.pb.h"
#include "hash-helper.h"
@@ -49,7 +49,7 @@
*/
void
UpdateFile (const std::string &filename, sqlite3_int64 version,
- const Hash &hash, const Ccnx::CcnxCharbuf &device_name, sqlite3_int64 seqno,
+ const Hash &hash, const Ndnx::NdnxCharbuf &device_name, sqlite3_int64 seqno,
time_t atime, time_t mtime, time_t ctime, int mode, int seg_num);
/**
diff --git a/src/hash-helper.cc b/src/hash-helper.cc
index 11b29e2..1ee08c1 100644
--- a/src/hash-helper.cc
+++ b/src/hash-helper.cc
@@ -169,7 +169,7 @@
}
HashPtr
-Hash::FromBytes (const Ccnx::Bytes &bytes)
+Hash::FromBytes (const Ndnx::Bytes &bytes)
{
HashPtr retval = make_shared<Hash> (reinterpret_cast<void*> (0), 0);
retval->m_buf = new unsigned char [EVP_MAX_MD_SIZE];
@@ -178,7 +178,7 @@
EVP_DigestInit_ex (hash_context, HASH_FUNCTION (), 0);
// not sure whether it's bad to do so if bytes.size is huge
- EVP_DigestUpdate(hash_context, Ccnx::head(bytes), bytes.size());
+ EVP_DigestUpdate(hash_context, Ndnx::head(bytes), bytes.size());
retval->m_buf = new unsigned char [EVP_MAX_MD_SIZE];
diff --git a/src/hash-helper.h b/src/hash-helper.h
index 9050573..a2690ce 100644
--- a/src/hash-helper.h
+++ b/src/hash-helper.h
@@ -27,7 +27,7 @@
#include <boost/shared_ptr.hpp>
#include <boost/exception/all.hpp>
#include <boost/filesystem.hpp>
-#include "ccnx-common.h"
+#include "ndnx-common.h"
// Other options: VP_md2, EVP_md5, EVP_sha, EVP_sha1, EVP_sha256, EVP_dss, EVP_dss1, EVP_mdc2, EVP_ripemd160
#define HASH_FUNCTION EVP_sha256
@@ -74,7 +74,7 @@
FromFileContent (const boost::filesystem::path &fileName);
static HashPtr
- FromBytes (const Ccnx::Bytes &bytes);
+ FromBytes (const Ndnx::Bytes &bytes);
~Hash ()
{
diff --git a/src/object-db.cc b/src/object-db.cc
index 05aca34..276441b 100644
--- a/src/object-db.cc
+++ b/src/object-db.cc
@@ -29,7 +29,7 @@
INIT_LOGGER ("Object.Db");
using namespace std;
-using namespace Ccnx;
+using namespace Ndnx;
using namespace boost;
namespace fs = boost::filesystem;
@@ -78,7 +78,7 @@
}
bool
-ObjectDb::DoesExist (const boost::filesystem::path &folder, const Ccnx::Name &deviceName, const std::string &hash)
+ObjectDb::DoesExist (const boost::filesystem::path &folder, const Ndnx::Name &deviceName, const std::string &hash)
{
fs::path actualFolder = folder / "objects" / hash.substr (0, 2);
bool retval = false;
@@ -90,7 +90,7 @@
sqlite3_stmt *stmt;
sqlite3_prepare_v2 (db, "SELECT count(*), count(nullif(content_object,0)) FROM File WHERE device_name=?", -1, &stmt, 0);
- CcnxCharbufPtr buf = deviceName.toCcnxCharbuf ();
+ NdnxCharbufPtr buf = deviceName.toNdnxCharbuf ();
sqlite3_bind_blob (stmt, 1, buf->buf (), buf->length (), SQLITE_TRANSIENT);
int res = sqlite3_step (stmt);
@@ -128,7 +128,7 @@
}
void
-ObjectDb::saveContentObject (const Ccnx::Name &deviceName, sqlite3_int64 segment, const Ccnx::Bytes &data)
+ObjectDb::saveContentObject (const Ndnx::Name &deviceName, sqlite3_int64 segment, const Ndnx::Bytes &data)
{
sqlite3_stmt *stmt;
sqlite3_prepare_v2 (m_db, "INSERT INTO File "
@@ -137,7 +137,7 @@
//_LOG_DEBUG ("Saving content object for [" << deviceName << ", seqno: " << segment << ", size: " << data.size () << "]");
- CcnxCharbufPtr buf = deviceName.toCcnxCharbuf ();
+ NdnxCharbufPtr buf = deviceName.toNdnxCharbuf ();
sqlite3_bind_blob (stmt, 1, buf->buf (), buf->length (), SQLITE_STATIC);
sqlite3_bind_int64 (stmt, 2, segment);
sqlite3_bind_blob (stmt, 3, &data[0], data.size (), SQLITE_STATIC);
@@ -150,13 +150,13 @@
m_lastUsed = time(NULL);
}
-Ccnx::BytesPtr
-ObjectDb::fetchSegment (const Ccnx::Name &deviceName, sqlite3_int64 segment)
+Ndnx::BytesPtr
+ObjectDb::fetchSegment (const Ndnx::Name &deviceName, sqlite3_int64 segment)
{
sqlite3_stmt *stmt;
sqlite3_prepare_v2 (m_db, "SELECT content_object FROM File WHERE device_name=? AND segment=?", -1, &stmt, 0);
- CcnxCharbufPtr buf = deviceName.toCcnxCharbuf ();
+ NdnxCharbufPtr buf = deviceName.toNdnxCharbuf ();
sqlite3_bind_blob (stmt, 1, buf->buf (), buf->length (), SQLITE_TRANSIENT);
sqlite3_bind_int64 (stmt, 2, segment);
@@ -186,7 +186,7 @@
}
// sqlite3_int64
-// ObjectDb::getNumberOfSegments (const Ccnx::Name &deviceName)
+// ObjectDb::getNumberOfSegments (const Ndnx::Name &deviceName)
// {
// sqlite3_stmt *stmt;
// sqlite3_prepare_v2 (m_db, "SELECT count(*) FROM File WHERE device_name=?", -1, &stmt, 0);
diff --git a/src/object-db.h b/src/object-db.h
index cabc46d..7e13203 100644
--- a/src/object-db.h
+++ b/src/object-db.h
@@ -24,8 +24,8 @@
#include <string>
#include <sqlite3.h>
-#include <ccnx-common.h>
-#include <ccnx-name.h>
+#include <ndnx-common.h>
+#include <ndnx-name.h>
#include <boost/filesystem.hpp>
#include <boost/shared_ptr.hpp>
#include <ctime>
@@ -39,19 +39,19 @@
~ObjectDb ();
void
- saveContentObject (const Ccnx::Name &deviceName, sqlite3_int64 segment, const Ccnx::Bytes &data);
+ saveContentObject (const Ndnx::Name &deviceName, sqlite3_int64 segment, const Ndnx::Bytes &data);
- Ccnx::BytesPtr
- fetchSegment (const Ccnx::Name &deviceName, sqlite3_int64 segment);
+ Ndnx::BytesPtr
+ fetchSegment (const Ndnx::Name &deviceName, sqlite3_int64 segment);
// sqlite3_int64
- // getNumberOfSegments (const Ccnx::Name &deviceName);
+ // getNumberOfSegments (const Ndnx::Name &deviceName);
time_t
secondsSinceLastUse();
static bool
- DoesExist (const boost::filesystem::path &folder, const Ccnx::Name &deviceName, const std::string &hash);
+ DoesExist (const boost::filesystem::path &folder, const Ndnx::Name &deviceName, const std::string &hash);
private:
void
diff --git a/src/object-manager.cc b/src/object-manager.cc
index fc50488..9b87853 100644
--- a/src/object-manager.cc
+++ b/src/object-manager.cc
@@ -20,9 +20,9 @@
*/
#include "object-manager.h"
-#include "ccnx-name.h"
-#include "ccnx-common.h"
-#include "ccnx-pco.h"
+#include "ndnx-name.h"
+#include "ndnx-common.h"
+#include "ndnx-pco.h"
#include "object-db.h"
#include "logging.h"
@@ -35,15 +35,15 @@
INIT_LOGGER ("Object.Manager");
-using namespace Ccnx;
+using namespace Ndnx;
using namespace boost;
using namespace std;
namespace fs = boost::filesystem;
const int MAX_FILE_SEGMENT_SIZE = 1024;
-ObjectManager::ObjectManager (Ccnx::CcnxWrapperPtr ccnx, const fs::path &folder, const std::string &appName)
- : m_ccnx (ccnx)
+ObjectManager::ObjectManager (Ndnx::NdnxWrapperPtr ndnx, const fs::path &folder, const std::string &appName)
+ : m_ndnx (ndnx)
, m_folder (folder / ".chronoshare")
, m_appName (appName)
{
@@ -56,7 +56,7 @@
// /<devicename>/<appname>/file/<hash>/<segment>
boost::tuple<HashPtr /*object-db name*/, size_t /* number of segments*/>
-ObjectManager::localFileToObjects (const fs::path &file, const Ccnx::Name &deviceName)
+ObjectManager::localFileToObjects (const fs::path &file, const Ndnx::Name &deviceName)
{
HashPtr fileHash = Hash::FromFileContent (file);
ObjectDb fileDb (m_folder, lexical_cast<string> (*fileHash));
@@ -79,7 +79,7 @@
// cout << name << endl;
//_LOG_DEBUG ("Read " << iff.gcount () << " from " << file << " for segment " << segment);
- Bytes data = m_ccnx->createContentObject (name, buf, iff.gcount ());
+ Bytes data = m_ndnx->createContentObject (name, buf, iff.gcount ());
fileDb.saveContentObject (deviceName, segment, data);
segment ++;
@@ -87,7 +87,7 @@
if (segment == 0) // handle empty files
{
Name name = Name ("/")(m_appName)("file")(fileHash->GetHash (), fileHash->GetHashBytes ())(deviceName)(0);
- Bytes data = m_ccnx->createContentObject (name, 0, 0);
+ Bytes data = m_ndnx->createContentObject (name, 0, 0);
fileDb.saveContentObject (deviceName, 0, data);
segment ++;
@@ -97,7 +97,7 @@
}
bool
-ObjectManager::objectsToLocalFile (/*in*/const Ccnx::Name &deviceName, /*in*/const Hash &fileHash, /*out*/ const fs::path &file)
+ObjectManager::objectsToLocalFile (/*in*/const Ndnx::Name &deviceName, /*in*/const Hash &fileHash, /*out*/ const fs::path &file)
{
string hashStr = lexical_cast<string> (fileHash);
if (!ObjectDb::DoesExist (m_folder, deviceName, hashStr))
diff --git a/src/object-manager.h b/src/object-manager.h
index 2d0cdd0..9f55822 100644
--- a/src/object-manager.h
+++ b/src/object-manager.h
@@ -23,7 +23,7 @@
#define OBJECT_MANAGER_H
#include <string>
-#include <ccnx-wrapper.h>
+#include <ndnx-wrapper.h>
#include <hash-helper.h>
#include <boost/filesystem.hpp>
#include <boost/tuple/tuple.hpp>
@@ -33,7 +33,7 @@
class ObjectManager
{
public:
- ObjectManager (Ccnx::CcnxWrapperPtr ccnx, const boost::filesystem::path &folder, const std::string &appName);
+ ObjectManager (Ndnx::NdnxWrapperPtr ndnx, const boost::filesystem::path &folder, const std::string &appName);
virtual ~ObjectManager ();
/**
@@ -42,13 +42,13 @@
* Format: /<appname>/file/<hash>/<devicename>/<segment>
*/
boost::tuple<HashPtr /*object-db name*/, size_t /* number of segments*/>
- localFileToObjects (const boost::filesystem::path &file, const Ccnx::Name &deviceName);
+ localFileToObjects (const boost::filesystem::path &file, const Ndnx::Name &deviceName);
bool
- objectsToLocalFile (/*in*/const Ccnx::Name &deviceName, /*in*/const Hash &hash, /*out*/ const boost::filesystem::path &file);
+ objectsToLocalFile (/*in*/const Ndnx::Name &deviceName, /*in*/const Hash &hash, /*out*/ const boost::filesystem::path &file);
private:
- Ccnx::CcnxWrapperPtr m_ccnx;
+ Ndnx::NdnxWrapperPtr m_ndnx;
boost::filesystem::path m_folder;
std::string m_appName;
};
diff --git a/src/state-server.cc b/src/state-server.cc
index 2d1d96a..418f8da 100644
--- a/src/state-server.cc
+++ b/src/state-server.cc
@@ -31,17 +31,17 @@
INIT_LOGGER ("StateServer");
-using namespace Ccnx;
+using namespace Ndnx;
using namespace std;
using namespace boost;
-StateServer::StateServer(CcnxWrapperPtr ccnx, ActionLogPtr actionLog,
+StateServer::StateServer(NdnxWrapperPtr ndnx, ActionLogPtr actionLog,
const boost::filesystem::path &rootDir,
- const Ccnx::Name &userName, const std::string &sharedFolderName,
+ const Ndnx::Name &userName, const std::string &sharedFolderName,
const std::string &appName,
ObjectManager &objectManager,
int freshness/* = -1*/)
- : m_ccnx(ccnx)
+ : m_ndnx(ndnx)
, m_actionLog(actionLog)
, m_objectManager (objectManager)
, m_rootDir(rootDir)
@@ -78,28 +78,28 @@
// will be extended to support all planned commands later
// <PREFIX_INFO>/"actions"/"all"/<segment> get list of all actions
- m_ccnx->setInterestFilter (Name (m_PREFIX_INFO)("actions")("folder"), bind(&StateServer::info_actions_folder, this, _1));
- m_ccnx->setInterestFilter (Name (m_PREFIX_INFO)("actions")("file"), bind(&StateServer::info_actions_file, this, _1));
+ m_ndnx->setInterestFilter (Name (m_PREFIX_INFO)("actions")("folder"), bind(&StateServer::info_actions_folder, this, _1));
+ m_ndnx->setInterestFilter (Name (m_PREFIX_INFO)("actions")("file"), bind(&StateServer::info_actions_file, this, _1));
// <PREFIX_INFO>/"filestate"/"all"/<segment>
- m_ccnx->setInterestFilter (Name (m_PREFIX_INFO)("files")("folder"), bind(&StateServer::info_files_folder, this, _1));
+ m_ndnx->setInterestFilter (Name (m_PREFIX_INFO)("files")("folder"), bind(&StateServer::info_files_folder, this, _1));
// <PREFIX_CMD>/"restore"/"file"/<one-component-relative-file-name>/<version>/<file-hash>
- m_ccnx->setInterestFilter (Name (m_PREFIX_CMD)("restore")("file"), bind(&StateServer::cmd_restore_file, this, _1));
+ m_ndnx->setInterestFilter (Name (m_PREFIX_CMD)("restore")("file"), bind(&StateServer::cmd_restore_file, this, _1));
}
void
StateServer::deregisterPrefixes ()
{
- m_ccnx->clearInterestFilter (Name (m_PREFIX_INFO)("actions")("folder"));
- m_ccnx->clearInterestFilter (Name (m_PREFIX_INFO)("actions")("file"));
- m_ccnx->clearInterestFilter (Name (m_PREFIX_INFO)("files")("folder"));
- m_ccnx->clearInterestFilter (Name (m_PREFIX_CMD) ("restore")("file"));
+ m_ndnx->clearInterestFilter (Name (m_PREFIX_INFO)("actions")("folder"));
+ m_ndnx->clearInterestFilter (Name (m_PREFIX_INFO)("actions")("file"));
+ m_ndnx->clearInterestFilter (Name (m_PREFIX_INFO)("files")("folder"));
+ m_ndnx->clearInterestFilter (Name (m_PREFIX_CMD) ("restore")("file"));
}
void
StateServer::formatActionJson (json_spirit::Array &actions,
- const Ccnx::Name &name, sqlite3_int64 seq_no, const ActionItem &action)
+ const Ndnx::Name &name, sqlite3_int64 seq_no, const ActionItem &action)
{
/*
* {
@@ -161,7 +161,7 @@
if (action.has_parent_device_name ())
{
Object parentId;
- Ccnx::Name parent_device_name (action.parent_device_name ().c_str (), action.parent_device_name ().size ());
+ Ndnx::Name parent_device_name (action.parent_device_name ().c_str (), action.parent_device_name ().size ());
id.push_back (Pair ("userName", boost::lexical_cast<string> (parent_device_name)));
id.push_back (Pair ("seqNo", action.parent_seq_no ()));
@@ -201,7 +201,7 @@
void
-StateServer::info_actions_fileOrFolder_Execute (const Ccnx::Name &interest, bool isFolder/* = true*/)
+StateServer::info_actions_fileOrFolder_Execute (const Ndnx::Name &interest, bool isFolder/* = true*/)
{
// <PREFIX_INFO>/"actions"/"folder|file"/<folder|file>/<offset> get list of all actions
@@ -250,18 +250,18 @@
if (more)
{
json.push_back (Pair ("more", lexical_cast<string> (offset + 1)));
- // Ccnx::Name more = Name (interest.getPartialName (0, interest.size () - 1))(offset + 1);
+ // Ndnx::Name more = Name (interest.getPartialName (0, interest.size () - 1))(offset + 1);
// json.push_back (Pair ("more", lexical_cast<string> (more)));
}
ostringstream os;
write_stream (Value (json), os, pretty_print | raw_utf8);
- m_ccnx->publishData (interest, os.str (), 1);
+ m_ndnx->publishData (interest, os.str (), 1);
}
- catch (Ccnx::NameException &ne)
+ catch (Ndnx::NameException &ne)
{
// ignore any unexpected interests and errors
- _LOG_ERROR (*boost::get_error_info<Ccnx::error_info_str>(ne));
+ _LOG_ERROR (*boost::get_error_info<Ndnx::error_info_str>(ne));
}
}
@@ -298,7 +298,7 @@
json.push_back (Pair ("version", file.version ()));
{
Object owner;
- Ccnx::Name device_name (file.device_name ().c_str (), file.device_name ().size ());
+ Ndnx::Name device_name (file.device_name ().c_str (), file.device_name ().size ());
owner.push_back (Pair ("userName", boost::lexical_cast<string> (device_name)));
owner.push_back (Pair ("seqNo", file.seq_no ()));
@@ -323,7 +323,7 @@
}
void
-StateServer::info_files_folder (const Ccnx::Name &interest)
+StateServer::info_files_folder (const Ndnx::Name &interest)
{
if (interest.size () - m_PREFIX_INFO.size () != 3 &&
interest.size () - m_PREFIX_INFO.size () != 4)
@@ -338,7 +338,7 @@
void
-StateServer::info_files_folder_Execute (const Ccnx::Name &interest)
+StateServer::info_files_folder_Execute (const Ndnx::Name &interest)
{
// <PREFIX_INFO>/"filestate"/"folder"/<one-component-relative-folder-name>/<offset>
try
@@ -379,24 +379,24 @@
if (more)
{
json.push_back (Pair ("more", lexical_cast<string> (offset + 1)));
- // Ccnx::Name more = Name (interest.getPartialName (0, interest.size () - 1))(offset + 1);
+ // Ndnx::Name more = Name (interest.getPartialName (0, interest.size () - 1))(offset + 1);
// json.push_back (Pair ("more", lexical_cast<string> (more)));
}
ostringstream os;
write_stream (Value (json), os, pretty_print | raw_utf8);
- m_ccnx->publishData (interest, os.str (), 1);
+ m_ndnx->publishData (interest, os.str (), 1);
}
- catch (Ccnx::NameException &ne)
+ catch (Ndnx::NameException &ne)
{
// ignore any unexpected interests and errors
- _LOG_ERROR (*boost::get_error_info<Ccnx::error_info_str>(ne));
+ _LOG_ERROR (*boost::get_error_info<Ndnx::error_info_str>(ne));
}
}
void
-StateServer::cmd_restore_file (const Ccnx::Name &interest)
+StateServer::cmd_restore_file (const Ndnx::Name &interest)
{
if (interest.size () - m_PREFIX_CMD.size () != 4 &&
interest.size () - m_PREFIX_CMD.size () != 5)
@@ -410,7 +410,7 @@
}
void
-StateServer::cmd_restore_file_Execute (const Ccnx::Name &interest)
+StateServer::cmd_restore_file_Execute (const Ndnx::Name &interest)
{
// <PREFIX_CMD>/"restore"/"file"/<one-component-relative-file-name>/<version>/<file-hash>
@@ -446,7 +446,7 @@
if (!file)
{
- m_ccnx->publishData (interest, "FAIL: Requested file is not found", 1);
+ m_ndnx->publishData (interest, "FAIL: Requested file is not found", 1);
return;
}
@@ -468,14 +468,14 @@
#endif
*Hash::FromFileContent (filePath) == hash)
{
- m_ccnx->publishData (interest, "OK: File already exists", 1);
+ m_ndnx->publishData (interest, "OK: File already exists", 1);
_LOG_DEBUG ("Asking to assemble a file, but file already exists on a filesystem");
return;
}
}
catch (filesystem::filesystem_error &error)
{
- m_ccnx->publishData (interest, "FAIL: File operation failed", 1);
+ m_ndnx->publishData (interest, "FAIL: File operation failed", 1);
_LOG_ERROR ("File operations failed on [" << filePath << "] (ignoring)");
}
@@ -486,16 +486,16 @@
#if BOOST_VERSION >= 104900
permissions (filePath, static_cast<filesystem::perms> (file->mode ()));
#endif
- m_ccnx->publishData (interest, "OK", 1);
+ m_ndnx->publishData (interest, "OK", 1);
}
else
{
- m_ccnx->publishData (interest, "FAIL: Unknown error while restoring file", 1);
+ m_ndnx->publishData (interest, "FAIL: Unknown error while restoring file", 1);
}
}
- catch (Ccnx::NameException &ne)
+ catch (Ndnx::NameException &ne)
{
// ignore any unexpected interests and errors
- _LOG_ERROR(*boost::get_error_info<Ccnx::error_info_str>(ne));
+ _LOG_ERROR(*boost::get_error_info<Ndnx::error_info_str>(ne));
}
}
diff --git a/src/state-server.h b/src/state-server.h
index 8809b7f..26a6697 100644
--- a/src/state-server.h
+++ b/src/state-server.h
@@ -22,7 +22,7 @@
#ifndef STATE_SERVER_H
#define STATE_SERVER_H
-#include "ccnx-wrapper.h"
+#include "ndnx-wrapper.h"
#include "object-manager.h"
#include "object-db.h"
#include "action-log.h"
@@ -152,33 +152,33 @@
class StateServer
{
public:
- StateServer(Ccnx::CcnxWrapperPtr ccnx, ActionLogPtr actionLog, const boost::filesystem::path &rootDir,
- const Ccnx::Name &userName, const std::string &sharedFolderName, const std::string &appName,
+ StateServer(Ndnx::NdnxWrapperPtr ndnx, ActionLogPtr actionLog, const boost::filesystem::path &rootDir,
+ const Ndnx::Name &userName, const std::string &sharedFolderName, const std::string &appName,
ObjectManager &objectManager,
int freshness = -1);
~StateServer();
private:
void
- info_actions_folder (const Ccnx::Name &interest);
+ info_actions_folder (const Ndnx::Name &interest);
void
- info_actions_file (const Ccnx::Name &interest);
+ info_actions_file (const Ndnx::Name &interest);
void
- info_actions_fileOrFolder_Execute (const Ccnx::Name &interest, bool isFolder = true);
+ info_actions_fileOrFolder_Execute (const Ndnx::Name &interest, bool isFolder = true);
void
- info_files_folder (const Ccnx::Name &interest);
+ info_files_folder (const Ndnx::Name &interest);
void
- info_files_folder_Execute (const Ccnx::Name &interest);
+ info_files_folder_Execute (const Ndnx::Name &interest);
void
- cmd_restore_file (const Ccnx::Name &interest);
+ cmd_restore_file (const Ndnx::Name &interest);
void
- cmd_restore_file_Execute (const Ccnx::Name &interest);
+ cmd_restore_file_Execute (const Ndnx::Name &interest);
private:
void
@@ -188,25 +188,25 @@
deregisterPrefixes ();
static void
- formatActionJson (json_spirit::Array &actions, const Ccnx::Name &name, sqlite3_int64 seq_no, const ActionItem &action);
+ formatActionJson (json_spirit::Array &actions, const Ndnx::Name &name, sqlite3_int64 seq_no, const ActionItem &action);
static void
formatFilestateJson (json_spirit::Array &files, const FileItem &file);
private:
- Ccnx::CcnxWrapperPtr m_ccnx;
+ Ndnx::NdnxWrapperPtr m_ndnx;
ActionLogPtr m_actionLog;
ObjectManager &m_objectManager;
- Ccnx::Name m_PREFIX_INFO;
- Ccnx::Name m_PREFIX_CMD;
+ Ndnx::Name m_PREFIX_INFO;
+ Ndnx::Name m_PREFIX_CMD;
boost::filesystem::path m_rootDir;
int m_freshness;
Executor m_executor;
- Ccnx::Name m_userName;
+ Ndnx::Name m_userName;
std::string m_sharedFolderName;
std::string m_appName;
};
diff --git a/src/sync-core.cc b/src/sync-core.cc
index 17cb16d..9ba28b7 100644
--- a/src/sync-core.cc
+++ b/src/sync-core.cc
@@ -41,11 +41,11 @@
const std::string LOCAL_STATE_CHANGE_DELAYED_TAG = "local-state-changed";
using namespace boost;
-using namespace Ccnx;
+using namespace Ndnx;
SyncCore::SyncCore(SyncLogPtr syncLog, const Name &userName, const Name &localPrefix, const Name &syncPrefix,
- const StateMsgCallback &callback, CcnxWrapperPtr ccnx, double syncInterestInterval/*= -1.0*/)
- : m_ccnx (ccnx)
+ const StateMsgCallback &callback, NdnxWrapperPtr ndnx, double syncInterestInterval/*= -1.0*/)
+ : m_ndnx (ndnx)
, m_log(syncLog)
, m_scheduler(new Scheduler ())
, m_stateMsgCallback(callback)
@@ -55,7 +55,7 @@
{
m_rootHash = m_log->RememberStateInStateLog();
- m_ccnx->setInterestFilter(m_syncPrefix, boost::bind(&SyncCore::handleInterest, this, _1));
+ m_ndnx->setInterestFilter(m_syncPrefix, boost::bind(&SyncCore::handleInterest, this, _1));
// m_log->initYP(m_yp);
m_log->UpdateLocalLocator (localPrefix);
@@ -92,7 +92,7 @@
Name syncName = Name (m_syncPrefix)(oldHash->GetHash(), oldHash->GetHashBytes());
BytesPtr syncData = serializeGZipMsg (*msg);
- m_ccnx->publishData(syncName, *syncData, FRESHNESS);
+ m_ndnx->publishData(syncName, *syncData, FRESHNESS);
_LOG_DEBUG ("[" << m_log->GetLocalName () << "] localStateChanged ");
_LOG_TRACE ("[" << m_log->GetLocalName () << "] publishes: " << oldHash->shortHash ());
// _LOG_TRACE (msg);
@@ -147,7 +147,7 @@
SyncStateMsgPtr msg = m_log->FindStateDifferences(*(Hash::Origin), *m_rootHash);
BytesPtr syncData = serializeGZipMsg (*msg);
- m_ccnx->publishData(name, *syncData, FRESHNESS);
+ m_ndnx->publishData(name, *syncData, FRESHNESS);
_LOG_TRACE ("[" << m_log->GetLocalName () << "] publishes " << hash.shortHash ());
// _LOG_TRACE (msg);
}
@@ -177,7 +177,7 @@
SyncStateMsgPtr msg = m_log->FindStateDifferences(*hash, *m_rootHash);
BytesPtr syncData = serializeGZipMsg (*msg);
- m_ccnx->publishData(name, *syncData, FRESHNESS);
+ m_ndnx->publishData(name, *syncData, FRESHNESS);
_LOG_TRACE (m_log->GetLocalName () << " publishes: " << hash->shortHash ());
_LOG_TRACE (msg);
}
@@ -322,7 +322,7 @@
{
selectors.interestLifetime(m_syncInterestInterval);
}
- m_ccnx->sendInterest(syncInterest,
+ m_ndnx->sendInterest(syncInterest,
Closure (boost::bind(&SyncCore::handleSyncData, this, _1, _2),
boost::bind(&SyncCore::handleSyncInterestTimeout, this, _1, _2, _3)),
selectors);
@@ -347,7 +347,7 @@
_LOG_DEBUG ("[" << m_log->GetLocalName () << "] >>> RECOVER Interests for " << hash->shortHash ());
- m_ccnx->sendInterest(recoverInterest,
+ m_ndnx->sendInterest(recoverInterest,
Closure (boost::bind(&SyncCore::handleRecoverData, this, _1, _2),
boost::bind(&SyncCore::handleRecoverInterestTimeout, this, _1, _2, _3)));
diff --git a/src/sync-core.h b/src/sync-core.h
index 7cf4368..8d97bd3 100644
--- a/src/sync-core.h
+++ b/src/sync-core.h
@@ -23,8 +23,8 @@
#define SYNC_CORE_H
#include "sync-log.h"
-#include "ccnx-wrapper.h"
-#include "ccnx-selectors.h"
+#include "ndnx-wrapper.h"
+#include "ndnx-selectors.h"
#include "scheduler.h"
#include "task.h"
@@ -42,11 +42,11 @@
public:
SyncCore(SyncLogPtr syncLog
- , const Ccnx::Name &userName
- , const Ccnx::Name &localPrefix // routable name used by the local user
- , const Ccnx::Name &syncPrefix // the prefix for the sync collection
+ , const Ndnx::Name &userName
+ , const Ndnx::Name &localPrefix // routable name used by the local user
+ , const Ndnx::Name &syncPrefix // the prefix for the sync collection
, const StateMsgCallback &callback // callback when state change is detected
- , Ccnx::CcnxWrapperPtr ccnx
+ , Ndnx::NdnxWrapperPtr ndnx
, double syncInterestInterval = -1.0);
~SyncCore();
@@ -71,26 +71,26 @@
root() const { return m_rootHash; }
sqlite3_int64
- seq (const Ccnx::Name &name);
+ seq (const Ndnx::Name &name);
private:
void
- handleInterest(const Ccnx::Name &name);
+ handleInterest(const Ndnx::Name &name);
void
- handleSyncData(const Ccnx::Name &name, Ccnx::PcoPtr content);
+ handleSyncData(const Ndnx::Name &name, Ndnx::PcoPtr content);
void
- handleRecoverData(const Ccnx::Name &name, Ccnx::PcoPtr content);
+ handleRecoverData(const Ndnx::Name &name, Ndnx::PcoPtr content);
void
- handleSyncInterestTimeout(const Ccnx::Name &name, const Ccnx::Closure &closure, Ccnx::Selectors selectors);
+ handleSyncInterestTimeout(const Ndnx::Name &name, const Ndnx::Closure &closure, Ndnx::Selectors selectors);
void
- handleRecoverInterestTimeout(const Ccnx::Name &name, const Ccnx::Closure &closure, Ccnx::Selectors selectors);
+ handleRecoverInterestTimeout(const Ndnx::Name &name, const Ndnx::Closure &closure, Ndnx::Selectors selectors);
void
- deregister(const Ccnx::Name &name);
+ deregister(const Ndnx::Name &name);
void
recover(HashPtr hash);
@@ -100,22 +100,22 @@
sendSyncInterest();
void
- handleSyncInterest(const Ccnx::Name &name);
+ handleSyncInterest(const Ndnx::Name &name);
void
- handleRecoverInterest(const Ccnx::Name &name);
+ handleRecoverInterest(const Ndnx::Name &name);
void
- handleStateData(const Ccnx::Bytes &content);
+ handleStateData(const Ndnx::Bytes &content);
private:
- Ccnx::CcnxWrapperPtr m_ccnx;
+ Ndnx::NdnxWrapperPtr m_ndnx;
SyncLogPtr m_log;
SchedulerPtr m_scheduler;
StateMsgCallback m_stateMsgCallback;
- Ccnx::Name m_syncPrefix;
+ Ndnx::Name m_syncPrefix;
HashPtr m_rootHash;
IntervalGeneratorPtr m_recoverWaitGenerator;
diff --git a/src/sync-log.cc b/src/sync-log.cc
index 5881bd9..23df286 100644
--- a/src/sync-log.cc
+++ b/src/sync-log.cc
@@ -30,7 +30,7 @@
using namespace boost;
using namespace std;
-using namespace Ccnx;
+using namespace Ndnx;
// static void xTrace (void*, const char* q)
// {
@@ -97,7 +97,7 @@
";
-SyncLog::SyncLog (const boost::filesystem::path &path, const Ccnx::Name &localName)
+SyncLog::SyncLog (const boost::filesystem::path &path, const Ndnx::Name &localName)
: DbHelper (path / ".chronoshare", "sync-log.db")
, m_localName (localName)
{
@@ -109,7 +109,7 @@
sqlite3_stmt *stmt;
int res = sqlite3_prepare_v2 (m_db, "SELECT device_id, seq_no FROM SyncNodes WHERE device_name=?", -1, &stmt, 0);
- Ccnx::CcnxCharbufPtr name = m_localName;
+ Ndnx::NdnxCharbufPtr name = m_localName;
sqlite3_bind_blob (stmt, 1, name->buf (), name->length (), SQLITE_STATIC);
if (sqlite3_step (stmt) == SQLITE_ROW)
@@ -267,14 +267,14 @@
}
void
-SyncLog::UpdateDeviceSeqNo (const Ccnx::Name &name, sqlite3_int64 seqNo)
+SyncLog::UpdateDeviceSeqNo (const Ndnx::Name &name, sqlite3_int64 seqNo)
{
sqlite3_stmt *stmt;
// update is performed using trigger
int res = sqlite3_prepare (m_db, "INSERT INTO SyncNodes (device_name, seq_no) VALUES (?,?);",
-1, &stmt, 0);
- Ccnx::CcnxCharbufPtr nameBuf = name;
+ Ndnx::NdnxCharbufPtr nameBuf = name;
res += sqlite3_bind_blob (stmt, 1, nameBuf->buf (), nameBuf->length (), SQLITE_STATIC);
res += sqlite3_bind_int64 (stmt, 2, seqNo);
sqlite3_step (stmt);
@@ -321,7 +321,7 @@
{
sqlite3_stmt *stmt;
sqlite3_prepare_v2 (m_db, "SELECT last_known_locator FROM SyncNodes WHERE device_name=?;", -1, &stmt, 0);
- Ccnx::CcnxCharbufPtr nameBuf = deviceName;
+ Ndnx::NdnxCharbufPtr nameBuf = deviceName;
sqlite3_bind_blob (stmt, 1, nameBuf->buf(), nameBuf->length(), SQLITE_STATIC);
int res = sqlite3_step (stmt);
Name locator;
@@ -341,7 +341,7 @@
return locator;
}
-Ccnx::Name
+Ndnx::Name
SyncLog::LookupLocalLocator ()
{
return LookupLocator (m_localName);
@@ -352,8 +352,8 @@
{
sqlite3_stmt *stmt;
sqlite3_prepare_v2 (m_db, "UPDATE SyncNodes SET last_known_locator=?,last_update=datetime('now') WHERE device_name=?;", -1, &stmt, 0);
- Ccnx::CcnxCharbufPtr nameBuf = deviceName;
- Ccnx::CcnxCharbufPtr locatorBuf = locator;
+ Ndnx::NdnxCharbufPtr nameBuf = deviceName;
+ Ndnx::NdnxCharbufPtr locatorBuf = locator;
sqlite3_bind_blob (stmt, 1, locatorBuf->buf(), locatorBuf->length(), SQLITE_STATIC);
sqlite3_bind_blob (stmt, 2, nameBuf->buf(), nameBuf->length(), SQLITE_STATIC);
int res = sqlite3_step (stmt);
@@ -367,7 +367,7 @@
}
void
-SyncLog::UpdateLocalLocator (const Ccnx::Name &forwardingHint)
+SyncLog::UpdateLocalLocator (const Ndnx::Name &forwardingHint)
{
return UpdateLocator (m_localName, forwardingHint);
}
@@ -494,7 +494,7 @@
sqlite3_stmt *stmt;
sqlite3_int64 seq = -1;
sqlite3_prepare_v2 (m_db, "SELECT seq_no FROM SyncNodes WHERE device_name=?;", -1, &stmt, 0);
- Ccnx::CcnxCharbufPtr nameBuf = name;
+ Ndnx::NdnxCharbufPtr nameBuf = name;
sqlite3_bind_blob (stmt, 1, nameBuf->buf (), nameBuf->length (), SQLITE_STATIC);
if (sqlite3_step (stmt) == SQLITE_ROW)
{
diff --git a/src/sync-log.h b/src/sync-log.h
index 304afa7..1d243ad 100644
--- a/src/sync-log.h
+++ b/src/sync-log.h
@@ -24,7 +24,7 @@
#include "db-helper.h"
#include <sync-state.pb.h>
-#include <ccnx-name.h>
+#include <ndnx-name.h>
#include <map>
#include <boost/thread/shared_mutex.hpp>
@@ -33,12 +33,12 @@
class SyncLog : public DbHelper
{
public:
- SyncLog (const boost::filesystem::path &path, const Ccnx::Name &localName);
+ SyncLog (const boost::filesystem::path &path, const Ndnx::Name &localName);
/**
* @brief Get local username
*/
- inline const Ccnx::Name &
+ inline const Ndnx::Name &
GetLocalName () const;
sqlite3_int64
@@ -46,22 +46,22 @@
// done
void
- UpdateDeviceSeqNo (const Ccnx::Name &name, sqlite3_int64 seqNo);
+ UpdateDeviceSeqNo (const Ndnx::Name &name, sqlite3_int64 seqNo);
void
UpdateLocalSeqNo (sqlite3_int64 seqNo);
- Ccnx::Name
- LookupLocator (const Ccnx::Name &deviceName);
+ Ndnx::Name
+ LookupLocator (const Ndnx::Name &deviceName);
- Ccnx::Name
+ Ndnx::Name
LookupLocalLocator ();
void
- UpdateLocator (const Ccnx::Name &deviceName, const Ccnx::Name &locator);
+ UpdateLocator (const Ndnx::Name &deviceName, const Ndnx::Name &locator);
void
- UpdateLocalLocator (const Ccnx::Name &locator);
+ UpdateLocalLocator (const Ndnx::Name &locator);
// done
/**
@@ -87,7 +87,7 @@
//-------- only used in test -----------------
sqlite3_int64
- SeqNo(const Ccnx::Name &name);
+ SeqNo(const Ndnx::Name &name);
sqlite3_int64
LogSize ();
@@ -97,7 +97,7 @@
UpdateDeviceSeqNo (sqlite3_int64 deviceId, sqlite3_int64 seqNo);
protected:
- Ccnx::Name m_localName;
+ Ndnx::Name m_localName;
sqlite3_int64 m_localDeviceId;
@@ -109,7 +109,7 @@
typedef boost::shared_ptr<SyncLog> SyncLogPtr;
-const Ccnx::Name &
+const Ndnx::Name &
SyncLog::GetLocalName () const
{
return m_localName;
diff --git a/src/sync-state-helper.h b/src/sync-state-helper.h
index 435ef9a..410bb8c 100644
--- a/src/sync-state-helper.h
+++ b/src/sync-state-helper.h
@@ -40,8 +40,8 @@
string strLocator = state.locator();
sqlite3_int64 seq = state.seq();
- os << "Name: " << Ccnx::Name((const unsigned char *)strName.c_str(), strName.size())
- << ", Locator: " << Ccnx::Name((const unsigned char *)strLocator.c_str(), strLocator.size())
+ os << "Name: " << Ndnx::Name((const unsigned char *)strName.c_str(), strName.size())
+ << ", Locator: " << Ndnx::Name((const unsigned char *)strLocator.c_str(), strLocator.size())
<< ", seq: " << seq << std::endl;
index ++;
}