diff --git a/include/ns3/sync-ccnx-wrapper.h b/include/ns3/sync-ccnx-wrapper.h
deleted file mode 100644
index c9ffe27..0000000
--- a/include/ns3/sync-ccnx-wrapper.h
+++ /dev/null
@@ -1,195 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2012 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>
- *         Chaoyi Bian <bcy@pku.edu.cn>
- *	   Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef SYNC_CCNX_WRAPPER_H
-#define SYNC_CCNX_WRAPPER_H
-
-#include <boost/exception/all.hpp>
-#include <boost/function.hpp>
-#include <string>
-
-#include <ns3/ptr.h>
-#include <ns3/node.h>
-#include <ns3/random-variable.h>
-#include <ns3/ccnx-app.h>
-#include <ns3/ccnx-name-components.h>
-#include <ns3/ccnx-name-components-hash-helper.h>
-
-#include <boost/multi_index_container.hpp>
-#include <boost/multi_index/hashed_index.hpp>
-#include <boost/multi_index/mem_fun.hpp>
-
-/**
- * \defgroup sync SYNC protocol
- *
- * Implementation of SYNC protocol
- */
-namespace Sync {
-
-template<class Callback>
-struct CcnxFilterEntry
-{
-public:
-  CcnxFilterEntry (ns3::Ptr<const ns3::CcnxNameComponents> prefix)
-    : m_prefix (prefix)
-  { }
-  
-  const ns3::CcnxNameComponents &
-  GetPrefix () const
-  { return *m_prefix; }
-
-  void
-  AddCallback (Callback callback)
-  { 
-    m_callback = callback;
-  }
-
-  void
-  ClearCallback ()
-  {
-    m_callback = 0;
-  }
-  
-public:
-  ns3::Ptr<const ns3::CcnxNameComponents> m_prefix; ///< \brief Prefix of the PIT entry
-  Callback m_callback;
-};
-
-
-template<class Callback>
-struct CcnxFilterEntryContainer
-{
-  typedef
-  boost::multi_index::multi_index_container<
-    CcnxFilterEntry<Callback>,
-    boost::multi_index::indexed_by<
-      // indexed by hash
-      boost::multi_index::hashed_unique<
-        boost::multi_index::const_mem_fun< CcnxFilterEntry<Callback>, const ns3::CcnxNameComponents&, &CcnxFilterEntry<Callback>::GetPrefix >,
-        ns3::CcnxPrefixHash
-        >
-      >
-    > type;
-};
-
-
-
-struct CcnxOperationException : virtual boost::exception, virtual std::exception { };
-/**
- * \ingroup sync
- * @brief A wrapper for ccnx library; clients of this code do not need to deal
- * with ccnx library
- */
-class CcnxWrapper
-  : public ns3::CcnxApp
-{
-public:
-  typedef boost::function<void (std::string, std::string)> DataCallback;
-  typedef boost::function<void (std::string)> InterestCallback;
-  
-  /**
-   * @brief initialize the wrapper; a lot of things needs to be done. 1) init
-   * keystore 2) init keylocator 3) start a thread to hold a loop of ccn_run
-   *
-   */
-  CcnxWrapper();
-  ~CcnxWrapper();
-
-  // from CcnxApp
-  /**
-   * @brief Should be called after Node pointer is set to create face and start application
-   */
-  virtual void
-  StartApplication ();
-
-  /**
-   * @brief Stop application
-   */
-  virtual void
-  StopApplication ();
-
-  /**
-   * @brief send Interest; need to grab lock m_mutex first
-   *
-   * @param strInterest the Interest name
-   * @param dataCallback the callback function to deal with the returned data
-   * @return the return code of ccn_express_interest
-   */
-  int
-  sendInterest (const std::string &strInterest, const DataCallback &dataCallback);
-
-  /**
-   * @brief set Interest filter (specify what interest you want to receive)
-   *
-   * @param prefix the prefix of Interest
-   * @param interestCallback the callback function to deal with the returned data
-   * @return the return code of ccn_set_interest_filter
-   */
-  int
-  setInterestFilter (const std::string &prefix, const InterestCallback &interestCallback);
-
-  /**
-   * @brief clear Interest filter
-   * @param prefix the prefix of Interest
-   */
-  void
-  clearInterestFilter (const std::string &prefix);
-
-  /**
-   * @brief publish data and put it to local ccn content store; need to grab
-   * lock m_mutex first
-   *
-   * @param name the name for the data object
-   * @param dataBuffer the data to be published
-   * @param freshness the freshness time for the data object
-   * @return code generated by ccnx library calls, >0 if success
-   */
-  int
-  publishData (const std::string &name, const std::string &dataBuffer, int freshness);
-
-  // from CcnxApp
-  virtual void
-  OnInterest (const ns3::Ptr<const ns3::CcnxInterestHeader> &interest, ns3::Ptr<ns3::Packet> packet);
- 
-  virtual void
-  OnContentObject (const ns3::Ptr<const ns3::CcnxContentObjectHeader> &contentObject,
-                   ns3::Ptr<ns3::Packet> payload);
-
-private:
-  CcnxFilterEntryContainer<InterestCallback>::type::iterator
-  InterestCallbackLookup (const ns3::CcnxNameComponents &name);
-
-  CcnxFilterEntryContainer<DataCallback>::type::iterator
-  DataCallbackLookup (const ns3::CcnxNameComponents &name);
-
-private:
-  ns3::UniformVariable m_rand; // nonce generator
-
-  CcnxFilterEntryContainer<DataCallback>::type m_dataCallbacks;
-  CcnxFilterEntryContainer<InterestCallback>::type m_interestCallbacks;
-};
-
-typedef boost::shared_ptr<CcnxWrapper> CcnxWrapperPtr;
-
-} // Sync
-
-#endif // SYNC_CCNX_WRAPPER_H
diff --git a/include/ns3/sync-log.h b/include/ns3/sync-log.h
deleted file mode 100644
index 9da0dc8..0000000
--- a/include/ns3/sync-log.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2012 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>
- *         Chaoyi Bian <bcy@pku.edu.cn>
- *	   Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef SYNC_LOG_H
-#define SYNC_LOG_H
-
-#ifdef NS3_MODULE
-
-#include <ns3/log.h>
-
-#ifdef _DEBUG
-
-#define INIT_LOGGER(name) NS_LOG_COMPONENT_DEFINE(name);
-
-#define _LOG_INFO(x) NS_LOG_INFO(x)
-
-#define _LOG_DEBUG(x) NS_LOG_DEBUG(x)
-
-#define _LOG_TRACE(x) NS_LOG_LOGIC(x)
-
-#define _LOG_FUNCTION(x) NS_LOG_FUNCTION(x)
-
-#define _LOG_FUNCTION_NOARGS NS_LOG_FUNCTION_NOARGS
-
-#else
-
-#define INIT_LOGGER(name) 
-#define _LOG_INFO(x) 
-#define _LOG_DEBUG(x) 
-#define _LOG_TRACE(x)
-#define _LOG_FUNCTION(x)
-#define _LOG_FUNCTION_NOARGS
-
-#endif
-
-#else
-
-#ifdef HAVE_LOG4CXX
-
-#include <log4cxx/logger.h>
-
-#define INIT_LOGGER(name) \
-  static log4cxx::LoggerPtr staticModuleLogger = log4cxx::Logger::getLogger (name);
-
-#define _LOG_INFO(x) \
-  LOG4CXX_INFO(staticModuleLogger, x);
-
-#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__ << "()");
-
-void
-INIT_LOGGERS ();
-
-#else
-
-#define INIT_LOGGER(name)
-#define _LOG_FUNCTION(x)
-#define _LOG_FUNCTION_NOARGS
-#define _LOG_TRACE(x)
-#define _LOG_INFO(x)
-#define INIT_LOGGERS(x)
-
-#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 << endl;
-
-#else
-#define _LOG_DEBUG(x)
-#endif
-
-#endif // HAVE_LOG4CXX
-
-#endif // NS3_MODULE
-
-#endif // SYNC_LOG_H
diff --git a/include/ns3/sync-logic-helper.h b/include/ns3/sync-logic-helper.h
deleted file mode 100644
index 20ad746..0000000
--- a/include/ns3/sync-logic-helper.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2011 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: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef SYNC_LOGIC_HELPER_H
-#define SYNC_LOGIC_HELPER_H
-
-#include "ns3/object-factory.h"
-#include "ns3/attribute.h"
-#include "ns3/node-container.h"
-#include "ns3/application-container.h"
-#include "ns3/ptr.h"
-
-#include <boost/function.hpp>
-
-namespace Sync 
-{
-
-class SeqNo;
-
-/**
- * \brief A helper to make it easier to instantiate an ns3::CcnxConsumer Application
- * on a set of nodes.
- */
-class SyncLogicHelper
-{        
-public:
-  typedef boost::function< void ( const std::string &/*prefix*/, const SeqNo &/*newSeq*/, const SeqNo &/*oldSeq*/ ) > LogicUpdateCallback;
-  typedef boost::function< void ( const std::string &/*prefix*/ ) > LogicRemoveCallback;
-
-  /**
-   * \brief Create an CcnxAppHelper to make it easier to work with CCNx apps
-   *
-   * \param app Class of the application
-   */
-  SyncLogicHelper ();
-
-  /**
-   * @brief Set the sync prefix
-   */
-  void
-  SetPrefix (const std::string &prefix);
-
-  /**
-   * @brief Set onUpdate and onRemove callbacks
-   */
-  void
-  SetCallbacks (LogicUpdateCallback onUpdate, LogicRemoveCallback onRemove);
-  
-  /**
-   * Install an ns3::CcnxConsumer on each node of the input container
-   * configured with all the attributes set with SetAttribute.
-   *
-   * \param c NodeContainer of the set of nodes on which an CcnxConsumer 
-   * will be installed.
-   * \returns Container of Ptr to the applications installed.
-   */
-  ns3::ApplicationContainer
-  Install (ns3::NodeContainer c);
-        
-  /**
-   * Install an ns3::CcnxConsumer on the node configured with all the 
-   * attributes set with SetAttribute.
-   *
-   * \param node The node on which an CcnxConsumer will be installed.
-   * \returns Container of Ptr to the applications installed.
-   */
-  ns3::ApplicationContainer
-  Install (ns3::Ptr<ns3::Node> node);
-        
-  /**
-   * Install an ns3::CcnxConsumer on the node configured with all the 
-   * attributes set with SetAttribute.
-   *
-   * \param nodeName The node on which an CcnxConsumer will be installed.
-   * \returns Container of Ptr to the applications installed.
-   */
-  ns3::ApplicationContainer
-  Install (std::string nodeName);
-        
-private:
-  /**
-   * \internal
-   * Install an ns3::CcnxConsumer on the node configured with all the 
-   * attributes set with SetAttribute.
-   *
-   * \param node The node on which an CcnxConsumer will be installed.
-   * \returns Ptr to the application installed.
-   */
-  ns3::Ptr<ns3::Application> InstallPriv (ns3::Ptr<ns3::Node> node);
-  std::string m_prefix; // sync prefix
-  LogicUpdateCallback m_onUpdate;
-  LogicRemoveCallback m_onRemove;
-};
-
-} // namespace Sync
-
-#endif // SYNC_LOGIC_HELPER_H
-
diff --git a/include/ns3/sync-ns3-name-info.h b/include/ns3/sync-ns3-name-info.h
deleted file mode 100644
index d412fdd..0000000
--- a/include/ns3/sync-ns3-name-info.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2012 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>
- *         Chaoyi Bian <bcy@pku.edu.cn>
- *	   Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifdef NS3_MODULE
-
-#ifndef SYNC_CCNX_NAME_INFO_H
-#define SYNC_CCNX_NAME_INFO_H
-
-#include "sync-name-info.h"
-#include "ns3/ptr.h"
-#include "ns3/ccnx-name-components.h"
-
-namespace Sync {
-
-class Ns3NameInfo : public NameInfo
-{
-public:
-  /**
-   * @brief Lookup existing or create new NameInfo object
-   * @param name routable prefix
-   */
-  static NameInfoConstPtr
-  FindOrCreate (ns3::Ptr<const ns3::CcnxNameComponents> name);
-
-  virtual ~Ns3NameInfo () { };
-  
-  // from NameInfo
-  virtual bool
-  operator == (const NameInfo &info) const;
-
-  virtual bool
-  operator < (const NameInfo &info) const;
-
-  virtual std::string
-  toString () const;
-
-private:
-  // implementing a singleton pattern. 
-  /**
-   * @brief Disabled default constructor. NameInfo object should be created through FindOrCreate static call.
-   */
-
-  /**
-   * @brief Disabled default
-   */
-  Ns3NameInfo () {}
-  Ns3NameInfo& operator = (const Ns3NameInfo &info) { return *this; }
-  Ns3NameInfo (ns3::Ptr<const ns3::CcnxNameComponents> name);
-  
-  ns3::Ptr<const ns3::CcnxNameComponents> m_name;
-};
-
-Digest &
-operator << (Digest &, const ns3::CcnxNameComponents &name);
-
-} // Sync
-
-#endif // SYNC_CCNX_NAME_INFO_H
-
-#endif // NS3_MODULE
diff --git a/include/ns3/sync-scheduler.h b/include/ns3/sync-scheduler.h
deleted file mode 100644
index a98f8c1..0000000
--- a/include/ns3/sync-scheduler.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2012 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>
- *         Chaoyi Bian <bcy@pku.edu.cn>
- *	   Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifndef SYNC_SCHEDULER_H
-#define SYNC_SCHEDULER_H
-
-#include <ns3/nstime.h>
-#include <ns3/event-id.h>
-#include <ns3/simulator.h>
-#include <list>
-#include <map>
-
-#include "sync-event.h"
-
-#define TIME_SECONDS(number) ns3::Seconds(number)
-#define TIME_MILLISECONDS(number) ns3::MilliSeconds(number)
-#define TIME_NOW ns3::Simulator::Now ()
-typedef ns3::Time TimeDuration;
-typedef ns3::Time TimeAbsolute;
-
-namespace Sync {
-
-/**
- * @ingroup sync
- * @brief General purpose event scheduler
- *
- * This class internally runs a thread and events can be scheduled by specifying an absolute or relative time of the event
- */
-class Scheduler
-{
-public:
-  /**
-   * @brief Default constructor. Thread will be created
-   */
-  Scheduler ();
-  /**
-   * @brief Destructor. Thread will be nicely stopped
-   */
-  ~Scheduler ();
-
-  /**
-   * @brief Schedule an event at absolute time 'abstime'
-   * @param abstime Absolute time
-   * @param event function to be called at the time
-   * @param label Label for the event
-   */
-  // void
-  // schedule (const boost::system_time &abstime, Event event, uint32_t label);
-
-  /**
-   * @brief Schedule an event at relative time 'reltime'
-   * @param reltime Relative time
-   * @param event function to be called at the time
-   * @param label Label for the event
-   */
-  void
-  schedule (const TimeDuration &reltime, Event event, uint32_t label); 
-
-  /**
-   * @brief Cancel all events for the label
-   * @param label Label of the event that needs to be cancelled
-   */
-  void
-  cancel (uint32_t label);
-
-private:
-  static void
-  eventWrapper (Event event);
-
-private:
-  std::map< uint32_t, std::list< ns3::EventId > > m_labeledEvents;
-};
-  
-}
-
-#endif // SYNC_SCHEDULER_H
diff --git a/ns3/sync-ccnx-wrapper.cc b/ns3/sync-ccnx-wrapper.cc
deleted file mode 100644
index d0e769a..0000000
--- a/ns3/sync-ccnx-wrapper.cc
+++ /dev/null
@@ -1,263 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2012 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>
- *         Chaoyi Bian <bcy@pku.edu.cn>
- *	   Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#include "sync-ccnx-wrapper.h"
-#include "sync-log.h"
-#include <boost/throw_exception.hpp>
-#include <boost/date_time/posix_time/posix_time.hpp>
-#include <boost/lambda/lambda.hpp>
-#include <boost/lambda/bind.hpp>
-
-namespace ll = boost::lambda;
-
-#include "../evaluation/type-tag.h"
-
-#include <ns3/ccnx-name-components.h>
-#include <ns3/ccnx-interest-header.h>
-#include <ns3/ccnx-content-object-header.h>
-#include <ns3/ccnx-face.h>
-#include <ns3/packet.h>
-#include <ns3/ccnx-fib.h>
-
-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;
-using namespace ns3;
-
-INIT_LOGGER ("CcnxWrapper");
-
-namespace Sync {
-
-CcnxWrapper::CcnxWrapper()
-  : m_rand (0, std::numeric_limits<uint32_t>::max ())
-{
-}
-
-CcnxWrapper::~CcnxWrapper()
-{
-}
-
-void
-CcnxWrapper::StartApplication ()
-{
-  CcnxApp::StartApplication ();
-}
-
-void
-CcnxWrapper::StopApplication ()
-{
-  CcnxApp::StopApplication ();
-}
-
-int
-CcnxWrapper::publishData (const string &dataName, const string &dataBuffer, int freshness)
-{
-  // NS_LOG_INFO ("Requesting Interest: \n" << interestHeader);
-  _LOG_INFO ("> Data for " << dataName);
-
-  Ptr<CcnxNameComponents> name = Create<CcnxNameComponents> ();
-  istringstream is (dataName);
-  is >> *name;
-
-  static CcnxContentObjectTail trailer;
-  
-  CcnxContentObjectHeader data;
-  data.SetName (name);
-  data.SetFreshness (Seconds (freshness));
-
-  Ptr<Packet> packet = Create<Packet> (reinterpret_cast<const uint8_t*> (dataBuffer.c_str ()), dataBuffer.size ());
-  packet->AddPacketTag (CreateObject<TypeTag> (TypeTag::DATA));
-  packet->AddHeader (data);
-  packet->AddTrailer (trailer);
-
-  m_protocolHandler (packet);
-
-  m_transmittedContentObjects (&data, packet, this, m_face);
-
-  return 0;
-}
-
-int CcnxWrapper::sendInterest (const string &strInterest, const DataCallback &dataCallback)
-{
-  // NS_LOG_INFO ("Requesting Interest: \n" << interestHeader);
-  _LOG_INFO ("> Interest for " << strInterest);
-
-  Ptr<CcnxNameComponents> name = Create<CcnxNameComponents> ();
-  istringstream is (strInterest);
-  is >> *name;
-  
-  CcnxInterestHeader interestHeader;
-  uint32_t nonce = m_rand.GetValue ();
-  _LOG_DEBUG ("Nonce: " << nonce);
-  interestHeader.SetNonce            (nonce);
-  interestHeader.SetName             (name);
-  interestHeader.SetInterestLifetime (Seconds (9.9)); // really long-lived interests
-
-  Ptr<Packet> packet = Create<Packet> ();
-  packet->AddPacketTag (CreateObject<TypeTag> (TypeTag::INTEREST));
-  packet->AddHeader (interestHeader);
-
-  // NS_LOG_DEBUG (interestHeader);
-  
-  m_protocolHandler (packet);
-
-  m_transmittedInterests (&interestHeader, this, m_face);
-
-  // Record the callback
-  CcnxFilterEntryContainer<DataCallback>::type::iterator entry = m_dataCallbacks.find (*name);
-  if (entry == m_dataCallbacks.end ())
-    {
-      pair<CcnxFilterEntryContainer<DataCallback>::type::iterator, bool> status =
-        m_dataCallbacks.insert (CcnxFilterEntry<DataCallback> (name));
-
-      entry = status.first;
-    }
-  m_dataCallbacks.modify (entry, ll::bind (&CcnxFilterEntry<DataCallback>::AddCallback, ll::_1, dataCallback));
-  
-  return 0;
-}
-
-int CcnxWrapper::setInterestFilter (const string &prefix, const InterestCallback &interestCallback)
-{
-  Ptr<CcnxNameComponents> name = Create<CcnxNameComponents> ();
-  istringstream is (prefix);
-  is >> *name;
-
-  CcnxFilterEntryContainer<InterestCallback>::type::iterator entry = m_interestCallbacks.find (*name);
-  if (entry == m_interestCallbacks.end ())
-    {
-      pair<CcnxFilterEntryContainer<InterestCallback>::type::iterator, bool> status =
-        m_interestCallbacks.insert (CcnxFilterEntry<InterestCallback> (name));
-
-      entry = status.first;
-    }
-
-  m_interestCallbacks.modify (entry, ll::bind (&CcnxFilterEntry<InterestCallback>::AddCallback, ll::_1, interestCallback));
-
-  // creating actual face
-  
-  Ptr<CcnxFib> fib = GetNode ()->GetObject<CcnxFib> ();
-  CcnxFibEntryContainer::type::iterator fibEntry = fib->Add (*name, m_face, 0);
-
-  // make face green, so it will be used primarily
-  fib->m_fib.modify (fibEntry,
-                     ll::bind (&CcnxFibEntry::UpdateStatus,
-                               ll::_1, m_face, CcnxFibFaceMetric::NDN_FIB_GREEN));
-
-  return 0;
-}
-
-void
-CcnxWrapper::clearInterestFilter (const std::string &prefix)
-{
-  Ptr<CcnxNameComponents> name = Create<CcnxNameComponents> ();
-  istringstream is (prefix);
-  is >> *name;
-
-  CcnxFilterEntryContainer<InterestCallback>::type::iterator entry = m_interestCallbacks.find (*name);
-  if (entry == m_interestCallbacks.end ())
-    return;
-
-  m_interestCallbacks.modify (entry, ll::bind (&CcnxFilterEntry<InterestCallback>::ClearCallback, ll::_1));  
-}
-
-CcnxFilterEntryContainer<CcnxWrapper::InterestCallback>::type::iterator
-CcnxWrapper::InterestCallbackLookup (const ns3::CcnxNameComponents &name)
-{
-  CcnxFilterEntryContainer<InterestCallback>::type::iterator entry = m_interestCallbacks.end ();
-
-  // do the longest prefix match
-  for (size_t componentsCount = name.GetComponents ().size ()+1;
-       componentsCount > 0;
-       componentsCount--)
-    {
-      CcnxNameComponents subPrefix (name.GetSubComponents (componentsCount-1));
-
-      entry = m_interestCallbacks.find (subPrefix);
-      if (entry != m_interestCallbacks.end())
-        return entry;
-    }
-
-  return entry;
-}
-
-CcnxFilterEntryContainer<CcnxWrapper::DataCallback>::type::iterator
-CcnxWrapper::DataCallbackLookup (const ns3::CcnxNameComponents &name)
-{
-  CcnxFilterEntryContainer<DataCallback>::type::iterator entry = m_dataCallbacks.end ();
-
-  // do the longest prefix match
-  for (size_t componentsCount = name.GetComponents ().size ()+1;
-       componentsCount > 0;
-       componentsCount--)
-    {
-      CcnxNameComponents subPrefix (name.GetSubComponents (componentsCount-1));
-
-      entry = m_dataCallbacks.find (subPrefix);
-      if (entry != m_dataCallbacks.end())
-        return entry;
-    }
-
-  return entry;  
-}
-
-void
-CcnxWrapper::OnInterest (const Ptr<const CcnxInterestHeader> &interest, Ptr<Packet> packet)
-{
-  CcnxApp::OnInterest (interest, packet);
-
-  CcnxFilterEntryContainer<InterestCallback>::type::iterator entry = InterestCallbackLookup (interest->GetName ());
-  if (entry == m_interestCallbacks.end ())
-    {
-      _LOG_DEBUG ("No Interest callback set");
-      return;
-    }
-  
-  entry->m_callback (lexical_cast<string> (interest->GetName ()));  
-}
-
-void
-CcnxWrapper::OnContentObject (const Ptr<const CcnxContentObjectHeader> &contentObject,
-                              Ptr<Packet> payload)
-{
-  CcnxApp::OnContentObject (contentObject, payload);
-
-  CcnxFilterEntryContainer<DataCallback>::type::iterator entry = DataCallbackLookup (contentObject->GetName ());
-  if (entry == m_dataCallbacks.end ())
-    {
-      _LOG_DEBUG ("No Data callback set");
-      return;
-    }
-
-  ostringstream content;
-  payload->CopyData (&content, payload->GetSize ());
-  
-  entry->m_callback (lexical_cast<string> (contentObject->GetName ()), content.str ());
-  
-  // i guess it make sense to remove callback when interest is satisfied
-  m_dataCallbacks.erase (entry);
-}
-
-
-}
diff --git a/ns3/sync-logic-helper.cc b/ns3/sync-logic-helper.cc
deleted file mode 100644
index 2425ec3..0000000
--- a/ns3/sync-logic-helper.cc
+++ /dev/null
@@ -1,94 +0,0 @@
-/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2011 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: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#include "sync-logic-helper.h"
-#include "sync-logic.h"
-
-#include "ns3/log.h"
-#include "ns3/string.h"
-#include "ns3/names.h"
-
-NS_LOG_COMPONENT_DEFINE ("SyncLogicHelper");
-
-using namespace ns3;
-
-namespace Sync 
-{
-
-SyncLogicHelper::SyncLogicHelper ()
-{
-  // m_factory.SetTypeId ("Sync::SyncLogic");
-}
-
-void
-SyncLogicHelper::SetPrefix (const std::string &prefix)
-{
-  m_prefix = prefix;
-}
-
-
-void
-SyncLogicHelper::SetCallbacks (LogicUpdateCallback onUpdate, LogicRemoveCallback onRemove)
-{
-  m_onUpdate = onUpdate;
-  m_onRemove = onRemove;
-}
-
-// void 
-// CcnxAppHelper::SetAttribute (std::string name, const AttributeValue &value)
-// {
-//   m_factory.Set (name, value);
-// }
-    
-ApplicationContainer
-SyncLogicHelper::Install (Ptr<Node> node)
-{
-  return ApplicationContainer (InstallPriv (node));
-}
-    
-ApplicationContainer
-SyncLogicHelper::Install (std::string nodeName)
-{
-  Ptr<Node> node = Names::Find<Node> (nodeName);
-  return ApplicationContainer (InstallPriv (node));
-}
-    
-ApplicationContainer
-SyncLogicHelper::Install (NodeContainer c)
-{
-  ApplicationContainer apps;
-  for (NodeContainer::Iterator i = c.Begin (); i != c.End (); ++i)
-    {
-      apps.Add (InstallPriv (*i));
-    }
-    
-  return apps;
-}
-    
-Ptr<Application>
-SyncLogicHelper::InstallPriv (Ptr<Node> node)
-{
-  Ptr<SyncLogic> app = CreateObject<SyncLogic> ("/sync", m_onUpdate, m_onRemove);
-  node->AddApplication (app);
-        
-  return app;
-}
-
-}
diff --git a/ns3/sync-ns3-name-info.cc b/ns3/sync-ns3-name-info.cc
deleted file mode 100644
index 7268e75..0000000
--- a/ns3/sync-ns3-name-info.cc
+++ /dev/null
@@ -1,126 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2012 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>
- *         Chaoyi Bian <bcy@pku.edu.cn>
- *	   Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#ifdef NS3_MODULE
-
-#include "sync-ns3-name-info.h"
-#include "ns3/ccnx-name-components.h"
-
-#include <boost/foreach.hpp>
-#include <boost/lexical_cast.hpp>
-#include <boost/make_shared.hpp>
-#include <utility>
-
-using namespace std;
-using namespace boost;
-
-namespace Sync {
-
-NameInfoConstPtr
-Ns3NameInfo::FindOrCreate (ns3::Ptr<const ns3::CcnxNameComponents> name)
-{
-  mutex::scoped_lock namesLock (m_namesMutex);
-  
-  NameInfoConstPtr ret;
-  string key = lexical_cast<string> (*name);
-  
-  NameMap::iterator item = m_names.find (key);
-  if (item != m_names.end ())
-    {
-      ret = item->second.lock ();
-      BOOST_ASSERT (ret != 0);
-    }
-  else
-    {
-      ret = NameInfoPtr (new Ns3NameInfo (name));
-      weak_ptr<const NameInfo> value (ret);
-      pair<NameMap::iterator,bool> inserted =
-        m_names.insert (make_pair (key, value));
-      
-      BOOST_ASSERT (inserted.second); // previous call has to insert value
-      item = inserted.first;
-    }
-
-  return ret;
-}
-
-
-Ns3NameInfo::Ns3NameInfo (ns3::Ptr<const ns3::CcnxNameComponents> name)
-  : m_name (name)
-{
-  m_id = m_ids ++; // set ID for a newly inserted element
-  m_digest << *name;
-  m_digest.getHash (); // finalize digest
-}
-
-string
-Ns3NameInfo::toString () const
-{
-  return lexical_cast<std::string> (*m_name);
-}
-
-bool
-Ns3NameInfo::operator == (const NameInfo &info) const
-{
-  try
-    {
-      return *m_name == *dynamic_cast<const Ns3NameInfo&> (info).m_name;
-    }
-  catch (...)
-    {
-      return false;
-    }
-}
-
-bool
-Ns3NameInfo::operator < (const NameInfo &info) const
-{
-  try
-    {
-      return *m_name < *dynamic_cast<const Ns3NameInfo&> (info).m_name;
-    }
-  catch (...)
-    {
-      return false;
-    }
-}
-
-Digest &
-operator << (Digest &digest, const ns3::CcnxNameComponents &name)
-{
-  BOOST_FOREACH (const std::string &component, name.GetComponents ())
-    {
-      Digest subhash;
-      subhash << component;
-      subhash.getHash (); // finalize hash
-
-      digest << subhash;
-    }
-
-  return digest;
-}
-
-
-} // Sync
-
-#endif
-
diff --git a/ns3/sync-scheduler.cc b/ns3/sync-scheduler.cc
deleted file mode 100644
index 025eb3e..0000000
--- a/ns3/sync-scheduler.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2012 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>
- *         Chaoyi Bian <bcy@pku.edu.cn>
- *	   Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-
-#include "sync-scheduler.h"
-#include "sync-log.h"
-
-#include "ns3/simulator.h"
-
-using namespace boost;
-using namespace std;
-using namespace ns3;
-
-INIT_LOGGER ("Scheduler");
-
-namespace Sync {
-
-Scheduler::Scheduler ()
-{
-}
-
-Scheduler::~Scheduler ()
-{
-}
-
-void
-Scheduler::eventWrapper (Event event)
-{
-  event ();
-}
-
-void
-Scheduler::schedule (const TimeDuration &reltime, Event event, uint32_t label)
-{
-  _LOG_DEBUG ("Schedule event for " << (Simulator::Now () +reltime).ToDouble (Time::S) << "s for label " << label);
-  
-  list< EventId > &eventsForLabel = m_labeledEvents [label];
-  list< EventId >::iterator i = eventsForLabel.begin ();
-  while (i != eventsForLabel.end ())
-    {
-      if (i->IsExpired ())
-        {
-          list< EventId >::iterator next = i;
-          next ++;
-          eventsForLabel.erase (i);
-          i = next;
-        }
-      else
-        i ++;
-    }
-
-  ns3::EventId eventId = ns3::Simulator::Schedule (reltime, Scheduler::eventWrapper, event);
-  eventsForLabel.push_back (eventId);
-}
-
-void
-Scheduler::cancel (uint32_t label)
-{
-  list< EventId > &eventsForLabel = m_labeledEvents [label];
-  _LOG_DEBUG ("Canceling events for label " << label << " (" << eventsForLabel.size () << " events)");
-
-  for (list< EventId >::iterator i = eventsForLabel.begin ();
-       i != eventsForLabel.end ();
-       i++)
-    {
-      i->Cancel ();
-    }
-
-  eventsForLabel.clear ();
-}
-
-
-} // Sync
diff --git a/ccnx/sync-app-socket-c.cc b/src/ccnx/sync-app-socket-c.cc
similarity index 100%
rename from ccnx/sync-app-socket-c.cc
rename to src/ccnx/sync-app-socket-c.cc
diff --git a/include/sync-app-socket-c.h b/src/ccnx/sync-app-socket-c.h
similarity index 100%
rename from include/sync-app-socket-c.h
rename to src/ccnx/sync-app-socket-c.h
diff --git a/ccnx/sync-app-socket.cc b/src/ccnx/sync-app-socket.cc
similarity index 100%
rename from ccnx/sync-app-socket.cc
rename to src/ccnx/sync-app-socket.cc
diff --git a/include/sync-app-socket.h b/src/ccnx/sync-app-socket.h
similarity index 100%
rename from include/sync-app-socket.h
rename to src/ccnx/sync-app-socket.h
diff --git a/ccnx/sync-ccnx-wrapper.cc b/src/ccnx/sync-ccnx-wrapper.cc
similarity index 100%
rename from ccnx/sync-ccnx-wrapper.cc
rename to src/ccnx/sync-ccnx-wrapper.cc
diff --git a/include/sync-ccnx-wrapper.h b/src/ccnx/sync-ccnx-wrapper.h
similarity index 100%
rename from include/sync-ccnx-wrapper.h
rename to src/ccnx/sync-ccnx-wrapper.h
diff --git a/model/sync-diff-leaf.cc b/src/sync-diff-leaf.cc
similarity index 100%
rename from model/sync-diff-leaf.cc
rename to src/sync-diff-leaf.cc
diff --git a/include/sync-diff-leaf.h b/src/sync-diff-leaf.h
similarity index 100%
rename from include/sync-diff-leaf.h
rename to src/sync-diff-leaf.h
diff --git a/include/sync-diff-state-container.h b/src/sync-diff-state-container.h
similarity index 100%
rename from include/sync-diff-state-container.h
rename to src/sync-diff-state-container.h
diff --git a/model/sync-diff-state.cc b/src/sync-diff-state.cc
similarity index 100%
rename from model/sync-diff-state.cc
rename to src/sync-diff-state.cc
diff --git a/include/sync-diff-state.h b/src/sync-diff-state.h
similarity index 100%
rename from include/sync-diff-state.h
rename to src/sync-diff-state.h
diff --git a/model/sync-digest.cc b/src/sync-digest.cc
similarity index 100%
rename from model/sync-digest.cc
rename to src/sync-digest.cc
diff --git a/include/sync-digest.h b/src/sync-digest.h
similarity index 100%
rename from include/sync-digest.h
rename to src/sync-digest.h
diff --git a/include/sync-event.h b/src/sync-event.h
similarity index 100%
rename from include/sync-event.h
rename to src/sync-event.h
diff --git a/model/sync-full-leaf.cc b/src/sync-full-leaf.cc
similarity index 100%
rename from model/sync-full-leaf.cc
rename to src/sync-full-leaf.cc
diff --git a/include/sync-full-leaf.h b/src/sync-full-leaf.h
similarity index 100%
rename from include/sync-full-leaf.h
rename to src/sync-full-leaf.h
diff --git a/model/sync-full-state.cc b/src/sync-full-state.cc
similarity index 100%
rename from model/sync-full-state.cc
rename to src/sync-full-state.cc
diff --git a/include/sync-full-state.h b/src/sync-full-state.h
similarity index 100%
rename from include/sync-full-state.h
rename to src/sync-full-state.h
diff --git a/include/sync-interest-container.h b/src/sync-interest-container.h
similarity index 100%
rename from include/sync-interest-container.h
rename to src/sync-interest-container.h
diff --git a/model/sync-interest-table.cc b/src/sync-interest-table.cc
similarity index 100%
rename from model/sync-interest-table.cc
rename to src/sync-interest-table.cc
diff --git a/include/sync-interest-table.h b/src/sync-interest-table.h
similarity index 100%
rename from include/sync-interest-table.h
rename to src/sync-interest-table.h
diff --git a/model/sync-leaf.cc b/src/sync-leaf.cc
similarity index 100%
rename from model/sync-leaf.cc
rename to src/sync-leaf.cc
diff --git a/include/sync-leaf.h b/src/sync-leaf.h
similarity index 100%
rename from include/sync-leaf.h
rename to src/sync-leaf.h
diff --git a/ccnx/sync-log.cc b/src/sync-logging.cc
similarity index 100%
rename from ccnx/sync-log.cc
rename to src/sync-logging.cc
diff --git a/include/sync-log.h b/src/sync-logging.h
similarity index 100%
rename from include/sync-log.h
rename to src/sync-logging.h
diff --git a/include/sync-logic-event-container.h b/src/sync-logic-event-container.h
similarity index 100%
rename from include/sync-logic-event-container.h
rename to src/sync-logic-event-container.h
diff --git a/model/sync-logic.cc b/src/sync-logic.cc
similarity index 100%
rename from model/sync-logic.cc
rename to src/sync-logic.cc
diff --git a/include/sync-logic.h b/src/sync-logic.h
similarity index 100%
rename from include/sync-logic.h
rename to src/sync-logic.h
diff --git a/model/sync-name-info.cc b/src/sync-name-info.cc
similarity index 100%
rename from model/sync-name-info.cc
rename to src/sync-name-info.cc
diff --git a/include/sync-name-info.h b/src/sync-name-info.h
similarity index 100%
rename from include/sync-name-info.h
rename to src/sync-name-info.h
diff --git a/ccnx/sync-scheduler.cc b/src/sync-scheduler.cc
similarity index 100%
rename from ccnx/sync-scheduler.cc
rename to src/sync-scheduler.cc
diff --git a/include/sync-scheduler.h b/src/sync-scheduler.h
similarity index 100%
rename from include/sync-scheduler.h
rename to src/sync-scheduler.h
diff --git a/model/sync-seq-no.cc b/src/sync-seq-no.cc
similarity index 100%
rename from model/sync-seq-no.cc
rename to src/sync-seq-no.cc
diff --git a/include/sync-seq-no.h b/src/sync-seq-no.h
similarity index 100%
rename from include/sync-seq-no.h
rename to src/sync-seq-no.h
diff --git a/include/sync-state-leaf-container.h b/src/sync-state-leaf-container.h
similarity index 100%
rename from include/sync-state-leaf-container.h
rename to src/sync-state-leaf-container.h
diff --git a/model/sync-state.cc b/src/sync-state.cc
similarity index 100%
rename from model/sync-state.cc
rename to src/sync-state.cc
diff --git a/include/sync-state.h b/src/sync-state.h
similarity index 100%
rename from include/sync-state.h
rename to src/sync-state.h
diff --git a/model/sync-state.proto b/src/sync-state.proto
similarity index 100%
rename from model/sync-state.proto
rename to src/sync-state.proto
diff --git a/model/sync-std-name-info.cc b/src/sync-std-name-info.cc
similarity index 100%
rename from model/sync-std-name-info.cc
rename to src/sync-std-name-info.cc
diff --git a/include/sync-std-name-info.h b/src/sync-std-name-info.h
similarity index 100%
rename from include/sync-std-name-info.h
rename to src/sync-std-name-info.h
diff --git a/test/test_app_socket.cc b/tests/test_app_socket.cc
similarity index 100%
rename from test/test_app_socket.cc
rename to tests/test_app_socket.cc
diff --git a/test/test_ccnx_wrapper.cc b/tests/test_ccnx_wrapper.cc
similarity index 100%
rename from test/test_ccnx_wrapper.cc
rename to tests/test_ccnx_wrapper.cc
diff --git a/test/test_data_fetch_and_publish.cc b/tests/test_data_fetch_and_publish.cc
similarity index 100%
rename from test/test_data_fetch_and_publish.cc
rename to tests/test_data_fetch_and_publish.cc
diff --git a/test/test_digest.cc b/tests/test_digest.cc
similarity index 100%
rename from test/test_digest.cc
rename to tests/test_digest.cc
diff --git a/test/test_interest_table.cc b/tests/test_interest_table.cc
similarity index 100%
rename from test/test_interest_table.cc
rename to tests/test_interest_table.cc
diff --git a/test/test_leaf.cc b/tests/test_leaf.cc
similarity index 100%
rename from test/test_leaf.cc
rename to tests/test_leaf.cc
diff --git a/test/test_pit.cc b/tests/test_pit.cc
similarity index 100%
rename from test/test_pit.cc
rename to tests/test_pit.cc
diff --git a/test/test_scheduler.cc b/tests/test_scheduler.cc
similarity index 100%
rename from test/test_scheduler.cc
rename to tests/test_scheduler.cc
diff --git a/test/test_state.cc.outdated b/tests/test_state.cc.outdated
similarity index 100%
rename from test/test_state.cc.outdated
rename to tests/test_state.cc.outdated
diff --git a/test/test_sync_logic.cc b/tests/test_sync_logic.cc
similarity index 100%
rename from test/test_sync_logic.cc
rename to tests/test_sync_logic.cc
diff --git a/waf b/waf
index ef85684..d45d28b 100755
--- a/waf
+++ b/waf
Binary files differ
diff --git a/waf-tools/ccnx.py b/waf-tools/ccnx.py
deleted file mode 100644
index 5338b5f..0000000
--- a/waf-tools/ccnx.py
+++ /dev/null
@@ -1,77 +0,0 @@
-#! /usr/bin/env python
-# encoding: utf-8
-
-'''
-
-When using this tool, the wscript will look like:
-
-	def options(opt):
-	        opt.tool_options('ccnx', tooldir=["waf-tools"])
-
-	def configure(conf):
-		conf.load('compiler_cxx ccnx')
-
-	def build(bld):
-		bld(source='main.cpp', target='app', use='CCNX')
-
-Options are generated, in order to specify the location of ccnx includes/libraries.
-
-
-'''
-import sys
-import re
-from waflib import Utils,Logs,Errors
-from waflib.Configure import conf
-CCNX_DIR=['/usr','/usr/local','/opt/local','/sw']
-CCNX_VERSION_FILE='ccn/ccn.h'
-CCNX_VERSION_CODE='''
-#include <iostream>
-#include <ccn/ccn.h>
-int main() { std::cout << ((CCN_API_VERSION/100000) % 100) << "." << ((CCN_API_VERSION/1000) % 100) << "." << (CCN_API_VERSION % 1000); }
-'''
-
-def options(opt):
-	opt.add_option('--ccnx',type='string',default='',dest='ccnx_dir',help='''path to where CCNx is installed, e.g. /usr/local''')
-@conf
-def __ccnx_get_version_file(self,dir):
-	# Logs.pprint ('CYAN', '  + %s/%s/%s' % (dir, 'include', CCNX_VERSION_FILE))
-	try:
-		return self.root.find_dir(dir).find_node('%s/%s' % ('include', CCNX_VERSION_FILE))
-	except:
-		return None
-@conf
-def ccnx_get_version(self,dir):
-	val=self.check_cxx(fragment=CCNX_VERSION_CODE,includes=['%s/%s' % (dir, 'include')],execute=True,define_ret = True, mandatory=True)
-	return val
-@conf
-def ccnx_get_root(self,*k,**kw):
-	root=k and k[0]or kw.get('path',None)
-	# Logs.pprint ('RED', '   %s' %root)
-	if root and self.__ccnx_get_version_file(root):
-		return root
-	for dir in CCNX_DIR:
-		if self.__ccnx_get_version_file(dir):
-			return dir
-	if root:
-		self.fatal('CCNx not found in %s'%root)
-	else:
-		self.fatal('CCNx not found, please provide a --ccnx argument (see help)')
-@conf
-def check_ccnx(self,*k,**kw):
-	if not self.env['CXX']:
-		self.fatal('load a c++ compiler first, conf.load("compiler_cxx")')
-
-	var=kw.get('uselib_store','CCNX')
-	self.start_msg('Checking CCNx')
-	root = self.ccnx_get_root(*k,**kw);
-	self.env.CCNX_VERSION=self.ccnx_get_version(root)
-
-	self.env['INCLUDES_%s'%var]= '%s/%s' % (root, "include");
-	self.env['LIB_%s'%var] = "ccn"
-	self.env['LIBPATH_%s'%var] = '%s/%s' % (root, "lib")
-
-	self.end_msg(self.env.CCNX_VERSION)
-	if Logs.verbose:
-		Logs.pprint('CYAN','	ccnx include : %s'%self.env['INCLUDES_%s'%var])
-		Logs.pprint('CYAN','	ccnx lib     : %s'%self.env['LIB_%s'%var])
-		Logs.pprint('CYAN','	ccnx libpath : %s'%self.env['LIBPATH_%s'%var])
diff --git a/waf-tools/ndnx.py b/waf-tools/ndnx.py
new file mode 100644
index 0000000..eec23c5
--- /dev/null
+++ b/waf-tools/ndnx.py
@@ -0,0 +1,160 @@
+#! /usr/bin/env python
+# encoding: utf-8
+
+'''
+
+When using this tool, the wscript will look like:
+
+	def options(opt):
+	        opt.tool_options('ndnx')
+
+	def configure(conf):
+		conf.load('compiler_c ndnx')
+
+	def build(bld):
+		bld(source='main.cpp', target='app', use='NDNX')
+
+Options are generated, in order to specify the location of ndnx includes/libraries.
+
+
+'''
+import sys, re
+from waflib import Utils, Logs, Errors, Options, ConfigSet
+from waflib.Configure import conf
+
+NDNX_DIR=['/usr','/usr/local','/opt/local','/sw']
+NDNX_VERSION_FILE='ccn/ccn.h'
+NDNX_VERSION_CODE='''
+#include <ccn/ccn.h>
+#include <stdio.h>
+int main() { printf ("%d.%d.%d", ((CCN_API_VERSION/100000) % 100), ((CCN_API_VERSION/1000) % 100), (CCN_API_VERSION % 1000)); return 0; }
+'''
+
+@conf
+def __ndnx_get_version_file(self,dir):
+	# Logs.pprint ('CYAN', '  + %s/%s/%s' % (dir, 'include', NDNX_VERSION_FILE))
+	try:
+		return self.root.find_dir(dir).find_node('%s/%s' % ('include', NDNX_VERSION_FILE))
+	except:
+		return None
+@conf
+def ndnx_get_version(self,dir):
+	val=self.check_cc(fragment=NDNX_VERSION_CODE,includes=['%s/%s' % (dir, 'include')],execute=True,define_ret = True, mandatory=True)
+	return val
+@conf
+def ndnx_get_root(self,*k,**kw):
+	root=Options.options.ndnx_dir or (k and k[0]) or kw.get('path',None)
+        
+	if root:
+                if self.__ndnx_get_version_file(root):
+                        return root
+		self.fatal('NDNx not found in %s'%root)
+                
+	for dir in NDNX_DIR:
+		if self.__ndnx_get_version_file(dir):
+			return dir
+        self.fatal('NDNx not found, please provide a --ndnx argument (see help)')
+
+@conf
+def check_openssl(self,*k,**kw):
+        root = k and k[0] or kw.get('path',None) or Options.options.openssl
+        mandatory = kw.get('mandatory', True)
+        var = kw.get('var', 'SSL')
+
+        CODE = """
+#include <openssl/crypto.h>
+#include <stdio.h>
+
+int main(int argc, char **argv) {
+	(void)argc;
+        printf ("%s", argv[0]);
+
+	return 0;
+}
+"""
+        if root:
+                testApp = self.check_cc (lib=['ssl', 'crypto'],
+                                         header_name='openssl/crypto.h',
+                                         define_name='HAVE_%s' % var,
+                                         uselib_store=var,
+                                         mandatory = mandatory,
+                                         cflags="-I%s/include" % root,
+                                         linkflags="-L%s/lib" % root,
+                                         execute = True, fragment = CODE, define_ret = True)
+        else:
+                testApp = libcrypto = self.check_cc (lib=['ssl', 'crypto'],
+                                                     header_name='openssl/crypto.h',
+                                                     define_name='HAVE_%s' % var,
+                                                     uselib_store=var,
+                                                     mandatory = mandatory,
+                                                     execute = True, fragment = CODE, define_ret = True)
+
+        if not testApp:
+                return
+
+        self.start_msg ('Checking if selected openssl matches NDNx')
+
+        ndn_var = kw.get('ndn_var', "NDNX")
+        if Utils.unversioned_sys_platform () == "darwin":
+                def otool (binary):
+                        p = Utils.subprocess.Popen (['/usr/bin/otool', '-L', binary], 
+                                                    stdout = Utils.subprocess.PIPE, )
+                        for line in p.communicate()[0].split ('\n'):
+                                if re.match ('.*/libcrypto\..*', line):
+                                        return line
+
+                selected_crypto = otool (testApp)
+                ccnd_crypto = otool ('%s/bin/ccnd' % self.env['%s_ROOT' % ndn_var])
+
+                if ccnd_crypto != selected_crypto:
+                        self.fatal ("Selected openssl does not match used to compile NDNx (%s != %s)" % 
+                                    (selected_crypto.strip (), ccnd_crypto.strip ()))
+                self.end_msg (True)
+
+        elif Utils.unversioned_sys_platform () == "linux" or  Utils.unversioned_sys_platform () == "freebsd":
+                def ldd (binary):
+                        p = Utils.subprocess.Popen (['/usr/bin/ldd', binary], 
+                                                        stdout = Utils.subprocess.PIPE, )
+                        for line in p.communicate()[0].split ('\n'):
+                                if re.match ('libcrypto\..*', line):
+                                        return line
+
+                selected_crypto = ldd (testApp)
+                ccnd_crypto = ldd ('%s/bin/ccnd' % self.env['%s_ROOT' % ndn_var])
+
+                if ccnd_crypto != selected_crypto:
+                        self.fatal ("Selected openssl does not match used to compile NDNx (%s != %s)" % 
+                                    (selected_crypto.strip (), ccnd_crypto.strip ()))
+                self.end_msg (True)
+        else:
+                self.end_msg ("Don't know how to check", 'YELLOW')
+
+@conf
+def check_ndnx(self,*k,**kw):
+	if not self.env['CC']:
+		self.fatal('load a c compiler first, conf.load("compiler_c")')
+
+	var=kw.get('uselib_store', 'NDNX')
+	self.start_msg('Checking for NDNx')
+	root = self.ndnx_get_root(*k,**kw);
+	self.env.NDNX_VERSION=self.ndnx_get_version(root)
+
+	self.env['INCLUDES_%s' % var]= '%s/%s' % (root, "include");
+	self.env['LIB_%s' % var] = "ccn"
+	self.env['LIBPATH_%s' % var] = '%s/%s' % (root, "lib")
+
+        self.env['%s_ROOT' % var] = root
+
+	self.end_msg("%s in %s " % (self.env.NDNX_VERSION, root))
+	if Logs.verbose:
+		Logs.pprint('CYAN','	NDNx include : %s'%self.env['INCLUDES_%s' % var])
+		Logs.pprint('CYAN','	NDNx lib     : %s'%self.env['LIB_%s' % var])
+		Logs.pprint('CYAN','	NDNx libpath : %s'%self.env['LIBPATH_%s' % var])
+
+def options(opt):
+        """
+        NDNx options
+        """
+        ndnopt = opt.add_option_group("NDNx Options")
+	ndnopt.add_option('--ndnx',type='string',default=None,dest='ndnx_dir',help='''path to where NDNx is installed, e.g. /usr/local''')
+        ndnopt.add_option('--openssl',type='string',default='',dest='openssl',help='''path to openssl, should be the same NDNx is compiled against''')
diff --git a/waf-tools/ns3.py b/waf-tools/ns3.py
deleted file mode 100644
index 8a1f33f..0000000
--- a/waf-tools/ns3.py
+++ /dev/null
@@ -1,71 +0,0 @@
-## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-
-import waflib
-from waflib.Configure import conf
-from waflib import Utils,Logs,Errors
-
-@conf
-def _print_optional_features(conf):
-    # Write a summary of optional features status
-    print "---- Summary of optional NS-3 features:"
-    Logs.pprint ('RED', "---- Summary of optional NS-3 features:")
-    # for (name, caption, was_enabled, reason_not_enabled) in conf.env['NS3_OPTIONAL_FEATURES']:
-    #     if was_enabled:
-    #         status = 'enabled'
-    #     else:
-    #         status = 'not enabled (%s)' % reason_not_enabled
-    #     print "%-30s: %s" % (caption, status)
-
-@conf
-def _check_dependencies(conf, required, mandatory):
-    # Logs.pprint ('CYAN', '  + %s' % required)
-    found = []
-    
-    libversion = "optimized"
-    if conf.options.ns3_debug:
-        libversion = "debug"
-    
-    for module in required:
-        retval = conf.check_cfg(package = 'libns3-dev-%s-%s' % (module, libversion),
-                                args='--cflags --libs', mandatory=mandatory,
-                                msg="Checking for ns3-%s" % module,
-                                uselib_store='NS3_%s' % module.upper())
-        # Logs.pprint ('CYAN', 'NS3_%s' % module.upper())
-        if not retval is None:
-            found.append(module)
-    import copy
-    if not 'NS3_MODULES_FOUND' in conf.env:
-        conf.env['NS3_MODULES_FOUND'] = []
-    conf.env['NS3_MODULES_FOUND'] = conf.env['NS3_MODULES_FOUND'] + copy.copy(found)
-
-def modules_uselib(bld, names):
-    return ['NS3_%s' % name.upper() for name in names] + \
-        ['NS3_LIBRARY_%s' % name.upper() for name in names] + \
-        ['NS3_HEADERS_%s' % name.upper() for name in names]
-
-def modules_found(bld, needed):
-    for module in needed:
-        if not module in bld.env['NS3_MODULES_FOUND']:
-            return False
-    return True
-
-@conf
-def check_modules(conf, modules, mandatory = True):
-    import os
-
-    if not 'NS3_CHECK_MODULE_ONCE' in conf.env:
-        conf.env['NS3_CHECK_MODULE_ONCE'] = ''
-
-        conf.check_cfg(atleast_pkgconfig_version='0.0.0')
-
-        if conf.options.log4cxx:
-            conf.env.append_value('DEFINES', 'NS3_LOG_ENABLE')
-
-    conf._check_dependencies(modules, mandatory)
-    conf._print_optional_features
-
-@conf
-def print_ns3_feature_summary(conf):
-    Logs.pprint ('CYAN', "---- Summary of optional NS-3 features:")
-    conf._print_optional_features
-
diff --git a/waf-tools/protobuf.py b/waf-tools/protobuf.py
deleted file mode 100644
index 684a945..0000000
--- a/waf-tools/protobuf.py
+++ /dev/null
@@ -1,72 +0,0 @@
-# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-
-#! /usr/bin/env python
-# encoding: utf-8
-
-'''
-
-When using this tool, the wscript will look like:
-
-def options(opt):
-   opt.tool_options("protobuf", tooldir=["waf-tools"])
-
-def configure(conf):
-   conf.load("compiler_cxx protobuf")
-
-def build(bld):
-   bld(source="main.cpp", target="app", use="PROTOBUF")
-
-Options are generated, in order to specify the location of protobuf includes/libraries.
-
-'''
-
-from waflib import Utils, TaskGen, Task, Logs
-
-from waflib import Utils,Logs,Errors
-from waflib.Configure import conf
-
-def options(opt):
-    pass
-
-def configure(conf):
-    """
-    """
-    conf.check_cfg(package='protobuf', args=['--cflags', '--libs'], uselib_store='PROTOBUF', mandatory=True)
-
-    conf.find_program ('protoc', var='PROTOC', path_list = conf.env['PATH'], mandatory = True)
-
-@TaskGen.extension('.proto')
-def add_proto(self, node):
-    """
-    Compile PROTOBUF protocol specifications
-    """
-    prototask = self.create_task ("protobuf", node, node.change_ext (".pb"))
-    try:
-        self.compiled_tasks.append (prototask)
-    except AttributeError:
-        self.compiled_tasks = [prototask]
-
-class protobuf(Task.Task):
-    """
-    Task for compiling PROTOBUF protocol specifications
-    """
-    run_str = '${PROTOC} --cpp_out ${TGT[0].parent.abspath()} --proto_path ${SRC[0].parent.abspath()} ${SRC[0].abspath()} -o${TGT[0].abspath()}'
-    color   = 'BLUE'
-
-@TaskGen.feature('cxxshlib')
-@TaskGen.before_method('process_source')
-def dynamic_post(self):
-    if not getattr(self, 'dynamic_source', None):
-        return
-    self.source = Utils.to_list(self.source)
-
-    src = self.bld.path.get_bld().ant_glob (Utils.to_list(self.dynamic_source))
-
-    for cc in src:
-        # Signature for the source
-        cc.sig = Utils.h_file (cc.abspath())
-        # Signature for the header
-        h = cc.change_ext (".h")
-        h.sig = Utils.h_file (h.abspath())
-
-    self.source.extend (src)
diff --git a/wscript b/wscript
index a4cea8b..ea47f7f 100644
--- a/wscript
+++ b/wscript
@@ -3,59 +3,42 @@
 VERSION='0.0.1'
 APPNAME='sync'
 
-from waflib import Build, Logs
+from waflib import Configure, Build, Logs
 
 def options(opt):
-    opt.add_option('--debug',action='store_true',default=False,dest='debug',help='''debugging mode''')
-    opt.add_option('--log4cxx', action='store_true',default=False,dest='log4cxx',help='''Compile with log4cxx/native NS3 logging support''')
-    opt.add_option('--ns3',     action='store_true',default=False,dest='ns3_enable',help='''Compile as NS-3 module''')
-    opt.add_option('--ns3-debug', action='store_true',default=False,dest='ns3_debug',help='''Link against debug NS3 libraries. Optimized version will be used otherwise''')
-    opt.add_option('--test', action='store_true',default=False,dest='_test',help='''build unit tests''')
-    opt.load('compiler_c')
-    opt.load('compiler_cxx')
-    opt.load('boost')
-    opt.load('doxygen')
-    opt.load('gnu_dirs')
-    opt.load('ccnx ns3 protobuf', tooldir=["waf-tools"])
+    opt.load('compiler_c compiler_cxx boost doxygen gnu_dirs protoc')
+    opt.load('ndnx', tooldir=["waf-tools"])
+
+    syncopt = opt.add_option_group ("ChronoSync Options")
+
+    syncopt.add_option('--debug',action='store_true',default=False,dest='debug',help='''debugging mode''')
+    syncopt.add_option('--log4cxx', action='store_true',default=False,dest='log4cxx',help='''Compile with log4cxx''')
+    syncopt.add_option('--test', action='store_true',default=False,dest='_test',help='''build unit tests''')
 
 def configure(conf):
-    conf.load("compiler_cxx")
-    conf.load('gnu_dirs')
-
-    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')
-    if not conf.get_define ("HAVE_SSL"):
-        conf.fatal ("Cannot find SSL libraries")
-
-    conf.load('boost')
-
-    if conf.options.ns3_enable:
-        conf.load('ns3')
-        conf.define('NS3_MODULE', 1)
-        conf.check_modules(['core', 'network', 'internet'], mandatory = True)
-        conf.check_modules(['NDNabstraction'], mandatory = True)
-        conf.check_modules(['point-to-point'], mandatory = False)
-        conf.check_modules(['point-to-point-layout'], mandatory = False)
-
-        conf.check_boost(lib='system iostreams thread')
-        conf.define ('NS3_LOG_ENABLE', 1)
-    else:
-        conf.check_boost(lib='system iostreams test thread')
-
-        conf.load ('ccnx')
-        conf.check_ccnx (path=conf.options.ccnx_dir)
-
-        if conf.options.log4cxx:
-            conf.check_cfg(package='liblog4cxx', args=['--cflags', '--libs'], uselib_store='LOG4CXX', mandatory=True)
+    conf.load('compiler_c compiler_cxx gnu_dirs boost')
+    conf.load('ndnx')
 
     if conf.options.debug:
         conf.define ('_DEBUG', 1)
-        conf.env.append_value('CXXFLAGS', ['-O0', '-g3'])
+        conf.add_supported_cxxflags (cxxflags = ['-O0',
+                                                 '-Wall',
+                                                 '-Wno-unused-variable',
+                                                 '-g3',
+                                                 '-Wno-unused-private-field', # only clang supports
+                                                 '-fcolor-diagnostics',       # only clang supports
+                                                 '-Qunused-arguments'         # only clang supports
+                                                 ])
     else:
-        conf.env.append_value('CXXFLAGS', ['-O3', '-g'])
+        conf.add_supported_cxxflags (cxxflags = ['-O3', '-g'])
+
+    conf.check_ndnx ()
+    conf.check_openssl ()
+
+    conf.check_boost(lib='system iostreams test thread')
+
+    if conf.options.log4cxx:
+        conf.check_cfg(package='liblog4cxx', args=['--cflags', '--libs'], uselib_store='LOG4CXX', mandatory=True)
 
     if conf.options._test:
       conf.define('_TEST', 1)
@@ -65,134 +48,45 @@
     except:
         pass
 
-    conf.load('protobuf')
+    conf.load('protoc')
 
 def build (bld):
-    bld.post_mode = Build.POST_LAZY
-
-    bld.add_group ("protobuf")
-
-    x = bld (
-        features = ["protobuf"],
-        source = ["model/sync-state.proto"],
-        target = ["model/sync-state.pb"],
+    libsync = bld (
+        target=APPNAME,
+        features=['cxx', 'cxxshlib'],
+        source =  ant_glob (['src/**/*.cc', 'src/**/*.proto']),
+        use = 'BOOST BOOST_IOSTREAMS BOOST_THREAD SSL NDNX',
+        includes = ['include', 'src'],
         )
+    
+    # Unit tests
+    if bld.get_define("_TEST"):
+      unittests = bld.program (
+          target="unit-tests",
+          source = bld.path.ant_glob(['tests/**/*.cc']),
+          features=['cxx', 'cxxprogram'],
+          use = 'BOOST_TEST sync',
+          includes = ['include', 'src'],
+          )
 
-    bld.add_group ("code")
-
-    if bld.get_define ("NS3_MODULE"):
-        libsync = bld.shlib (
-            target = "sync-ns3",
-            features=['cxx', 'cxxshlib'],
-            source =  [
-                'ns3/sync-ccnx-wrapper.cc',
-                'ns3/sync-ns3-name-info.cc',
-                'ns3/sync-scheduler.cc',
-                'ns3/sync-logic-helper.cc',
-                
-                # 'model/sync-app-data-fetch.cc',
-                # 'model/sync-app-data-publish.cc',
-                # 'ns3/sync-app.cc',
-
-                'model/sync-diff-leaf.cc',
-                'model/sync-diff-state.cc',
-                'model/sync-digest.cc',
-                'model/sync-full-leaf.cc',
-                'model/sync-full-state.cc',
-                'model/sync-interest-table.cc',
-                'model/sync-leaf.cc',
-                'model/sync-logic.cc',
-                'model/sync-name-info.cc',
-                'model/sync-seq-no.cc',
-                'model/sync-state.cc',
-                'model/sync-std-name-info.cc',
-                ],
-            dynamic_source = [
-                'model/sync-state.pb.cc',
-                ],
-            use = 'BOOST BOOST_IOSTREAMS SSL PROTOBUF ' + ' '.join (['ns3_'+dep for dep in ['core', 'network', 'internet', 'NDNabstraction']]).upper (),
-            includes = ['include', 'model', 'include/ns3', 'helper'],
-            )
-
-        example = bld.program (
-            target = "sync-example",
-            features=['cxx', 'cxxprogram'],
-            source = ['examples/sync-example.cc'],
-            use = 'libsync',
-            includes = ['include', 'model', 'include/ns3', 'helper'],
-            )
-
-        sync_eval = bld.program (
-            target = "sync-eval",
-            features=['cxx', 'cxxprogram'],
-            source = ['evaluation/sync-eval.cc',
-                      'evaluation/standard-muc.cc',
-                      'evaluation/sync-muc.cc',
-                      ],
-            use = 'libsync',
-            includes = ['include', 'model', 'include/ns3', 'helper'],
-            )
-        # from waflib import Utils,Logs,Errors
-        # Logs.pprint ('CYAN', program.use)
-        
-    else:
-        libsync = bld (
-            target=APPNAME,
-            features=['cxx', 'cxxshlib'],
-            source =  [
-                'ccnx/sync-ccnx-wrapper.cc',
-                'ccnx/sync-scheduler.cc',
-                'ccnx/sync-log.cc',
-                'ccnx/sync-app-socket-c.cc',
-                'ccnx/sync-app-socket.cc',
-                'model/sync-diff-leaf.cc',
-                'model/sync-diff-state.cc',
-                'model/sync-digest.cc',
-                'model/sync-full-leaf.cc',
-                'model/sync-full-state.cc',
-                'model/sync-interest-table.cc',
-                'model/sync-leaf.cc',
-                'model/sync-logic.cc',
-                'model/sync-name-info.cc',
-                'model/sync-seq-no.cc',
-                'model/sync-state.cc',
-                'model/sync-std-name-info.cc',
-                ],
-            dynamic_source = [
-                'model/sync-state.pb.cc',
-                ],
-            use = 'BOOST BOOST_IOSTREAMS BOOST_THREAD SSL PROTOBUF CCNX',
-            includes = ['include', 'model', 'helper'],
-            )
-        
-        # Unit tests
+    if bld.get_define ("HAVE_LOG4CXX"):
+        libsync.use += ' LOG4CXX'
         if bld.get_define("_TEST"):
-          unittests = bld.program (
-              target="unit-tests",
-              source = bld.path.ant_glob(['test/**/*.cc']),
-              features=['cxx', 'cxxprogram'],
-              use = 'BOOST_TEST sync',
-              includes = ['include', 'model', 'helper'],
-              )
+            unittests.use += ' LOG4CXX'
 
-        if bld.get_define ("HAVE_LOG4CXX"):
-            libsync.use += ' LOG4CXX'
-            if bld.get_define("_TEST"):
-                unittests.use += ' LOG4CXX'
+    headers = bld.path.ant_glob(['include/*.h'])
+    headers.extend (bld.path.get_bld().ant_glob(['model/sync-state.pb.h']))
+    bld.install_files ("%s/sync" % bld.env['INCLUDEDIR'], headers)
 
-        headers = bld.path.ant_glob(['include/*.h'])
-        headers.extend (bld.path.get_bld().ant_glob(['model/sync-state.pb.h']))
-        bld.install_files ("%s/sync" % bld.env['INCLUDEDIR'], headers)
-
-        pc = bld (
-            features = "subst",
-            source='libsync.pc.in',
-            target='libsync.pc',
-            install_path = '${LIBDIR}/pkgconfig',
-            PREFIX       = bld.env['PREFIX'],
-            INCLUDEDIR   = "%s/sync" % bld.env['INCLUDEDIR'],
-            VERSION      = VERSION,
-            )
+    pc = bld (
+        features = "subst",
+        source='libsync.pc.in',
+        target='libsync.pc',
+        install_path = '${LIBDIR}/pkgconfig',
+        PREFIX       = bld.env['PREFIX'],
+        INCLUDEDIR   = "%s/sync" % bld.env['INCLUDEDIR'],
+        VERSION      = VERSION,
+        )
 
 # doxygen docs
 from waflib.Build import BuildContext
@@ -206,3 +100,18 @@
     bld (features="doxygen",
          doxyfile='doc/doxygen.conf',
          output_dir = 'doc')
+
+@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
