Remove disabled files and files related to the forwarding server
diff --git a/disabled/cert.cc b/disabled/cert.cc
deleted file mode 100644
index b8a170e..0000000
--- a/disabled/cert.cc
+++ /dev/null
@@ -1,132 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013 University of California, Los Angeles
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-#include "cert.h"
-
-#include <tinyxml.h>
-#include <boost/lexical_cast.hpp>
-
-#include "logging.h"
-
-INIT_LOGGER ("ndn.Cert");
-
-using namespace std;
-
-namespace ndn {
-
-Cert::Cert()
-    : m_pkey(0)
-    , m_meta("", "",  0, 0)
-{
-}
-
-Cert::Cert(const PcoPtr &keyObject, const PcoPtr &metaObject = PcoPtr())
-    : m_pkey(0)
-    , m_meta("", "", 0, 0)
-{
-  m_name = keyObject->name();
-  m_rawKeyBytes = keyObject->content();
-  m_keyHash = *(Hash::FromBytes(m_rawKeyBytes));
-  m_pkey = ccn_d2i_pubkey(head(m_rawKeyBytes), m_rawKeyBytes.size());
-  updateMeta(metaObject);
-}
-
-Cert::~Cert()
-{
-  if (m_pkey != 0)
-  {
-    ccn_pubkey_free(m_pkey);
-    m_pkey = 0;
-  }
-}
-
-void
-Cert::updateMeta(const PcoPtr &metaObject)
-{
-  if (metaObject)
-  {
-    Bytes xml = metaObject->content();
-    // just make sure it's null terminated as it's required by TiXmlDocument::parse
-    xml.push_back('\0');
-    TiXmlDocument doc;
-    doc.Parse((const char *)(head(xml)));
-    if (!doc.Error())
-    {
-      TiXmlElement *root = doc.RootElement();
-      for (TiXmlElement *child = root->FirstChildElement(); child; child = child->NextSiblingElement())
-      {
-        string elemName = child->Value();
-        string text = child->GetText();
-        if (elemName == "Name")
-        {
-          m_meta.realworldID = text;
-          _LOG_TRACE("Name = " << text);
-        }
-        else if (elemName == "Affiliation")
-        {
-          m_meta.affiliation = text;
-          _LOG_TRACE("Affiliation = " << text);
-        }
-        else if (elemName == "Valid_to")
-        {
-          m_meta.validTo = boost::lexical_cast<time_t>(text);
-          _LOG_TRACE("Valid_to = " << text);
-        }
-        else if (elemName == "Valid_from")
-        {
-          // this is not included in the key meta yet
-          // but it should eventually be there
-        }
-        else
-        {
-          // ignore known stuff
-        }
-      }
-    }
-    else
-    {
-      _LOG_ERROR("Cannot parse meta info:" << std::string((const char *)head(xml), xml.size()));
-    }
-  }
-}
-
-Cert::VALIDITY
-Cert::validity()
-{
-  if (m_meta.validFrom == 0 && m_meta.validTo == 0)
-  {
-    return OTHER;
-  }
-
-  time_t now = time(NULL);
-  if (now < m_meta.validFrom)
-  {
-    return NOT_YET_VALID;
-  }
-
-  if (now >= m_meta.validTo)
-  {
-    return EXPIRED;
-  }
-
-  return WITHIN_VALID_TIME_SPAN;
-}
-
-} // ndn
diff --git a/disabled/cert.h b/disabled/cert.h
deleted file mode 100644
index 00f432d..0000000
--- a/disabled/cert.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013 University of California, Los Angeles
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef NDN_CERT_H
-#define NDN_CERT_H
-
-#include "ndn.cxx/common.h"
-#include "ndn.cxx/name.h"
-#include "ndn.cxx/pco.h"
-#include "ndn.cxx/hash.h"
-#include <boost/shared_ptr.hpp>
-
-namespace ndn {
-
-class Cert
-{
-public:
-  enum VALIDITY
-  {
-    NOT_YET_VALID,
-    WITHIN_VALID_TIME_SPAN,
-    EXPIRED,
-    OTHER
-  };
-
-  Cert();
-  Cert(const PcoPtr &keyObject, const PcoPtr &metaObject);
-  ~Cert();
-
-  void
-  updateMeta(const PcoPtr &metaObject);
-
-  Name
-  name() { return m_name; }
-
-  Bytes
-  rawKeyBytes() { return m_rawKeyBytes; }
-
-  Hash
-  keyDigest() { return m_keyHash; }
-
-  std::string
-  realworldID() { return m_meta.realworldID; }
-
-  std::string
-  affilication() { return m_meta.affiliation; }
-
-  ccn_pkey *
-  pkey() { return m_pkey; }
-
-  VALIDITY
-  validity();
-
-private:
-  struct Meta
-  {
-    Meta(std::string id, std::string affi, time_t from, time_t to)
-      : realworldID(id)
-      , affiliation(affi)
-      , validFrom(from)
-      , validTo(to)
-    {
-    }
-    std::string realworldID;
-    std::string affiliation;
-    time_t validFrom;
-    time_t validTo;
-  };
-
-  Name m_name;
-  Hash m_keyHash; // publisherPublicKeyHash
-  Bytes m_rawKeyBytes;
-  ccn_pkey *m_pkey;
-  Meta m_meta;
-};
-
-typedef boost::shared_ptr<Cert> CertPtr;
-
-}
-
-#endif // NDN_CERT_H
diff --git a/disabled/charbuf.cc b/disabled/charbuf.cc
deleted file mode 100644
index 12425f6..0000000
--- a/disabled/charbuf.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#include "charbuf.h"
-
-using namespace std;
-
-namespace ndn {
-
-void
-Charbuf::init(ccn_charbuf *buf)
-{
-  if (buf != NULL)
-  {
-    m_buf = ccn_charbuf_create();
-    ccn_charbuf_reserve(m_buf, buf->length);
-    memcpy(m_buf->buf, buf->buf, buf->length);
-    m_buf->length = buf->length;
-  }
-}
-
-Charbuf::Charbuf()
-            : m_buf(NULL)
-{
-  m_buf = ccn_charbuf_create();
-}
-
-Charbuf::Charbuf(ccn_charbuf *buf)
-            : m_buf(NULL)
-{
-  init(buf);
-}
-
-Charbuf::Charbuf(const Charbuf &other)
-            : m_buf (NULL)
-{
-  init(other.m_buf);
-}
-
-Charbuf::Charbuf(const void *buf, size_t length)
-{
-  m_buf = ccn_charbuf_create ();
-  ccn_charbuf_reserve (m_buf, length);
-  memcpy (m_buf->buf, buf, length);
-  m_buf->length = length;
-}
-
-Charbuf::~Charbuf()
-{
-  ccn_charbuf_destroy (&m_buf);
-}
-
-namespace iostreams
-{
-
-charbuf_append_device::charbuf_append_device (Charbuf& cnt)
-  : container (cnt)
-{
-}
-
-std::streamsize
-charbuf_append_device::write (const char_type* s, std::streamsize n)
-{
-  ccn_charbuf_append (container.getBuf (), s, n);
-  return n;
-}
-
-} // iostreams
-
-} // ndn
diff --git a/disabled/charbuf.h b/disabled/charbuf.h
deleted file mode 100644
index ce3ddef..0000000
--- a/disabled/charbuf.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef NDN_NDN_CHARBUF_H
-#define NDN_NDN_CHARBUF_H
-
-#include "ndn.cxx/common.h"
-#include <boost/shared_ptr.hpp>
-#include <boost/iostreams/detail/ios.hpp>
-#include <boost/iostreams/categories.hpp>
-#include <boost/iostreams/stream.hpp>
-
-namespace ndn {
-
-class Charbuf;
-typedef boost::shared_ptr<Charbuf> CharbufPtr;
-
-//  This class is mostly used in Wrapper; users should not be directly using this class
-// The main purpose of this class to is avoid manually create and destroy charbuf everytime
-class Charbuf
-{
-public:
-  Charbuf();
-  Charbuf(ccn_charbuf *buf);
-  Charbuf(const Charbuf &other);
-  Charbuf(const void *buf, size_t length);
-  ~Charbuf();
-
-  // expose internal data structure, use with caution!!
-  ccn_charbuf *
-  getBuf() { return m_buf; }
-
-  const ccn_charbuf *
-  getBuf() const { return m_buf; }
-
-  const unsigned char *
-  buf () const
-  { return m_buf->buf; }
-
-  size_t
-  length () const
-  { return m_buf->length; }
-
-private:
-  void init(ccn_charbuf *buf);
-
-protected:
-  ccn_charbuf *m_buf;
-};
-
-namespace iostreams
-{
-
-class charbuf_append_device {
-public:
-  typedef char  char_type;
-  typedef boost::iostreams::sink_tag       category;
-  
-  charbuf_append_device (Charbuf& cnt);
-  
-  std::streamsize
-  write(const char_type* s, std::streamsize n);
-protected:
-  Charbuf& container;
-};
-
-} // iostreams
-
-struct charbuf_stream : public boost::iostreams::stream<iostreams::charbuf_append_device>
-{
-  charbuf_stream ()
-    : m_device (m_buf)
-  {
-    open (m_device);
-  }
-
-  Charbuf &
-  buf ()
-  {
-    flush ();
-    return m_buf;
-  }
-
-private:
-  Charbuf m_buf;
-  iostreams::charbuf_append_device m_device;
-};
-
-} // ndn
-
-#endif // NDN_NDN_CHARBUF_H
diff --git a/disabled/closure.cc b/disabled/closure.cc
deleted file mode 100644
index a45ef2a..0000000
--- a/disabled/closure.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#include "closure.h"
-
-namespace ndn {
-
-Closure::Closure(const DataCallback &dataCallback, const TimeoutCallback &timeoutCallback)
-  : m_timeoutCallback (timeoutCallback)
-  , m_dataCallback (dataCallback)
-{
-}
-
-Closure::~Closure ()
-{
-}
-
-void
-Closure::runTimeoutCallback(Name interest, const Closure &closure, InterestPtr origInterest)
-{
-  if (!m_timeoutCallback.empty ())
-    {
-      m_timeoutCallback (interest, closure, origInterest);
-    }
-}
-
-
-void
-Closure::runDataCallback(Name name, PcoPtr content)
-{
-  if (!m_dataCallback.empty ())
-    {
-      m_dataCallback (name, content);
-    }
-}
-
-} // ndn
diff --git a/disabled/closure.h b/disabled/closure.h
deleted file mode 100644
index dbcba79..0000000
--- a/disabled/closure.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef NDN_CLOSURE_H
-#define NDN_CLOSURE_H
-
-#include "ndn.cxx/common.h"
-#include "ndn.cxx/fields/name.h"
-#include "ndn.cxx/interest.h"
-
-namespace ndn {
-
-class ParsedContentObject;
-typedef boost::shared_ptr<ParsedContentObject> PcoPtr;
-
-class Closure
-{
-public:
-  typedef boost::function<void (Name, PcoPtr pco)> DataCallback;
-
-  typedef boost::function<void (Name, const Closure &, InterestPtr)> TimeoutCallback;
-
-  Closure(const DataCallback &dataCallback, const TimeoutCallback &timeoutCallback = TimeoutCallback());
-  virtual ~Closure();
-
-  virtual void
-  runDataCallback(Name name, ndn::PcoPtr pco);
-
-  virtual void
-  runTimeoutCallback(Name interest, const Closure &closure, InterestPtr originalInterest);
-
-  virtual Closure *
-  dup () const { return new Closure (*this); }
-
-public:
-  TimeoutCallback m_timeoutCallback;
-  DataCallback m_dataCallback;
-};
-
-} // ndn
-
-#endif
diff --git a/disabled/discovery.cc b/disabled/discovery.cc
deleted file mode 100644
index 273402a..0000000
--- a/disabled/discovery.cc
+++ /dev/null
@@ -1,172 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013 University of California, Los Angeles
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#include "discovery.h"
-
-#include "scheduler/scheduler.h"
-#include "scheduler/simple-interval-generator.h"
-#include "scheduler/task.h"
-#include "scheduler/periodic-task.h"
-
-#include <sstream>
-#include <boost/make_shared.hpp>
-#include <boost/bind.hpp>
-
-using namespace std;
-
-namespace ndn
-{
-
-namespace discovery
-{
-
-const string
-TaggedFunction::CHAR_SET = string("abcdefghijklmnopqtrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
-
-TaggedFunction::TaggedFunction(const Callback &callback, const string &tag)
-                   : m_callback(callback)
-                   , m_tag(tag)
-{
-}
-
-string
-TaggedFunction::GetRandomTag()
-{
-  //boost::random::random_device rng;
-  boost::random::uniform_int_distribution<> dist(0, CHAR_SET.size() - 1);
-  ostringstream oss;
-  for (int i = 0; i < DEFAULT_TAG_SIZE; i++)
-  {
-    //oss << CHAR_SET[dist(rng)];
-  }
-  return oss.str();
-}
-
-void
-TaggedFunction::operator()(const Name &name)
-{
-  if (!m_callback.empty())
-  {
-    m_callback(name);
-  }
-}
-
-} // namespace discovery
-
-const double
-Discovery::INTERVAL = 15.0;
-
-Discovery *
-Discovery::instance = NULL;
-
-boost::mutex
-Discovery::mutex;
-
-Discovery::Discovery()
-              : m_scheduler(new Scheduler())
-              , m_localPrefix("/")
-{
-  m_scheduler->start();
-
-  Scheduler::scheduleOneTimeTask (m_scheduler, 0,
-                                  boost::bind(&Discovery::poll, this), "Initial-Local-Prefix-Check");
-  Scheduler::schedulePeriodicTask (m_scheduler,
-                                   boost::make_shared<SimpleIntervalGenerator>(INTERVAL),
-                                   boost::bind(&Discovery::poll, this), "Local-Prefix-Check");
-}
-
-Discovery::~Discovery()
-{
-  m_scheduler->shutdown();
-}
-
-void
-Discovery::addCallback(const discovery::TaggedFunction &callback)
-{
-  m_callbacks.push_back(callback);
-}
-
-int
-Discovery::deleteCallback(const discovery::TaggedFunction &callback)
-{
-  List::iterator it = m_callbacks.begin();
-  while (it != m_callbacks.end())
-  {
-    if ((*it) == callback)
-    {
-      it = m_callbacks.erase(it);
-    }
-    else
-    {
-      ++it;
-    }
-  }
-  return m_callbacks.size();
-}
-
-void
-Discovery::poll()
-{
-  Name localPrefix = Wrapper::getLocalPrefix();
-  if (localPrefix != m_localPrefix)
-  {
-    Lock lock(mutex);
-    for (List::iterator it = m_callbacks.begin(); it != m_callbacks.end(); ++it)
-    {
-      (*it)(localPrefix);
-    }
-    m_localPrefix = localPrefix;
-  }
-}
-
-void
-Discovery::registerCallback(const discovery::TaggedFunction &callback)
-{
-  Lock lock(mutex);
-  if (instance == NULL)
-  {
-    instance = new Discovery();
-  }
-
-  instance->addCallback(callback);
-}
-
-void
-Discovery::deregisterCallback(const discovery::TaggedFunction &callback)
-{
-  Lock lock(mutex);
-  if (instance == NULL)
-  {
-    cerr << "Discovery::deregisterCallback called without instance" << endl;
-  }
-  else
-  {
-    int size = instance->deleteCallback(callback);
-    if (size == 0)
-    {
-      delete instance;
-      instance = NULL;
-    }
-  }
-}
-
-}
-
diff --git a/disabled/discovery.h b/disabled/discovery.h
deleted file mode 100644
index 1dc684d..0000000
--- a/disabled/discovery.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013 University of California, Los Angeles
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef NDN_DISCOVERY_H
-#define NDN_DISCOVERY_H
-
-#include "ndn.cxx/wrapper.h"
-#include "ndn.cxx/common.h"
-#include "ndn.cxx/name.h"
-
-#include <boost/shared_ptr.hpp>
-#include <boost/function.hpp>
-#include <boost/random/random_device.hpp>
-#include <boost/random/uniform_int_distribution.hpp>
-#include <boost/thread/mutex.hpp>
-#include <boost/thread/locks.hpp>
-#include <list>
-
-class Scheduler;
-typedef boost::shared_ptr<Scheduler> SchedulerPtr;
-
-namespace ndn
-{
-
-class Discovery;
-typedef boost::shared_ptr<Discovery> DiscoveryPtr;
-
-namespace discovery
-{
-
-class TaggedFunction
-{
-public:
-  typedef boost::function<void (const Name &)> Callback;
-  TaggedFunction(const Callback &callback, const std::string &tag = GetRandomTag());
-  ~TaggedFunction(){};
-
-  bool
-  operator==(const TaggedFunction &other) { return m_tag == other.m_tag; }
-
-  void
-  operator()(const Name &name);
-
-private:
-  static const std::string CHAR_SET;
-  static const int DEFAULT_TAG_SIZE = 32;
-
-  static std::string
-  GetRandomTag();
-
-private:
-  Callback m_callback;
-  std::string m_tag;
-};
-
-}
-
-class Discovery
-{
-public:
-  const static double INTERVAL;
-  // Add a callback to be invoked when local prefix changes
-  // you must remember to deregister the callback
-  // otherwise you may have undefined behavior if the callback is
-  // bind to a member function of an object and the object is deleted
-  static void
-  registerCallback(const discovery::TaggedFunction &callback);
-
-  // remember to call this before you quit
-  static void
-  deregisterCallback(const discovery::TaggedFunction &callback);
-
-private:
-  Discovery();
-  ~Discovery();
-
-  void
-  poll();
-
-  void
-  addCallback(const discovery::TaggedFunction &callback);
-
-  int
-  deleteCallback(const discovery::TaggedFunction &callback);
-
-private:
-  typedef boost::mutex Mutex;
-  typedef boost::unique_lock<Mutex> Lock;
-  typedef std::list<discovery::TaggedFunction> List;
-
-  static Discovery *instance;
-  static Mutex mutex;
-  List m_callbacks;
-  SchedulerPtr m_scheduler;
-  Name m_localPrefix;
-};
-
-} // ndn
-
-#endif // NDN_DISCOVERY_H
diff --git a/disabled/pco.cc b/disabled/pco.cc
deleted file mode 100644
index f039b54..0000000
--- a/disabled/pco.cc
+++ /dev/null
@@ -1,138 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#include "pco.h"
-
-namespace ndn {
-
-void
-ParsedContentObject::init(const unsigned char *data, size_t len)
-{
-  readRaw(m_bytes, data, len);
-
-  m_comps = ccn_indexbuf_create();
-  int res = ccn_parse_ContentObject(head (m_bytes), len, &m_pco, m_comps);
-  if (res < 0)
-  {
-    boost::throw_exception(Error::MisformedContentObject());
-  }
-
-}
-
-ParsedContentObject::ParsedContentObject(const unsigned char *data, size_t len, bool verified)
-            : m_comps(NULL)
-            , m_verified(verified)
-{
-  init(data, len);
-}
-
-ParsedContentObject::ParsedContentObject(const Bytes &bytes, bool verified)
-            : m_comps(NULL)
-            , m_verified(verified)
-{
-  init(head(bytes), bytes.size());
-}
-
-ParsedContentObject::ParsedContentObject(const ParsedContentObject &other, bool verified)
-            : m_comps(NULL)
-            , m_verified(verified)
-{
-  init(head(other.m_bytes), other.m_bytes.size());
-}
-
-ParsedContentObject::~ParsedContentObject()
-{
-  ccn_indexbuf_destroy(&m_comps);
-  m_comps = NULL;
-}
-
-Bytes
-ParsedContentObject::content() const
-{
-  const unsigned char *content;
-  size_t len;
-  int res = ccn_content_get_value(head(m_bytes), m_pco.offset[CCN_PCO_E], &m_pco, &content, &len);
-  if (res < 0)
-  {
-    boost::throw_exception(Error::MisformedContentObject());
-  }
-
-  Bytes bytes;
-  readRaw(bytes, content, len);
-  return bytes;
-}
-
-BytesPtr
-ParsedContentObject::contentPtr() const
-{
-  const unsigned char *content;
-  size_t len;
-  int res = ccn_content_get_value(head(m_bytes), m_pco.offset[CCN_PCO_E], &m_pco, &content, &len);
-  if (res < 0)
-  {
-    boost::throw_exception(Error::MisformedContentObject());
-  }
-
-  return readRawPtr (content, len);
-}
-
-Name
-ParsedContentObject::name() const
-{
-  return Name(head(m_bytes), m_comps);
-}
-
-Name
-ParsedContentObject::keyName() const
-{
-  if (m_pco.offset[CCN_PCO_E_KeyName_Name] > m_pco.offset[CCN_PCO_B_KeyName_Name])
-  {
-    CharbufPtr ptr = boost::make_shared<Charbuf>();
-    ccn_charbuf_append(ptr->getBuf(), head(m_bytes) + m_pco.offset[CCN_PCO_B_KeyName_Name], m_pco.offset[CCN_PCO_E_KeyName_Name] - m_pco.offset[CCN_PCO_B_KeyName_Name]);
-
-    return Name(*ptr);
-  }
-  else
-  {
-    return Name();
-  }
-}
-
-HashPtr
-ParsedContentObject::publisherPublicKeyDigest() const
-{
-  const unsigned char *buf = NULL;
-  size_t size = 0;
-  ccn_ref_tagged_BLOB(CCN_DTAG_PublisherPublicKeyDigest, head(m_bytes), m_pco.offset[CCN_PCO_B_PublisherPublicKeyDigest], m_pco.offset[CCN_PCO_E_PublisherPublicKeyDigest], &buf, &size);
-
-  return boost::make_shared<Hash>(buf, size);
-}
-
-ParsedContentObject::Type
-ParsedContentObject::type() const
-{
-  switch (m_pco.type)
-  {
-  case CCN_CONTENT_DATA: return DATA;
-  case CCN_CONTENT_KEY: return KEY;
-  default: break;
-  }
-  return OTHER;
-}
-
-// void
-// ParsedContentObject::verifySignature(const CertPtr &cert)
-// {
-//   m_verified = (ccn_verify_signature(head(m_bytes), m_pco.offset[CCN_PCO_E], &m_pco, cert->pkey()) == 1);
-// }
-
-}
diff --git a/disabled/pco.h b/disabled/pco.h
deleted file mode 100644
index 6931022..0000000
--- a/disabled/pco.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef NDN_CONTENT_OBJECT_H
-#define NDN_CONTENT_OBJECT_H
-
-#include "ndn.cxx/wrapper.h"
-#include "ndn.cxx/common.h"
-#include "ndn.cxx/fields/name.h"
-#include "ndn.cxx/helpers/hash.h"
-
-namespace ndn {
-
-// class Cert;
-// typedef boost::shared_ptr<Cert> CertPtr;
-
-class ParsedContentObject
-{
-public:
-  enum Type
-  {
-    DATA,
-    KEY,
-    OTHER
-  };
-  ParsedContentObject(const unsigned char *data, size_t len, bool verified = false);
-  ParsedContentObject(const unsigned char *data, const ccn_parsed_ContentObject &pco, bool verified = false);
-  ParsedContentObject(const Bytes &bytes, bool verified = false);
-  ParsedContentObject(const ParsedContentObject &other, bool verified = false);
-  virtual ~ParsedContentObject();
-
-  Bytes
-  content() const;
-
-  BytesPtr
-  contentPtr() const;
-
-  Name
-  name() const;
-
-  Name
-  keyName() const;
-
-  HashPtr
-  publisherPublicKeyDigest() const;
-
-  Type
-  type() const;
-
-  inline const Bytes &
-  buf () const;
-
-  bool
-  verified() const { return m_verified; }
-
-  // void
-  // verifySignature(const CertPtr &cert);
-
-  const unsigned char *
-  msg() const { return head(m_bytes); }
-
-  const ccn_parsed_ContentObject *
-  pco() const { return &m_pco; }
-
-private:
-  void
-  init(const unsigned char *data, size_t len);
-
-protected:
-  ccn_parsed_ContentObject m_pco;
-  ccn_indexbuf *m_comps;
-  Bytes m_bytes;
-  bool m_verified;
-  bool m_integrityChecked;
-};
-
-typedef boost::shared_ptr<ParsedContentObject> PcoPtr;
-
-namespace Error {
-struct MisformedContentObject : virtual boost::exception, virtual std::exception { };
-}
-
-const Bytes &
-ParsedContentObject::buf () const
-{
-  return m_bytes;
-}
-
-
-}
-
-#endif // NDN_CONTENT_OBJECT_H
diff --git a/disabled/verifier.cc b/disabled/verifier.cc
deleted file mode 100644
index 99599bd..0000000
--- a/disabled/verifier.cc
+++ /dev/null
@@ -1,173 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013 University of California, Los Angeles
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#include "verifier.h"
-#include "ndn.cxx/wrapper.h"
-#include "logging.h"
-
-INIT_LOGGER ("ndn.Verifier");
-namespace ndn {
-
-static const size_t ROOT_KEY_DIGEST_LEN = 32;  // SHA-256
-static const unsigned char ROOT_KEY_DIGEST[ROOT_KEY_DIGEST_LEN] = {0xa7, 0xd9, 0x8b, 0x81, 0xde, 0x13, 0xfc,
-0x56, 0xc5, 0xa6, 0x92, 0xb4, 0x44, 0x93, 0x6e, 0x56, 0x70, 0x9d, 0x52, 0x6f, 0x70,
-0xed, 0x39, 0xef, 0xb5, 0xe2, 0x3, 0x29, 0xa5, 0x53, 0x3e, 0x68};
-
-Verifier::Verifier(Wrapper *ccnx)
-         : m_ccnx(ccnx)
-         , m_rootKeyDigest(ROOT_KEY_DIGEST, ROOT_KEY_DIGEST_LEN)
-{
-}
-
-Verifier::~Verifier()
-{
-}
-
-bool
-Verifier::verify(PcoPtr pco, double maxWait)
-{
-  _LOG_TRACE("Verifying content [" << pco->name() << "]");
-  HashPtr publisherPublicKeyDigest = pco->publisherPublicKeyDigest();
-
-  {
-    UniqueRecLock lock(m_cacheLock);
-    CertCache::iterator it = m_certCache.find(*publisherPublicKeyDigest);
-    if (it != m_certCache.end())
-    {
-      CertPtr cert = it->second;
-      if (cert->validity() == Cert::WITHIN_VALID_TIME_SPAN)
-      {
-        pco->verifySignature(cert);
-        return pco->verified();
-      }
-      else
-      {
-        // delete the invalid cert cache
-        m_certCache.erase(it);
-      }
-    }
-  }
-
-  // keyName is the name specified in key locator, i.e. without version and segment
-  Name keyName = pco->keyName();
-  int keyNameSize = keyName.size();
-
-  if (keyNameSize < 2)
-  {
-    _LOG_ERROR("Key name is empty or has too few components.");
-    return false;
-  }
-
-  // for keys, we have to make sure key name is strictly prefix of the content name
-  if (pco->type() == ParsedContentObject::KEY)
-  {
-    Name contentName = pco->name();
-    // when checking for prefix, do not include the hash in the key name (which is the last component)
-    Name keyNamePrefix = keyName.getPrefix (keyNameSize - 1);
-    if (keyNamePrefix.size() >= contentName.size() || contentName.getPrefix (keyNamePrefix.size()) != keyNamePrefix)
-    {
-      _LOG_ERROR("Key name prefix [" << keyNamePrefix << "] is not the prefix of content name [" << contentName << "]");
-      return false;
-    }
-  }
-  else
-  {
-    // for now, user can assign any data using his key
-  }
-
-  Name metaName;
-  metaName
-    .append (keyName.getPrefix (keyNameSize - 1))
-    .append ("info")
-    .append (keyName.getSubName (keyNameSize - 1));
-
-  Interest interest;
-  interest.setChildSelector (Interest::CHILD_RIGHT)
-    .setInterestLifetime(maxWait);
-
-  PcoPtr keyObject = m_ccnx->get(Interest (interest).setName (keyName), maxWait);
-  PcoPtr metaObject = m_ccnx->get(Interest (interest).setName (metaName), maxWait);
-  if (!keyObject || !metaObject )
-  {
-    _LOG_ERROR("can not fetch key or meta");
-    return false;
-  }
-
-  HashPtr publisherKeyHashInKeyObject = keyObject->publisherPublicKeyDigest();
-  HashPtr publisherKeyHashInMetaObject = metaObject->publisherPublicKeyDigest();
-
-  // make sure key and meta are signed using the same key
-  if (publisherKeyHashInKeyObject->IsZero() || ! (*publisherKeyHashInKeyObject == *publisherKeyHashInMetaObject))
-  {
-    _LOG_ERROR("Key and Meta not signed by the same publisher");
-    return false;
-  }
-
-  CertPtr cert = boost::make_shared<Cert>(keyObject, metaObject);
-  if (cert->validity() != Cert::WITHIN_VALID_TIME_SPAN)
-  {
-    _LOG_ERROR("Certificate is not valid, validity status is : " << cert->validity());
-    return false;
-  }
-
-  // check pco is actually signed by this key (i.e. we don't trust the publisherPublicKeyDigest given by ccnx c lib)
-  if (! (*pco->publisherPublicKeyDigest() == cert->keyDigest()))
-  {
-    _LOG_ERROR("key digest does not match the publisher public key digest of the content object");
-    return false;
-  }
-
-  // now we only need to make sure the key is trustworthy
-  if (cert->keyDigest() == m_rootKeyDigest)
-  {
-    // the key is the root key
-    // do nothing now
-  }
-  else
-  {
-    // can not verify key or can not verify meta
-    if (!verify(keyObject, maxWait) || !verify(metaObject, maxWait))
-    {
-      _LOG_ERROR("Can not verify key or meta");
-      return false;
-    }
-  }
-
-  // ok, keyObject verified, because metaObject is signed by the same parent key and integrity checked
-  // so metaObject is also verified
-  {
-    UniqueRecLock lock(m_cacheLock);
-    m_certCache.insert(std::make_pair(cert->keyDigest(), cert));
-  }
-
-  pco->verifySignature(cert);
-  if (pco->verified())
-  {
-    _LOG_TRACE("[" << pco->name() << "] VERIFIED.");
-  }
-  else
-  {
-    _LOG_ERROR("[" << pco->name() << "] CANNOT BE VERIFIED.");
-  }
-  return pco->verified();
-}
-
-} // ndn
diff --git a/disabled/verifier.h b/disabled/verifier.h
deleted file mode 100644
index 0065d87..0000000
--- a/disabled/verifier.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013 University of California, Los Angeles
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef NDN_VERIFIER_H
-#define NDN_VERIFIER_H
-
-#include "ndn.cxx/common.h"
-#include "ndn.cxx/name.h"
-#include "ndn.cxx/cert.h"
-#include "ndn.cxx/pco.h"
-#include <map>
-#include <boost/thread/locks.hpp>
-#include <boost/thread/recursive_mutex.hpp>
-#include <boost/thread/thread.hpp>
-
-namespace ndn {
-
-class Wrapper;
-
-class Verifier
-{
-public:
-  Verifier(Wrapper *ccnx);
-  ~Verifier();
-
-  bool verify(PcoPtr pco, double maxWait);
-
-private:
-
-private:
-  Wrapper *m_ccnx;
-  Hash m_rootKeyDigest;
-  typedef std::map<Hash, CertPtr> CertCache;
-  CertCache m_certCache;
-  typedef boost::recursive_mutex RecLock;
-  typedef boost::unique_lock<RecLock> UniqueRecLock;
-  RecLock m_cacheLock;
-};
-
-} // ndn
-
-#endif // NDN_VERIFIER_H
diff --git a/disabled/wrapper-tests.cc b/disabled/wrapper-tests.cc
deleted file mode 100644
index c69ca54..0000000
--- a/disabled/wrapper-tests.cc
+++ /dev/null
@@ -1,248 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-
-#include "ndn.cxx.h"
-#include <unistd.h>
-#include <fstream>
-
-#include <boost/date_time/posix_time/posix_time.hpp>
-#include <boost/test/unit_test.hpp>
-#include <boost/make_shared.hpp>
-
-#include "logging.h"
-
-using namespace ndn;
-using namespace std;
-using namespace boost;
-
-BOOST_AUTO_TEST_SUITE(WrapperTests)
-
-WrapperPtr c1;
-WrapperPtr c2;
-int g_timeout_counter = 0;
-int g_dataCallback_counter = 0;
-
-void publish1(InterestPtr interest)
-{
-  string content = interest->getName ().toUri();
-  c1->publishData(interest->getName (), (const unsigned char*)content.c_str(), content.size(), 5);
-}
-
-void publish2(InterestPtr interest)
-{
-  string content = interest->getName ().toUri();
-  c2->publishData(interest->getName (), (const unsigned char*)content.c_str(), content.size(), 5);
-}
-
-void dataCallback(const Name &name, ndn::PcoPtr pco)
-{
-  cout << " in data callback" << endl;
-  BytesPtr content = pco->contentPtr ();
-  string msg(reinterpret_cast<const char *> (head (*content)), content->size());
-  g_dataCallback_counter ++;
-  BOOST_CHECK_EQUAL(name, msg);
-}
-
-void encapCallback(const Name &name, ndn::PcoPtr pco)
-{
-  cout << " in encap data callback" << endl;
-  BOOST_CHECK(!c1->verify(pco));
-  cout << "++++++++++++++++++ Outer content couldn't be verified, which is expected." << endl;
-  PcoPtr npco = make_shared<ParsedContentObject> (*(pco->contentPtr()));
-  g_dataCallback_counter ++;
-  BOOST_CHECK(npco);
-  BOOST_CHECK(c1->verify(npco));
-}
-
-void
-timeout(const Name &name, const Closure &closure, InterestPtr origInterest)
-{
-  g_timeout_counter ++;
-}
-
-void
-setup()
-{
-  if (!c1)
-  {
-    c1 = make_shared<Wrapper> ();
-  }
-  if (!c2)
-  {
-    c2 = make_shared<Wrapper> ();
-  }
-}
-
-void
-teardown()
-{
-  if (c1)
-  {
-    c1.reset();
-  }
-  if (c2)
-  {
-    c2.reset();
-  }
-}
-
-
-BOOST_AUTO_TEST_CASE (Basic)
-{
-  INIT_LOGGERS ();
-  
-  setup();
-  Name prefix1("/c1");
-  Name prefix2("/c2");
-
-  c1->setInterestFilter(prefix1, bind(publish1, _1));
-  usleep(100000);
-  c2->setInterestFilter(prefix2, bind(publish2, _1));
-
-  Closure closure (bind(dataCallback, _1, _2), bind(timeout, _1, _2, _3));
-
-  c1->sendInterest(Name("/c2/hi"), closure);
-  usleep(100000);
-  c2->sendInterest(Name("/c1/hi"), closure);
-  sleep(1);
-  BOOST_CHECK_EQUAL(g_dataCallback_counter, 2);
-  
-  // reset
-  g_dataCallback_counter = 0;
-  g_timeout_counter = 0;
-
-  teardown();
-}
-
-BOOST_AUTO_TEST_CASE (Selector)
-{
-  setup();
-  Closure closure (bind(dataCallback, _1, _2), bind(timeout, _1, _2, _3));
-
-  Interest interest;
-  interest
-    .setInterestLifetime(1)
-    .setChildSelector (Interest::CHILD_RIGHT);
-
-  string n1 = "/random/01";
-  c1->sendInterest (Interest (interest).setName (Name(n1)), closure);
-  sleep(2);
-  c2->publishData(Name(n1), (const unsigned char *)n1.c_str(), n1.size(), 1);
-  usleep(100000);
-  BOOST_CHECK_EQUAL(g_timeout_counter, 1);
-  BOOST_CHECK_EQUAL(g_dataCallback_counter, 0);
-
-  string n2 = "/random/02";
-  interest.setInterestLifetime(2);
-  c1->sendInterest(Interest (interest).setName (Name(n2)), closure);
-  sleep(1);
-  c2->publishData(Name(n2), (const unsigned char *)n2.c_str(), n2.size(), 1);
-  usleep(100000);
-  BOOST_CHECK_EQUAL(g_timeout_counter, 1);
-  BOOST_CHECK_EQUAL(g_dataCallback_counter, 1);
-
-  // reset
-  g_dataCallback_counter = 0;
-  g_timeout_counter = 0;
-
-  teardown();
-
-}
-
-void
-reexpress(const Name &name, const Closure &closure, InterestPtr origInterest)
-{
-  g_timeout_counter ++;
-  c1->sendInterest (*origInterest, closure);
-}
-
-BOOST_AUTO_TEST_CASE (Timeout)
-{
-  setup();
-  g_dataCallback_counter = 0;
-  g_timeout_counter = 0;
-  Closure closure (bind(dataCallback, _1, _2), bind(reexpress, _1, _2, _3));
-
-  string n1 = "/random/04";
-
-  Interest interest;
-  interest
-    .setInterestLifetime(1)
-    .setName (n1);
-
-  c1->sendInterest(interest, closure);
-  usleep(3500000);
-  c2->publishData(Name(n1), (const unsigned char *)n1.c_str(), n1.size(), 1);
-  usleep(100000);
-  BOOST_CHECK_EQUAL(g_dataCallback_counter, 1);
-  BOOST_CHECK_EQUAL(g_timeout_counter, 3);
-  teardown();
-}
-
-BOOST_AUTO_TEST_CASE (Unsigned)
-{
-  setup();
-  string n1 = "/xxxxxx/unsigned/001";
-  Closure closure (bind(dataCallback, _1, _2), bind(timeout, _1, _2, _3));
-
-  g_dataCallback_counter = 0;
-  c1->sendInterest(Name(n1), closure);
-  usleep(100000);
-  c2->publishUnsignedData(Name(n1), (const unsigned char *)n1.c_str(), n1.size(), 1);
-  usleep(100000);
-  BOOST_CHECK_EQUAL(g_dataCallback_counter, 1);
-
-  string n2 = "/xxxxxx/signed/001";
-  Bytes content = c1->createContentObject(Name(n1), (const unsigned char *)n2.c_str(), n2.size(), 1);
-
-  c1->publishUnsignedData(Name(n2), head(content), content.size(), 1);
-  Closure encapClosure(bind(encapCallback, _1, _2), bind(timeout, _1, _2, _3));
-  c2->sendInterest(Name(n2), encapClosure);
-  usleep(4000000);
-  BOOST_CHECK_EQUAL(g_dataCallback_counter, 2);
-  teardown();
-}
-
-
- /*
- BOOST_AUTO_TEST_CASE (ndnWrapperUnsigningTest)
- {
-   setup();
-   Bytes data;
-   data.resize(1024);
-   for (int i = 0; i < 1024; i++)
-   {
-     data[i] = 'm';
-   }
-
-   Name name("/unsigningtest");
-
-   posix_time::ptime start = posix_time::second_clock::local_time();
-   for (uint64_t i = 0; i < 100000; i++)
-   {
-     Name n = name;
-     n.appendComp(i);
-     c1->publishUnsignedData(n, data, 10);
-   }
-   posix_time::ptime end = posix_time::second_clock::local_time();
-
-   posix_time::time_duration duration = end - start;
-
-   cout << "Publishing 100000 1K size content objects costs " <<duration.total_milliseconds() << " milliseconds" << endl;
-   cout << "Average time to publish one content object is " << (double) duration.total_milliseconds() / 100000.0 << " milliseconds" << endl;
-    teardown();
- }
- */
-
-
-BOOST_AUTO_TEST_SUITE_END()
diff --git a/disabled/wrapper.cc b/disabled/wrapper.cc
deleted file mode 100644
index 4ef079e..0000000
--- a/disabled/wrapper.cc
+++ /dev/null
@@ -1,791 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#include "wrapper.h"
-
-extern "C" {
-#include <ccn/fetch.h>
-}
-#include <poll.h>
-#include <boost/throw_exception.hpp>
-#include <boost/random.hpp>
-#include <boost/make_shared.hpp>
-#include <boost/algorithm/string.hpp>
-
-#include <sstream>
-
-// #include "ndn.cxx/verifier.h"
-#include "executor/executor.h"
-
-#include "logging.h"
-#include "ndn.cxx/wire/ccnb.h"
-
-
-INIT_LOGGER ("ndn.Wrapper");
-
-typedef boost::error_info<struct tag_errmsg, std::string> errmsg_info_str;
-typedef boost::error_info<struct tag_errmsg, int> errmsg_info_int;
-
-using namespace std;
-using namespace boost;
-
-namespace ndn {
-
-// hack to enable fake signatures
-// min length for signature field is 16, as defined in ccn_buf_decoder.c:728
-const int DEFAULT_SIGNATURE_SIZE = 16;
-
-// Although ccn_buf_decoder.c:745 defines minimum length 16, something else is checking and only 32-byte fake value is accepted by ccnd
-const int PUBLISHER_KEY_SIZE = 32;
-
-static int
-ccn_encode_garbage_Signature(struct ccn_charbuf *buf)
-{
-    int res = 0;
-
-    res |= ccn_charbuf_append_tt(buf, CCN_DTAG_Signature, CCN_DTAG);
-
-    // Let's cheat more.  Default signing algorithm in ccnd is SHA256, so we just need add 32 bytes of garbage
-    static char garbage [DEFAULT_SIGNATURE_SIZE];
-
-    // digest and witness fields are optional, so use default ones
-
-    res |= ccn_charbuf_append_tt(buf, CCN_DTAG_SignatureBits, CCN_DTAG);
-    res |= ccn_charbuf_append_tt(buf, DEFAULT_SIGNATURE_SIZE, CCN_BLOB);
-    res |= ccn_charbuf_append(buf, garbage, DEFAULT_SIGNATURE_SIZE);
-    res |= ccn_charbuf_append_closer(buf);
-
-    res |= ccn_charbuf_append_closer(buf);
-
-    return(res == 0 ? 0 : -1);
-}
-
-static int
-ccn_pack_unsigned_ContentObject(struct ccn_charbuf *buf,
-                                const struct ccn_charbuf *Name,
-                                const struct ccn_charbuf *SignedInfo,
-                                const void *data,
-                                size_t size)
-{
-    int res = 0;
-    struct ccn_charbuf *content_header;
-    size_t closer_start;
-
-    content_header = ccn_charbuf_create();
-    res |= ccn_charbuf_append_tt(content_header, CCN_DTAG_Content, CCN_DTAG);
-    if (size != 0)
-        res |= ccn_charbuf_append_tt(content_header, size, CCN_BLOB);
-    closer_start = content_header->length;
-    res |= ccn_charbuf_append_closer(content_header);
-    if (res < 0)
-        return(-1);
-
-    res |= ccn_charbuf_append_tt(buf, CCN_DTAG_ContentObject, CCN_DTAG);
-
-    res |= ccn_encode_garbage_Signature(buf);
-
-    res |= ccn_charbuf_append_charbuf(buf, Name);
-    res |= ccn_charbuf_append_charbuf(buf, SignedInfo);
-    res |= ccnb_append_tagged_blob(buf, CCN_DTAG_Content, data, size);
-    res |= ccn_charbuf_append_closer(buf);
-
-    ccn_charbuf_destroy(&content_header);
-    return(res == 0 ? 0 : -1);
-}
-
-Wrapper::Wrapper()
-  : m_handle (0)
-  , m_running (true)
-  , m_connected (false)
-  , m_executor (new Executor(1))
-  // , m_verifier(new Verifier(this))
-{
-  start ();
-}
-
-void
-Wrapper::connectCcnd()
-{
-  if (m_handle != 0) {
-    ccn_disconnect (m_handle);
-    //ccn_destroy (&m_handle);
-  }
-  else
-    {
-      m_handle = ccn_create ();
-    }
-
-  UniqueRecLock lock(m_mutex);
-  if (ccn_connect(m_handle, NULL) < 0)
-  {
-    BOOST_THROW_EXCEPTION (Error::ndnOperation() << errmsg_info_str("connection to ccnd failed"));
-  }
-  m_connected = true;
-
-  if (!m_registeredInterests.empty())
-  {
-   for (map<Name, InterestCallback>::const_iterator it = m_registeredInterests.begin(); it != m_registeredInterests.end(); ++it)
-    {
-      clearInterestFilter(it->first, false);
-      setInterestFilter(it->first, it->second, false);
-    }
-  }
-}
-
-Wrapper::~Wrapper()
-{
-  shutdown ();
-  // if (m_verifier != 0)
-  // {
-  //   delete m_verifier;
-  //   m_verifier = 0;
-  // }
-}
-
-void
-Wrapper::start () // called automatically in constructor
-{
-  connectCcnd();
-  m_thread = thread (&Wrapper::ccnLoop, this);
-  m_executor->start();
-}
-
-void
-Wrapper::shutdown () // called in destructor, but can called manually
-{
-  m_executor->shutdown();
-
-  {
-    UniqueRecLock lock(m_mutex);
-    m_running = false;
-  }
-
-  _LOG_DEBUG ("+++++++++SHUTDOWN+++++++");
-  if (m_connected)
-    {
-      m_thread.join ();
-
-      ccn_disconnect (m_handle);
-      //ccn_destroy (&m_handle);
-      m_connected = false;
-    }
-}
-
-void
-Wrapper::ccnLoop ()
-{
-  static boost::mt19937 randomGenerator (static_cast<unsigned int> (std::time (0)));
-  static boost::variate_generator<boost::mt19937&, boost::uniform_int<> > rangeUniformRandom (randomGenerator, uniform_int<> (0,1000));
-
-  while (m_running)
-    {
-      try
-        {
-          int res = 0;
-          {
-            UniqueRecLock lock(m_mutex);
-            res = ccn_run (m_handle, 0);
-          }
-
-          if (!m_running) break;
-
-          if (res < 0) {
-            _LOG_ERROR ("ccn_run returned negative status: " << res);
-
-            BOOST_THROW_EXCEPTION (Error::ndnOperation()
-                                   << errmsg_info_str("ccn_run returned error"));
-          }
-
-
-          pollfd pfds[1];
-          {
-            UniqueRecLock lock(m_mutex);
-
-            pfds[0].fd = ccn_get_connection_fd (m_handle);
-            pfds[0].events = POLLIN;
-            if (ccn_output_is_pending (m_handle))
-              pfds[0].events |= POLLOUT;
-          }
-
-          int ret = poll (pfds, 1, 1);
-          if (ret < 0)
-            {
-              BOOST_THROW_EXCEPTION (Error::ndnOperation() << errmsg_info_str("ccnd socket failed (probably ccnd got stopped)"));
-            }
-        }
-        catch (Error::ndnOperation &e)
-        {
-          m_connected = false;
-          // probably ccnd has been stopped
-          // try reconnect with sleep
-          int interval = 1;
-          int maxInterval = 32;
-          while (m_running)
-          {
-            try
-            {
-              this_thread::sleep (boost::get_system_time () +  time::Seconds (interval) + time::Milliseconds (rangeUniformRandom ()));
-
-              connectCcnd ();
-              _LOG_DEBUG("reconnect to ccnd succeeded");
-              break;
-            }
-            catch (Error::ndnOperation &e)
-            {
-              this_thread::sleep (boost::get_system_time () +  time::Seconds (interval) + time::Milliseconds (rangeUniformRandom ()));
-
-              // do exponential backup for reconnect interval
-              if (interval < maxInterval)
-              {
-                interval *= 2;
-              }
-            }
-          }
-        }
-        catch (const std::exception &exc)
-          {
-            // catch anything thrown within try block that derives from std::exception
-            std::cerr << exc.what();
-          }
-        catch (...)
-          {
-            cout << "UNKNOWN EXCEPTION !!!" << endl;
-          }
-     }
-}
-
-Bytes
-Wrapper::createContentObject(const Name  &name, const void *buf, size_t len, int freshness, const Name &keyNameParam)
-{
-  {
-    UniqueRecLock lock(m_mutex);
-    if (!m_running || !m_connected)
-      {
-        _LOG_TRACE ("<< not running or connected");
-        return Bytes ();
-      }
-  }
-
-  ccn_charbuf *content = ccn_charbuf_create();
-
-  struct ccn_signing_params sp = CCN_SIGNING_PARAMS_INIT;
-  sp.freshness = freshness;
-
-  Name keyName;
-
-  if (keyNameParam.size() == 0)
-  {
-    // use default key name
-    CharbufPtr defaultKeyNamePtr = boost::make_shared<Charbuf>();
-    ccn_get_public_key_and_name(m_handle, &sp, NULL, NULL, defaultKeyNamePtr->getBuf());
-    keyName = Name(*defaultKeyNamePtr);
-
-    _LOG_DEBUG ("DEFAULT KEY NAME: " << keyName);
-  }
-  else
-  {
-    keyName = keyNameParam;
-  }
-
-  if (sp.template_ccnb == NULL)
-  {
-    sp.template_ccnb = ccn_charbuf_create();
-    ccn_charbuf_append_tt(sp.template_ccnb, CCN_DTAG_SignedInfo, CCN_DTAG);
-  }
-  // no idea what the following 3 lines do, but it was there
-  else if (sp.template_ccnb->length > 0) {
-      sp.template_ccnb->length--;
-  }
-  ccn_charbuf_append_tt(sp.template_ccnb, CCN_DTAG_KeyLocator, CCN_DTAG);
-  ccn_charbuf_append_tt(sp.template_ccnb, CCN_DTAG_KeyName, CCN_DTAG);
-
-  charbuf_stream keyStream;
-  wire::Ccnb::appendName (keyStream, keyName);
-  
-  ccn_charbuf_append(sp.template_ccnb, keyStream.buf ().getBuf ()->buf, keyStream.buf ().getBuf ()->length);
-  ccn_charbuf_append_closer(sp.template_ccnb); // </KeyName>
-  ccn_charbuf_append_closer(sp.template_ccnb); // </KeyLocator>
-  sp.sp_flags |= CCN_SP_TEMPL_KEY_LOCATOR;
-  ccn_charbuf_append_closer(sp.template_ccnb); // </SignedInfo>
-
-  charbuf_stream nameStream;
-  wire::Ccnb::appendName (nameStream, name);
-  
-  if (ccn_sign_content(m_handle, content, nameStream.buf ().getBuf (), &sp, buf, len) != 0)
-  {
-    BOOST_THROW_EXCEPTION(Error::ndnOperation() << errmsg_info_str("sign content failed"));
-  }
-
-  Bytes bytes;
-  readRaw(bytes, content->buf, content->length);
-
-  ccn_charbuf_destroy (&content);
-  if (sp.template_ccnb != NULL)
-  {
-    ccn_charbuf_destroy (&sp.template_ccnb);
-  }
-
-  return bytes;
-}
-
-int
-Wrapper::putToCcnd (const Bytes &contentObject)
-{
-  _LOG_TRACE (">> putToCcnd");
-  UniqueRecLock lock(m_mutex);
-  if (!m_running || !m_connected)
-    {
-      _LOG_TRACE ("<< not running or connected");
-      return -1;
-    }
-
-
-  if (ccn_put(m_handle, head(contentObject), contentObject.size()) < 0)
-  {
-    _LOG_ERROR ("ccn_put failed");
-    // BOOST_THROW_EXCEPTION(Error::ndnOperation() << errmsg_info_str("ccnput failed"));
-  }
-  else
-    {
-      _LOG_DEBUG ("<< putToCcnd");
-    }
-
-  return 0;
-}
-
-int
-Wrapper::publishData (const Name &name, const unsigned char *buf, size_t len, int freshness, const Name &keyName)
-{
-  _LOG_TRACE ("publishData: " << name);
-  Bytes co = createContentObject(name, buf, len, freshness, keyName);
-  return putToCcnd(co);
-}
-
-int
-Wrapper::publishUnsignedData(const Name &name, const unsigned char *buf, size_t len, int freshness)
-{
-  _LOG_TRACE ("publishUnsignedData: " << name);
-  {
-    UniqueRecLock lock(m_mutex);
-    if (!m_running || !m_connected)
-      {
-        _LOG_TRACE ("<< not running or connected");
-        return -1;
-      }
-  }
-
-  ccn_charbuf *content = ccn_charbuf_create();
-  ccn_charbuf *signed_info = ccn_charbuf_create();
-
-  static char fakeKey[PUBLISHER_KEY_SIZE];
-
-  int res = ccn_signed_info_create(signed_info,
-                                   fakeKey, PUBLISHER_KEY_SIZE,
-                                   NULL,
-                                   CCN_CONTENT_DATA,
-                                   freshness,
-                                   NULL,
-                                   NULL  // ccnd is happy with absent key locator and key itself... ha ha
-                                   );
-
-  charbuf_stream nameStream;
-  wire::Ccnb::appendName (nameStream, name);
-
-  ccn_pack_unsigned_ContentObject(content, nameStream.buf ().getBuf (), signed_info, buf, len);
-
-  Bytes bytes;
-  readRaw(bytes, content->buf, content->length);
-
-  ccn_charbuf_destroy (&content);
-  ccn_charbuf_destroy (&signed_info);
-
-  return putToCcnd (bytes);
-}
-
-
-static void
-deleterInInterestTuple (tuple<Wrapper::InterestCallback *, ExecutorPtr> *tuple)
-{
-  delete tuple->get<0> ();
-  delete tuple;
-}
-
-static ccn_upcall_res
-incomingInterest(ccn_closure *selfp,
-                 ccn_upcall_kind kind,
-                 ccn_upcall_info *info)
-{
-  Wrapper::InterestCallback *f;
-  ExecutorPtr executor;
-  tuple<Wrapper::InterestCallback *, ExecutorPtr> *realData = reinterpret_cast< tuple<Wrapper::InterestCallback *, ExecutorPtr>* > (selfp->data);
-  tie (f, executor) = *realData;
-
-  switch (kind)
-    {
-    case CCN_UPCALL_FINAL: // effective in unit tests
-      // delete closure;
-      executor->execute (bind (deleterInInterestTuple, realData));
-
-      delete selfp;
-      _LOG_TRACE ("<< incomingInterest with CCN_UPCALL_FINAL");
-      return CCN_UPCALL_RESULT_OK;
-
-    case CCN_UPCALL_INTEREST:
-      _LOG_TRACE (">> incomingInterest upcall: " << Name(info->interest_ccnb, info->interest_comps));
-      break;
-
-    default:
-      _LOG_TRACE ("<< incomingInterest with CCN_UPCALL_RESULT_OK: " << Name(info->interest_ccnb, info->interest_comps));
-      return CCN_UPCALL_RESULT_OK;
-    }
-
-  InterestPtr interest = make_shared<Interest> (info->pi);
-  interest->setName (Name (info->interest_ccnb, info->interest_comps));
-
-  executor->execute (bind (*f, interest));
-  // this will be run in executor
-  // (*f) (interest);
-  // closure->runInterestCallback(interest);
-
-  return CCN_UPCALL_RESULT_OK;
-}
-
-static void
-deleterInDataTuple (tuple<Closure *, ExecutorPtr, InterestPtr> *tuple)
-{
-  delete tuple->get<0> ();
-  delete tuple;
-}
-
-static ccn_upcall_res
-incomingData(ccn_closure *selfp,
-             ccn_upcall_kind kind,
-             ccn_upcall_info *info)
-{
-  // Closure *cp = static_cast<Closure *> (selfp->data);
-  Closure *cp;
-  ExecutorPtr executor;
-  InterestPtr interest;
-  tuple<Closure *, ExecutorPtr, InterestPtr> *realData = reinterpret_cast< tuple<Closure*, ExecutorPtr, InterestPtr>* > (selfp->data);
-  tie (cp, executor, interest) = *realData;
-
-  switch (kind)
-    {
-    case CCN_UPCALL_FINAL:  // effecitve in unit tests
-      executor->execute (bind (deleterInDataTuple, realData));
-
-      cp = NULL;
-      delete selfp;
-      _LOG_TRACE ("<< incomingData with CCN_UPCALL_FINAL");
-      return CCN_UPCALL_RESULT_OK;
-
-    case CCN_UPCALL_CONTENT:
-      _LOG_TRACE (">> incomingData content upcall: " << Name (info->content_ccnb, info->content_comps));
-      break;
-
-    // this is the case where the intentionally unsigned packets coming (in Encapsulation case)
-    case CCN_UPCALL_CONTENT_BAD:
-      _LOG_TRACE (">> incomingData content bad upcall: " << Name (info->content_ccnb, info->content_comps));
-      break;
-
-    // always ask ccnd to try to fetch the key
-    case CCN_UPCALL_CONTENT_UNVERIFIED:
-      _LOG_TRACE (">> incomingData content unverified upcall: " << Name (info->content_ccnb, info->content_comps));
-      break;
-
-    case CCN_UPCALL_INTEREST_TIMED_OUT: {
-      if (cp != NULL)
-      {
-        Name interestName (info->interest_ccnb, info->interest_comps);
-        _LOG_TRACE ("<< incomingData timeout: " << Name (info->interest_ccnb, info->interest_comps));
-        executor->execute (bind (&Closure::runTimeoutCallback, cp, interestName, *cp, interest));
-      }
-      else
-        {
-          _LOG_TRACE ("<< incomingData timeout, but callback is not set...: " << Name (info->interest_ccnb, info->interest_comps));
-        }
-      return CCN_UPCALL_RESULT_OK;
-    }
-
-    default:
-      _LOG_TRACE(">> unknown upcall type");
-      return CCN_UPCALL_RESULT_OK;
-    }
-
-  PcoPtr pco = make_shared<ParsedContentObject> (info->content_ccnb, info->pco->offset[CCN_PCO_E]);
-
-  // this will be run in executor
-  executor->execute (bind (&Closure::runDataCallback, cp, pco->name (), pco));
-  _LOG_TRACE (">> incomingData");
-
-  return CCN_UPCALL_RESULT_OK;
-}
-
-int Wrapper::sendInterest (const Interest &interest, const Closure &closure)
-{
-  _LOG_TRACE (">> sendInterest: " << interest.getName ());
-  {
-    UniqueRecLock lock(m_mutex);
-    if (!m_running || !m_connected)
-      {
-        _LOG_ERROR ("<< sendInterest: not running or connected");
-        return -1;
-      }
-  }
-
-  ccn_closure *dataClosure = new ccn_closure;
-
-  // Closure *myClosure = new ExecutorClosure(closure, m_executor);
-  Closure *myClosure = closure.dup ();
-  dataClosure->data = new tuple<Closure*, ExecutorPtr, InterestPtr> (myClosure, m_executor, make_shared<Interest> (interest));
-
-  dataClosure->p = &incomingData;
-
-  UniqueRecLock lock(m_mutex);
-
-  charbuf_stream nameStream;
-  wire::Ccnb::appendName (nameStream, interest.getName ());
-
-  charbuf_stream interestStream;
-  wire::Ccnb::appendInterest (interestStream, interest);
-
-  if (ccn_express_interest (m_handle, nameStream.buf ().getBuf (),
-                            dataClosure,
-                            interestStream.buf ().getBuf ()
-                            ) < 0)
-  {
-    _LOG_ERROR ("<< sendInterest: ccn_express_interest FAILED!!!");
-  }
-
-  return 0;
-}
-
-int Wrapper::setInterestFilter (const Name &prefix, const InterestCallback &interestCallback, bool record/* = true*/)
-{
-  _LOG_TRACE (">> setInterestFilter");
-  UniqueRecLock lock(m_mutex);
-  if (!m_running || !m_connected)
-  {
-    return -1;
-  }
-
-  ccn_closure *interestClosure = new ccn_closure;
-
-  // interestClosure->data = new ExecutorInterestClosure(interestCallback, m_executor);
-
-  interestClosure->data = new tuple<Wrapper::InterestCallback *, ExecutorPtr> (new InterestCallback (interestCallback), m_executor); // should be removed when closure is removed
-  interestClosure->p = &incomingInterest;
-
-  charbuf_stream prefixStream;
-  wire::Ccnb::appendName (prefixStream, prefix);
-
-  int ret = ccn_set_interest_filter (m_handle, prefixStream.buf ().getBuf (), interestClosure);
-  if (ret < 0)
-  {
-    _LOG_ERROR ("<< setInterestFilter: ccn_set_interest_filter FAILED");
-  }
-
-  if (record)
-    {
-      m_registeredInterests.insert(pair<Name, InterestCallback>(prefix, interestCallback));
-    }
-
-  _LOG_TRACE ("<< setInterestFilter");
-
-  return ret;
-}
-
-void
-Wrapper::clearInterestFilter (const Name &prefix, bool record/* = true*/)
-{
-  _LOG_TRACE (">> clearInterestFilter");
-  UniqueRecLock lock(m_mutex);
-  if (!m_running || !m_connected)
-    return;
-
-  charbuf_stream prefixStream;
-  wire::Ccnb::appendName (prefixStream, prefix);
-
-  int ret = ccn_set_interest_filter (m_handle, prefixStream.buf ().getBuf (), 0);
-  if (ret < 0)
-  {
-  }
-
-  if (record)
-    {
-      m_registeredInterests.erase(prefix);
-    }
-
-  _LOG_TRACE ("<< clearInterestFilter");
-}
-
-Name
-Wrapper::getLocalPrefix ()
-{
-  struct ccn * tmp_handle = ccn_create ();
-  int res = ccn_connect (tmp_handle, NULL);
-  if (res < 0)
-    {
-      return Name();
-    }
-
-  string retval = "";
-
-  struct ccn_charbuf *templ = ccn_charbuf_create();
-  ccn_charbuf_append_tt(templ, CCN_DTAG_Interest, CCN_DTAG);
-  ccn_charbuf_append_tt(templ, CCN_DTAG_Name, CCN_DTAG);
-  ccn_charbuf_append_closer(templ); /* </Name> */
-  // XXX - use pubid if possible
-  ccn_charbuf_append_tt(templ, CCN_DTAG_MaxSuffixComponents, CCN_DTAG);
-  ccnb_append_number(templ, 1);
-  ccn_charbuf_append_closer(templ); /* </MaxSuffixComponents> */
-  ccnb_tagged_putf(templ, CCN_DTAG_Scope, "%d", 2);
-  ccn_charbuf_append_closer(templ); /* </Interest> */
-
-  struct ccn_charbuf *name = ccn_charbuf_create ();
-  res = ccn_name_from_uri (name, "/local/ndn/prefix");
-  if (res < 0) {
-  }
-  else
-    {
-      struct ccn_fetch *fetch = ccn_fetch_new (tmp_handle);
-
-      struct ccn_fetch_stream *stream = ccn_fetch_open (fetch, name, "/local/ndn/prefix",
-                                                        NULL, 4, CCN_V_HIGHEST, 0);
-      if (stream == NULL) {
-      }
-      else
-        {
-          ostringstream os;
-
-          int counter = 0;
-          char buf[256];
-          while (true) {
-            res = ccn_fetch_read (stream, buf, sizeof(buf));
-
-            if (res == 0) {
-              break;
-            }
-
-            if (res > 0) {
-              os << string(buf, res);
-            } else if (res == CCN_FETCH_READ_NONE) {
-              if (counter < 2)
-                {
-                  ccn_run(tmp_handle, 1000);
-                  counter ++;
-                }
-              else
-                {
-                  break;
-                }
-            } else if (res == CCN_FETCH_READ_END) {
-              break;
-            } else if (res == CCN_FETCH_READ_TIMEOUT) {
-              break;
-            } else {
-              break;
-            }
-          }
-          retval = os.str ();
-          stream = ccn_fetch_close(stream);
-        }
-      fetch = ccn_fetch_destroy(fetch);
-    }
-
-  ccn_charbuf_destroy (&name);
-
-  ccn_disconnect (tmp_handle);
-  ccn_destroy (&tmp_handle);
-
-  boost::algorithm::trim(retval);
-  return Name(retval);
-}
-
-bool
-Wrapper::verify(PcoPtr &pco, double maxWait)
-{
-  return true; // totally fake
-  // return m_verifier->verify(pco, maxWait);
-}
-
-/// @cond include_hidden
-// This is needed just for get function implementation
-struct GetState
-{
-  GetState (double maxWait)
-  {
-    double intPart, fraction;
-    fraction = modf (std::abs(maxWait), &intPart);
-
-    m_maxWait = time::Now ()
-      + time::Seconds (intPart)
-      + time::Microseconds (fraction * 1000000);
-  }
-
-  PcoPtr
-  WaitForResult ()
-  {
-    //_LOG_TRACE("GetState::WaitForResult start");
-    boost::unique_lock<boost::mutex> lock (m_mutex);
-    m_cond.timed_wait (lock, m_maxWait);
-    //_LOG_TRACE("GetState::WaitForResult finish");
-
-    return m_retval;
-  }
-
-  void
-  DataCallback (Name name, PcoPtr pco)
-  {
-    //_LOG_TRACE("GetState::DataCallback, Name [" << name << "]");
-    boost::unique_lock<boost::mutex> lock (m_mutex);
-    m_retval = pco;
-    m_cond.notify_one ();
-  }
-
-  void
-  TimeoutCallback (Name name)
-  {
-    boost::unique_lock<boost::mutex> lock (m_mutex);
-    m_cond.notify_one ();
-  }
-
-private:
-  Time m_maxWait;
-
-  boost::mutex m_mutex;
-  boost::condition_variable    m_cond;
-
-  PcoPtr  m_retval;
-};
-/// @endcond
-
-PcoPtr
-Wrapper::get(const Interest &interest, double maxWait/* = 4.0*/)
-{
-  _LOG_TRACE (">> get: " << interest.getName ());
-  {
-    UniqueRecLock lock(m_mutex);
-    if (!m_running || !m_connected)
-      {
-        _LOG_ERROR ("<< get: not running or connected");
-        return PcoPtr ();
-      }
-  }
-
-  GetState state (maxWait);
-  this->sendInterest (interest, Closure (boost::bind (&GetState::DataCallback, &state, _1, _2),
-                                         boost::bind (&GetState::TimeoutCallback, &state, _1)));
-  return state.WaitForResult ();
-}
-
-}
diff --git a/disabled/wrapper.h b/disabled/wrapper.h
deleted file mode 100644
index 517a832..0000000
--- a/disabled/wrapper.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef NDN_WRAPPER_H
-#define NDN_WRAPPER_H
-
-#include <boost/thread/locks.hpp>
-#include <boost/thread/recursive_mutex.hpp>
-#include <boost/thread/thread.hpp>
-
-#include "ndn.cxx/common.h"
-#include "ndn.cxx/fields/name.h"
-#include "ndn.cxx/interest.h"
-#include "ndn.cxx/closure.h"
-#include "ndn.cxx/pco.h"
-
-class Executor;
-typedef boost::shared_ptr<Executor> ExecutorPtr;
-
-namespace ndn {
-
-class Verifier;
-class Wrapper
-{
-public:
-  const static int MAX_FRESHNESS = 2147; // max value for ccnx
-  const static int DEFAULT_FRESHNESS = 60;
-  typedef boost::function<void (InterestPtr)> InterestCallback;
-
-  Wrapper();
-  ~Wrapper();
-
-  void
-  start (); // called automatically in constructor
-
-  /**
-   * @brief Because of uncertainty with executor, in some case it is necessary to call shutdown explicitly (see test-server-and-fetch.cc)
-   */
-  void
-  shutdown (); // called in destructor, but can called manually
-
-  int
-  setInterestFilter (const Name &prefix, const InterestCallback &interestCallback, bool record = true);
-
-  void
-  clearInterestFilter (const Name &prefix, bool record = true);
-
-  int
-  sendInterest (const Interest &interest, const Closure &closure);
-
-  int
-  publishData (const Name &name, const unsigned char *buf, size_t len, int freshness = DEFAULT_FRESHNESS, const Name &keyName=Name());
-
-  inline int
-  publishData (const Name &name, const Bytes &content, int freshness = DEFAULT_FRESHNESS, const Name &keyName=Name());
-
-  inline int
-  publishData (const Name &name, const std::string &content, int freshness = DEFAULT_FRESHNESS, const Name &keyName=Name());
-
-  int
-  publishUnsignedData(const Name &name, const unsigned char *buf, size_t len, int freshness = DEFAULT_FRESHNESS);
-
-  inline int
-  publishUnsignedData(const Name &name, const Bytes &content, int freshness = DEFAULT_FRESHNESS);
-
-  inline int
-  publishUnsignedData(const Name &name, const std::string &content, int freshness = DEFAULT_FRESHNESS);
-
-  static Name
-  getLocalPrefix ();
-
-  Bytes
-  createContentObject(const Name &name, const void *buf, size_t len, int freshness = DEFAULT_FRESHNESS, const Name &keyNameParam=Name());
-
-  int
-  putToCcnd (const Bytes &contentObject);
-
-  bool
-  verify(PcoPtr &pco, double maxWait = 1 /*seconds*/);
-
-  PcoPtr
-  get (const Interest &interest, double maxWait = 4.0/*seconds*/);
-
-private:
-  Wrapper(const Wrapper &other) {}
-
-protected:
-  void
-  connectCcnd();
-
-  /// @cond include_hidden
-  void
-  ccnLoop ();
-
-  /// @endcond
-
-protected:
-  typedef boost::shared_mutex Lock;
-  typedef boost::unique_lock<Lock> WriteLock;
-  typedef boost::shared_lock<Lock> ReadLock;
-
-  typedef boost::recursive_mutex RecLock;
-  typedef boost::unique_lock<RecLock> UniqueRecLock;
-
-  ccn* m_handle;
-  RecLock m_mutex;
-  boost::thread m_thread;
-  bool m_running;
-  bool m_connected;
-  std::map<Name, InterestCallback> m_registeredInterests;
-  ExecutorPtr m_executor;
-  Verifier *m_verifier;
-};
-
-typedef boost::shared_ptr<Wrapper> WrapperPtr;
-
-/**
- * @brief Namespace holding all exceptions that can be fired by the library
- */
-namespace Error
-{
-struct ndnOperation : boost::exception, std::exception { };
-}
-
-inline int
-Wrapper::publishData (const Name &name, const Bytes &content, int freshness, const Name &keyName)
-{
-  return publishData(name, head(content), content.size(), freshness, keyName);
-}
-
-inline int
-Wrapper::publishData (const Name &name, const std::string &content, int freshness, const Name &keyName)
-{
-  return publishData(name, reinterpret_cast<const unsigned char *> (content.c_str ()), content.size (), freshness, keyName);
-}
-
-inline int
-Wrapper::publishUnsignedData(const Name &name, const Bytes &content, int freshness)
-{
-  return publishUnsignedData(name, head(content), content.size(), freshness);
-}
-
-inline int
-Wrapper::publishUnsignedData(const Name &name, const std::string &content, int freshness)
-{
-  return publishUnsignedData(name, reinterpret_cast<const unsigned char *> (content.c_str ()), content.size (), freshness);
-}
-
-
-} // ndn
-
-#endif
diff --git a/example/.gitignore b/example/.gitignore
deleted file mode 100644
index 8ed876c..0000000
--- a/example/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-build/
-.waf*
diff --git a/example/client.cc b/example/client.cc
deleted file mode 100644
index 279d260..0000000
--- a/example/client.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#include <ndn.cxx.h>
-#include <iostream>
-
-using namespace std;
-
-const char *FILENAME = NULL;
-ndn::Name InterestBaseName;
-
-// create a global handler
-ndn::Wrapper handler;
-
-void OnData (ndn::Name name, ndn::PcoPtr pco);
-void OnTimeout (ndn::Name name, const ndn::Closure &closure, ndn::InterestPtr origInterest);
-
-void OnData (ndn::Name name, ndn::PcoPtr pco)
-{
-  ndn::BytesPtr content = pco->contentPtr ();
-  cout << string ((char*)ndn::head (*content), content->size ());
-
-  int seqnum = ndn::Name::asSeqNum (*name.rbegin ());
-  if (seqnum >= 10)
-    {
-      return;
-    }
-
-  cerr << ">> C++ " << ndn::Name (InterestBaseName).appendSeqNum (seqnum + 1) << endl; // a shortcut to construct name
-  handler.sendInterest (ndn::Interest ()
-                        .setName (ndn::Name (InterestBaseName).appendSeqNum (seqnum + 1))
-                        .setScope (ndn::Interest::SCOPE_LOCAL_HOST),
-                        ndn::Closure (OnData, OnTimeout));
-}
-
-void OnTimeout (ndn::Name name, const ndn::Closure &closure, ndn::InterestPtr origInterest)
-{
-  // re-express interest
-  handler.sendInterest (*origInterest, closure);
-}
-
-int
-main (int argc, char **argv)
-{
-  if (argc < 2)
-    {
-      std::cerr << "You have to specify filename as an argument" << std::endl;
-      return -1;
-    }
-  
-  // this code does not check for most of the bad conditions
-  FILENAME = argv[1];
-
-  InterestBaseName = ndn::Name ("/my-local-prefix/simple-fetch/file");
-  InterestBaseName.append (FILENAME);
-
-  cerr << ">> C++ " << ndn::Name (InterestBaseName).appendSeqNum (0) << endl;
-  handler.sendInterest (ndn::Interest ()
-                        .setName (ndn::Name (InterestBaseName).appendSeqNum (0))
-                        .setScope (ndn::Interest::SCOPE_LOCAL_HOST),
-                        ndn::Closure (OnData, OnTimeout));
-
-  sleep (3);
-  return 0;
-}
diff --git a/example/server.cc b/example/server.cc
deleted file mode 100644
index 1a62f20..0000000
--- a/example/server.cc
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#include <ndn.cxx.h>
-#include <iostream>
-
-using namespace std;
-
-ndn::Name InterestBaseName;
-
-// create a global handler
-ndn::Wrapper handler;
-
-void OnInterest (ndn::InterestPtr interest)
-{
-  cerr << interest->getName () << endl;
-  
-  static int COUNTER = 0;
-
-  ostringstream os;
-  os << "C++ LINE #" << (COUNTER++) << endl;
-  
-  handler.publishData (interest->getName (), os.str (), 5);
-}
-
-int
-main (int argc, char **argv)
-{
-  InterestBaseName = ndn::Name ("ccnx:/my-local-prefix/simple-fetch/file");
-
-  handler.setInterestFilter (InterestBaseName, OnInterest);
-  
-  while (true)
-    {
-      sleep (1);
-    }
-  return 0;
-}
diff --git a/example/waf b/example/waf
deleted file mode 100755
index f26d925..0000000
--- a/example/waf
+++ /dev/null
Binary files differ
diff --git a/example/wscript b/example/wscript
deleted file mode 100644
index c617d47..0000000
--- a/example/wscript
+++ /dev/null
@@ -1,66 +0,0 @@
-# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-VERSION='0.1'
-APPNAME='test-project'
-
-from waflib import Build, Logs, Utils, Task, TaskGen, Configure
-
-def options(opt):
-    opt.load('compiler_c compiler_cxx boost ccnx')
-
-def configure(conf):
-    conf.load("compiler_c compiler_cxx ccnx")
-
-    conf.add_supported_cxxflags (cxxflags = ['-O0',
-                                             '-Wall',
-                                             '-Wno-unused-variable',
-                                             '-g3',
-                                             '-Wno-unused-private-field',
-                                             '-fcolor-diagnostics',
-                                             '-Qunused-arguments'
-                                             ])
-
-    if not conf.check_cfg(package='openssl', args=['--cflags', '--libs'], uselib_store='SSL', mandatory=False):
-        libcrypto = conf.check_cc(lib='crypto',
-                                  header_name='openssl/crypto.h',
-                                  define_name='HAVE_SSL',
-                                  uselib_store='SSL')
-    else:
-        conf.define ("HAVE_SSL", 1)
-    if not conf.get_define ("HAVE_SSL"):
-        conf.fatal ("Cannot find SSL libraries")
-
-    conf.check_ccnx (path=conf.options.ccnx_dir)
-    conf.check_cfg(package='libndn.cxx', args=['--cflags', '--libs'], uselib_store='CCNXCPP', mandatory=True)
-
-    conf.load('boost')
-    conf.check_boost(lib='system test iostreams filesystem thread')
-
-def build (bld):
-    bld (
-        features = ["cxx", "cxxprogram"],
-        target = "client",
-        source = "client.cc",
-        use = 'BOOST BOOST_THREAD CCNX CCNXCPP',
-        )
-
-    bld (
-        features = ["cxx", "cxxprogram"],
-        target = "server",
-        source = "server.cc",
-        use = 'BOOST BOOST_THREAD CCNX CCNXCPP',
-        )
-
-@Configure.conf
-def add_supported_cxxflags(self, cxxflags):
-    """
-    Check which cxxflags are supported by compiler and add them to env.CXXFLAGS variable
-    """
-    self.start_msg('Checking allowed flags for c++ compiler')
-
-    supportedFlags = []
-    for flag in cxxflags:
-        if self.check_cxx (cxxflags=[flag], mandatory=False):
-            supportedFlags += [flag]
-
-    self.end_msg (' '.join (supportedFlags))
-    self.env.CXXFLAGS += supportedFlags
diff --git a/executor/executor.cc b/executor/executor.cc
deleted file mode 100644
index 87b5760..0000000
--- a/executor/executor.cc
+++ /dev/null
@@ -1,129 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#include "executor.h"
-#include "logging.h"
-
-INIT_LOGGER("Executor")
-
-using namespace std;
-using namespace boost;
-
-Executor::Executor (int poolSize)
-  : m_needStop (true)
-  , m_poolSize (poolSize)
-{
-}
-
-Executor::~Executor()
-{
-  _LOG_DEBUG ("Enter destructor");
-  shutdown ();
-  _LOG_DEBUG ("Exit destructor");
-}
-
-void
-Executor::start ()
-{
-  if (m_needStop)
-    {
-      m_needStop = false;
-      for (int i = 0; i < m_poolSize; i++)
-        {
-          m_group.create_thread (bind(&Executor::run, this));
-        }
-    }
-}
-
-void
-Executor::shutdown ()
-{
-  if (!m_needStop)
-    {
-      m_needStop = true;
-      _LOG_DEBUG ("Iterrupting all");
-      m_group.interrupt_all ();
-      _LOG_DEBUG ("Join all");
-      m_group.join_all ();
-    }
-}
-
-
-void
-Executor::execute(const Job &job)
-{
-  _LOG_DEBUG ("Add to job queue");
-
-  Lock lock(m_mutex);
-  bool queueWasEmpty = m_queue.empty ();
-  m_queue.push_back(job);
-
-  // notify working threads if the queue was empty
-  if (queueWasEmpty)
-  {
-    m_cond.notify_one ();
-  }
-}
-
-int
-Executor::poolSize()
-{
-  return m_group.size();
-}
-
-int
-Executor::jobQueueSize()
-{
-  Lock lock(m_mutex);
-  return m_queue.size();
-}
-
-void
-Executor::run ()
-{
-  _LOG_DEBUG ("Start thread");
-
-  while(!m_needStop)
-  {
-    Job job = waitForJob();
-
-    _LOG_DEBUG (">>> enter job");
-    job (); // even if job is "null", nothing bad will happen
-    _LOG_DEBUG ("<<< exit job");
-  }
-
-  _LOG_DEBUG ("Executor thread finished");
-}
-
-Executor::Job
-Executor::waitForJob()
-{
-  Lock lock(m_mutex);
-
-  // wait until job queue is not empty
-  while (m_queue.empty())
-  {
-    _LOG_DEBUG ("Unlocking mutex for wait");
-    m_cond.wait(lock);
-    _LOG_DEBUG ("Re-locking mutex after wait");
-  }
-
-  _LOG_DEBUG ("Got signal on condition");
-
-  Job job;
-  if (!m_queue.empty ()) // this is not always guaranteed, especially after interruption from destructor
-    {
-      job = m_queue.front();
-      m_queue.pop_front();
-    }
-  return job;
-}
diff --git a/executor/executor.h b/executor/executor.h
deleted file mode 100644
index dd9eac3..0000000
--- a/executor/executor.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef EXECUTOR_H
-#define EXECUTOR_H
-
-#include <boost/function.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/thread/condition_variable.hpp>
-#include <boost/thread/mutex.hpp>
-#include <boost/thread/locks.hpp>
-#include <boost/thread/thread.hpp>
-#include <deque>
-
-/* A very simple executor to execute submitted tasks immediately or
- * in the future (depending on whether there is idle thread)
- * A fixed number of threads are created for executing tasks;
- * The policy is FIFO
- * No cancellation of submitted tasks
- */
-
-class Executor
-{
-public:
-  typedef boost::function<void ()> Job;
-
-  Executor(int poolSize);
-  ~Executor();
-
-  // execute the job immediately or sometime in the future
-  void
-  execute(const Job &job);
-
-  int
-  poolSize();
-
-// only for test
-  int
-  jobQueueSize();
-
-  void
-  start ();
-
-  void
-  shutdown ();
-
-private:
-  void
-  run();
-
-  Job
-  waitForJob();
-
-private:
-  typedef std::deque<Job> JobQueue;
-  typedef boost::mutex Mutex;
-  typedef boost::unique_lock<Mutex> Lock;
-  typedef boost::condition_variable Cond;
-  typedef boost::thread Thread;
-  typedef boost::thread_group ThreadGroup;
-  JobQueue m_queue;
-  Mutex m_mutex;
-  Cond m_cond;
-  ThreadGroup m_group;
-
-  volatile bool m_needStop;
-  int m_poolSize;
-};
-
-typedef boost::shared_ptr<Executor> ExecutorPtr;
-#endif // EXECUTOR_H
diff --git a/logging.cc b/logging.cc
deleted file mode 100644
index 04fb6c3..0000000
--- a/logging.cc
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- *         Zhenkai Zhu <zhenkai@cs.ucla.edu>
- */
-
-#include "logging.h"
-
-#ifdef HAVE_LOG4CXX
-
-#include <log4cxx/logger.h>
-#include <log4cxx/basicconfigurator.h>
-#include <log4cxx/consoleappender.h>
-#include <log4cxx/patternlayout.h>
-#include <log4cxx/level.h>
-#include <log4cxx/propertyconfigurator.h>
-#include <log4cxx/defaultconfigurator.h>
-#include <log4cxx/helpers/exception.h>
-using namespace log4cxx;
-using namespace log4cxx::helpers;
-
-#include <unistd.h>
-
-void
-INIT_LOGGERS ()
-{
-  static bool configured = false;
-
-  if (configured) return;
-
-  if (access ("log4cxx.properties", R_OK)==0)
-    PropertyConfigurator::configureAndWatch ("log4cxx.properties");
-  else
-    {
-      PatternLayoutPtr   layout   (new PatternLayout ("%d{HH:mm:ss} %p %c{1} - %m%n"));
-      ConsoleAppenderPtr appender (new ConsoleAppender (layout));
-
-      BasicConfigurator::configure( appender );
-      Logger::getRootLogger()->setLevel (log4cxx::Level::getInfo ());
-    }
-
-  configured = true;
-}
-
-#endif
diff --git a/logging.h b/logging.h
deleted file mode 100644
index 2aa3344..0000000
--- a/logging.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- *         Zhenkai Zhu <zhenkai@cs.ucla.edu>
- */
-
-#ifndef LOGGING_H
-#define LOGGING_H
-
-#include "config.h"
-
-#ifdef HAVE_LOG4CXX
-
-#include <log4cxx/logger.h>
-
-#define MEMBER_LOGGER                           \
-  static log4cxx::LoggerPtr staticModuleLogger;
-
-#define INIT_MEMBER_LOGGER(className,name)          \
-  log4cxx::LoggerPtr className::staticModuleLogger =  log4cxx::Logger::getLogger (name);
-
-#define INIT_LOGGER(name) \
-  static log4cxx::LoggerPtr staticModuleLogger = log4cxx::Logger::getLogger (name);
-
-#define _LOG_DEBUG(x) \
-  LOG4CXX_DEBUG(staticModuleLogger, x);
-
-#define _LOG_TRACE(x) \
-  LOG4CXX_TRACE(staticModuleLogger, x);
-
-#define _LOG_FUNCTION(x) \
-  LOG4CXX_TRACE(staticModuleLogger, __FUNCTION__ << "(" << x << ")");
-
-#define _LOG_FUNCTION_NOARGS \
-  LOG4CXX_TRACE(staticModuleLogger, __FUNCTION__ << "()");
-
-#define _LOG_ERROR(x) \
-  LOG4CXX_ERROR(staticModuleLogger, x);
-
-#define _LOG_ERROR_COND(cond,x) \
-  if (cond) { _LOG_ERROR(x) }
-
-#define _LOG_DEBUG_COND(cond,x) \
-  if (cond) { _LOG_DEBUG(x) }
-
-void
-INIT_LOGGERS ();
-
-#else // else HAVE_LOG4CXX
-
-#define INIT_LOGGER(name)
-#define _LOG_FUNCTION(x)
-#define _LOG_FUNCTION_NOARGS
-#define _LOG_TRACE(x)
-#define INIT_LOGGERS(x)
-#define _LOG_ERROR(x)
-#define _LOG_ERROR_COND(cond,x)
-#define _LOG_DEBUG_COND(cond,x)
-
-#define MEMBER_LOGGER
-#define INIT_MEMBER_LOGGER(className,name)
-
-#ifdef _DEBUG
-
-#include <boost/thread/thread.hpp>
-#include <boost/date_time/posix_time/posix_time.hpp>
-#include <iostream>
-
-#define _LOG_DEBUG(x) \
-  std::clog << boost::get_system_time () << " " << boost::this_thread::get_id () << " " << x << std::endl;
-
-#else
-#define _LOG_DEBUG(x)
-#endif
-
-#endif // HAVE_LOG4CXX
-
-#endif // LOGGING_H
diff --git a/ndn-cpp.h b/ndn-cpp.h
deleted file mode 100644
index 72a1db9..0000000
--- a/ndn-cpp.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013 University of California, Los Angeles
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef NDN_CXX_ALL_H
-#define NDN_CXX_ALL_H
-
-#include <ndn.cxx/common.h>
-#include <ndn.cxx/wrapper.h>
-
-#include <ndn.cxx/interest.h>
-#include <ndn.cxx/pco.h>
-
-#include <ndn.cxx/closure.h>
-
-// #include <ndn.cxx/cert.h>
-// #include <ndn.cxx/charbuf.h>
-// #include <ndn.cxx/discovery.h>
-// #include <ndn.cxx/verifier.h>
-
-#endif
diff --git a/ndn-cpp/error.h b/ndn-cpp/error.h
deleted file mode 100644
index d6379c6..0000000
--- a/ndn-cpp/error.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-/**
- * @file error.h
- * @brief This file defines basic elements for the library reporting
- *
- * The library throws a number of exceptions.
- * In general, the following example shows how to print out diagnostic information
- * when one of the exceptions is thrown
- * @code
- *     try
- *       {
- *         ... operations with ndn::Name
- *       }
- *     catch (boost::exception &e)
- *       {
- *         std::cerr << boost::diagnostic_information (e) << std::endl;
- *       }
- * @endcode
- */
-
-#ifndef NDN_ERROR_H
-#define NDN_ERROR_H
-
-#include <boost/exception/all.hpp>
-
-namespace ndn
-{
-namespace error
-{
-
-struct Error           : public virtual boost::exception, public virtual std::exception {}; ///< @brief Some error with error reporting engine
-struct Uri             : public virtual boost::exception, public virtual std::exception {}; ///< @brief An error with URI processing
-struct StringTransform : public virtual boost::exception, public virtual std::exception {};
-struct Name            : public virtual boost::exception, public virtual std::exception {}; ///< @brief An error with Name
-namespace name {
-struct Component       : public virtual boost::exception, public virtual std::exception {}; ///< @brief An error with name::Component
-}
-struct Exclude         : public virtual boost::exception, public virtual std::exception {}; ///< @brief An error with Exclude
-struct KeyLocator      : public virtual boost::exception, public virtual std::exception {}; ///< @brief An error with KeyLocator
-namespace wire {
-struct Ccnb            : public virtual boost::exception, public virtual std::exception {}; ///< @brief An error with wire::Ccnb encoding
-}
-struct Keychain        : public virtual boost::exception, public virtual std::exception {}; ///< @brief An error with security::Keychain
-
-// Diagnostic information fields
-
-/**
- * @brief Free-formatted text message explaining the error
- *
- * @code
- * ...
- * catch (boost::exception &e)
- * {
- *     if (const std::string *error = boost::get_error_info<error::msg> (e))
- *          ...
- * }
- * @endcode
- *
- * @see get_msg
- */
-typedef boost::error_info<struct tag_msg, std::string> msg;
-
-/**
- * @brief Helper method to get error message from the exception
- *
- * Method assumes that message is present, if not, an exception will be thrown
- */
-inline const std::string &
-get_msg (boost::exception &e)
-{
-  const std::string *error = boost::get_error_info<msg> (e);
-  if (error == 0)
-    BOOST_THROW_EXCEPTION (Error ());
-  return *error;
-}
-
-/**
- * @brief Report of the position of the error (error-specific meaning)
- *
- * @code
- * ...
- * catch (boost::exception &e)
- * {
- *     if (const int *error = boost::get_error_info<error::pos> (e))
- *          ...
- * }
- * @endcode
- *
- * @see get_pos
- */
-typedef boost::error_info<struct tag_pos, int> pos;
-
-/**
- * @brief Helper method to get position of the error from the exception
- *
- * Method assumes that position is present, if not, an exception will be thrown
- */
-inline int
-get_pos (boost::exception &e)
-{
-  const int *position = boost::get_error_info<pos> (e);
-  if (position == 0)
-    BOOST_THROW_EXCEPTION (Error ());
-  return *position;
-}
-
-} // error
-} // ndn
-
-#endif // NDN_ERROR_H
diff --git a/ndn-cpp/face.cc b/ndn-cpp/face.cc
deleted file mode 100644
index 455f283..0000000
--- a/ndn-cpp/face.cc
+++ /dev/null
@@ -1,118 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#include "face.h"
-
-namespace ndn {
-
-Face::sent_interest
-Face::sendInterest (Ptr<const Interest> interest, const SatisfiedInterestCallback &dataCallback)
-{
-  // magic to be done in child class
-
-  sent_interest item = m_sentInterests.find_exact (interest->getName ());
-  if (item == m_sentInterests.end ())
-    {
-      std::pair<sent_interest, bool> insertRes =
-        m_sentInterests.insert (interest->getName (), Ptr<sent_interest_container::payload_traits::payload_type>::Create ());
-
-      item = insertRes.first;
-    }
-  item->payload ()->push_back (dataCallback);
-
-  return item;
-}
-
-void
-Face::clearInterest (Face::sent_interest interest)
-{
-  m_sentInterests.erase (interest);
-}
-  
-Face::registered_prefix
-Face::setInterestFilter (Ptr<const Name> prefix, const ExpectedInterestCallback &interestCallback)
-{
-  // magic to be done in child class
-  
-  registered_prefix item = m_registeredPrefixes.find_exact (*prefix);
-  if (item == m_registeredPrefixes.end ())
-    {
-      std::pair<registered_prefix, bool> insertRes =
-        m_registeredPrefixes.insert (*prefix, Ptr<registered_prefix_container::payload_traits::payload_type>::Create ());
-
-      item = insertRes.first;
-    }
-  item->payload ()->push_back (interestCallback);
-
-  return item;
-}
-
-void
-Face::clearInterestFilter (const Name &prefix)
-{
-  registered_prefix item = m_registeredPrefixes.find_exact (prefix);
-  if (item == m_registeredPrefixes.end ())
-    return;
-
-  clearInterestFilter (item);
-}
-
-void
-Face::clearInterestFilter (Face::registered_prefix filter)
-{
-  m_registeredPrefixes.erase (filter);
-}
-
-} // ndn
-
-// void
-// CcnxWrapper::OnInterest (const Ptr<const ndn::Interest> &interest, Ptr<Packet> packet)
-// {
-//   ndn::App::OnInterest (interest, packet);
-
-//   // the app cannot set several filters for the same prefix
-//   CcnxFilterEntryContainer<InterestCallback>::iterator entry = m_interestCallbacks.longest_prefix_match (interest->GetName ());
-//   if (entry == m_interestCallbacks.end ())
-//     {
-//       _LOG_DEBUG ("No Interest callback set");
-//       return;
-//     }
-  
-//   entry->payload ()->m_callback (lexical_cast<string> (interest->GetName ()));  
-// }
-
-// void
-// CcnxWrapper::OnContentObject (const Ptr<const ndn::ContentObject> &contentObject,
-//                               Ptr<Packet> payload)
-// {
-//   ndn::App::OnContentObject (contentObject, payload);
-//   NS_LOG_DEBUG ("<< D " << contentObject->GetName ());
-
-//   CcnxFilterEntryContainer<RawDataCallback>::iterator entry = m_dataCallbacks.longest_prefix_match (contentObject->GetName ());
-//   if (entry == m_dataCallbacks.end ())
-//     {
-//       _LOG_DEBUG ("No Data callback set");
-//       return;
-//     }
-
-//   while (entry != m_dataCallbacks.end ())
-//     {
-//       ostringstream content;
-//       payload->CopyData (&content, payload->GetSize ());
-  
-//       entry->payload ()->m_callback (lexical_cast<string> (contentObject->GetName ()), content.str ().c_str (), content.str ().size ());
-  
-//       m_dataCallbacks.erase (entry);
-
-//       entry = m_dataCallbacks.longest_prefix_match (contentObject->GetName ());
-//     }
-// }
-
-// }
diff --git a/ndn-cpp/face.h b/ndn-cpp/face.h
deleted file mode 100644
index 38a618c..0000000
--- a/ndn-cpp/face.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef NDN_CXX_H
-#define NDN_CXX_H
-
-#include "ndn-cpp/common.h"
-#include "ndn-cpp/fields/name.h"
-#include "ndn-cpp/interest.h"
-#include "ndn-cpp/data.h"
-
-#include "trie/trie-with-policy.h"
-#include "trie/policies/counting-policy.h"
-
-#include <list>
-
-namespace ndn {
-
-template<class Callback>
-struct CallbackTable :
-    public trie::trie_with_policy< Name,
-                                   trie::ptr_payload_traits< std::list<Callback> >,
-                                   trie::counting_policy_traits >
-{
-};
-
-
-class Face
-{
-public:
-  typedef boost::function<void (Ptr<Data> incomingData, Ptr<const Interest> satisfiedInterest)> SatisfiedInterestCallback;
-  typedef boost::function<void (Ptr<Interest> incomingInterest, Ptr<const Name> registeredPrefix)> ExpectedInterestCallback;
-
-  // some internal definitions
-  typedef CallbackTable< SatisfiedInterestCallback > sent_interest_container;
-  typedef CallbackTable< ExpectedInterestCallback >  registered_prefix_container;
-
-  typedef sent_interest_container::iterator sent_interest;
-  typedef registered_prefix_container::iterator registered_prefix;
-  
-  sent_interest
-  sendInterest (Ptr<const Interest> interest, const SatisfiedInterestCallback &dataCallback);
-
-  void
-  clearInterest (sent_interest interest);
-  
-  registered_prefix
-  setInterestFilter (Ptr<const Name> prefix, const ExpectedInterestCallback &interestCallback);
-
-  void
-  clearInterestFilter (const Name &prefix);
-
-  void
-  clearInterestFilter (registered_prefix filter);
-  
-private:
-  sent_interest_container m_sentInterests;
-  registered_prefix_container m_registeredPrefixes;
-};
-
-} // ndn
-
-#endif // NDN_CXX_H
diff --git a/ndn-cpp/fields/blob.h b/ndn-cpp/fields/blob.h
deleted file mode 100644
index d81d039..0000000
--- a/ndn-cpp/fields/blob.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef NDN_BLOB_H
-#define NDN_BLOB_H
-
-#include <vector>
-#include <cstddef>
-#include <boost/shared_ptr.hpp>
-
-namespace ndn {
-
-/**
- * @brief Class representing a general-use binary blob
- */
-class Blob : public std::vector<char>
-{
-public:
-  /**
-   * @brief Creates an empty blob
-   */
-  Blob ()
-  {
-  }
-
-  Blob (const void *buf, size_t length)
-    : std::vector<char> (reinterpret_cast<const char*> (buf), reinterpret_cast<const char*> (buf) + length)
-  {
-  }
-  
-  /**
-   * @brief Get pointer to the first byte of the binary blob
-   */
-  inline char*
-  buf ()
-  {
-    return &front ();
-  }
-
-  /**
-   * @brief Get const pointer to the first byte of the binary blob
-   */
-  inline const char*
-  buf () const
-  {
-    return &front ();
-  }
-};
-
-} // ndn
-
-#endif // NDN_BLOB_H
diff --git a/ndn-cpp/fields/content.cc b/ndn-cpp/fields/content.cc
deleted file mode 100644
index 0216bd2..0000000
--- a/ndn-cpp/fields/content.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#include "content.h"
-#include "ndn-cpp/error.h"
-
-namespace ndn
-{
-
-const name::Component Content::noFinalBlock = name::Component ();
-const TimeInterval Content::noFreshness;
-const TimeInterval Content::maxFreshness = time::Seconds (2147);
-
-Content::Content ()
-{
-}
-
-Content::Content (const void *buffer, size_t size,
-                  const Time &timestamp,
-                  Type type/* = DATA*/,
-                  const TimeInterval &freshness/* = maxFreshness*/,
-                  const name::Component &finalBlock/* = noFinalBlock*/)
-  : m_timestamp (timestamp)
-  , m_type (type)
-  , m_freshness (freshness)
-  , m_finalBlockId (finalBlock)
-
-  , m_content (buffer, size)
-{
-}
-
-Content::Content (const void *buffer, size_t size,
-                  Type type/* = DATA*/,
-                  const TimeInterval &freshness/* = maxFreshness*/,
-                  const name::Component &finalBlock/* = noFinalBlock*/)
-  : m_timestamp (time::Now ())
-  , m_type (type)
-  , m_freshness (freshness)
-  , m_finalBlockId (finalBlock)
-
-  , m_content (buffer, size)
-{
-}
-
-
-} // ndn
diff --git a/ndn-cpp/fields/content.h b/ndn-cpp/fields/content.h
deleted file mode 100644
index 752f24c..0000000
--- a/ndn-cpp/fields/content.h
+++ /dev/null
@@ -1,306 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef NDN_CONTENT_H
-#define NDN_CONTENT_H
-
-#include "ndn-cpp/common.h"
-#include "ndn-cpp/fields/blob.h"
-#include "ndn-cpp/fields/name-component.h"
-
-namespace ndn {
-
-/**
- * @brief Class providing an interface to work with content NDN data packets
- *
- * Content of data packets consists of two parts: information about content
- * (timestamp, freshness, type, etc.) and raw content itself
- *
- * @code
- * Content ::= ContentInfo
- *             ContentData
- *
- * ContentInfo ::= Timestamp
- *                 Type?
- *                 Freshness?
- *                 FinalBlockID?
- * @endcode
- */
-class Content
-{
-public:
-  /**
-   * @brief Enum of content types
-   */
-  enum Type
-    {
-      DATA = 0, ///< @brief No semantics is defined for the content
-      ENCR,     ///< @brief Indicate that the content is encrypted
-      GONE,     ///< @brief ?
-      KEY,      ///< @brief Content is a key object
-      LINK,     ///< @brief Content contains a LINK object
-      NACK      ///< @brief Negative acknowledgment by the content producer, indicating that there is no data with the requested name
-    };
-
-  /**
-   * @brief Create an empty content
-   */
-  Content ();
-
-  /**
-   * @brief Create a content from a memory buffer
-   * @param buffer pointer to first byte of the memory buffer
-   * @param size size of the memory buffer
-   * @param timestamp content generation timestamp
-   * @param type type of content (default is Content::DATA)
-   * @param freshness amount of time the content is considered "fresh" (default is 2147 seconds, maximum possible value for CCNx)
-   * @param finalBlock name of the final DATA
-   *
-   * Use the other version of the constructor, if timestamp needs to be automatically generated
-   */
-  Content (const void *buffer, size_t size,
-           const Time &timestamp,
-           Type type = DATA,
-           const TimeInterval &freshness = maxFreshness,
-           const name::Component &finalBlock = noFinalBlock);
-
-  /**
-   * @brief Create a content from a memory buffer
-   * @param buffer pointer to first byte of the memory buffer
-   * @param size size of the memory buffer
-   * @param type type of content (default is Content::DATA)
-   * @param freshness amount of time the content is considered "fresh" (default is 2147 seconds, maximum possible value for CCNx)
-   * @param finalBlock name of the final DATA
-   *
-   * This method automatically sets timestamp of the created content to the current time (UTC clock)
-   */
-  Content (const void *buffer, size_t size,
-           Type type = DATA,
-           const TimeInterval &freshness = maxFreshness,
-           const name::Component &finalBlock = noFinalBlock);
-
-  /**
-   * @brief Get content timestamp (const reference)
-   */
-  inline const Time &
-  getTimestamp () const;
-
-  /**
-   * @brief Get content timestamp (reference)
-   */
-  inline Time &
-  getTimestamp ();
-
-  /**
-   * @brief Set content timestamp
-   * @param timestamp content timestamp (default is empty ptime object)
-   *
-   * If parameter is omitted, then the current time (UTC clock) is used
-   */
-  inline void
-  setTimeStamp (const Time &timestamp = Time ());
-
-  /**
-   * @brief Get type of content
-   */
-  inline Type
-  getType () const;
-
-  /**
-   * @brief Set type of content
-   * @param type content type @see Content::Type
-   */
-  inline void
-  setType (Type type);
-
-  /**
-   * @brief Get content freshness (const reference)
-   */
-  inline const TimeInterval &
-  getFreshness () const;
-
-  /**
-   * @brief Get content freshness (reference)
-   */
-  inline TimeInterval &
-  getFreshness ();
-
-  /**
-   * @brief Set content freshness
-   * @param freshness content freshness (default value is Content::maxFreshness = 2147 seconds)
-   */
-  inline void
-  setFreshness (const TimeInterval &freshness = maxFreshness);
-
-  /**
-   * @brief Get final block ID of the content (const reference)
-   */
-  inline const name::Component &
-  getFinalBlockId () const;
-
-  /**
-   * @brief Get final block ID of the content (reference)
-   */
-  inline name::Component &
-  getFinalBlockId ();
-
-  /**
-   * @brief Set final block ID of the content
-   * @param finalBlock component name of the final block
-   */
-  inline void
-  setFinalBlockId (const name::Component &finalBlock);
-
-  /**
-   * @brief Get const reference to content bits
-   */
-  inline const Blob &
-  getContent () const;
-
-  /**
-   * @brief Get reference to content bits
-   */
-  inline Blob &
-  getContent ();
-
-  /**
-   * @brief Set content bits from blob
-   * @param content blob that holds content bits
-   *
-   * In certain cases, getContent ().swap (content); is more appropriate,
-   * since it would avoid object copying
-   */
-  inline void
-  setContent (const Blob &content);
-
-  /**
-   * @brief Set content bits from memory buffer
-   * @param buf pointer to first byte of memory buffer
-   * @param length size of memory buffer
-   */
-  inline void
-  setContent (const void *buf, size_t length);
-
-public:
-  static const name::Component noFinalBlock; ///< @brief Not a final block == name::Component ()
-  static const TimeInterval noFreshness; ///< @brief Minimum freshness == seconds (0)
-  static const TimeInterval maxFreshness; ///< @brief Maximum freshnes == seconds (2147)
-
-private:
-  // ContentInfo
-  Time m_timestamp;
-  Type m_type;
-  TimeInterval m_freshness;
-  name::Component m_finalBlockId;
-
-  // ContentData
-  Blob m_content;
-};
-
-inline const Time &
-Content::getTimestamp () const
-{
-  return m_timestamp;
-}
-
-inline Time &
-Content::getTimestamp ()
-{
-  return m_timestamp;
-}
-
-inline void
-Content::setTimeStamp (const Time &timestamp/* = Time ()*/)
-{
-  if (timestamp != Time ())
-    {
-      m_timestamp = timestamp;
-    }
-  else
-    {
-      m_timestamp = time::Now ();
-    }
-}
-
-inline Content::Type
-Content::getType () const
-{
-  return m_type;
-}
-
-inline void
-Content::setType (Content::Type type)
-{
-  m_type = type;
-}
-
-inline const TimeInterval &
-Content::getFreshness () const
-{
-  return m_freshness;
-}
-
-inline TimeInterval &
-Content::getFreshness ()
-{
-  return m_freshness;
-}
-
-inline void
-Content::setFreshness (const TimeInterval &freshness/* = Content::maxFreshness*/)
-{
-  m_freshness = freshness;
-}
-
-inline const name::Component &
-Content::getFinalBlockId () const
-{
-  return m_finalBlockId;
-}
-
-inline name::Component &
-Content::getFinalBlockId ()
-{
-  return m_finalBlockId;
-}
-
-inline void
-Content::setFinalBlockId (const name::Component &finalBlock)
-{
-  m_finalBlockId = finalBlock;
-}
-
-inline const Blob &
-Content::getContent () const
-{
-  return m_content;
-}
-
-inline Blob &
-Content::getContent ()
-{
-  return m_content;
-}
-
-inline void
-Content::setContent (const Blob &content)
-{
-  m_content = content;
-}
-
-inline void
-Content::setContent (const void *buf, size_t length)
-{
-  Blob (buf, length).swap (m_content);
-}
-
-} // ndn
-
-#endif // NDN_SIGNATURE_H
diff --git a/ndn-cpp/fields/exclude.cc b/ndn-cpp/fields/exclude.cc
deleted file mode 100644
index b637c01..0000000
--- a/ndn-cpp/fields/exclude.cc
+++ /dev/null
@@ -1,168 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#include "exclude.h"
-
-#include "ndn-cpp/error.h"
-
-namespace ndn
-{
-
-Exclude::Exclude ()
-{
-}
-
-// example: ANY /b /d ANY /f
-//
-// ordered in map as:
-//
-// /f (false); /d (true); /b (false); / (true)
-//
-// lower_bound (/)  -> / (true) <-- excluded (equal)
-// lower_bound (/a) -> / (true) <-- excluded (any)
-// lower_bound (/b) -> /b (false) <--- excluded (equal)
-// lower_bound (/c) -> /b (false) <--- not excluded (not equal and no ANY)
-// lower_bound (/d) -> /d (true) <- excluded
-// lower_bound (/e) -> /d (true) <- excluded
-bool
-Exclude::isExcluded (const name::Component &comp) const
-{
-  const_iterator lowerBound = m_exclude.lower_bound (comp);
-  if (lowerBound == end ())
-    return false;
-
-  if (lowerBound->second)
-    return true;
-  else
-    return lowerBound->first == comp;
-
-  return false;
-}
-
-Exclude &
-Exclude::excludeOne (const name::Component &comp)
-{
-  if (!isExcluded (comp))
-    {
-      m_exclude.insert (std::make_pair (comp, false));
-    }
-  return *this;
-}
-
-
-// example: ANY /b0 /d0 ANY /f0
-//
-// ordered in map as:
-//
-// /f0 (false); /d0 (true); /b0 (false); / (true)
-//
-// lower_bound (/)  -> / (true) <-- excluded (equal)
-// lower_bound (/a0) -> / (true) <-- excluded (any)
-// lower_bound (/b0) -> /b0 (false) <--- excluded (equal)
-// lower_bound (/c0) -> /b0 (false) <--- not excluded (not equal and no ANY)
-// lower_bound (/d0) -> /d0 (true) <- excluded
-// lower_bound (/e0) -> /d0 (true) <- excluded
-
-
-// examples with desired outcomes
-// excludeRange (/, /f0) ->  ANY /f0
-//                          /f0 (false); / (true)
-// excludeRange (/, /f1) ->  ANY /f1
-//                          /f1 (false); / (true)
-// excludeRange (/a0, /e0) ->  ANY /f0
-//                          /f0 (false); / (true)
-// excludeRange (/a0, /e0) ->  ANY /f0
-//                          /f0 (false); / (true)
-
-// excludeRange (/b1, /c0) ->  ANY /b0 /b1 ANY /c0 /d0 ANY /f0
-//                          /f0 (false); /d0 (true); /c0 (false); /b1 (true); /b0 (false); / (true)
-
-Exclude &
-Exclude::excludeRange (const name::Component &from, const name::Component &to)
-{
-  if (from >= to)
-    {
-      BOOST_THROW_EXCEPTION (error::Exclude ()
-                             << error::msg ("Invalid exclude range (for single name exclude use Exclude::excludeOne)")
-                             << error::msg (from.toUri ())
-                             << error::msg (to.toUri ()));
-    }
-
-  iterator newFrom = m_exclude.lower_bound (from);
-  if (newFrom == end () || !newFrom->second /*without ANY*/)
-    {
-      std::pair<iterator, bool> fromResult = m_exclude.insert (std::make_pair (from, true));
-      newFrom = fromResult.first;
-      if (!fromResult.second)
-        {
-          // this means that the lower bound is equal to the item itself. So, just update ANY flag
-          newFrom->second = true;
-        }
-    }
-  // else
-  // nothing special if start of the range already exists with ANY flag set
-
-  iterator newTo = m_exclude.lower_bound (to); // !newTo cannot be end ()
-  if (newTo == newFrom || !newTo->second)
-    {
-      std::pair<iterator, bool> toResult = m_exclude.insert (std::make_pair (to, false));
-      newTo = toResult.first;
-      ++ newTo;
-    }
-  else
-    {
-      // nothing to do really
-    }
-
-  m_exclude.erase (newTo, newFrom); // remove any intermediate node, since all of the are excluded
-
-  return *this;
-}
-
-Exclude &
-Exclude::excludeAfter (const name::Component &from)
-{
-  iterator newFrom = m_exclude.lower_bound (from);
-  if (newFrom == end () || !newFrom->second /*without ANY*/)
-    {
-      std::pair<iterator, bool> fromResult = m_exclude.insert (std::make_pair (from, true));
-      newFrom = fromResult.first;
-      if (!fromResult.second)
-        {
-          // this means that the lower bound is equal to the item itself. So, just update ANY flag
-          newFrom->second = true;
-        }
-    }
-  // else
-  // nothing special if start of the range already exists with ANY flag set
-
-  if (newFrom != m_exclude.begin ())
-    {
-      m_exclude.erase (m_exclude.begin (), newFrom); // remove any intermediate node, since all of the are excluded
-    }
-
-  return *this;
-}
-
-
-std::ostream&
-operator << (std::ostream &os, const Exclude &exclude)
-{
-  for (Exclude::const_reverse_iterator i = exclude.rbegin (); i != exclude.rend (); i++)
-    {
-      os << i->first.toUri () << " ";
-      if (i->second)
-        os << "----> ";
-    }
-  return os;
-}
-
-
-} // ndn
diff --git a/ndn-cpp/fields/exclude.h b/ndn-cpp/fields/exclude.h
deleted file mode 100644
index 265a809..0000000
--- a/ndn-cpp/fields/exclude.h
+++ /dev/null
@@ -1,169 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef NDN_EXCLUDE_H
-#define NDN_EXCLUDE_H
-
-#include "ndn-cpp/fields/name-component.h"
-
-#include <map>
-
-namespace ndn {
-
-/**
- * @brief Class to represent Exclude component in NDN interests
- */
-class Exclude
-{
-public:
-  typedef std::map< name::Component, bool /*any*/, std::greater<name::Component> > exclude_type;
-
-  typedef exclude_type::iterator iterator;
-  typedef exclude_type::const_iterator const_iterator;
-  typedef exclude_type::reverse_iterator reverse_iterator;
-  typedef exclude_type::const_reverse_iterator const_reverse_iterator;
-
-  /**
-   * @brief Default constructor an empty exclude
-   */
-  Exclude ();
-
-  /**
-   * @brief Check if name component is excluded
-   * @param comp Name component to check against exclude filter
-   */
-  bool
-  isExcluded (const name::Component &comp) const;
-
-  /**
-   * @brief Exclude specific name component
-   * @param comp component to exclude
-   * @returns *this to allow chaining
-   */
-  Exclude &
-  excludeOne (const name::Component &comp);
-
-  /**
-   * @brief Exclude components from range [from, to]
-   * @param from first element of the range
-   * @param to last element of the range
-   * @returns *this to allow chaining
-   */
-  Exclude &
-  excludeRange (const name::Component &from, const name::Component &to);
-
-  /**
-   * @brief Exclude all components from range [/, to]
-   * @param to last element of the range
-   * @returns *this to allow chaining
-   */
-  inline Exclude &
-  excludeBefore (const name::Component &to);
-
-  /**
-   * @brief Exclude all components from range [from, +Inf]
-   * @param to last element of the range
-   * @returns *this to allow chaining
-   */
-  Exclude &
-  excludeAfter (const name::Component &from);
-
-  /**
-   * @brief Method to directly append exclude element
-   * @param name excluded name component
-   * @param any  flag indicating if there is a postfix ANY component after the name
-   *
-   * This method is used during conversion from wire format of exclude filter
-   *
-   * If there is an error with ranges (e.g., order of components is wrong) an exception is thrown
-   */
-  void
-  appendExclude (const name::Component &name, bool any);
-
-  /**
-   * @brief Get number of exclude terms
-   */
-  inline size_t
-  size () const;
-
-  /**
-   * @brief Get begin iterator of the exclude terms
-   */
-  inline const_iterator
-  begin () const;
-
-  /**
-   * @brief Get end iterator of the exclude terms
-   */
-  inline const_iterator
-  end () const;
-
-  /**
-   * @brief Get begin iterator of the exclude terms
-   */
-  inline const_reverse_iterator
-  rbegin () const;
-
-  /**
-   * @brief Get end iterator of the exclude terms
-   */
-  inline const_reverse_iterator
-  rend () const;
-
-private:
-  Exclude &
-  excludeRange (iterator fromLowerBound, iterator toLowerBound);
-
-private:
-  exclude_type m_exclude;
-};
-
-std::ostream&
-operator << (std::ostream &os, const Exclude &name);
-
-inline Exclude &
-Exclude::excludeBefore (const name::Component &to)
-{
-  return excludeRange (name::Component (), to);
-}
-
-inline size_t
-Exclude::size () const
-{
-  return m_exclude.size ();
-}
-
-inline Exclude::const_iterator
-Exclude::begin () const
-{
-  return m_exclude.begin ();
-}
-
-inline Exclude::const_iterator
-Exclude::end () const
-{
-  return m_exclude.end ();
-}
-
-inline Exclude::const_reverse_iterator
-Exclude::rbegin () const
-{
-  return m_exclude.rbegin ();
-}
-
-inline Exclude::const_reverse_iterator
-Exclude::rend () const
-{
-  return m_exclude.rend ();
-}
-
-} // ndn
-
-#endif // NDN_EXCLUDE_H
diff --git a/ndn-cpp/fields/key-locator.cc b/ndn-cpp/fields/key-locator.cc
deleted file mode 100644
index 84fd60c..0000000
--- a/ndn-cpp/fields/key-locator.cc
+++ /dev/null
@@ -1,200 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#include "key-locator.h"
-#include "ndn-cpp/error.h"
-
-namespace ndn {
-
-KeyLocator::KeyLocator ()
-  : m_type (NOTSET)
-  , m_data (0)
-{
-}
-
-KeyLocator::KeyLocator (const KeyLocator &keyLocator)
-  : m_type (keyLocator.getType ())
-  , m_data (0)
-{
-  switch (m_type)
-    {
-    case NOTSET:
-      break;
-    case KEY:
-      m_data = new Blob (keyLocator.getKey ());
-      break;
-    case CERTIFICATE:
-      m_data = new Blob (keyLocator.getCertificate ());
-      break;
-    case KEYNAME:
-      m_data = new Name (keyLocator.getKeyName ());
-      break;
-    }
-}
-
-KeyLocator::~KeyLocator ()
-{
-  deleteData ();
-}
-
-KeyLocator &
-KeyLocator::operator = (const KeyLocator &keyLocator)
-{
-  if (this == &keyLocator)
-    return *this;
-
-  deleteData ();
-  m_type = keyLocator.getType ();
-  
-  switch (m_type)
-    {
-    case NOTSET:
-      break;
-    case KEY:
-      m_data = new Blob (keyLocator.getKey ());
-      break;
-    case CERTIFICATE:
-      m_data = new Blob (keyLocator.getCertificate ());
-      break;
-    case KEYNAME:
-      m_data = new Name (keyLocator.getKeyName ());
-      break;
-    }
-
-  return *this;
-}
-
-void
-KeyLocator::deleteData ()
-{
-  switch (m_type)
-    {
-    case NOTSET: // nothing to clean up
-      break;
-    case KEY:
-      delete reinterpret_cast<Blob*> (m_data);
-      break;
-    case CERTIFICATE:
-      delete reinterpret_cast<Blob*> (m_data);
-      break;
-    case KEYNAME:
-      delete reinterpret_cast<Name*> (m_data);
-      break;
-    }
-}
-
-void
-KeyLocator::setType (KeyLocator::Type type)
-{
-  if (m_type == type)
-    return;
-
-  deleteData ();
-  m_type = type;
-  
-  switch (m_type)
-    {
-    case NOTSET:
-      m_data = 0;
-    case KEY:
-      m_data = new Blob;
-      break;
-    case CERTIFICATE:
-      m_data = new Blob;
-      break;
-    case KEYNAME:
-      m_data = new Name;
-      break;
-    }
-}
-
-const Blob &
-KeyLocator::getKey () const
-{
-  if (m_type != KEY)
-    BOOST_THROW_EXCEPTION (error::KeyLocator ()
-                           << error::msg ("getKey called, but KeyLocator is not of type KeyLocator::KEY"));
-  return *reinterpret_cast<const Blob*> (m_data);
-}
-
-Blob &
-KeyLocator::getKey ()
-{
-  if (m_type != KEY)
-    BOOST_THROW_EXCEPTION (error::KeyLocator ()
-                           << error::msg ("getKey called, but KeyLocator is not of type KeyLocator::KEY"));
-  return *reinterpret_cast<Blob*> (m_data);
-}
-
-void
-KeyLocator::setKey (const Blob &key)
-{
-  if (m_type != KEY)
-    BOOST_THROW_EXCEPTION (error::KeyLocator ()
-                           << error::msg ("setKey called, but KeyLocator is not of type KeyLocator::KEY"));
-  *reinterpret_cast<Blob*> (m_data) = key;
-}
-
-const Blob &
-KeyLocator::getCertificate () const
-{
-  if (m_type != CERTIFICATE)
-    BOOST_THROW_EXCEPTION (error::KeyLocator ()
-                           << error::msg ("getCertificate called, but KeyLocator is not of type KeyLocator::CERTIFICATE"));
-  return *reinterpret_cast<const Blob*> (m_data);
-}
-
-Blob &
-KeyLocator::getCertificate ()
-{
-  if (m_type != CERTIFICATE)
-    BOOST_THROW_EXCEPTION (error::KeyLocator ()
-                           << error::msg ("getCertificate called, but KeyLocator is not of type KeyLocator::CERTIFICATE"));
-  return *reinterpret_cast<Blob*> (m_data);
-}
-
-void
-KeyLocator::setCertificate (const Blob &certificate)
-{
-  if (m_type != CERTIFICATE)
-    BOOST_THROW_EXCEPTION (error::KeyLocator ()
-                           << error::msg ("setCertificate called, but KeyLocator is not of type KeyLocator::CERTIFICATE"));
-  *reinterpret_cast<Blob*> (m_data) = certificate;
-}
-
-const Name &
-KeyLocator::getKeyName () const
-{
-  if (m_type != KEYNAME)
-    BOOST_THROW_EXCEPTION (error::KeyLocator ()
-                           << error::msg ("getKeyName called, but KeyLocator is not of type KeyLocator::KEYNAME"));
-  return *reinterpret_cast<const Name*> (m_data);
-}
-
-Name &
-KeyLocator::getKeyName ()
-{
-  if (m_type != KEYNAME)
-    BOOST_THROW_EXCEPTION (error::KeyLocator ()
-                           << error::msg ("getKeyName called, but KeyLocator is not of type KeyLocator::KEYNAME"));
-  return *reinterpret_cast<Name*> (m_data);
-}
-
-
-void
-KeyLocator::setKeyName (const Name &name)
-{
-  if (m_type != KEYNAME)
-    BOOST_THROW_EXCEPTION (error::KeyLocator ()
-                           << error::msg ("setKeyName called, but KeyLocator is not of type KeyLocator::KEYNAME"));
-  *reinterpret_cast<Name*> (m_data) = name;
-}
-
-}
diff --git a/ndn-cpp/fields/key-locator.h b/ndn-cpp/fields/key-locator.h
deleted file mode 100644
index cf1c6ea..0000000
--- a/ndn-cpp/fields/key-locator.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef NDN_KEY_LOCATOR_H
-#define NDN_KEY_LOCATOR_H
-
-#include "ndn-cpp/fields/blob.h"
-#include "ndn-cpp/fields/name.h"
-
-namespace ndn {
-
-/**
- * @brief Class providing an interface to work with key locators in NDN data packets
- */
-class KeyLocator
-{
-public:
-  /**
-   * @brief Key locator type
-   *
-   * Key locator can be only of the defined types, i.e., it cannot contain key bits and key name
-   */
-  enum Type
-    {
-      NOTSET=-1,   ///< @brief Unset key locator type, any attempt to use KeyLocator of NOTSET type will cause an exception
-      KEY,         ///< @brief Key locator contains key bits
-      CERTIFICATE, ///< @brief Key locator contains certificate bits
-      KEYNAME      ///< @brief key locator contains name of the key
-    };
-
-  /**
-   * @brief Default constructor
-   */
-  KeyLocator ();
-
-  /**
-   * @brief Copy constructor
-   */
-  KeyLocator (const KeyLocator &keyLocator);
-  
-  /**
-   * @brief Destructor
-   */
-  ~KeyLocator ();
-
-  /**
-   * @brief Copy operator
-   */
-  KeyLocator &
-  operator = (const KeyLocator &keyLocator);
-  
-  /**
-   * @brief Set type of the key locator
-   * @param type key locator type, @see Type
-   *
-   * If type of the key locator changes, setType will delete any previously allocated
-   * data, allocate appropriate type and store it in m_data
-   */
-  void
-  setType (Type type);
-
-  /**
-   * @brief Get type of the key locator
-   */
-  inline Type
-  getType () const;
-
-  /**
-   * @brief Get const reference to key bits, associated with key locator
-   *
-   * If key locator type is not KEY, then an exception will be thrown
-   */
-  const Blob &
-  getKey () const;
-
-  /**
-   * @brief Get reference to key bits, associated with key locator
-   *
-   * If key locator type is not KEY, then an exception will be thrown
-   */
-  Blob &
-  getKey ();
-
-  /**
-   * @brief Set key bits, associated with key locator
-   * @param key const reference to key bits
-   *
-   * If key locator type is not KEY, then an exception will be thrown
-   */
-  void
-  setKey (const Blob &key);
-
-  /**
-   * @brief Get const reference to certificated bits, associated with key locator
-   *
-   * If key locator type is not CERTIFICATE, then an exception will be thrown
-   */
-  const Blob &
-  getCertificate () const;
-
-  /**
-   * @brief Get reference to certificated bits, associated with key locator
-   *
-   * If key locator type is not CERTIFICATE, then an exception will be thrown
-   */
-  Blob &
-  getCertificate ();
-
-  /**
-   * @brief Set certificated bits, associated with key locator
-   * @param certificate const reference to certificate bits
-   *
-   * If key locator type is not CERTIFICATE, then an exception will be thrown
-   */
-  void
-  setCertificate (const Blob &certificate);
-
-  /**
-   * @brief Get const reference to key name, associated with key locator
-   *
-   * If key locator type is not KEYNAME, then an exception will be thrown
-   */
-  const Name &
-  getKeyName () const;
-
-  /**
-   * @brief Get reference to key name, associated with key locator
-   *
-   * If key locator type is not KEYNAME, then an exception will be thrown
-   */
-  Name &
-  getKeyName ();
-
-  /**
-   * @brief Set key name, associated with key locator
-   * @param name const reference to key name
-   *
-   * If key locator type is not KEYNAME, then an exception will be thrown
-   */
-  void
-  setKeyName (const Name &name);
-
-private:
-  void
-  deleteData ();
-  
-private:
-  Type m_type;
-  void *m_data;
-};
-
-inline KeyLocator::Type
-KeyLocator::getType () const
-{
-  return m_type;
-}
-
-
-} // ndn
-
-#endif // NDN_KEY_LOCATOR_H
diff --git a/ndn-cpp/fields/signature-sha256-with-rsa.cc b/ndn-cpp/fields/signature-sha256-with-rsa.cc
deleted file mode 100644
index c9c89ed..0000000
--- a/ndn-cpp/fields/signature-sha256-with-rsa.cc
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#include "signature-sha256-with-rsa.h"
-#include "../encoding/base.h"
-
-namespace ndn {
-namespace signature {
-
-const std::string Sha256WithRsa::s_oid = "2.16.840.1.101.3.4.2.1";
-
-Sha256WithRsa::~Sha256WithRsa ()
-{
-}
-
-void
-Sha256WithRsa::doubleDispatch (std::ostream &os, wire::Base &wire, void *userData) const
-{
-  wire.appendSignature (os, *this, userData);
-}
-
-} // signature
-} // ndn
diff --git a/ndn-cpp/fields/signature-sha256-with-rsa.h b/ndn-cpp/fields/signature-sha256-with-rsa.h
deleted file mode 100644
index be6766b..0000000
--- a/ndn-cpp/fields/signature-sha256-with-rsa.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef NDN_SIGNATURE_SHA256_WITH_RSA_H
-#define NDN_SIGNATURE_SHA256_WITH_RSA_H
-
-#include "signature.h"
-
-#include "ndn-cpp/fields/blob.h"
-#include "ndn-cpp/fields/key-locator.h"
-
-#include <string>
-
-namespace ndn {
-
-namespace signature {
-
-/**
- * @brief Class providing operations to work with SHA256withRSA (OID: "2.16.840.1.101.3.4.2.1")
- */
-class Sha256WithRsa : public virtual Signature
-{
-public:
-  /**
-   * @brief Virtual destructor
-   */
-  virtual
-  ~Sha256WithRsa ();
-
-  /**
-   * @brief Get OID of the signature algorithm
-   */
-  inline const std::string &
-  getDigestAlgorithm () const;
-
-  /**
-   * @brief Get reference to signature bits
-   */
-  inline Blob &
-  getSignatureBits ();
-
-  /**
-   * @brief Get const reference to signature bits
-   */
-  inline const Blob &
-  getSignatureBits () const;
-
-  /**
-   * @brief Set signature bits
-   */
-  inline void
-  setSignatureBits (const Blob &signatureBits);
-
-  /**
-   * @brief Get reference to publisher key digest bits
-   */
-  inline Blob &
-  getPublisherKeyDigest ();
-
-  /**
-   * @brief Get const reference to publisher key digest bits
-   */
-  inline const Blob &
-  getPublisherKeyDigest () const;
-
-  /**
-   * @brief Set publisher key digest bits
-   */
-  inline void
-  setPublisherKeyDigest (const Blob &publisherKeyDigest);
-
-  /**
-   * @brief Get reference to key locator object
-   */
-  inline KeyLocator &
-  getKeyLocator ();
-
-  /**
-   * @brief Get const reference to key locator object
-   */
-  inline const KeyLocator &
-  getKeyLocator () const;
-
-  /**
-   * @brief Set key locator object
-   */
-  inline void
-  setKeyLocator (const KeyLocator &keyLocator);
-
-  // from Signature
-  virtual void
-  doubleDispatch (std::ostream &os, wire::Base &wire, void *userData) const;
-
-private:
-  static const std::string s_oid;
-
-  Blob m_signatureBits;
-  Blob m_publisherKeyDigest;
-  KeyLocator m_keyLocator;
-};
-
-const std::string &
-Sha256WithRsa::getDigestAlgorithm () const
-{
-  return s_oid;
-}
-
-inline Blob &
-Sha256WithRsa::getSignatureBits ()
-{
-  return m_signatureBits;
-}
-
-inline const Blob &
-Sha256WithRsa::getSignatureBits () const
-{
-  return m_signatureBits;
-}
-
-inline void
-Sha256WithRsa::setSignatureBits (const Blob &signatureBits)
-{
-  m_signatureBits = signatureBits;
-}
-
-inline Blob &
-Sha256WithRsa::getPublisherKeyDigest ()
-{
-  return m_publisherKeyDigest;
-}
-
-inline const Blob &
-Sha256WithRsa::getPublisherKeyDigest () const
-{
-  return m_publisherKeyDigest;
-}
-
-inline void
-Sha256WithRsa::setPublisherKeyDigest (const Blob &publisherKeyDigest)
-{
-  m_publisherKeyDigest = publisherKeyDigest;
-}
-
-inline KeyLocator &
-Sha256WithRsa::getKeyLocator ()
-{
-  return m_keyLocator;
-}
-
-inline const KeyLocator &
-Sha256WithRsa::getKeyLocator () const
-{
-  return m_keyLocator;
-}
-
-inline void
-Sha256WithRsa::setKeyLocator (const KeyLocator &keyLocator)
-{
-  m_keyLocator = keyLocator;
-}
-
-} // signature
-} // ndn
-
-#endif // NDN_EXCLUDE_H
diff --git a/ndn-cpp/fields/signature.cc b/ndn-cpp/fields/signature.cc
deleted file mode 100644
index 4c7a3a5..0000000
--- a/ndn-cpp/fields/signature.cc
+++ /dev/null
@@ -1,18 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#include "signature.h"
-#include "ndn-cpp/error.h"
-
-namespace ndn
-{
-
-
-} // ndn
diff --git a/ndn-cpp/fields/signature.h b/ndn-cpp/fields/signature.h
deleted file mode 100644
index 65afc04..0000000
--- a/ndn-cpp/fields/signature.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef NDN_SIGNATURE_H
-#define NDN_SIGNATURE_H
-
-#include <iostream>
-#include <boost/shared_ptr.hpp>
-
-namespace ndn {
-
-namespace wire { class Base; }
-
-/**
- * @brief Pure virtual class providing an interface to work with signatures for NDN data packets
- */
-class Signature
-{
-public:
-  /**
-   * @brief Virtual destructor
-   */
-  virtual
-  ~Signature () { }
-
-  /**
-   * @brief A double dispatch pattern to call the right wireFormatter method to format signature
-   * @param os reference to output stream
-   * @param wireFormatter a reference to a wireFormatter object
-   * @param userData any user-specific data
-   */
-  virtual void
-  doubleDispatch (std::ostream &os, wire::Base &wireFormatter, void *userData) const = 0;
-};
-
-} // ndn
-
-#endif // NDN_SIGNATURE_H
diff --git a/ndn-cpp/fields/signed-blob.h b/ndn-cpp/fields/signed-blob.h
deleted file mode 100644
index b8cb39f..0000000
--- a/ndn-cpp/fields/signed-blob.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef NDN_SIGNED_BLOB_H
-#define NDN_SIGNED_BLOB_H
-
-#include "blob.h"
-
-namespace ndn {
-
-/**
- * @brief Class representing a blob, which has a signed portion (e.g., bytes of DATA packet)
- */
-class SignedBlob : public Blob
-{
-public:
-  /**
-   * @brief Set signed portion of the blob
-   * @param offset An offset from the beginning of the blob
-   * @param size Size of the signed portion of the blob
-   */
-  inline void
-  setSignedPortion (size_t offset, size_t size);
-  
-  /**
-   * @brief Get begin iterator to a signed portion of the blob
-   */
-  inline const_iterator
-  signed_begin () const;
-
-  /**
-   * @brief Get end iterator of a signed portion of the blob
-   */
-  inline const_iterator
-  signed_end () const;
-
-  /**
-   * @brief Get pointer to a first byte of the signed blob
-   */
-  inline const char*
-  signed_buf () const;
-
-  /**
-   * @brief Get size of the signed blob
-   */
-  inline size_t
-  signed_size () const;
-
-private:
-  const_iterator m_signedBegin;
-  const_iterator m_signedEnd;
-};
-
-
-inline void
-SignedBlob::setSignedPortion (size_t offset, size_t size)
-{
-  m_signedBegin = begin () + offset;
-  m_signedEnd = begin () + offset + size;
-}
-  
-inline SignedBlob::const_iterator
-SignedBlob::signed_begin () const
-{
-  return m_signedBegin;
-}
-
-inline SignedBlob::const_iterator
-SignedBlob::signed_end () const
-{
-  return m_signedEnd;
-}
-
-inline const char*
-SignedBlob::signed_buf () const
-{
-  return &*m_signedBegin;
-}
-
-inline size_t
-SignedBlob::signed_size () const
-{
-  return m_signedEnd - m_signedBegin;
-}
-
-} // ndn
-
-#endif // NDN_SIGNED_BLOB_H
diff --git a/ndn-cpp/helpers/hash.cc b/ndn-cpp/helpers/hash.cc
deleted file mode 100644
index aa98784..0000000
--- a/ndn-cpp/helpers/hash.cc
+++ /dev/null
@@ -1,130 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- *         Zhenkai Zhu <zhenkai@cs.ucla.edu>
- */
-
-#include "hash.h"
-#include "ndn-cpp/helpers/uri.h"
-
-#include <boost/lexical_cast.hpp>
-#include <openssl/evp.h>
-#include <fstream>
-
-using namespace boost;
-using namespace std;
-
-// 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
-
-namespace ndn
-{
-
-std::ostream &
-operator << (std::ostream &os, const Hash &hash)
-{
-  if (hash.m_length == 0)
-    return os;
-
-  ostreambuf_iterator<char> out_it (os); // ostream iterator
-  // need to encode to base64
-  copy (detail::string_from_binary (reinterpret_cast<const char*> (hash.m_buf)),
-        detail::string_from_binary (reinterpret_cast<const char*> (hash.m_buf+hash.m_length)),
-        out_it);
-
-  return os;
-}
-
-std::string
-Hash::shortHash () const
-{
-  return lexical_cast<string> (*this).substr (0, 10);
-}
-
-
-unsigned char Hash::_origin = 0;
-ptr_lib::shared_ptr<Hash> Hash::Origin(new Hash(&Hash::_origin, sizeof(unsigned char)));
-
-ptr_lib::shared_ptr<Hash>
-Hash::FromString (const std::string &hashInTextEncoding)
-{
-  ptr_lib::shared_ptr<Hash> retval = make_shared<Hash> (reinterpret_cast<void*> (0), 0);
-
-  if (hashInTextEncoding.size () == 0)
-    {
-      return retval;
-    }
-
-  if (hashInTextEncoding.size () > EVP_MAX_MD_SIZE * 2)
-    {
-      cerr << "Input hash is too long. Returning an empty hash" << endl;
-      return retval;
-    }
-
-  retval->m_buf = new unsigned char [EVP_MAX_MD_SIZE];
-
-  unsigned char *end = copy (detail::string_to_binary (hashInTextEncoding.begin ()),
-                             detail::string_to_binary (hashInTextEncoding.end ()),
-                             retval->m_buf);
-
-  retval->m_length = end - retval->m_buf;
-
-  return retval;
-}
-
-ptr_lib::shared_ptr<Hash>
-Hash::FromFileContent (const char *filename)
-{
-  ptr_lib::shared_ptr<Hash> retval = make_shared<Hash> (reinterpret_cast<void*> (0), 0);
-  retval->m_buf = new unsigned char [EVP_MAX_MD_SIZE];
-
-  EVP_MD_CTX *hash_context = EVP_MD_CTX_create ();
-  EVP_DigestInit_ex (hash_context, HASH_FUNCTION (), 0);
-
-  ifstream iff (filename, std::ios::in | std::ios::binary);
-  while (iff.good ())
-    {
-      char buf[1024];
-      iff.read (buf, 1024);
-      EVP_DigestUpdate (hash_context, buf, iff.gcount ());
-    }
-
-  retval->m_buf = new unsigned char [EVP_MAX_MD_SIZE];
-
-  EVP_DigestFinal_ex (hash_context,
-                      retval->m_buf, &retval->m_length);
-
-  EVP_MD_CTX_destroy (hash_context);
-
-  return retval;
-}
-
-ptr_lib::shared_ptr<Hash>
-Hash::FromBytes (const ndn::Bytes &bytes)
-{
-  ptr_lib::shared_ptr<Hash> retval = make_shared<Hash> (reinterpret_cast<void*> (0), 0);
-  retval->m_buf = new unsigned char [EVP_MAX_MD_SIZE];
-
-  EVP_MD_CTX *hash_context = EVP_MD_CTX_create ();
-  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, ndn::head(bytes), bytes.size());
-
-  retval->m_buf = new unsigned char [EVP_MAX_MD_SIZE];
-
-  EVP_DigestFinal_ex (hash_context,
-                      retval->m_buf, &retval->m_length);
-
-  EVP_MD_CTX_destroy (hash_context);
-
-  return retval;
-}
-
-} // ndn
diff --git a/ndn-cpp/helpers/hash.h b/ndn-cpp/helpers/hash.h
deleted file mode 100644
index b5d96aa..0000000
--- a/ndn-cpp/helpers/hash.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- *         Zhenkai Zhu <zhenkai@cs.ucla.edu>
- */
-
-#ifndef NDN_HASH_H
-#define NDN_HASH_H
-
-#include <string.h>
-#include <iostream>
-#include <boost/shared_ptr.hpp>
-#include <boost/exception/all.hpp>
-
-#include "ndn-cpp/common.h"
-
-namespace ndn
-{
-class Hash
-{
-public:
-  static unsigned char _origin;
-  static ptr_lib::shared_ptr<Hash> Origin;
-
-  Hash ()
-    : m_buf(0)
-    , m_length(0)
-  {
-  }
-
-  Hash (const void *buf, unsigned int length)
-    : m_length (length)
-  {
-    if (m_length != 0)
-      {
-        m_buf = new unsigned char [length];
-        memcpy (m_buf, buf, length);
-      }
-  }
-
-  Hash (const Hash &otherHash)
-  : m_length (otherHash.m_length)
-  {
-    if (m_length != 0)
-      {
-        m_buf = new unsigned char [m_length];
-        memcpy (m_buf, otherHash.m_buf, otherHash.m_length);
-      }
-  }
-
-  static ptr_lib::shared_ptr<Hash>
-  FromString (const std::string &hashInTextEncoding);
-
-  static ptr_lib::shared_ptr<Hash>
-  FromFileContent (const char *fileName);
-
-  static ptr_lib::shared_ptr<Hash>
-  FromBytes (const ndn::Bytes &bytes);
-
-  ~Hash ()
-  {
-    if (m_length != 0)
-      delete [] m_buf;
-  }
-
-  Hash &
-  operator = (const Hash &otherHash)
-  {
-    if (m_length != 0)
-      delete [] m_buf;
-
-    m_length = otherHash.m_length;
-    if (m_length != 0)
-      {
-        m_buf = new unsigned char [m_length];
-        memcpy (m_buf, otherHash.m_buf, otherHash.m_length);
-      }
-    return *this;
-  }
-
-  bool
-  IsZero () const
-  {
-    return m_length == 0 ||
-      (m_length == 1 && m_buf[0] == 0);
-  }
-
-  bool
-  operator == (const Hash &otherHash) const
-  {
-    if (m_length != otherHash.m_length)
-      return false;
-
-    return memcmp (m_buf, otherHash.m_buf, m_length) == 0;
-  }
-
-  bool operator < (const Hash &otherHash) const
-  {
-    if (m_length < otherHash.m_length)
-      return true;
-
-    if (m_length > otherHash.m_length)
-      return false;
-
-    for (unsigned int i = 0; i < m_length; i++)
-      {
-        if (m_buf [i] < otherHash.m_buf [i])
-          return true;
-
-        if (m_buf [i] > otherHash.m_buf [i])
-          return false;
-
-        // if equal, continue
-      }
-
-    return false;
-  }
-
-  const void *
-  GetHash () const
-  {
-    return m_buf;
-  }
-
-  unsigned int
-  GetHashBytes () const
-  {
-    return m_length;
-  }
-
-  std::string
-  shortHash () const;
-
-private:
-  unsigned char *m_buf;
-  unsigned int m_length;
-
-  friend std::ostream &
-  operator << (std::ostream &os, const Hash &digest);
-};
-
-namespace Error {
-struct HashConversion : virtual boost::exception, virtual std::exception { };
-}
-
-
-std::ostream &
-operator << (std::ostream &os, const Hash &digest);
-
-}
-
-#endif // NDN_HASH_H
diff --git a/ndn-cpp/helpers/uri.h b/ndn-cpp/helpers/uri.h
deleted file mode 100644
index 3fbda7c..0000000
--- a/ndn-cpp/helpers/uri.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef NDN_DETAIL_URI_H
-#define NDN_DETAIL_URI_H
-
-#include "ndn-cpp/error.h"
-
-#include <boost/archive/iterators/transform_width.hpp>
-#include <boost/iterator/transform_iterator.hpp>
-
-namespace ndn
-{
-
-namespace detail
-{
-
-static const bool ESCAPE_CHARACTER [256] = {
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 26
-  1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 53
-  0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 80
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 107
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, // 134
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 161
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 188
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 215
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 242
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // 255
-};
-
-/// @cond include_hidden
-template<class CharType>
-struct hex_from_4_bit
-{
-  typedef CharType result_type;
-  CharType operator () (CharType ch) const
-  {
-    const char lookup_table [16] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
-    // cout << "New character: " << (int) ch << " (" << (char) ch << ")" << "\n";
-    BOOST_ASSERT (ch < 16);
-    return lookup_table[static_cast<size_t>(ch)];
-  }
-};
-
-typedef boost::transform_iterator<hex_from_4_bit<std::string::const_iterator::value_type>,
-                                  boost::archive::iterators::transform_width<std::string::const_iterator, 4, 8, std::string::const_iterator::value_type> > string_from_binary;
-
-
-
-template<class CharType>
-struct hex_to_4_bit
-{
-  typedef CharType result_type;
-  CharType operator () (CharType ch) const
-  {
-    const signed char lookup_table [] = {
-      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-      0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1,-1,-1,-1,-1,
-      -1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-      -1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
-    };
-
-    signed char value = -1;
-    if ((unsigned)ch < 128)
-      value = lookup_table [(unsigned)ch];
-    if (value == -1)
-      boost::throw_exception (error::StringTransform ());
-
-    return value;
-  }
-};
-
-typedef boost::archive::iterators::transform_width<boost::transform_iterator<hex_to_4_bit<std::string::const_iterator::value_type>, std::string::const_iterator>, 8, 4> string_to_binary;
-/// @endcond
-
-} // detail
-
-/**
- * @brief A helper class to convert to/from URI
- */
-class Uri
-{
-public:
-  template<class Iterator1, class Iterator2>
-  inline static void
-  fromEscaped (Iterator1 begin, Iterator1 end, Iterator2 inserter)
-  {
-    Iterator1 i = begin;
-    while (i != end)
-      {
-        if (*i == '%')
-          {
-            try
-              {
-                ++i;
-                Iterator1 j = i;
-                advance (i, 2);
-              
-                std::copy (detail::string_to_binary (j), detail::string_to_binary (i), inserter);
-              }
-            catch (ndn::error::StringTransform &e)
-              {
-                BOOST_THROW_EXCEPTION (error::Uri ()
-                                       << error::pos (std::distance (i, begin)));
-              }
-          }
-        else if (!detail::ESCAPE_CHARACTER[static_cast<unsigned char> (*i)])
-          {
-            *inserter = *i;
-            ++inserter; ++i;
-          }
-        else
-          {
-            BOOST_THROW_EXCEPTION (error::Uri ()
-                                   << error::pos (std::distance (i, begin)));
-          }
-      }
-  }
-
-  template<class Iterator1, class Iterator2>
-  inline static void
-  toEscaped (Iterator1 begin, Iterator1 end, Iterator2 inserter)
-  {
-    const char lookup_table [16] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
-    
-    for (Iterator1 i = begin; i != end; i++)
-      {
-        if (detail::ESCAPE_CHARACTER[static_cast<unsigned char> (*i)])
-          {
-            *inserter = '%';         ++inserter;
-            *inserter = lookup_table [(*i >> 4) & 0x0F]; ++inserter;
-            *inserter = lookup_table [(*i & 0x0F)];      ++inserter;
-          }
-        else
-          {
-            *inserter = *i; ++inserter;
-          }
-      }
-  }
-};
-
-} // ndn
-
-#endif // NDN_DETAIL_URI_H
diff --git a/platforms/osx/keychain-osx.h b/platforms/osx/keychain-osx.h
deleted file mode 100644
index 7399e05..0000000
--- a/platforms/osx/keychain-osx.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef NDN_KEYCHAIN_OSX_H
-#define NDN_KEYCHAIN_OSX_H
-
-#include "ndn.cxx/security/keychain.h"
-
-namespace ndn {
-namespace keychain {
-
-class OSX : public Keychain
-{
-public:
-  OSX ();
-
-  virtual
-  ~OSX ();
-
-  virtual void
-  generateKeyPair (const Name &keyName);
-
-  virtual void
-  deleteKeyPair (const Name &keyName);
-
-  virtual void
-  deletePublicKey (const Name &keyName);
-
-  virtual Ptr<Blob>
-  getPublicKey (const Name &publicKeyName);
-
-private:
-  void *m_private;
-};
-
-} // keychain
-} // ndn
-
-#endif // NDN_KEYCHAIN_OSX_H
diff --git a/platforms/osx/keychain-osx.mm b/platforms/osx/keychain-osx.mm
deleted file mode 100644
index 15b9a0d..0000000
--- a/platforms/osx/keychain-osx.mm
+++ /dev/null
@@ -1,245 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#include "keychain-osx.h"
-#include "ndn.cxx/error.h"
-#include "logging.h"
-
-#include <Foundation/Foundation.h>
-#include <AppKit/AppKit.h>
-#include <Security/Security.h>
-
-INIT_LOGGER ("Keychain.OSX");
-
-namespace ndn {
-
-namespace keychain {
-class OSX_Private
-{
-public:
-  static void
-  LogHumanError (OSStatus res, const std::string &errMsgStr)
-  {
-    CFStringRef errMsgPtr = SecCopyErrorMessageString (res, NULL);
-    char errMsg[1024];
-    CFStringGetCString (errMsgPtr, errMsg, 1024, kCFStringEncodingUTF8);
-    _LOG_DEBUG ("Open status: " << errMsg);
-
-    BOOST_THROW_EXCEPTION (error::Keychain ()
-                           << error::msg (errMsgStr)
-                           << error::msg (errMsg));
-  }
-
-  SecKeychainRef m_keychain;
-  SecKeychainRef m_origDefaultKeychain;
-  static const std::string s_keychainPath;
-};
-
-const std::string OSX_Private::s_keychainPath = "~/Library/Keychains/NDN.keychain";
-} // keychain
-
-
-
-keychain::OSX::OSX ()
-{
-  m_private = new OSX_Private ();
-  OSX_Private *self = reinterpret_cast<OSX_Private*> (m_private);
-
-  // AuthorizationRef authRef;
-  // AuthorizationItem right = { "system.keychain.modify", 0, NULL, 0 };
-  // AuthorizationRights rightSet = { 1, &right };
-
-  // /* Create authorization to access the system.keychain */
-  // OSStatus res1 = AuthorizationCreate(&rightSet, kAuthorizationEmptyEnvironment,
-  //                              kAuthorizationFlagExtendRights | kAuthorizationFlagInteractionAllowed, &authRef);
-  // _LOG_DEBUG ("Auth status: " << res1);
-
-  SecKeychainSetUserInteractionAllowed (true);
-
-  OSStatus res = SecKeychainCreate (OSX_Private::s_keychainPath.c_str (),
-                                    0, NULL, true, NULL,
-                                    &self->m_keychain);
-  _LOG_DEBUG ("Create status: " << res);
-
-  if (res == errSecDuplicateKeychain)
-    {
-      res = SecKeychainOpen (OSX_Private::s_keychainPath.c_str (),
-                             &self->m_keychain);
-      _LOG_DEBUG ("Open status: " << res);
-    }
-
-  if (res != errSecSuccess)
-    OSX_Private::LogHumanError (res, "Cannot open or create OSX Keychain");
-
-  // res = SecKeychainUnlock (self->m_keychain, 0, NULL, false);
-  // _LOG_DEBUG ("Unlock status: " << res);
-
-  SecKeychainCopyDefault (&self->m_origDefaultKeychain);
-  SecKeychainSetDefault (self->m_keychain);
-}
-
-keychain::OSX::~OSX ()
-{
-  OSX_Private *self = reinterpret_cast<OSX_Private*> (m_private);
-
-  SecKeychainSetDefault (self->m_origDefaultKeychain);
-
-  CFRelease (self->m_keychain);
-  CFRelease (self->m_origDefaultKeychain);
-  delete self;
-}
-
-void
-keychain::OSX::generateKeyPair (const Name &keyName)
-{
-  const void *	keys[] = {
-    kSecAttrLabel,
-    kSecAttrIsPermanent,
-    kSecAttrKeyType,
-    kSecAttrKeySizeInBits,
-    kSecAttrApplicationTag
-  };
-
-  std::string uri = keyName.toUri ();
-  CFStringRef label = CFStringCreateWithCString (NULL, uri.c_str (), kCFStringEncodingUTF8);
-  CFDataRef tag = CFDataCreate (NULL, reinterpret_cast<const unsigned char *> (uri.c_str ()), uri.size ());
-  
-  int keySize = 2048;
-  const void *	values[] = {
-    label,
-    kCFBooleanTrue,
-    kSecAttrKeyTypeRSA,
-    CFNumberCreate (NULL, kCFNumberIntType, &keySize),
-    tag
-  };
-
-  CFDictionaryRef dict = CFDictionaryCreate (NULL,
-                                             keys, values,
-                                             sizeof(keys) / sizeof(*keys),
-                                             NULL, NULL);
-
-  SecKeyRef publicKey, privateKey;
-
-  OSStatus res = SecKeyGeneratePair (dict, &publicKey, &privateKey);
-  _LOG_DEBUG ("GeneratePair stats: " << res);
-
-  if (res != errSecSuccess)
-    OSX_Private::LogHumanError (res, "Cannot generate public/private key pair");
-
-  CFRelease (publicKey);
-  CFRelease (privateKey);
-}
-
-void
-keychain::OSX::deleteKeyPair (const Name &keyName)
-{
-  const void *	keys[] = {
-    kSecClass,
-    kSecAttrApplicationTag
-  };
-
-  std::string uri = keyName.toUri ();
-  CFDataRef tag = CFDataCreate (NULL, reinterpret_cast<const unsigned char *> (uri.c_str ()), uri.size ());
-
-  const void *	values[] = {
-    kSecClassKey,
-    tag
-  };
-
-  CFDictionaryRef dict = CFDictionaryCreate (NULL,
-                                             keys, values,
-                                             sizeof(keys) / sizeof(*keys),
-                                             NULL, NULL);
-
-  OSStatus res = errSecSuccess;
-  while (res == errSecSuccess)
-    {
-      res = SecItemDelete (dict);
-      _LOG_DEBUG ("SecItemDelete status: " << res);
-    }
-
-  if (res != errSecItemNotFound)
-    OSX_Private::LogHumanError (res, "Error while deleting key " + keyName.toUri ());
-}
-
-void
-keychain::OSX::deletePublicKey (const Name &keyName)
-{
-  const void *	keys[] = {
-    kSecClass,
-    kSecAttrKeyClass,
-    kSecAttrApplicationTag
-  };
-
-  std::string uri = keyName.toUri ();
-  CFDataRef tag = CFDataCreate (NULL, reinterpret_cast<const unsigned char *> (uri.c_str ()), uri.size ());
-
-  const void *	values[] = {
-    kSecClassKey,
-    kSecAttrKeyClassPublic,
-    tag
-  };
-
-  CFDictionaryRef dict = CFDictionaryCreate (NULL,
-                                             keys, values,
-                                             sizeof(keys) / sizeof(*keys),
-                                             NULL, NULL);
-
-  OSStatus res = errSecSuccess;
-  while (res == errSecSuccess)
-    {
-      res = SecItemDelete (dict);
-      _LOG_DEBUG ("SecItemDelete status: " << res);
-    }
-
-  if (res != errSecItemNotFound)
-    OSX_Private::LogHumanError (res, "Error while deleting public key " + keyName.toUri ());
-}
-
-Ptr<Blob>
-keychain::OSX::getPublicKey (const Name &publicKeyName)
-{
-  const void *	keys[] = {
-    kSecClass,
-    kSecAttrKeyType,
-    kSecAttrKeyClass,
-    kSecAttrApplicationTag,
-    kSecReturnData
-  };
-
-  std::string uri = publicKeyName.toUri ();
-  CFDataRef tag = CFDataCreate (NULL, reinterpret_cast<const unsigned char *> (uri.c_str ()), uri.size ());
-
-  const void *	values[] = {
-    kSecClassKey,
-    kSecAttrKeyTypeRSA,
-    kSecAttrKeyClassPublic,
-    tag,
-    [NSNumber numberWithBool:YES]
-  };
-
-  CFDictionaryRef query = CFDictionaryCreate (NULL,
-                                              keys, values,
-                                              sizeof(keys) / sizeof(*keys),
-                                              NULL, NULL);
-
-  NSData* publicKey;
-  OSStatus res = SecItemCopyMatching (query, (CFTypeRef *)(&publicKey));
-  if (res != errSecSuccess)
-    OSX_Private::LogHumanError (res, "Cannot find public key " + publicKeyName.toUri ());
-
-  Ptr<Blob> retval (new Blob ([publicKey bytes], [publicKey length]));
-  _LOG_DEBUG ("Key size: " << [publicKey length]);
-  return retval;
-}
-
-/// @todo Release data structures after use
-
-} // ndn
diff --git a/scheduler/interval-generator.h b/scheduler/interval-generator.h
deleted file mode 100644
index e480ecc..0000000
--- a/scheduler/interval-generator.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef INTERVAL_GENERATOR_H
-#define INTERVAL_GENERATOR_H
-
-#include <boost/shared_ptr.hpp>
-
-using namespace std;
-
-class IntervalGenerator;
-typedef boost::shared_ptr<IntervalGenerator> IntervalGeneratorPtr;
-
-class IntervalGenerator
-{
-public:
-  virtual ~IntervalGenerator () { }
-  
-  virtual double
-  nextInterval() = 0;
-};
-
-
-#endif // INTERVAL_GENERATOR_H
diff --git a/scheduler/one-time-task.cc b/scheduler/one-time-task.cc
deleted file mode 100644
index b3082af..0000000
--- a/scheduler/one-time-task.cc
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#include "one-time-task.h"
-#include "scheduler.h"
-
-OneTimeTask::OneTimeTask(const Callback &callback, const Tag &tag, const SchedulerPtr &scheduler, double delay)
-            : Task(callback, tag, scheduler)
-{
-  setTv(delay);
-}
-
-void
-OneTimeTask::run()
-{
-  if (!m_invoked)
-  {
-    m_callback();
-    m_invoked = true;
-    deregisterSelf();
-  }
-}
-
-void
-OneTimeTask::deregisterSelf()
-{
-  m_scheduler->deleteTask(m_tag);
-}
-
-void
-OneTimeTask::reset()
-{
-  m_invoked = false;
-}
diff --git a/scheduler/one-time-task.h b/scheduler/one-time-task.h
deleted file mode 100644
index 744ca90..0000000
--- a/scheduler/one-time-task.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef ONE_TIME_TASK_H
-#define ONE_TIME_TASK_H
-
-#include "task.h"
-
-class OneTimeTask : public Task
-{
-public:
-  OneTimeTask(const Callback &callback, const Tag &tag, const SchedulerPtr &scheduler, double delay);
-  virtual ~OneTimeTask(){}
-
-  // invoke callback and mark self as invoked and deregister self from scheduler
-  virtual void
-  run() _OVERRIDE;
-
-  // after reset, the task is marked as un-invoked and can be add to scheduler again, with same delay
-  // if not invoked yet, no effect
-  virtual void
-  reset() _OVERRIDE;
-
-private:
-  // this is to deregister itself from scheduler automatically after invoke
-  void
-  deregisterSelf();
-};
-
-
-#endif // EVENT_SCHEDULER_H
diff --git a/scheduler/periodic-task.cc b/scheduler/periodic-task.cc
deleted file mode 100644
index 110c4df..0000000
--- a/scheduler/periodic-task.cc
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#include "periodic-task.h"
-#include "logging.h"
-#include <utility>
-
-INIT_LOGGER ("Scheduler.PeriodicTask");
-
-PeriodicTask::PeriodicTask(const Callback &callback, const Tag &tag, const SchedulerPtr &scheduler,
-                           IntervalGeneratorPtr generator)
-  : Task(callback, tag, scheduler)
-  , m_generator(generator)
-{
-}
-
-void
-PeriodicTask::run()
-{
-  if (!m_invoked)
-  {
-    m_invoked = true;
-    m_callback();
-
-    if (m_invoked)
-      {
-        // m_invoked getting back if it is rescheduled inside the callback
-        m_scheduler->rescheduleTask(m_tag);
-      }
-  }
-}
-
-void
-PeriodicTask::reset()
-{
-  m_invoked = false;
-  double interval = m_generator->nextInterval();
-  setTv(interval);
-}
diff --git a/scheduler/periodic-task.h b/scheduler/periodic-task.h
deleted file mode 100644
index 303dca4..0000000
--- a/scheduler/periodic-task.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef PERIODIC_TASK_H
-#define PERIODIC_TASK_H
-
-#include "task.h"
-#include "scheduler.h"
-#include "interval-generator.h"
-
-class PeriodicTask : public Task
-{
-public:
-  // generator is needed only when this is a periodic task
-  // two simple generators implementation (SimpleIntervalGenerator and RandomIntervalGenerator) are provided;
-  // if user needs more complex pattern in the intervals between calls, extend class IntervalGenerator
-  PeriodicTask(const Callback &callback, const Tag &tag, const SchedulerPtr &scheduler, IntervalGeneratorPtr generator);
-  virtual ~PeriodicTask(){}
-
-  // invoke callback, reset self and ask scheduler to schedule self with the next delay interval
-  virtual void
-  run() _OVERRIDE;
-
-  // set the next delay and mark as un-invoke
-  virtual void
-  reset() _OVERRIDE;
-
-private:
-  IntervalGeneratorPtr m_generator;
-};
-
-#endif // PERIODIC_TASK_H
diff --git a/scheduler/random-interval-generator.h b/scheduler/random-interval-generator.h
deleted file mode 100644
index 476578c..0000000
--- a/scheduler/random-interval-generator.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef RANDOM_INTERVAL_GENERATOR_H
-#define RANDOM_INTERVAL_GENERATOR_H
-
-#include "interval-generator.h"
-
-#include <boost/random/mersenne_twister.hpp>
-#include <boost/random/uniform_real.hpp>
-#include <boost/random/variate_generator.hpp>
-#include <boost/date_time/posix_time/posix_time_types.hpp>
-
-// generates intervals with uniform distribution
-class RandomIntervalGenerator : public IntervalGenerator
-{
-public:
-  typedef enum
-  {
-    UP = 1,
-    DOWN = 2,
-    EVEN = 3
-  } Direction;
-
-public:
-  // percent is random-range/interval; e.g. if interval is 10 and you wish the random-range to be 2
-  // e.g. 9 ~ 11, percent = 0.2
-  // direction shifts the random range; e.g. in the above example, UP would produce a range of
-  // 10 ~ 12, DOWN of 8 ~ 10, and EVEN of 9 ~ 11
-  RandomIntervalGenerator(double interval, double percent, Direction direction = EVEN)
-  // : m_rng(time(NULL))
-    : m_rng (static_cast<int> (boost::posix_time::microsec_clock::local_time().time_of_day ().total_nanoseconds ()))
-  , m_dist(0.0, fractional(percent))
-  , m_random(m_rng, m_dist)
-  , m_direction(direction)
-  , m_percent(percent)
-  , m_interval(interval)
-  { }
-
-  virtual ~RandomIntervalGenerator(){}
-
-  virtual double
-  nextInterval() _OVERRIDE
-  {
-    double percent = m_random();
-    double interval = m_interval;
-    switch (m_direction)
-      {
-      case UP: interval = m_interval * (1.0 + percent); break;
-      case DOWN: interval = m_interval * (1.0 - percent); break;
-      case EVEN: interval = m_interval * (1.0 - m_percent/2.0 + percent); break;
-      default: break;
-      }
-
-    return interval;
-  }
-
-private:
-  inline double fractional(double x) { double dummy; return abs(modf(x, &dummy)); }
-
-private:
-  typedef boost::mt19937 RNG_TYPE;
-  RNG_TYPE m_rng;
-  boost::uniform_real<> m_dist;
-  boost::variate_generator<RNG_TYPE &, boost::uniform_real<> > m_random;
-  Direction m_direction;
-  double m_percent;
-  double m_interval;
-
-};
-#endif // RANDOM_INTERVAL_GENERATOR_H
diff --git a/scheduler/scheduler-all.h b/scheduler/scheduler-all.h
deleted file mode 100644
index 388a74c..0000000
--- a/scheduler/scheduler-all.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef SCHEDULE_ALL_H
-#define SCHEDULE_ALL_H
-
-#include "scheduler/interval-generator.h"
-#include "scheduler/one-time-task.h"
-#include "scheduler/periodic-task.h"
-#include "scheduler/random-interval-generator.h"
-#include "scheduler/scheduler.h"
-#include "scheduler/simple-interval-generator.h"
-#include "scheduler/task.h"
-
-#endif
diff --git a/scheduler/scheduler.cc b/scheduler/scheduler.cc
deleted file mode 100644
index 02ac0c0..0000000
--- a/scheduler/scheduler.cc
+++ /dev/null
@@ -1,338 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#include "scheduler.h"
-#include "one-time-task.h"
-#include "periodic-task.h"
-#include "logging.h"
-
-#include <utility>
-#include <boost/make_shared.hpp>
-
-INIT_LOGGER ("Scheduler");
-
-using namespace std;
-using namespace boost;
-
-#define EVLOOP_NO_EXIT_ON_EMPTY 0x04
-
-static void
-dummyCallback(evutil_socket_t fd, short what, void *arg)
-{
-  // 1 year later, that was a long run for the app
-  // let's wait for another year
-  timeval tv;
-  tv.tv_sec = 365 * 24 * 3600;
-  tv.tv_usec = 0;
-  event *ev = *(event **)arg;
-  int res = evtimer_add(ev, &tv);
-}
-
-// IntervalGeneratorPtr
-// IntervalGenerator:: Null;
-
-void errorCallback(int err)
-{
-  _LOG_ERROR ("Fatal error: " << err);
-}
-
-Scheduler::Scheduler()
-  : m_running(false)
-  , m_executor(1)
-{
-  event_set_fatal_callback(errorCallback);
-  evthread_use_pthreads();
-  m_base = event_base_new();
-
-  // This is a hack to prevent event_base_loop from exiting;
-  // the flag EVLOOP_NO_EXIT_ON_EMPTY is somehow ignored, at least on Mac OS X
-  // it's going to be scheduled to 10 years later
-  timeval tv;
-  tv.tv_sec = 365 * 24 * 3600;
-  tv.tv_usec = 0;
-  m_ev = evtimer_new(m_base, dummyCallback, &m_ev);
-  int res = evtimer_add(m_ev, &tv);
-  if (res < 0)
-  {
-    _LOG_ERROR("heck");
-  }
-}
-
-Scheduler::~Scheduler()
-{
-  shutdown ();
-  evtimer_del(m_ev);
-  event_free(m_ev);
-  event_base_free(m_base);
-}
-
-void
-Scheduler::eventLoop()
-{
-  while(true)
-  {
-    if (event_base_loop(m_base, EVLOOP_NO_EXIT_ON_EMPTY) < 0)
-    {
-      _LOG_DEBUG ("scheduler loop break error");
-    }
-    else
-    {
-      _LOG_DEBUG ("scheduler loop break normal");
-    }
-
-    {
-      ScopedLock lock(m_mutex);
-      if (!m_running)
-        {
-          _LOG_DEBUG ("scheduler loop break normal");
-          break;
-        }
-    }
-
-    // just to prevent craziness in CPU usage which supposedly should not happen
-    // after adding the dummy event
-    usleep(1000);
-  }
-}
-
-void
-Scheduler::execute(Executor::Job job)
-{
-  m_executor.execute(job);
-}
-
-void
-Scheduler::start()
-{
-  ScopedLock lock(m_mutex);
-  if (!m_running)
-  {
-    m_thread = boost::thread(&Scheduler::eventLoop, this);
-    m_executor.start();
-    m_running = true;
-  }
-}
-
-void
-Scheduler::shutdown()
-{
-  bool breakAndWait = false;
-  {
-    ScopedLock lock (m_mutex);
-    if (m_running)
-      {
-        m_running = false;
-        breakAndWait = true;
-      }
-  }
-
-  if (breakAndWait)
-    {
-      event_base_loopbreak(m_base);
-      m_executor.shutdown();
-      m_thread.join();
-    }
-}
-
-TaskPtr
-Scheduler::scheduleOneTimeTask (SchedulerPtr scheduler, double delay,
-                                const Task::Callback &callback, const Task::Tag &tag)
-{
-  TaskPtr task = make_shared<OneTimeTask> (callback, tag, scheduler, delay);
-  if (scheduler->addTask (task))
-    return task;
-  else
-    return TaskPtr ();
-}
-
-TaskPtr
-Scheduler::schedulePeriodicTask (SchedulerPtr scheduler, IntervalGeneratorPtr delayGenerator,
-                                 const Task::Callback &callback, const Task::Tag &tag)
-{
-  TaskPtr task = make_shared<PeriodicTask> (callback, tag, scheduler, delayGenerator);
-
-  if (scheduler->addTask (task))
-    return task;
-  else
-    return TaskPtr ();
-}
-
-bool
-Scheduler::addTask(TaskPtr newTask, bool reset/* = true*/)
-{
-  if (addToMap(newTask))
-  {
-    if (reset)
-      {
-        newTask->reset();
-      }
-    int res = evtimer_add(newTask->ev(), newTask->tv());
-    if (res < 0)
-    {
-      _LOG_ERROR ("evtimer_add failed for " << newTask->tag());
-    }
-    return true;
-  }
-  else
-  {
-    _LOG_ERROR ("fail to add task: " << newTask->tag());
-  }
-
-  return false;
-}
-
-void
-Scheduler::deleteTask(TaskPtr task)
-{
-  deleteTask (task->tag ());
-}
-
-void
-Scheduler::rescheduleTask(TaskPtr task)
-{
-  ScopedLock lock(m_mutex);
-  TaskMapIt it = m_taskMap.find(task->tag());
-  if (it != m_taskMap.end())
-  {
-    TaskPtr task = it->second;
-    task->reset();
-    int res = evtimer_add(task->ev(), task->tv());
-    if (res < 0)
-    {
-      _LOG_ERROR ("evtimer_add failed for " << task->tag());
-    }
-  }
-  else
-  {
-    addTask(task);
-  }
-}
-
-void
-Scheduler::rescheduleTask(const Task::Tag &tag)
-{
-  ScopedLock lock(m_mutex);
-  TaskMapIt it = m_taskMap.find(tag);
-  if (it != m_taskMap.end())
-  {
-    TaskPtr task = it->second;
-    task->reset();
-    int res = evtimer_add(task->ev(), task->tv());
-    if (res < 0)
-    {
-      cout << "evtimer_add failed for " << task->tag() << endl;
-    }
-  }
-}
-
-void
-Scheduler::rescheduleTaskAt (const Task::Tag &tag, double time)
-{
-  ScopedLock lock(m_mutex);
-  TaskMapIt it = m_taskMap.find (tag);
-  if (it != m_taskMap.end())
-  {
-    TaskPtr task = it->second;
-    task->reset();
-    task->setTv (time);
-
-    int res = evtimer_add(task->ev(), task->tv());
-    if (res < 0)
-    {
-      _LOG_ERROR ("evtimer_add failed for " << task->tag());
-    }
-  }
-  else
-    {
-      _LOG_ERROR ("Task for tag " << tag << " not found");
-    }
-}
-
-void
-Scheduler::rescheduleTaskAt (TaskPtr task, double time)
-{
-  ScopedLock lock(m_mutex);
-  TaskMapIt it = m_taskMap.find(task->tag());
-  if (it != m_taskMap.end())
-  {
-    TaskPtr task = it->second;
-    task->reset();
-    task->setTv (time);
-
-    int res = evtimer_add(task->ev(), task->tv());
-    if (res < 0)
-    {
-      _LOG_ERROR ("evtimer_add failed for " << task->tag());
-    }
-  }
-  else
-  {
-    task->setTv (time); // force different time
-    addTask (task, false);
-  }
-}
-
-
-bool
-Scheduler::addToMap(TaskPtr task)
-{
-  ScopedLock lock(m_mutex);
-  if (m_taskMap.find(task->tag()) == m_taskMap.end())
-  {
-    m_taskMap.insert(make_pair(task->tag(), task));
-    return true;
-  }
-  return false;
-}
-
-void
-Scheduler::deleteTask(const Task::Tag &tag)
-{
-  ScopedLock lock(m_mutex);
-  TaskMapIt it = m_taskMap.find(tag);
-  if (it != m_taskMap.end())
-  {
-    TaskPtr task = it->second;
-    evtimer_del(task->ev());
-    m_taskMap.erase(it);
-  }
-}
-
-void
-Scheduler::deleteTask(const Task::TaskMatcher &matcher)
-{
-  ScopedLock lock(m_mutex);
-  TaskMapIt it = m_taskMap.begin();
-  while(it != m_taskMap.end())
-  {
-    TaskPtr task = it->second;
-    if (matcher(task))
-    {
-      evtimer_del(task->ev());
-      // Use post increment; map.erase invalidate the iterator that is beening erased,
-      // but does not invalidate other iterators. This seems to be the convention to
-      // erase something from C++ STL map while traversing.
-      m_taskMap.erase(it++);
-    }
-    else
-    {
-      ++it;
-    }
-  }
-}
-
-int
-Scheduler::size()
-{
-  ScopedLock lock(m_mutex);
-  return m_taskMap.size();
-}
diff --git a/scheduler/scheduler.h b/scheduler/scheduler.h
deleted file mode 100644
index ffac5d2..0000000
--- a/scheduler/scheduler.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef SCHEDULER_H
-#define SCHEDULER_H
-
-#include <event2/event.h>
-#include <event2/thread.h>
-#include <event2/event-config.h>
-#include <event2/util.h>
-
-#include <boost/function.hpp>
-#include <boost/shared_ptr.hpp>
-
-#include <boost/exception/all.hpp>
-#include <boost/thread/recursive_mutex.hpp>
-#include <boost/thread/thread.hpp>
-#include <math.h>
-#include <map>
-#include <sys/time.h>
-
-#include "scheduler/task.h"
-#include "scheduler/interval-generator.h"
-#include "executor/executor.h"
-
-class Scheduler;
-typedef boost::shared_ptr<Scheduler> SchedulerPtr;
-
-/**
- * @brief Scheduler class
- */
-class Scheduler
-{
-public:
-  Scheduler();
-  virtual ~Scheduler();
-
-  // start event scheduling
-  virtual void
-  start();
-
-  // stop event scheduling
-  virtual void
-  shutdown();
-
-  // helper method to schedule one-time task
-  static TaskPtr
-  scheduleOneTimeTask (SchedulerPtr scheduler, double delay, const Task::Callback &callback, const Task::Tag &tag);
-
-  // helper method to schedule periodic task
-  static TaskPtr
-  schedulePeriodicTask (SchedulerPtr scheduler, IntervalGeneratorPtr delayGenerator,
-                        const Task::Callback &callback, const Task::Tag &tag);
-
-  // if task with the same tag exists, the task is not added and return false
-  virtual bool
-  addTask(TaskPtr task, bool reset = true);
-
-  // delete task by task->tag, regardless of whether it's invoked or not
-  virtual void
-  deleteTask(TaskPtr task);
-
-  // delete task by tag, regardless of whether it's invoked or not
-  // if no task is found, no effect
-  virtual void
-  deleteTask(const Task::Tag &tag);
-
-  // delete tasks by matcher, regardless of whether it's invoked or not
-  // this is flexiable in that you can use any form of criteria in finding tasks to delete
-  // but keep in mind this is a linear scan
-
-  // if no task is found, no effect
-  virtual void
-  deleteTask(const Task::TaskMatcher &matcher);
-
-  // task must already have been added to the scheduler, otherwise this method has no effect
-  // this is usually used by PeriodicTask
-  virtual void
-  rescheduleTask(const Task::Tag &tag);
-
-  // if the task is not pending, it will be added to the schedule queue
-  // if the task is pending, the delay is changed to the passed in delay
-  // e.g. if at second 0 task A with delay 5 is originally going to run at second 5 and
-  // rescheduleTask(A) is called at second 4, A will be reschedule to run
-  // at second 9
-  virtual void
-  rescheduleTask(TaskPtr task);
-
-  virtual void
-  rescheduleTaskAt (const Task::Tag &tag, double time);
-
-  virtual void
-  rescheduleTaskAt (TaskPtr task, double time);
-
-  void
-  execute(Executor::Job);
-
-  void
-  eventLoop();
-
-  event_base *
-  base() { return m_base; }
-
-  // used in test
-  int
-  size();
-
-protected:
-  bool
-  addToMap(TaskPtr task);
-
-protected:
-  typedef std::map<Task::Tag, TaskPtr> TaskMap;
-  typedef std::map<Task::Tag, TaskPtr>::iterator TaskMapIt;
-  typedef boost::recursive_mutex Mutex;
-  typedef boost::unique_lock<Mutex> ScopedLock;
-
-  TaskMap m_taskMap;
-  Mutex m_mutex;
-  volatile bool m_running;
-  event_base *m_base;
-  event *m_ev;
-  boost::thread m_thread;
-  Executor m_executor;
-};
-
-struct SchedulerException : virtual boost::exception, virtual std::exception { };
-
-#endif // SCHEDULER_H
diff --git a/scheduler/simple-interval-generator.h b/scheduler/simple-interval-generator.h
deleted file mode 100644
index c7a9e77..0000000
--- a/scheduler/simple-interval-generator.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef SIMPLE_INTERVAL_GENERATOR_H
-#define SIMPLE_INTERVAL_GENERATOR_H
-
-#include "interval-generator.h"
-
-class SimpleIntervalGenerator : public IntervalGenerator
-{
-public:
-  SimpleIntervalGenerator(double interval) : m_interval (interval) {}
-  virtual ~SimpleIntervalGenerator() {}
-  
-  virtual double
-  nextInterval() _OVERRIDE { return m_interval; }
-
-private:
-  double m_interval;
-};
-
-#endif // SIMPLE_INTERVAL_GENERATOR_H
diff --git a/scheduler/task.cc b/scheduler/task.cc
deleted file mode 100644
index fa73490..0000000
--- a/scheduler/task.cc
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#include "task.h"
-#include "scheduler.h"
-
-static void
-eventCallback(evutil_socket_t fd, short what, void *arg)
-{
-  Task *task = static_cast<Task *>(arg);
-  task->execute();
-  task = NULL;
-}
-
-Task::Task(const Callback &callback, const Tag &tag, const SchedulerPtr &scheduler)
-     : m_callback(callback)
-     , m_tag(tag)
-     , m_scheduler(scheduler)
-     , m_invoked(false)
-     , m_event(NULL)
-     , m_tv(NULL)
-{
-  m_event = evtimer_new(scheduler->base(), eventCallback, this);
-  m_tv = new timeval;
-}
-
-Task::~Task()
-{
-  if (m_event != NULL)
-  {
-    event_free(m_event);
-    m_event = NULL;
-  }
-
-  if (m_tv != NULL)
-  {
-    delete m_tv;
-    m_tv = NULL;
-  }
-}
-
-void
-Task::setTv(double delay)
-{
-  // Alex: when using abs function, i would recommend use it with std:: prefix, otherwise
-  // the standard one may be used, which converts everything to INT, making a lot of problems
-  double intPart, fraction;
-  fraction = modf(std::abs(delay), &intPart);
-
-  m_tv->tv_sec = static_cast<int>(intPart);
-  m_tv->tv_usec = static_cast<int>((fraction * 1000000));
-}
-
-void
-Task::execute()
-{
-  // m_scheduler->execute(boost::bind(&Task::run, this));
-
-  // using a shared_ptr of this to ensure that when invoked from executor
-  // the task object still exists
-  // otherwise, it could be the case that the run() is to be executed, but before it
-  // could finish, the TaskPtr gets deleted from scheduler and the task object
-  // gets destroyed, causing crash
-  m_scheduler->execute(boost::bind(&Task::run, shared_from_this()));
-}
diff --git a/scheduler/task.h b/scheduler/task.h
deleted file mode 100644
index bd14296..0000000
--- a/scheduler/task.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2013, Regents of the University of California
- *                     Alexander Afanasyev
- *                     Zhenkai Zhu
- *
- * BSD license, See the LICENSE file for more information
- *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef TASK_H
-#define TASK_H
-
-#define _OVERRIDE
-#ifdef __GNUC__
-#if __GNUC_MAJOR >= 4 && __GNUC_MINOR__ >= 7
-  #undef _OVERRIDE
-  #define _OVERRIDE override
-#endif // __GNUC__ version
-#endif // __GNUC__
-
-#include <boost/function.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/enable_shared_from_this.hpp>
-#include <sys/time.h>
-
-//////////////////////////////////////////////////
-// forward declarations
-class Task;
-typedef boost::shared_ptr<Task> TaskPtr;
-
-class Scheduler;
-typedef boost::shared_ptr<Scheduler> SchedulerPtr;
-
-struct event;
-//////////////////////////////////////////////////
-
-
-/**
- * @brief Base class for a task
- */
-class Task : public boost::enable_shared_from_this<Task>
-{
-public:
-  // callback of this task
-  typedef boost::function<void ()> Callback;
-  // tag identifies this task, should be unique
-  typedef std::string Tag;
-  // used to match tasks
-  typedef boost::function<bool (const TaskPtr &task)> TaskMatcher;
-
-  // Task is associated with Schedulers due to the requirement that libevent event is associated with an libevent event_base
-  Task(const Callback &callback, const Tag &tag, const SchedulerPtr &scheduler);
-  virtual ~Task();
-
-  virtual void
-  run() = 0;
-
-  Tag
-  tag() { return m_tag; }
-
-  event *
-  ev() { return m_event; }
-
-  timeval *
-  tv() { return m_tv; }
-
-  // Task needs to be resetted after the callback is invoked if it is to be schedule again; just for safety
-  // it's called by scheduler automatically when addTask or rescheduleTask is called;
-  // Tasks should do preparation work here (e.g. set up new delay, etc. )
-  virtual void
-  reset() = 0;
-
-  // set delay
-  // This overrides whatever delay kept in m_tv
-  void
-  setTv(double delay);
-
-  void
-  execute();
-
-protected:
-  Callback m_callback;
-  Tag m_tag;
-  SchedulerPtr m_scheduler;
-  bool m_invoked;
-  event *m_event;
-  timeval *m_tv;
-};
-
-
-#endif // TASK_H