Switch from NDNx to CCNx

Change-Id: Icc2e6dd95d9c4e0ba22b7efb9933c1db7194842e
diff --git a/test/daemon/daemon.cc b/test/daemon/daemon.cc
index ae41418..6983965 100644
--- a/test/daemon/daemon.cc
+++ b/test/daemon/daemon.cc
@@ -23,7 +23,7 @@
 #include <iostream>
 #include <Ice/Service.h>
 #include <Ice/Identity.h>
-#include <ccnx-wrapper.h>
+#include <ndnx-wrapper.h>
 
 #include "notify-i.h"
 #include <boost/make_shared.hpp>
@@ -31,7 +31,7 @@
 using namespace std;
 using namespace boost;
 using namespace ChronoshareClient;
-using namespace Ccnx;
+using namespace Ndnx;
 
 typedef boost::error_info<struct tag_errmsg, std::string> errmsg_info_str; 
 
@@ -72,8 +72,8 @@
   try
     {
       // DbHelper db ("./", "/ndn/ucla.edu/alex");
-      CcnxWrapperPtr ccnx = make_shared<CcnxWrapper> ();
-      ActionLogPtr actionLog = make_shared<ActionLog> (ccnx, "./", "/ndn/ucla.edu/alex", "shared");
+      NdnxWrapperPtr ndnx = make_shared<NdnxWrapper> ();
+      ActionLogPtr actionLog = make_shared<ActionLog> (ndnx, "./", "/ndn/ucla.edu/alex", "shared");
 
       MyService svc (actionLog);
       status = svc.main (argc, argv);
diff --git a/test/test-action-log.cc b/test/test-action-log.cc
index c4d6a9b..86eb059 100644
--- a/test/test-action-log.cc
+++ b/test/test-action-log.cc
@@ -32,7 +32,7 @@
 
 using namespace std;
 using namespace boost;
-using namespace Ccnx;
+using namespace Ndnx;
 namespace fs = boost::filesystem;
 
 BOOST_AUTO_TEST_SUITE(TestActionLog)
@@ -45,9 +45,9 @@
 
   fs::path tmpdir = fs::unique_path (fs::temp_directory_path () / "%%%%-%%%%-%%%%-%%%%");
   SyncLogPtr syncLog = make_shared<SyncLog> (tmpdir, localName);
-  CcnxWrapperPtr ccnx = make_shared<CcnxWrapper> ();
+  NdnxWrapperPtr ndnx = make_shared<NdnxWrapper> ();
 
-  ActionLogPtr actionLog = make_shared<ActionLog> (ccnx, tmpdir, syncLog, "top-secret", "test-chronoshare",
+  ActionLogPtr actionLog = make_shared<ActionLog> (ndnx, tmpdir, syncLog, "top-secret", "test-chronoshare",
                                                    ActionLog::OnFileAddedOrChangedCallback(), ActionLog::OnFileRemovedCallback ());
 
 // const std::string &filename,
@@ -129,7 +129,7 @@
 
   BytesPtr item_msg = serializeMsg (item);
   Name actionName = Name ("/")(Name("/zhenkai/test"))("test-chronoshare")("action")("top-secret")(1);
-  Bytes actionData = ccnx->createContentObject (actionName, head (*item_msg), item_msg->size ());
+  Bytes actionData = ndnx->createContentObject (actionName, head (*item_msg), item_msg->size ());
 
   pco = make_shared<ParsedContentObject> (actionData);
   BOOST_CHECK_EQUAL ((bool)actionLog->AddRemoteAction (pco), true);
diff --git a/test/test-dispatcher.cc b/test/test-dispatcher.cc
index 77a499b..b5c023b 100644
--- a/test/test-dispatcher.cc
+++ b/test/test-dispatcher.cc
@@ -19,7 +19,7 @@
  *          Alexander Afanasyev <alexander.afanasyev@ucla.edu>
  */
 
-#include "ccnx-wrapper.h"
+#include "ndnx-wrapper.h"
 #include "logging.h"
 #include "dispatcher.h"
 #include <boost/test/unit_test.hpp>
@@ -28,7 +28,7 @@
 #include <fstream>
 #include <cassert>
 
-using namespace Ccnx;
+using namespace Ndnx;
 using namespace std;
 using namespace boost;
 namespace fs = boost::filesystem;
@@ -63,17 +63,17 @@
 
   string folder = "who-is-president";
 
-  CcnxWrapperPtr ccnx1 = make_shared<CcnxWrapper>();
+  NdnxWrapperPtr ndnx1 = make_shared<NdnxWrapper>();
   usleep(100);
-  CcnxWrapperPtr ccnx2 = make_shared<CcnxWrapper>();
+  NdnxWrapperPtr ndnx2 = make_shared<NdnxWrapper>();
   usleep(100);
 
   cleanDir(dir1);
   cleanDir(dir2);
 
-  Dispatcher d1(user1, folder, dir1, ccnx1, false);
+  Dispatcher d1(user1, folder, dir1, ndnx1, false);
   usleep(100);
-  Dispatcher d2(user2, folder, dir2, ccnx2, false);
+  Dispatcher d2(user2, folder, dir2, ndnx2, false);
 
   usleep(14900000);
 
diff --git a/test/test-fetch-manager.cc b/test/test-fetch-manager.cc
index ed604f3..98c820a 100644
--- a/test/test-fetch-manager.cc
+++ b/test/test-fetch-manager.cc
@@ -21,7 +21,7 @@
 
 #include "fetch-manager.h"
 #include "fetcher.h"
-#include "ccnx-wrapper.h"
+#include "ndnx-wrapper.h"
 #include <boost/test/unit_test.hpp>
 #include <boost/make_shared.hpp>
 #include <boost/thread/thread.hpp>
@@ -30,7 +30,7 @@
 
 INIT_LOGGER ("Test.FetchManager");
 
-using namespace Ccnx;
+using namespace Ndnx;
 using namespace std;
 using namespace boost;
 
@@ -54,7 +54,7 @@
   }
 
   void
-  onData (const Ccnx::Name &deviceName, const Ccnx::Name &basename, uint64_t seqno, Ccnx::PcoPtr pco)
+  onData (const Ndnx::Name &deviceName, const Ndnx::Name &basename, uint64_t seqno, Ndnx::PcoPtr pco)
   {
     _LOG_TRACE ("onData: " << seqno);
 
@@ -75,7 +75,7 @@
   }
 
   void
-  finish(const Ccnx::Name &deviceName, const Ccnx::Name &baseName)
+  finish(const Ndnx::Name &deviceName, const Ndnx::Name &baseName)
   {
   }
 
@@ -96,7 +96,7 @@
 
 void run()
 {
-  CcnxWrapperPtr ccnx = make_shared<CcnxWrapper> ();
+  NdnxWrapperPtr ndnx = make_shared<NdnxWrapper> ();
 
   Name baseName ("/base");
   Name deviceName ("/device");
@@ -104,13 +104,13 @@
   for (int i = 0; i < 10; i++)
     {
       usleep(100000);
-      ccnx->publishData (Name (baseName)(i), reinterpret_cast<const unsigned char*> (&i), sizeof(int), 30);
+      ndnx->publishData (Name (baseName)(i), reinterpret_cast<const unsigned char*> (&i), sizeof(int), 30);
     }
 
   for (int i = 11; i < 50; i++)
     {
       usleep(100000);
-      ccnx->publishData (Name (baseName)(i), reinterpret_cast<const unsigned char*> (&i), sizeof(int), 30);
+      ndnx->publishData (Name (baseName)(i), reinterpret_cast<const unsigned char*> (&i), sizeof(int), 30);
     }
 
 }
@@ -119,7 +119,7 @@
 {
   INIT_LOGGERS ();
 
-  CcnxWrapperPtr ccnx = make_shared<CcnxWrapper> ();
+  NdnxWrapperPtr ndnx = make_shared<NdnxWrapper> ();
 
   Name baseName ("/base");
   Name deviceName ("/device");
@@ -127,22 +127,22 @@
   // this will allow us to test our pipeline of 6
   for (int i = 0; i < 10; i++)
     {
-      ccnx->publishData (Name (baseName)(i), reinterpret_cast<const unsigned char*> (&i), sizeof(int), 30);
+      ndnx->publishData (Name (baseName)(i), reinterpret_cast<const unsigned char*> (&i), sizeof(int), 30);
     }
 
   for (int i = 15; i < 25; i++)
     {
-      ccnx->publishData (Name (baseName)(i), reinterpret_cast<const unsigned char*> (&i), sizeof(int), 30);
+      ndnx->publishData (Name (baseName)(i), reinterpret_cast<const unsigned char*> (&i), sizeof(int), 30);
     }
 
   int oneMore = 26;
-  ccnx->publishData (Name (baseName)(oneMore), reinterpret_cast<const unsigned char*> (&oneMore), sizeof(int), 30);
+  ndnx->publishData (Name (baseName)(oneMore), reinterpret_cast<const unsigned char*> (&oneMore), sizeof(int), 30);
 
   FetcherTestData data;
   ExecutorPtr executor = make_shared<Executor>(1);
   executor->start ();
 
-  Fetcher fetcher (ccnx,
+  Fetcher fetcher (ndnx,
                    executor,
                    bind (&FetcherTestData::onData, &data, _1, _2, _3, _4),
                    bind (&FetcherTestData::finish, &data, _1, _2),
@@ -185,7 +185,7 @@
   // publishing missing pieces
   for (int i = 0; i < 27; i++)
     {
-      ccnx->publishData (Name (baseName)(i), reinterpret_cast<const unsigned char*> (&i), sizeof(int), 1);
+      ndnx->publishData (Name (baseName)(i), reinterpret_cast<const unsigned char*> (&i), sizeof(int), 1);
     }
   BOOST_CHECK_EQUAL (fetcher.IsActive (), false);
   fetcher.RestartPipeline ();
@@ -215,7 +215,7 @@
 {
   INIT_LOGGERS ();
 
-  CcnxWrapperPtr ccnx = make_shared<CcnxWrapper> ();
+  NdnxWrapperPtr ndnx = make_shared<NdnxWrapper> ();
 
   Name baseName ("/base");
   Name deviceName ("/device");
@@ -226,7 +226,7 @@
   ExecutorPtr executor = make_shared<Executor>(1);
   executor->start ();
 
-  Fetcher fetcher (ccnx,
+  Fetcher fetcher (ndnx,
                    executor,
                    bind (&FetcherTestData::onData, &data, _1, _2, _3, _4),
                    bind (&FetcherTestData::finish, &data, _1, _2),
@@ -247,7 +247,7 @@
 
 
 
-// BOOST_AUTO_TEST_CASE (CcnxWrapperSelector)
+// BOOST_AUTO_TEST_CASE (NdnxWrapperSelector)
 // {
 
 //   Closure closure (bind(dataCallback, _1, _2), bind(timeout, _1));
diff --git a/test/test-fetch-task-db.cc b/test/test-fetch-task-db.cc
index 1e647af..61bec89 100644
--- a/test/test-fetch-task-db.cc
+++ b/test/test-fetch-task-db.cc
@@ -37,7 +37,7 @@
 
 INIT_LOGGER ("Test.FetchTaskDb");
 
-using namespace Ccnx;
+using namespace Ndnx;
 using namespace std;
 using namespace boost;
 namespace fs = boost::filesystem;
diff --git a/test/test-ccnx-name.cc b/test/test-ndnx-name.cc
similarity index 91%
rename from test/test-ccnx-name.cc
rename to test/test-ndnx-name.cc
index a876ba4..6022ec2 100644
--- a/test/test-ccnx-name.cc
+++ b/test/test-ndnx-name.cc
@@ -1,17 +1,17 @@
 
-#include "ccnx-name.h"
+#include "ndnx-name.h"
 
 #define BOOST_TEST_MAIN 1
 
 #include <boost/test/unit_test.hpp>
 
-using namespace Ccnx;
+using namespace Ndnx;
 using namespace std;
 using namespace boost;
 
-BOOST_AUTO_TEST_SUITE(CcnxNameTests)
+BOOST_AUTO_TEST_SUITE(NdnxNameTests)
 
-BOOST_AUTO_TEST_CASE (CcnxNameTest)
+BOOST_AUTO_TEST_CASE (NdnxNameTest)
 {
   Name empty = Name();
   Name root = Name("/");
diff --git a/test/test-ccnx-wrapper.cc b/test/test-ndnx-wrapper.cc
similarity index 91%
rename from test/test-ccnx-wrapper.cc
rename to test/test-ndnx-wrapper.cc
index 9989cdb..eaf0ef3 100644
--- a/test/test-ccnx-wrapper.cc
+++ b/test/test-ndnx-wrapper.cc
@@ -19,25 +19,25 @@
  *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
  */
 
-#include "ccnx-wrapper.h"
-#include "ccnx-closure.h"
-#include "ccnx-name.h"
-#include "ccnx-selectors.h"
-#include "ccnx-pco.h"
+#include "ndnx-wrapper.h"
+#include "ndnx-closure.h"
+#include "ndnx-name.h"
+#include "ndnx-selectors.h"
+#include "ndnx-pco.h"
 #include <unistd.h>
 
 #include <boost/date_time/posix_time/posix_time.hpp>
 #include <boost/test/unit_test.hpp>
 #include <boost/make_shared.hpp>
 
-using namespace Ccnx;
+using namespace Ndnx;
 using namespace std;
 using namespace boost;
 
-BOOST_AUTO_TEST_SUITE(TestCcnxWrapper)
+BOOST_AUTO_TEST_SUITE(TestNdnxWrapper)
 
-CcnxWrapperPtr c1;
-CcnxWrapperPtr c2;
+NdnxWrapperPtr c1;
+NdnxWrapperPtr c2;
 int g_timeout_counter = 0;
 int g_dataCallback_counter = 0;
 
@@ -53,7 +53,7 @@
   c2->publishData(name, (const unsigned char*)content.c_str(), content.size(), 5);
 }
 
-void dataCallback(const Name &name, Ccnx::PcoPtr pco)
+void dataCallback(const Name &name, Ndnx::PcoPtr pco)
 {
   cout << " in data callback" << endl;
   BytesPtr content = pco->contentPtr ();
@@ -62,7 +62,7 @@
   BOOST_CHECK_EQUAL(name, msg);
 }
 
-void encapCallback(const Name &name, Ccnx::PcoPtr pco)
+void encapCallback(const Name &name, Ndnx::PcoPtr pco)
 {
   cout << " in encap data callback" << endl;
   BOOST_CHECK(!c1->verify(pco));
@@ -84,11 +84,11 @@
 {
   if (!c1)
   {
-    c1 = make_shared<CcnxWrapper> ();
+    c1 = make_shared<NdnxWrapper> ();
   }
   if (!c2)
   {
-    c2 = make_shared<CcnxWrapper> ();
+    c2 = make_shared<NdnxWrapper> ();
   }
 }
 
@@ -106,7 +106,7 @@
 }
 
 
-BOOST_AUTO_TEST_CASE (BlaCcnxWrapperTest)
+BOOST_AUTO_TEST_CASE (BlaNdnxWrapperTest)
 {
   INIT_LOGGERS ();
   
@@ -132,7 +132,7 @@
   teardown();
 }
 
-BOOST_AUTO_TEST_CASE (CcnxWrapperSelector)
+BOOST_AUTO_TEST_CASE (NdnxWrapperSelector)
 {
 
   setup();
@@ -220,7 +220,7 @@
 
 
  /*
- BOOST_AUTO_TEST_CASE (CcnxWrapperUnsigningTest)
+ BOOST_AUTO_TEST_CASE (NdnxWrapperUnsigningTest)
  {
    setup();
    Bytes data;
diff --git a/test/test-object-manager.cc b/test/test-object-manager.cc
index 36c5c57..60f0c58 100644
--- a/test/test-object-manager.cc
+++ b/test/test-object-manager.cc
@@ -33,7 +33,7 @@
 
 INIT_LOGGER ("Test.ObjectManager");
 
-using namespace Ccnx;
+using namespace Ndnx;
 using namespace std;
 using namespace boost;
 namespace fs = boost::filesystem;
@@ -48,8 +48,8 @@
   _LOG_DEBUG ("tmpdir: " << tmpdir);
   Name deviceName ("/device");
 
-  CcnxWrapperPtr ccnx = make_shared<CcnxWrapper> ();
-  ObjectManager manager (ccnx, tmpdir, "test-chronoshare");
+  NdnxWrapperPtr ndnx = make_shared<NdnxWrapper> ();
+  ObjectManager manager (ndnx, tmpdir, "test-chronoshare");
 
   tuple<HashPtr,int> hash_semgents = manager.localFileToObjects (fs::path("test") / "test-object-manager.cc", deviceName);
 
diff --git a/test/test-protobuf.cc b/test/test-protobuf.cc
index fdf211b..d0a7b8e 100644
--- a/test/test-protobuf.cc
+++ b/test/test-protobuf.cc
@@ -1,4 +1,4 @@
-#include "ccnx-common.h"
+#include "ndnx-common.h"
 #include "sync-core.h"
 #include <boost/make_shared.hpp>
 #include <boost/test/unit_test.hpp>
@@ -8,7 +8,7 @@
 #include <boost/range/iterator_range.hpp>
 #include <boost/make_shared.hpp>
 
-using namespace Ccnx;
+using namespace Ndnx;
 using namespace std;
 using namespace boost;
 
diff --git a/test/test-serve-and-fetch.cc b/test/test-serve-and-fetch.cc
index a551404..8e54404 100644
--- a/test/test-serve-and-fetch.cc
+++ b/test/test-serve-and-fetch.cc
@@ -20,8 +20,8 @@
  */
 
 #include "fetch-manager.h"
-#include "ccnx-wrapper.h"
-#include "ccnx-common.h"
+#include "ndnx-wrapper.h"
+#include "ndnx-common.h"
 #include "scheduler.h"
 #include "object-db.h"
 #include "object-manager.h"
@@ -40,7 +40,7 @@
 
 INIT_LOGGER("Test.ServerAndFetch");
 
-using namespace Ccnx;
+using namespace Ndnx;
 using namespace std;
 using namespace boost;
 using namespace boost::filesystem;
@@ -122,9 +122,9 @@
   _LOG_DEBUG ("Setting up test environment ...");
   setup();
 
-  CcnxWrapperPtr ccnx_serve = make_shared<CcnxWrapper>();
+  NdnxWrapperPtr ndnx_serve = make_shared<NdnxWrapper>();
   usleep(1000);
-  CcnxWrapperPtr ccnx_fetch = make_shared<CcnxWrapper>();
+  NdnxWrapperPtr ndnx_fetch = make_shared<NdnxWrapper>();
 
   Name deviceName("/test/device");
   Name localPrefix("/local");
@@ -135,17 +135,17 @@
   time_t start = time(NULL);
   _LOG_DEBUG ("At time " << start << ", publish local file to database, this is extremely slow ...");
   // publish file to db
-  ObjectManager om(ccnx_serve, root, APPNAME);
+  ObjectManager om(ndnx_serve, root, APPNAME);
   tuple<HashPtr, size_t> pub = om.localFileToObjects(filePath, deviceName);
   time_t end = time(NULL);
   _LOG_DEBUG ("At time " << end <<", publish finally finished, used " << end - start << " seconds ...");
 
   ActionLogPtr dummyLog;
-  ContentServer server(ccnx_serve, dummyLog, root, deviceName, "pentagon's secrets", APPNAME, 5);
+  ContentServer server(ndnx_serve, dummyLog, root, deviceName, "pentagon's secrets", APPNAME, 5);
   server.registerPrefix(localPrefix);
   server.registerPrefix(broadcastPrefix);
 
-  FetchManager fm(ccnx_fetch, bind(simpleMap, _1), Name("/local/broadcast"));
+  FetchManager fm(ndnx_fetch, bind(simpleMap, _1), Name("/local/broadcast"));
   HashPtr hash = pub.get<0> ();
   Name baseName = Name ("/")(deviceName)(APPNAME)("file")(hash->GetHash(), hash->GetHashBytes());
 
@@ -161,8 +161,8 @@
           break;
         }
     }
-  ccnx_fetch->shutdown ();
-  ccnx_serve->shutdown ();
+  ndnx_fetch->shutdown ();
+  ndnx_serve->shutdown ();
 
   _LOG_DEBUG ("Finish");
   usleep(100000);
diff --git a/test/test-sync-core.cc b/test/test-sync-core.cc
index f38dab7..04f560a 100644
--- a/test/test-sync-core.cc
+++ b/test/test-sync-core.cc
@@ -6,7 +6,7 @@
 #include <boost/make_shared.hpp>
 
 using namespace std;
-using namespace Ccnx;
+using namespace Ndnx;
 using namespace boost;
 using namespace boost::filesystem;
 
@@ -56,8 +56,8 @@
   Name user2("/darkknight");
   Name loc2("/gotham2");
   Name syncPrefix("/broadcast/darkknight");
-  CcnxWrapperPtr c1(new CcnxWrapper());
-  CcnxWrapperPtr c2(new CcnxWrapper());
+  NdnxWrapperPtr c1(new NdnxWrapper());
+  NdnxWrapperPtr c2(new NdnxWrapper());
   SyncLogPtr log1(new SyncLog(dir1, user1.toString()));
   SyncLogPtr log2(new SyncLog(dir2, user2.toString()));
 
diff --git a/test/test-sync-log.cc b/test/test-sync-log.cc
index 09443e9..8ac36b1 100644
--- a/test/test-sync-log.cc
+++ b/test/test-sync-log.cc
@@ -26,12 +26,12 @@
 #include <unistd.h>
 #include "action-log.h"
 #include <iostream>
-#include <ccnx-name.h>
+#include <ndnx-name.h>
 #include <boost/filesystem.hpp>
 
 using namespace std;
 using namespace boost;
-using namespace Ccnx;
+using namespace Ndnx;
 namespace fs = boost::filesystem;
 
 BOOST_AUTO_TEST_SUITE(TestSyncLog)