jni: Upgrade underlying NFD to version 0.6.2-11-gd657d53
This change replaces in-project JNI compilation of ndn-cxx and NFD with
packaged versions of ndn-cxx and NFD using a customized
android-crew-staging (https://github.com/named-data-mobile/android-crew-staging).
Refer to README-dev.md for more detail.
This commit also drops Logcat views
Refs: #4661
Change-Id: Id981689475d9da3aea63bea38d925f335c25b46e
diff --git a/app/src/main/jni/Android.mk b/app/src/main/jni/Android.mk
index 762c358..9310d31 100644
--- a/app/src/main/jni/Android.mk
+++ b/app/src/main/jni/Android.mk
@@ -4,9 +4,9 @@
include $(CLEAR_VARS)
LOCAL_MODULE := nfd-wrapper
LOCAL_SRC_FILES := nfd-wrapper.cpp
-LOCAL_SHARED_LIBRARIES := nfd-daemon ndn-cxx boost_system_shared boost_thread_shared
+LOCAL_SHARED_LIBRARIES := nfd_shared ndn_cxx_shared boost_system_shared boost_thread_shared boost_log_shared
LOCAL_LDLIBS := -llog -latomic
+LOCAL_CFLAGS := -DBOOST_LOG_DYN_LINK=1
include $(BUILD_SHARED_LIBRARY)
-include $(LOCAL_PATH_SAVED)/ndn-cxx.mk
-include $(LOCAL_PATH_SAVED)/nfd.mk
+$(call import-module,../packages/nfd/0.6.2-11-gd657d53)
diff --git a/app/src/main/jni/Application.mk b/app/src/main/jni/Application.mk
index 793e7c4..b0e4094 100644
--- a/app/src/main/jni/Application.mk
+++ b/app/src/main/jni/Application.mk
@@ -1,8 +1,8 @@
APP_ABI := armeabi-v7a arm64-v8a x86 x86_64
-APP_STL := gnustl_shared
-APP_CPPFLAGS += -fexceptions -frtti -std=c++11
+APP_STL := c++_shared
+APP_CPPFLAGS += -fexceptions -frtti -std=c++14
# -Wno-deprecated-declarations
-NDK_TOOLCHAIN_VERSION := 4.9
+NDK_TOOLCHAIN_VERSION := clang
APP_PLATFORM := android-23
diff --git a/app/src/main/jni/NFD b/app/src/main/jni/NFD
deleted file mode 160000
index e5abc94..0000000
--- a/app/src/main/jni/NFD
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit e5abc94540a8987ab8c2fc83f28d6073e2be0b96
diff --git a/app/src/main/jni/ndn-cxx b/app/src/main/jni/ndn-cxx
deleted file mode 160000
index f2e7a03..0000000
--- a/app/src/main/jni/ndn-cxx
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit f2e7a0391eed1670691c1e0a7c644bc2430bb01c
diff --git a/app/src/main/jni/ndn-cxx-android/ndn-cxx-config.hpp b/app/src/main/jni/ndn-cxx-android/ndn-cxx-config.hpp
deleted file mode 100644
index e79c69d..0000000
--- a/app/src/main/jni/ndn-cxx-android/ndn-cxx-config.hpp
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef W_SRC_NDN_CXX_CONFIG_HPP_WAF
-#define W_SRC_NDN_CXX_CONFIG_HPP_WAF
-
-// Uncomment this after switch to clang/libc++
-// #define NDN_CXX_HAVE_STD_TO_STRING 1
-
-#define NDN_CXX_HAVE_VECTOR_INSERT_ERASE_CONST_ITERATOR 1
-#define NDN_CXX_HAVE_IS_DEFAULT_CONSTRUCTIBLE 1
-#define NDN_CXX_HAVE_IS_NOTHROW_MOVE_CONSTRUCTIBLE 1
-#define NDN_CXX_HAVE_IS_NOTHROW_MOVE_ASSIGNABLE 1
-#define NDN_CXX_HAVE_PTHREAD 1
-#define NDN_CXX_HAVE_RT 1
-#define NDN_CXX_HAVE_RTNETLINK 1
-#define NDN_CXX_HAVE_SQLITE3 1
-#define NDN_CXX_HAVE_OPENSSL 1
-#define NDN_CXX_SYSCONFDIR "./etc"
-#define NDN_CXX_NDEBUG 1
-#define NDEBUG 1
-#define HAVE_NDN_CXX_CUSTOM_LOGGER 1
-
-#endif /* W_SRC_NDN_CXX_CONFIG_HPP_WAF */
diff --git a/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logger.cpp b/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logger.cpp
deleted file mode 100644
index 41cae15..0000000
--- a/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logger.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2016 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library 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 Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "ndn-cxx-custom-logger.hpp"
-#include "ndn-cxx-custom-logging.hpp"
-
-#include <cinttypes>
-#include <stdio.h>
-#include <type_traits>
-
-namespace ndn {
-namespace util {
-
-std::ostream&
-operator<<(std::ostream& os, LogLevel level)
-{
- switch (level) {
- case LogLevel::FATAL:
- return os << "FATAL";
- case LogLevel::NONE:
- return os << "NONE";
- case LogLevel::ERROR:
- return os << "ERROR";
- case LogLevel::WARN:
- return os << "WARN";
- case LogLevel::INFO:
- return os << "INFO";
- case LogLevel::DEBUG:
- return os << "DEBUG";
- case LogLevel::TRACE:
- return os << "TRACE";
- case LogLevel::ALL:
- return os << "ALL";
- }
-
- BOOST_THROW_EXCEPTION(std::invalid_argument("unknown log level " + to_string(static_cast<int>(level))));
-}
-
-LogLevel
-parseLogLevel(const std::string& s)
-{
- if (s == "FATAL")
- return LogLevel::FATAL;
- else if (s == "NONE")
- return LogLevel::NONE;
- else if (s == "ERROR")
- return LogLevel::ERROR;
- else if (s == "WARN")
- return LogLevel::WARN;
- else if (s == "INFO")
- return LogLevel::INFO;
- else if (s == "DEBUG")
- return LogLevel::DEBUG;
- else if (s == "TRACE")
- return LogLevel::TRACE;
- else if (s == "ALL")
- return LogLevel::ALL;
-
- BOOST_THROW_EXCEPTION(std::invalid_argument("unrecognized log level '" + s + "'"));
-}
-
-Logger::Logger(const std::string& name)
- : m_moduleName(name)
-{
- this->setLevel(LogLevel::NONE);
- Logging::addLogger(*this);
-}
-
-} // namespace util
-} // namespace ndn
diff --git a/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logger.hpp b/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logger.hpp
deleted file mode 100644
index c8595fe..0000000
--- a/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logger.hpp
+++ /dev/null
@@ -1,122 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library 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 Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#ifndef NFD_ANDROID_NDN_CXX_ANDROID_NDN_CXX_CUSTOM_LOGGER_HPP
-#define NFD_ANDROID_NDN_CXX_ANDROID_NDN_CXX_CUSTOM_LOGGER_HPP
-
-#include "common.hpp"
-#include <sstream>
-#include <atomic>
-#include <android/log.h>
-
-namespace ndn {
-namespace util {
-
-/** \brief indicates the severity level of a log message
- */
-enum class LogLevel {
- FATAL = -1, ///< fatal (will be logged unconditionally)
- NONE = 0, ///< no messages
- ERROR = 1, ///< serious error messages
- WARN = 2, ///< warning messages
- INFO = 3, ///< informational messages
- DEBUG = 4, ///< debug messages
- TRACE = 5, ///< trace messages (most verbose)
- ALL = 255 ///< all messages
-};
-
-/** \brief output LogLevel as string
- * \throw std::invalid_argument unknown \p level
- */
-std::ostream&
-operator<<(std::ostream& os, LogLevel level);
-
-/** \brief parse LogLevel from string
- * \throw std::invalid_argument unknown level name
- */
-LogLevel
-parseLogLevel(const std::string& s);
-
-/** \brief represents a logger in logging facility
- * \note User should declare a new logger with \p NDN_LOG_INIT macro.
- */
-class Logger
-{
-public:
- explicit
- Logger(const std::string& name);
-
- const std::string&
- getModuleName() const
- {
- return m_moduleName;
- }
-
- bool
- isLevelEnabled(LogLevel level) const
- {
- return m_currentLevel.load(std::memory_order_relaxed) >= level;
- }
-
- void
- setLevel(LogLevel level)
- {
- m_currentLevel.store(level, std::memory_order_relaxed);
- }
-
-private:
- const std::string m_moduleName;
- std::atomic<LogLevel> m_currentLevel;
-};
-
-/** \brief declare a log module
- */
-#define NDN_LOG_INIT(name) \
- namespace { \
- inline ::ndn::util::Logger& getNdnCxxLogger() \
- { \
- static ::ndn::util::Logger logger(BOOST_STRINGIZE(name)); \
- return logger; \
- } \
- } \
- struct ndn_cxx__allow_trailing_semicolon
-
-#define NDN_LOG(level, androidLevel, msg, expression) \
- do { \
- if (getNdnCxxLogger().isLevelEnabled(::ndn::util::LogLevel::level)) { \
- std::ostringstream os; \
- os << expression; \
- __android_log_print(ANDROID_LOG_##androidLevel, \
- getNdnCxxLogger().getModuleName().c_str(), "%s", os.str().c_str()); \
- } \
- } while (false)
-
-#define NDN_LOG_TRACE(expression) NDN_LOG(TRACE, VERBOSE, TRACE, expression)
-#define NDN_LOG_DEBUG(expression) NDN_LOG(DEBUG, DEBUG, DEBUG, expression)
-#define NDN_LOG_INFO(expression) NDN_LOG(INFO, INFO, INFO, expression)
-#define NDN_LOG_WARN(expression) NDN_LOG(WARN, WARN, WARNING, expression)
-#define NDN_LOG_ERROR(expression) NDN_LOG(ERROR, ERROR, ERROR, expression)
-#define NDN_LOG_FATAL(expression) NDN_LOG(FATAL, FATAL, FATAL, expression)
-
-} // namespace util
-} // namespace ndn
-
-#endif // NFD_ANDROID_NDN_CXX_ANDROID_NDN_CXX_CUSTOM_LOGGER_HPP
diff --git a/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logging.cpp b/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logging.cpp
deleted file mode 100644
index 845d412..0000000
--- a/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logging.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2016 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library 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 Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "ndn-cxx-custom-logging.hpp"
-#include "ndn-cxx-custom-logger.hpp"
-
-#include <cstdlib>
-#include <sstream>
-
-namespace ndn {
-namespace util {
-
-static const LogLevel INITIAL_DEFAULT_LEVEL = LogLevel::NONE;
-
-Logging&
-Logging::get()
-{
- // Initialization of block-scope variables with static storage duration is thread-safe.
- // See ISO C++ standard [stmt.dcl]/4
- static Logging instance;
- return instance;
-}
-
-Logging::Logging()
-{
-}
-
-void
-Logging::addLoggerImpl(Logger& logger)
-{
- std::lock_guard<std::mutex> lock(m_mutex);
-
- const std::string& moduleName = logger.getModuleName();
- m_loggers.insert({moduleName, &logger});
-
- auto levelIt = m_enabledLevel.find(moduleName);
- if (levelIt == m_enabledLevel.end()) {
- levelIt = m_enabledLevel.find("*");
- }
- LogLevel level = levelIt == m_enabledLevel.end() ? INITIAL_DEFAULT_LEVEL : levelIt->second;
- logger.setLevel(level);
-}
-
-void
-Logging::setLevelImpl(const std::string& moduleName, LogLevel level)
-{
- std::lock_guard<std::mutex> lock(m_mutex);
-
- if (moduleName == "*") {
- this->setDefaultLevel(level);
- return;
- }
-
- m_enabledLevel[moduleName] = level;
- auto range = m_loggers.equal_range(moduleName);
- for (auto i = range.first; i != range.second; ++i) {
- i->second->setLevel(level);
- }
-}
-
-void
-Logging::setDefaultLevel(LogLevel level)
-{
- m_enabledLevel.clear();
- m_enabledLevel["*"] = level;
-
- for (auto i = m_loggers.begin(); i != m_loggers.end(); ++i) {
- i->second->setLevel(level);
- }
-}
-
-void
-Logging::setLevelImpl(const std::string& config)
-{
- std::stringstream ss(config);
- std::string configModule;
- while (std::getline(ss, configModule, ':')) {
- size_t ind = configModule.find('=');
- if (ind == std::string::npos) {
- BOOST_THROW_EXCEPTION(std::invalid_argument("malformed logging config: '=' is missing"));
- }
-
- std::string moduleName = configModule.substr(0, ind);
- LogLevel level = parseLogLevel(configModule.substr(ind+1));
-
- this->setLevelImpl(moduleName, level);
- }
-}
-
-} // namespace util
-} // namespace ndn
diff --git a/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logging.hpp b/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logging.hpp
deleted file mode 100644
index b59b927..0000000
--- a/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logging.hpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2016 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library 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 Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#ifndef NFD_ANDROID_NDN_CXX_ANDROID_NDN_CXX_CUSTOM_LOGGING_HPP
-#define NFD_ANDROID_NDN_CXX_ANDROID_NDN_CXX_CUSTOM_LOGGING_HPP
-
-#include "common.hpp"
-
-#include <mutex>
-#include <unordered_map>
-
-namespace ndn {
-namespace util {
-
-enum class LogLevel;
-class Logger;
-
-/** \brief controls the logging facility
- *
- * \note Public static methods are thread safe.
- * Non-public methods are not guaranteed to be thread safe.
- */
-class Logging : noncopyable
-{
-public:
- /** \brief register a new logger
- * \note App should declare a new logger with \p NDN_LOG_INIT macro.
- */
- static void
- addLogger(Logger& logger);
-
- /** \brief set severity level
- * \param moduleName logger name, or "*" for default level
- * \param level minimum severity level
- *
- * Log messages are output only if its severity is greater than the set minimum severity level.
- * Initial default severity level is \p LogLevel::NONE which enables FATAL only.
- *
- * Changing the default level overwrites individual settings.
- */
- static void
- setLevel(const std::string& moduleName, LogLevel level);
-
- /** \brief set severity levels with a config string
- * \param config colon-separate key=value pairs
- * \throw std::invalid_argument config string is malformed
- *
- * \code
- * Logging::setSeverityLevels("*=INFO:Face=DEBUG:NfdController=WARN");
- * \endcode
- * is equivalent to
- * \code
- * Logging::setSeverityLevel("*", LogLevel::INFO);
- * Logging::setSeverityLevel("Face", LogLevel::DEBUG);
- * Logging::setSeverityLevel("NfdController", LogLevel::WARN);
- * \endcode
- */
- static void
- setLevel(const std::string& config);
-
-private:
- Logging();
-
- void
- addLoggerImpl(Logger& logger);
-
- void
- setLevelImpl(const std::string& moduleName, LogLevel level);
-
- void
- setDefaultLevel(LogLevel level);
-
- void
- setLevelImpl(const std::string& config);
-
-NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
- static Logging&
- get();
-
-private:
- std::mutex m_mutex;
- std::unordered_map<std::string, LogLevel> m_enabledLevel; ///< moduleName => minimum level
- std::unordered_multimap<std::string, Logger*> m_loggers; ///< moduleName => logger
-};
-
-inline void
-Logging::addLogger(Logger& logger)
-{
- get().addLoggerImpl(logger);
-}
-
-inline void
-Logging::setLevel(const std::string& moduleName, LogLevel level)
-{
- get().setLevelImpl(moduleName, level);
-}
-
-inline void
-Logging::setLevel(const std::string& config)
-{
- get().setLevelImpl(config);
-}
-
-
-} // namespace util
-} // namespace ndn
-
-#endif // NFD_ANDROID_NDN_CXX_ANDROID_NDN_CXX_CUSTOM_LOGGING_HPP
diff --git a/app/src/main/jni/ndn-cxx-android/version.hpp b/app/src/main/jni/ndn-cxx-android/version.hpp
deleted file mode 100644
index 4ab8d5d..0000000
--- a/app/src/main/jni/ndn-cxx-android/version.hpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library 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 Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#ifndef NDN_VERSION_HPP
-#define NDN_VERSION_HPP
-
-namespace ndn {
-
-/** ndn-cxx version follows Semantic Versioning 2.0.0 specification
- * http://semver.org/
- */
-
-/** \brief ndn-cxx version represented as an integer
- *
- * MAJOR*1000000 + MINOR*1000 + PATCH
- */
-#define NDN_CXX_VERSION 6000
-
-/** \brief ndn-cxx version represented as a string
- *
- * MAJOR.MINOR.PATCH
- */
-#define NDN_CXX_VERSION_STRING "0.6.0"
-
-/** \brief ndn-cxx version string, including git commit information, if ndn-cxx is build from
- * specific git commit
- *
- * NDN_CXX_VERSION_BUILD_STRING is obtained using the following command (`ndn-cxx-` prefix is
- * afterwards removed):
- *
- * `git describe --match 'ndn-cxx-*'`
- *
- * When ndn-cxx is built not from git, NDN_CXX_VERSION_BUILD_STRING equals NDN_CXX_VERSION_STRING
- *
- * MAJOR.MINOR.PATCH(-release-candidate-tag)(-(number-of-commits-since-tag)-COMMIT-HASH)
- *
- * Example, 0.1.0-rc1-1-g5c86570
- */
-#define NDN_CXX_VERSION_BUILD_STRING "0.6.0"
-
-/// MAJOR version
-#define NDN_CXX_VERSION_MAJOR 0
-/// MINOR version
-#define NDN_CXX_VERSION_MINOR 6
-/// PATCH version
-#define NDN_CXX_VERSION_PATCH 0
-
-} // namespace ndn
-
-#endif // NDN_VERSION_HPP
diff --git a/app/src/main/jni/ndn-cxx.mk b/app/src/main/jni/ndn-cxx.mk
deleted file mode 100644
index d12a5b6..0000000
--- a/app/src/main/jni/ndn-cxx.mk
+++ /dev/null
@@ -1,173 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-LOCAL_PATH_SAVED := $(LOCAL_PATH)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := ndn-cxx
-NDN_CXX_BOOST_LIBS = system filesystem date_time iostreams program_options chrono random
-LOCAL_SHARED_LIBRARIES := libcrypto_shared libssl_shared $(addsuffix _shared,$(addprefix boost_,$(NDN_CXX_BOOST_LIBS)))
-LOCAL_STATIC_LIBRARIES := sqlite3_static boost_regex_static
-NDN_CXX_SRC_FILES := \
- data.cpp \
- delegation-list.cpp \
- delegation.cpp \
- encoding/block-helpers.cpp \
- encoding/block.cpp \
- encoding/buffer-stream.cpp \
- encoding/buffer.cpp \
- encoding/encoder.cpp \
- encoding/estimator.cpp \
- encoding/nfd-constants.cpp \
- encoding/tlv.cpp \
- exclude.cpp \
- face.cpp \
- ims/in-memory-storage-entry.cpp \
- ims/in-memory-storage-fifo.cpp \
- ims/in-memory-storage-lfu.cpp \
- ims/in-memory-storage-lru.cpp \
- ims/in-memory-storage-persistent.cpp \
- ims/in-memory-storage.cpp \
- interest-filter.cpp \
- interest.cpp \
- key-locator.cpp \
- link.cpp \
- lp/cache-policy.cpp \
- lp/nack-header.cpp \
- lp/nack.cpp \
- lp/packet.cpp \
- meta-info.cpp \
- mgmt/control-response.cpp \
- mgmt/dispatcher.cpp \
- mgmt/nfd/channel-status.cpp \
- mgmt/nfd/command-options.cpp \
- mgmt/nfd/control-command.cpp \
- mgmt/nfd/control-parameters.cpp \
- mgmt/nfd/controller.cpp \
- mgmt/nfd/face-event-notification.cpp \
- mgmt/nfd/face-monitor.cpp \
- mgmt/nfd/face-query-filter.cpp \
- mgmt/nfd/face-status.cpp \
- mgmt/nfd/fib-entry.cpp \
- mgmt/nfd/forwarder-status.cpp \
- mgmt/nfd/rib-entry.cpp \
- mgmt/nfd/status-dataset.cpp \
- mgmt/nfd/strategy-choice.cpp \
- mgmt/status-dataset-context.cpp \
- name-component.cpp \
- name.cpp \
- net/address-converter.cpp \
- net/detail/link-type-helper.cpp \
- net/detail/linux-if-constants.cpp \
- net/detail/network-monitor-impl-rtnl.cpp \
- net/dns.cpp \
- net/ethernet.cpp \
- net/face-uri.cpp \
- net/network-address.cpp \
- net/network-interface.cpp \
- net/network-monitor-stub.cpp \
- net/network-monitor.cpp \
- packet-base.cpp \
- security/command-interest-signer.cpp \
- security/detail/openssl-helper.cpp \
- security/digest-sha256.cpp \
- security/key-params.cpp \
- security/pib/certificate-container.cpp \
- security/pib/detail/identity-impl.cpp \
- security/pib/detail/key-impl.cpp \
- security/pib/identity-container.cpp \
- security/pib/identity.cpp \
- security/pib/key-container.cpp \
- security/pib/key.cpp \
- security/pib/pib-memory.cpp \
- security/pib/pib-sqlite3.cpp \
- security/pib/pib.cpp \
- security/safe-bag.cpp \
- security/security-common.cpp \
- security/signature-sha256-with-ecdsa.cpp \
- security/signature-sha256-with-rsa.cpp \
- security/signing-helpers.cpp \
- security/signing-info.cpp \
- security/tpm/back-end-file.cpp \
- security/tpm/back-end-mem.cpp \
- security/tpm/back-end.cpp \
- security/tpm/key-handle-mem.cpp \
- security/tpm/key-handle.cpp \
- security/tpm/tpm.cpp \
- security/transform/base64-decode.cpp \
- security/transform/base64-encode.cpp \
- security/transform/block-cipher.cpp \
- security/transform/bool-sink.cpp \
- security/transform/buffer-source.cpp \
- security/transform/digest-filter.cpp \
- security/transform/hex-decode.cpp \
- security/transform/hex-encode.cpp \
- security/transform/hmac-filter.cpp \
- security/transform/private-key.cpp \
- security/transform/public-key.cpp \
- security/transform/signer-filter.cpp \
- security/transform/step-source.cpp \
- security/transform/stream-sink.cpp \
- security/transform/stream-source.cpp \
- security/transform/strip-space.cpp \
- security/transform/transform-base.cpp \
- security/transform/verifier-filter.cpp \
- security/v2/additional-description.cpp \
- security/v2/certificate-bundle-fetcher.cpp \
- security/v2/certificate-cache.cpp \
- security/v2/certificate-fetcher-direct-fetch.cpp \
- security/v2/certificate-fetcher-from-network.cpp \
- security/v2/certificate-fetcher-offline.cpp \
- security/v2/certificate-fetcher.cpp \
- security/v2/certificate-storage.cpp \
- security/v2/certificate.cpp \
- security/v2/key-chain.cpp \
- security/v2/trust-anchor-container.cpp \
- security/v2/trust-anchor-group.cpp \
- security/v2/validation-error.cpp \
- security/v2/validation-policy-command-interest.cpp \
- security/v2/validation-policy-config.cpp \
- security/v2/validation-policy-simple-hierarchy.cpp \
- security/v2/validation-policy.cpp \
- security/v2/validation-state.cpp \
- security/v2/validator-config/checker.cpp \
- security/v2/validator-config/filter.cpp \
- security/v2/validator-config/name-relation.cpp \
- security/v2/validator-config/rule.cpp \
- security/v2/validator.cpp \
- security/validator-config.cpp \
- security/validator-null.cpp \
- security/validity-period.cpp \
- security/verification-helpers.cpp \
- selectors.cpp \
- signature-info.cpp \
- signature.cpp \
- transport/tcp-transport.cpp \
- transport/transport.cpp \
- transport/unix-transport.cpp \
- util/config-file.cpp \
- util/dummy-client-face.cpp \
- util/indented-stream.cpp \
- util/io.cpp \
- util/notification-subscriber.cpp \
- util/random.cpp \
- util/regex/regex-top-matcher.cpp \
- util/scheduler-scoped-event-id.cpp \
- util/scheduler.cpp \
- util/segment-fetcher.cpp \
- util/sha256.cpp \
- util/signal/connection.cpp \
- util/signal/scoped-connection.cpp \
- util/sqlite3-statement.cpp \
- util/string-helper.cpp \
- util/time-unit-test-clock.cpp \
- util/time.cpp \
- ../../ndn-cxx-android/ndn-cxx-custom-logger.cpp \
- ../../ndn-cxx-android/ndn-cxx-custom-logging.cpp
-LOCAL_SRC_FILES := $(addprefix ndn-cxx/src/,$(NDN_CXX_SRC_FILES))
-LOCAL_CPPFLAGS := -I$(LOCAL_PATH)/ndn-cxx/src -I$(LOCAL_PATH)/ndn-cxx-android -I$(LOCAL_PATH)/../../../build/generated/source/ndn-cxx
-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/ndn-cxx-android $(LOCAL_PATH)/../../../build/generated/source/include
-LOCAL_LDLIBS := -llog -latomic
-include $(BUILD_SHARED_LIBRARY)
-
-$(call import-module,../packages/boost/1.65.1)
-$(call import-module,../packages/sqlite/3.18.0)
-$(call import-module,../packages/openssl/1.0.2m)
diff --git a/app/src/main/jni/nfd-android/core/config.hpp b/app/src/main/jni/nfd-android/core/config.hpp
deleted file mode 100644
index 30c61c2..0000000
--- a/app/src/main/jni/nfd-android/core/config.hpp
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef W_CONFIG_HPP_WAF
-#define W_CONFIG_HPP_WAF
-
-#define HAVE_IS_DEFAULT_CONSTRUCTIBLE 1
-#define HAVE_IS_MOVE_CONSTRUCTIBLE 1
-#define HAVE_LIBRT
-#define HAVE_LIBRESOLV
-// #define HAVE_IFADDRS_H 1
-/*#undef HAVE_UNIX_SOCKETS*/
-#define HAVE_WEBSOCKET 1
-#define _WEBSOCKETPP_CPP11_STL_ 1
-#define DEFAULT_CONFIG_FILE "./nfd.conf"
-#define HAVE_CUSTOM_LOGGER 1
-#define NDEBUG 1
-
-#define BOOST_LOG_DYN_LINK 1
-
-#endif /* W_CONFIG_HPP_WAF */
diff --git a/app/src/main/jni/nfd-android/core/version.hpp b/app/src/main/jni/nfd-android/core/version.hpp
deleted file mode 100644
index 19a9d22..0000000
--- a/app/src/main/jni/nfd-android/core/version.hpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD 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.
- *
- * NFD 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
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_CORE_VERSION_HPP
-#define NFD_CORE_VERSION_HPP
-
-namespace nfd {
-
-/** NFD version follows Semantic Versioning 2.0.0 specification
- * http://semver.org/
- */
-
-// To change version number, modify VERSION variable in top-level wscript.
-
-/** \brief NFD version represented as an integer
- *
- * MAJOR*1000000 + MINOR*1000 + PATCH
- */
-#define NFD_VERSION 6000
-
-/** \brief NFD version represented as a string
- *
- * MAJOR.MINOR.PATCH
- */
-#define NFD_VERSION_STRING "0.6.0"
-
-/** \brief NFD version string, including git commit information, if NFD is build from
- * specific git commit
- *
- * NFD_VERSION_BUILD_STRING is obtained using the following command (`NFD-` prefix is
- * afterwards removed):
- *
- * `git describe --match 'NFD-*'`
- *
- * When NFD is built not from git, NFD_VERSION_BUILD_STRING equals NFD_VERSION_STRING
- *
- * MAJOR.MINOR.PATCH(-release-candidate-tag)(-(number-of-commits-since-tag)-COMMIT-HASH)
- *
- * Example, 0.1.0-rc1-1-g5c86570
- */
-#define NFD_VERSION_BUILD_STRING "0.6.0"
-
-/// MAJOR version
-#define NFD_VERSION_MAJOR 0
-/// MINOR version
-#define NFD_VERSION_MINOR 6
-/// PATCH version
-#define NFD_VERSION_PATCH 0
-
-} // namespace nfd
-
-#endif // NFD_CORE_VERSION_HPP
diff --git a/app/src/main/jni/nfd-android/custom-logger-factory.cpp b/app/src/main/jni/nfd-android/custom-logger-factory.cpp
deleted file mode 100644
index 436bdf1..0000000
--- a/app/src/main/jni/nfd-android/custom-logger-factory.cpp
+++ /dev/null
@@ -1,198 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD 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.
- *
- * NFD 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
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "custom-logger-factory.hpp"
-
-#include <boost/algorithm/string/case_conv.hpp>
-
-namespace nfd {
-
-NFD_LOG_INIT("LoggerFactory");
-
-LoggerFactory&
-LoggerFactory::getInstance()
-{
- static LoggerFactory globalLoggerFactory;
-
- return globalLoggerFactory;
-}
-
-LoggerFactory::LoggerFactory()
- : m_defaultLevel(LOG_INFO)
-{
- m_levelNames["NONE"] = LOG_NONE;
- m_levelNames["ERROR"] = LOG_ERROR;
- m_levelNames["WARN"] = LOG_WARN;
- m_levelNames["INFO"] = LOG_INFO;
- m_levelNames["DEBUG"] = LOG_DEBUG;
- m_levelNames["TRACE"] = LOG_TRACE;
- m_levelNames["ALL"] = LOG_ALL;
-}
-
-void
-LoggerFactory::setConfigFile(ConfigFile& config)
-{
- config.addSectionHandler("log", bind(&LoggerFactory::onConfig, this, _1, _2, _3));
-}
-
-LogLevel
-LoggerFactory::parseLevel(const std::string& level)
-{
- std::string upperLevel = level;
- boost::to_upper(upperLevel);
-
- // std::cerr << "parsing level: " << upperLevel << std::endl;;
- // std::cerr << "# levels: " << m_levelNames.size() << std::endl;
- // std::cerr << m_levelNames.begin()->first << std::endl;
-
- LevelMap::const_iterator levelIt = m_levelNames.find(upperLevel);
- if (levelIt != m_levelNames.end()) {
- return levelIt->second;
- }
- try {
- uint32_t levelNo = boost::lexical_cast<uint32_t>(level);
-
- if ((boost::lexical_cast<uint32_t>(LOG_NONE) <= levelNo &&
- levelNo <= boost::lexical_cast<uint32_t>(LOG_TRACE)) ||
- levelNo == LOG_ALL) {
- return static_cast<LogLevel>(levelNo);
- }
- }
- catch (const boost::bad_lexical_cast& error) {
- }
- throw LoggerFactory::Error("Unsupported logging level \"" + level + "\"");
-}
-
-LogLevel
-LoggerFactory::extractLevel(const ConfigSection& item, const std::string& key)
-{
- std::string levelString;
- try {
- levelString = item.get_value<std::string>();
- }
- catch (const boost::property_tree::ptree_error& error) {
- }
-
- if (levelString.empty()) {
- throw LoggerFactory::Error("No logging level found for option \"" + key + "\"");
- }
-
- return parseLevel(levelString);
-}
-
-void
-LoggerFactory::onConfig(const ConfigSection& section,
- bool isDryRun,
- const std::string& filename)
-{
-// log
-// {
-// ; default_level specifies the logging level for modules
-// ; that are not explicitly named. All debugging levels
-// ; listed above the selected value are enabled.
-//
-// default_level INFO
-//
-// ; You may also override the default for specific modules:
-//
-// FibManager DEBUG
-// Forwarder WARN
-// }
-
- if (!isDryRun) {
- ConfigSection::const_assoc_iterator item = section.find("default_level");
- if (item != section.not_found()) {
- LogLevel level = extractLevel(item->second, "default_level");
- setDefaultLevel(level);
- }
- else {
- setDefaultLevel(LOG_INFO);
- }
- }
-
- for (ConfigSection::const_iterator item = section.begin();
- item != section.end();
- ++item) {
- LogLevel level = extractLevel(item->second, item->first);
-
- if (item->first == "default_level") {
- // do nothing
- }
- else {
- LoggerMap::iterator loggerIt = m_loggers.find(item->first);
- if (loggerIt == m_loggers.end()) {
- NFD_LOG_DEBUG("Failed to configure logging level for module \"" <<
- item->first << "\" (module not found)");
- }
- else if (!isDryRun) {
- // std::cerr << "changing level for module " << item->first << " to " << level << std::endl;
- loggerIt->second.setLogLevel(level);
- }
- }
- }
-}
-
-void
-LoggerFactory::setDefaultLevel(LogLevel level)
-{
- // std::cerr << "changing to default_level " << level << std::endl;
-
- m_defaultLevel = level;
- for (LoggerMap::iterator i = m_loggers.begin(); i != m_loggers.end(); ++i) {
- // std::cerr << "changing " << i->first << " to default " << m_defaultLevel << std::endl;
- i->second.setLogLevel(m_defaultLevel);
- }
-}
-
-Logger&
-LoggerFactory::create(const std::string& moduleName)
-{
- return LoggerFactory::getInstance().createLogger(moduleName);
-}
-
-Logger&
-LoggerFactory::createLogger(const std::string& moduleName)
-{
- // std::cerr << "creating logger for " << moduleName
- // << " with level " << m_defaultLevel << std::endl;
-
- std::pair<LoggerMap::iterator, bool> loggerIt =
- m_loggers.insert(NameAndLogger(moduleName, Logger(moduleName, m_defaultLevel)));
-
- return loggerIt.first->second;
-}
-
-std::list<std::string>
-LoggerFactory::getModules() const
-{
- std::list<std::string> modules;
- for (LoggerMap::const_iterator i = m_loggers.begin(); i != m_loggers.end(); ++i) {
- modules.push_back(i->first);
- }
-
- return modules;
-}
-
-} // namespace nfd
diff --git a/app/src/main/jni/nfd-android/custom-logger-factory.hpp b/app/src/main/jni/nfd-android/custom-logger-factory.hpp
deleted file mode 100644
index f158b81..0000000
--- a/app/src/main/jni/nfd-android/custom-logger-factory.hpp
+++ /dev/null
@@ -1,112 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD 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.
- *
- * NFD 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
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_ANDROID_CUSTOM_LOGGER_FACTORY_HPP
-#define NFD_ANDROID_CUSTOM_LOGGER_FACTORY_HPP
-
-#include "core/common.hpp"
-
-#include "core/config-file.hpp"
-#include "core/logger.hpp"
-
-namespace nfd {
-
-class LoggerFactory : noncopyable
-{
-public:
-
- class Error : public std::runtime_error
- {
- public:
- explicit
- Error(const std::string& error)
- : std::runtime_error(error)
- {
- }
- };
-
- static LoggerFactory&
- getInstance();
-
- void
- setConfigFile(ConfigFile& config);
-
- void
- onConfig(const ConfigSection& section, bool isDryRun, const std::string& filename);
-
- std::list<std::string>
- getModules() const;
-
- static Logger&
- create(const std::string& moduleName);
-
-
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
-
- // these methods are used during unit-testing
-
- LogLevel
- getDefaultLevel() const;
-
- void
- setDefaultLevel(LogLevel level);
-
-private:
-
- LoggerFactory();
-
- Logger&
- createLogger(const std::string& moduleName);
-
- LogLevel
- parseLevel(const std::string& level);
-
- LogLevel
- extractLevel(const ConfigSection& item, const std::string& key);
-
-private:
-
- typedef std::map<std::string, LogLevel> LevelMap;
- typedef std::pair<std::string, LogLevel> NameAndLevel;
-
- LevelMap m_levelNames;
-
- typedef std::map<std::string, Logger> LoggerMap;
- typedef std::pair<std::string, Logger> NameAndLogger;
-
- LoggerMap m_loggers;
-
- LogLevel m_defaultLevel;
-};
-
-inline LogLevel
-LoggerFactory::getDefaultLevel() const
-{
- return m_defaultLevel;
-}
-
-} // namespace nfd
-
-#endif // NFD_ANDROID_CUSTOM_LOGGER_FACTORY_HPP
diff --git a/app/src/main/jni/nfd-android/custom-logger.cpp b/app/src/main/jni/nfd-android/custom-logger.cpp
deleted file mode 100644
index d5e7ca1..0000000
--- a/app/src/main/jni/nfd-android/custom-logger.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD 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.
- *
- * NFD 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
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "custom-logger.hpp"
-
-namespace nfd {
-
-Logger::Logger(const std::string& name, LogLevel level)
- : m_moduleName(name)
- , m_enabledLogLevel(level)
-{
-}
-
-} // namespace nfd
diff --git a/app/src/main/jni/nfd-android/custom-logger.hpp b/app/src/main/jni/nfd-android/custom-logger.hpp
deleted file mode 100644
index 86ed64c..0000000
--- a/app/src/main/jni/nfd-android/custom-logger.hpp
+++ /dev/null
@@ -1,141 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD 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.
- *
- * NFD 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
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_ANDROID_CUSTOM_LOGGER_HPP
-#define NFD_ANDROID_CUSTOM_LOGGER_HPP
-
-#include "core/common.hpp"
-#include <sstream>
-#include <android/log.h>
-
-namespace nfd {
-
-/** \brief indicates a log level
- * \note This type is internal. Logger should be accessed through NFD_LOG_* macros.
- */
-enum LogLevel {
- LOG_FATAL = -1, // fatal (will be logged unconditionally)
- LOG_NONE = 0, // no messages
- LOG_ERROR = 1, // serious error messages
- LOG_WARN = 2, // warning messages
- LOG_INFO = 3, // informational messages
- LOG_DEBUG = 4, // debug messages
- LOG_TRACE = 5, // trace messages (most verbose)
- LOG_ALL = 255 // all messages
-};
-
-/** \brief provides logging for a module
- * \note This type is internal. Logger should be accessed through NFD_LOG_* macros.
- * \note This type is copyable because logger can be declared as a field of
- * (usually template) classes, and shouldn't prevent those classes to be copyable.
- */
-class Logger
-{
-public:
- Logger(const std::string& name, LogLevel level);
-
- bool
- isEnabled(LogLevel level) const
- {
- return m_enabledLogLevel >= level;
- }
-
- void
- setLogLevel(LogLevel level)
- {
- m_enabledLogLevel = level;
- }
-
- const std::string&
- getName() const
- {
- return m_moduleName;
- }
-
- void
- setName(const std::string& name)
- {
- m_moduleName = name;
- }
-
-private:
- std::string m_moduleName;
- LogLevel m_enabledLogLevel;
-};
-
-inline std::ostream&
-operator<<(std::ostream& output, const Logger& logger)
-{
- output << logger.getName();
- return output;
-}
-
-} // namespace nfd
-
-#include "core/logger-factory.hpp"
-
-namespace nfd {
-
-#define NFD_LOG_INIT(name) \
-static nfd::Logger& g_logger = nfd::LoggerFactory::create(name)
-
-#define NFD_LOG_INCLASS_DECLARE() \
-static nfd::Logger& g_logger
-
-#define NFD_LOG_INCLASS_DEFINE(cls, name) \
-nfd::Logger& cls::g_logger = nfd::LoggerFactory::create(name)
-
-#define NFD_LOG_INCLASS_TEMPLATE_DEFINE(cls, name) \
-template<class T> \
-nfd::Logger& cls<T>::g_logger = nfd::LoggerFactory::create(name)
-
-#define NFD_LOG_INCLASS_TEMPLATE_SPECIALIZATION_DEFINE(cls, specialization, name) \
-template<> \
-nfd::Logger& cls<specialization>::g_logger = nfd::LoggerFactory::create(name)
-
-#define NFD_LOG_INCLASS_2TEMPLATE_SPECIALIZATION_DEFINE(cls, s1, s2, name) \
-template<> \
-nfd::Logger& cls<s1, s2>::g_logger = nfd::LoggerFactory::create(name)
-
-#define NFD_LOG(nfdLevel, androidLevel, msg, expression) \
-do { \
- if (g_logger.isEnabled(::nfd::LOG_##nfdLevel)) { \
- std::ostringstream os; \
- os << expression; \
- __android_log_print(ANDROID_LOG_##androidLevel, \
- g_logger.getName().c_str(), "%s", os.str().c_str()); \
- } \
-} while (false)
-
-#define NFD_LOG_TRACE(expression) NFD_LOG(TRACE, VERBOSE, TRACE, expression)
-#define NFD_LOG_DEBUG(expression) NFD_LOG(DEBUG, DEBUG, DEBUG, expression)
-#define NFD_LOG_INFO(expression) NFD_LOG(INFO, INFO, INFO, expression)
-#define NFD_LOG_WARN(expression) NFD_LOG(WARN, WARN, WARNING, expression)
-#define NFD_LOG_ERROR(expression) NFD_LOG(ERROR, ERROR, ERROR, expression)
-#define NFD_LOG_FATAL(expression) NFD_LOG(FATAL, FATAL, FATAL, expression)
-
-} // namespace nfd
-
-#endif // NFD_ANDROID_CUSTOM_LOGGER_HPP
diff --git a/app/src/main/jni/nfd-wrapper.cpp b/app/src/main/jni/nfd-wrapper.cpp
index a04585e..918efce 100644
--- a/app/src/main/jni/nfd-wrapper.cpp
+++ b/app/src/main/jni/nfd-wrapper.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2015-2016 Regents of the University of California
+ * Copyright (c) 2015-2018 Regents of the University of California
*
* This file is part of NFD (Named Data Networking Forwarding Daemon) Android.
* See AUTHORS.md for complete list of NFD Android authors and contributors.
@@ -22,17 +22,18 @@
#include "daemon/nfd.hpp"
#include "rib/service.hpp"
-#include "core/global-io.hpp"
#include "core/config-file.hpp"
+#include "core/global-io.hpp"
#include "core/logger.hpp"
#include "core/privilege-helper.hpp"
-#include <stdlib.h>
#include <boost/property_tree/info_parser.hpp>
#include <boost/thread.hpp>
#include <mutex>
+#include <ndn-cxx/util/logging.hpp>
+#include <stdlib.h>
-NFD_LOG_INIT("NfdWrapper");
+NFD_LOG_INIT(NfdWrapper);
namespace nfd {
@@ -48,104 +49,67 @@
void
resetGlobalIoService();
-
class Runner
{
public:
Runner()
: m_io(nullptr)
{
- std::string initialConfig =
- "general\n"
- "{\n"
- "}\n"
- "\n"
- "log\n"
- "{\n"
- " default_level ALL\n"
- " NameTree INFO\n"
- " BestRouteStrategy2 INFO\n"
- " InternalFace INFO\n"
- " Forwarder INFO\n"
- " ContentStore INFO\n"
- " DeadNonceList INFO\n"
- "}\n"
- "tables\n"
- "{\n"
- " cs_max_packets 100\n"
- "\n"
- " strategy_choice\n"
- " {\n"
- " / /localhost/nfd/strategy/best-route\n"
- " /localhost /localhost/nfd/strategy/multicast\n"
- " /localhost/nfd /localhost/nfd/strategy/best-route\n"
- " /ndn/broadcast /localhost/nfd/strategy/multicast\n"
- " /ndn/multicast /localhost/nfd/strategy/multicast\n"
- " }\n"
- "}\n"
- "\n"
- "face_system\n"
- "{\n"
- " tcp\n"
- " {\n"
- " listen yes\n"
- " port 6363\n"
- " enable_v4 yes\n"
- " enable_v6 yes\n"
- " }\n"
- "\n"
- " udp\n"
- " {\n"
- " port 6363\n"
- " enable_v4 yes\n"
- " enable_v6 yes\n"
- " idle_timeout 600\n"
- " keep_alive_interval 25\n"
- " mcast no\n"
- " }\n"
- " websocket\n"
- " {\n"
- " listen yes\n"
- " port 9696\n"
- " enable_v4 yes\n"
- " enable_v6 yes\n"
- " }\n"
- "}\n"
- "\n"
- "authorizations\n"
- "{\n"
- " authorize\n"
- " {\n"
- " certfile any\n"
- " privileges\n"
- " {\n"
- " faces\n"
- " fib\n"
- " strategy-choice\n"
- " }\n"
- " }\n"
- "}\n"
- "\n"
- "rib\n"
- "{\n"
- " localhost_security\n"
- " {\n"
- " trust-anchor\n"
- " {\n"
- " type any\n"
- " }\n"
- " }\n"
- "\n"
- " auto_prefix_propagate\n"
- " {\n"
- " cost 15\n"
- " timeout 10000\n"
- " refresh_interval 300\n"
- " base_retry_wait 50\n"
- " max_retry_wait 3600\n"
- " }\n"
- "}\n"
- "\n";
+ std::string initialConfig = R"CONF(
+ log
+ {
+ default_level ALL
+ }
+ tables
+ {
+ cs_max_packets 100
+ strategy_choice
+ {
+ / /localhost/nfd/strategy/best-route
+ /localhost /localhost/nfd/strategy/multicast
+ /localhost/nfd /localhost/nfd/strategy/best-route
+ /ndn/broadcast /localhost/nfd/strategy/multicast
+ /ndn/multicast /localhost/nfd/strategy/multicast
+ }
+ }
+ face_system
+ {
+ tcp
+ udp
+ {
+ mcast no
+ }
+ websocket
+ }
+ authorizations
+ {
+ authorize
+ {
+ certfile any
+ privileges
+ {
+ faces
+ fib
+ cs
+ strategy-choice
+ }
+ }
+ }
+ rib
+ {
+ localhost_security
+ {
+ trust-anchor
+ {
+ type any
+ }
+ }
+ auto_prefix_propagate
+ {
+ refresh_interval 300
+ }
+ }
+ )CONF";
std::istringstream input(initialConfig);
boost::property_tree::read_info(input, m_config);
@@ -308,7 +272,7 @@
jobject jModules = env->NewObject(jcLinkedList, jcLinkedListConstructor);
- for (const auto& module : nfd::LoggerFactory::getInstance().getModules()) {
+ for (const auto& module : ndn::util::Logging::getLoggerNames()) {
jstring jModule = env->NewStringUTF(module.c_str());
env->CallBooleanMethod(jModules, jcLinkedListAdd, jModule);
}
diff --git a/app/src/main/jni/nfd.mk b/app/src/main/jni/nfd.mk
deleted file mode 100644
index a2c145e..0000000
--- a/app/src/main/jni/nfd.mk
+++ /dev/null
@@ -1,131 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-LOCAL_PATH_SAVED := $(LOCAL_PATH)
-
-NFD_BOOST_LIBS = system filesystem chrono program_options random thread
-
-# nfd itself
-include $(CLEAR_VARS)
-LOCAL_MODULE := nfd-daemon
-LOCAL_SHARED_LIBRARIES := libssl_shared libcrypto_shared ndn-cxx $(addsuffix _shared,$(addprefix boost_,$(NFD_BOOST_LIBS)))
-NFD_DAEMON_SRC_FILES := \
- core/city-hash.cpp \
- core/config-file.cpp \
- core/global-io.cpp \
- core/manager-base.cpp \
- core/network-interface-predicate.cpp \
- core/network.cpp \
- core/privilege-helper.cpp \
- core/random.cpp \
- core/rtt-estimator.cpp \
- core/scheduler.cpp \
- ../nfd-android/custom-logger.cpp \
- ../nfd-android/custom-logger-factory.cpp \
- \
- daemon/face/channel.cpp \
- daemon/face/face-counters.cpp \
- daemon/face/face-system.cpp \
- daemon/face/face.cpp \
- daemon/face/generic-link-service.cpp \
- daemon/face/internal-face.cpp \
- daemon/face/internal-transport.cpp \
- daemon/face/link-service.cpp \
- daemon/face/lp-fragmenter.cpp \
- daemon/face/lp-reassembler.cpp \
- daemon/face/lp-reliability.cpp \
- daemon/face/multicast-udp-transport.cpp \
- daemon/face/null-face.cpp \
- daemon/face/protocol-factory.cpp \
- daemon/face/tcp-channel.cpp \
- daemon/face/tcp-factory.cpp \
- daemon/face/tcp-transport.cpp \
- daemon/face/transport.cpp \
- daemon/face/udp-channel.cpp \
- daemon/face/udp-factory.cpp \
- daemon/face/udp-protocol.cpp \
- daemon/face/unicast-udp-transport.cpp \
- daemon/face/websocket-channel.cpp \
- daemon/face/websocket-factory.cpp \
- daemon/face/websocket-transport.cpp \
- daemon/fw/access-strategy.cpp \
- daemon/fw/algorithm.cpp \
- daemon/fw/asf-measurements.cpp \
- daemon/fw/asf-probing-module.cpp \
- daemon/fw/asf-strategy.cpp \
- daemon/fw/best-route-strategy.cpp \
- daemon/fw/best-route-strategy2.cpp \
- daemon/fw/client-control-strategy.cpp \
- daemon/fw/face-table.cpp \
- daemon/fw/forwarder.cpp \
- daemon/fw/multicast-strategy.cpp \
- daemon/fw/ncc-strategy.cpp \
- daemon/fw/process-nack-traits.cpp \
- daemon/fw/retx-suppression-exponential.cpp \
- daemon/fw/retx-suppression-fixed.cpp \
- daemon/fw/strategy.cpp \
- daemon/fw/unsolicited-data-policy.cpp \
- daemon/main.cpp \
- daemon/mgmt/command-authenticator.cpp \
- daemon/mgmt/face-manager.cpp \
- daemon/mgmt/fib-manager.cpp \
- daemon/mgmt/forwarder-status-manager.cpp \
- daemon/mgmt/general-config-section.cpp \
- daemon/mgmt/nfd-manager-base.cpp \
- daemon/mgmt/strategy-choice-manager.cpp \
- daemon/mgmt/tables-config-section.cpp \
- daemon/nfd.cpp \
- daemon/table/cleanup.cpp \
- daemon/table/cs-entry-impl.cpp \
- daemon/table/cs-entry.cpp \
- daemon/table/cs-policy-lru.cpp \
- daemon/table/cs-policy-priority-fifo.cpp \
- daemon/table/cs-policy.cpp \
- daemon/table/cs.cpp \
- daemon/table/dead-nonce-list.cpp \
- daemon/table/fib-entry.cpp \
- daemon/table/fib-nexthop.cpp \
- daemon/table/fib.cpp \
- daemon/table/measurements-accessor.cpp \
- daemon/table/measurements-entry.cpp \
- daemon/table/measurements.cpp \
- daemon/table/name-tree-entry.cpp \
- daemon/table/name-tree-hashtable.cpp \
- daemon/table/name-tree-iterator.cpp \
- daemon/table/name-tree.cpp \
- daemon/table/network-region-table.cpp \
- daemon/table/pit-entry.cpp \
- daemon/table/pit-face-record.cpp \
- daemon/table/pit-in-record.cpp \
- daemon/table/pit-iterator.cpp \
- daemon/table/pit-out-record.cpp \
- daemon/table/pit.cpp \
- daemon/table/strategy-choice-entry.cpp \
- daemon/table/strategy-choice.cpp \
- daemon/table/strategy-info-host.cpp \
- \
- rib/auto-prefix-propagator.cpp \
- rib/fib-update.cpp \
- rib/fib-updater.cpp \
- rib/propagated-entry.cpp \
- rib/readvertise/client-to-nlsr-readvertise-policy.cpp \
- rib/readvertise/nfd-rib-readvertise-destination.cpp \
- rib/readvertise/readvertise-destination.cpp \
- rib/readvertise/readvertise.cpp \
- rib/readvertise/readvertised-route.cpp \
- rib/rib-entry.cpp \
- rib/rib-manager.cpp \
- rib/rib-update-batch.cpp \
- rib/rib-update.cpp \
- rib/rib.cpp \
- rib/route.cpp \
- rib/service.cpp
-LOCAL_SRC_FILES := $(addprefix NFD/,$(NFD_DAEMON_SRC_FILES))
-LOCAL_CPPFLAGS := \
- -I$(LOCAL_PATH)/nfd-android \
- -I$(LOCAL_PATH)/NFD \
- -I$(LOCAL_PATH)/NFD/core \
- -I$(LOCAL_PATH)/NFD/daemon \
- -I$(LOCAL_PATH)/NFD/rib \
- -I$(LOCAL_PATH)/NFD/websocketpp
-LOCAL_LDLIBS := -llog
-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/nfd-android $(LOCAL_PATH)/NFD
-include $(BUILD_SHARED_LIBRARY)