Move config.hpp and a few more private headers to a 'detail' subdir
Also upgrade waf to version 2.0.21
Change-Id: Id290b8336c607fb3939f2ab96dd066dae9810c1e
diff --git a/src/detail/bzip2-helper.cpp b/src/detail/bzip2-helper.cpp
new file mode 100644
index 0000000..0784b7f
--- /dev/null
+++ b/src/detail/bzip2-helper.cpp
@@ -0,0 +1,59 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2012-2021 University of California, Los Angeles
+ *
+ * This file is part of ChronoSync, synchronization library for distributed realtime
+ * applications for NDN.
+ *
+ * ChronoSync is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * ChronoSync 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
+ * ChronoSync, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "detail/bzip2-helper.hpp"
+
+#include <boost/iostreams/filtering_stream.hpp>
+#include <boost/iostreams/detail/iostream.hpp>
+#include <boost/iostreams/filter/bzip2.hpp>
+#include <boost/iostreams/copy.hpp>
+
+#include <ndn-cxx/encoding/buffer-stream.hpp>
+
+namespace chronosync {
+namespace bzip2 {
+
+namespace bio = boost::iostreams;
+
+std::shared_ptr<ndn::Buffer>
+compress(const char* buffer, size_t bufferSize)
+{
+ ndn::OBufferStream os;
+ bio::filtering_stream<bio::output> out;
+ out.push(bio::bzip2_compressor());
+ out.push(os);
+ bio::stream<bio::array_source> in(reinterpret_cast<const char*>(buffer), bufferSize);
+ bio::copy(in, out);
+ return os.buf();
+}
+
+std::shared_ptr<ndn::Buffer>
+decompress(const char* buffer, size_t bufferSize)
+{
+ ndn::OBufferStream os;
+ bio::filtering_stream<bio::output> out;
+ out.push(bio::bzip2_decompressor());
+ out.push(os);
+ bio::stream<bio::array_source> in(reinterpret_cast<const char*>(buffer), bufferSize);
+ bio::copy(in, out);
+ return os.buf();
+}
+
+} // namespace bzip2
+} // namespace chronosync
diff --git a/src/detail/bzip2-helper.hpp b/src/detail/bzip2-helper.hpp
new file mode 100644
index 0000000..47ff5ac
--- /dev/null
+++ b/src/detail/bzip2-helper.hpp
@@ -0,0 +1,43 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2012-2021 University of California, Los Angeles
+ *
+ * This file is part of ChronoSync, synchronization library for distributed realtime
+ * applications for NDN.
+ *
+ * ChronoSync is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * ChronoSync 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
+ * ChronoSync, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef CHRONOSYNC_DETAIL_BZIP2_HELPER_HPP
+#define CHRONOSYNC_DETAIL_BZIP2_HELPER_HPP
+
+#include <ndn-cxx/encoding/buffer.hpp>
+
+namespace chronosync {
+namespace bzip2 {
+
+/**
+ * @brief Compress @p buffer of size @p bufferSize with bzip2
+ */
+std::shared_ptr<ndn::Buffer>
+compress(const char* buffer, size_t bufferSize);
+
+/**
+ * @brief Decompress buffer @p buffer of size @p bufferSize with bzip2
+ */
+std::shared_ptr<ndn::Buffer>
+decompress(const char* buffer, size_t bufferSize);
+
+} // namespace bzip2
+} // namespace chronosync
+
+#endif // CHRONOSYNC_DETAIL_BZIP2_HELPER_HPP
diff --git a/src/detail/common.hpp b/src/detail/common.hpp
new file mode 100644
index 0000000..4e9e4cd
--- /dev/null
+++ b/src/detail/common.hpp
@@ -0,0 +1,96 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2012-2021 University of California, Los Angeles
+ *
+ * This file is part of ChronoSync, synchronization library for distributed realtime
+ * applications for NDN.
+ *
+ * ChronoSync is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * ChronoSync 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
+ * ChronoSync, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
+ * @author Yingdi Yu <yingdi@cs.ucla.edu>
+ */
+
+#ifndef CHRONOSYNC_DETAIL_COMMON_HPP
+#define CHRONOSYNC_DETAIL_COMMON_HPP
+
+#include "detail/config.hpp"
+
+#ifdef CHRONOSYNC_WITH_TESTS
+#define CHRONOSYNC_VIRTUAL_WITH_TESTS virtual
+#define CHRONOSYNC_PUBLIC_WITH_TESTS_ELSE_PROTECTED public
+#define CHRONOSYNC_PUBLIC_WITH_TESTS_ELSE_PRIVATE public
+#define CHRONOSYNC_PROTECTED_WITH_TESTS_ELSE_PRIVATE protected
+#else
+#define CHRONOSYNC_VIRTUAL_WITH_TESTS
+#define CHRONOSYNC_PUBLIC_WITH_TESTS_ELSE_PROTECTED protected
+#define CHRONOSYNC_PUBLIC_WITH_TESTS_ELSE_PRIVATE private
+#define CHRONOSYNC_PROTECTED_WITH_TESTS_ELSE_PRIVATE private
+#endif
+
+#include <cstddef>
+#include <list>
+#include <queue>
+#include <set>
+#include <vector>
+#include <tuple>
+
+#include <ndn-cxx/data.hpp>
+#include <ndn-cxx/face.hpp>
+#include <ndn-cxx/interest.hpp>
+#include <ndn-cxx/security/key-chain.hpp>
+#include <ndn-cxx/security/signing-helpers.hpp>
+#include <ndn-cxx/security/validator.hpp>
+#include <ndn-cxx/security/validator-config.hpp>
+#include <ndn-cxx/util/scheduler.hpp>
+#include <ndn-cxx/util/time.hpp>
+
+#include <boost/algorithm/string.hpp>
+#include <boost/asio.hpp>
+#include <boost/assert.hpp>
+#include <boost/core/noncopyable.hpp>
+#include <boost/lexical_cast.hpp>
+
+namespace chronosync {
+
+using std::size_t;
+
+using boost::noncopyable;
+
+using std::bind;
+using std::cref;
+using std::function;
+using std::make_shared;
+using std::make_tuple;
+using std::ref;
+using std::shared_ptr;
+
+using ndn::Block;
+using ndn::ConstBufferPtr;
+using ndn::Data;
+using ndn::Interest;
+using ndn::Name;
+using ndn::security::ValidationError;
+using ndn::security::Validator;
+
+namespace tlv {
+using namespace ndn::tlv;
+} // namespace tlv
+
+namespace name = ndn::name;
+namespace time = ndn::time;
+namespace security = ndn::security;
+namespace encoding = ndn::encoding;
+
+} // namespace chronosync
+
+#endif // CHRONOSYNC_DETAIL_COMMON_HPP
diff --git a/src/detail/mi-tag.hpp b/src/detail/mi-tag.hpp
new file mode 100644
index 0000000..a64195e
--- /dev/null
+++ b/src/detail/mi-tag.hpp
@@ -0,0 +1,45 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2012-2021 University of California, Los Angeles
+ *
+ * This file is part of ChronoSync, synchronization library for distributed realtime
+ * applications for NDN.
+ *
+ * ChronoSync is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * ChronoSync 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
+ * ChronoSync, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @author Zhenkai Zhu <http://irl.cs.ucla.edu/~zhenkai/>
+ * @author Chaoyi Bian <bcy@pku.edu.cn>
+ * @author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
+ * @author Yingdi Yu <yingdi@cs.ucla.edu>
+ */
+
+#ifndef CHRONOSYNC_DETAIL_MI_TAG_HPP
+#define CHRONOSYNC_DETAIL_MI_TAG_HPP
+
+namespace chronosync {
+
+// Multi-Index-Container Tags
+struct hashed
+{
+};
+
+struct ordered
+{
+};
+
+struct sequenced
+{
+};
+
+} // namespace chronosync
+
+#endif // CHRONOSYNC_DETAIL_MI_TAG_HPP