service: Initial implementation of the NFD Android Service

Change-Id: Iee2c2f3588aa9af36bd170a22ce8333e4945ff67
diff --git a/app/src/main/jni/Android.mk b/app/src/main/jni/Android.mk
index 925d790..7bae03f 100644
--- a/app/src/main/jni/Android.mk
+++ b/app/src/main/jni/Android.mk
@@ -3,8 +3,9 @@
 
 include $(CLEAR_VARS)
 LOCAL_MODULE := nfd-wrapper
-LOCAL_SRC_FILES := android-logger-streambuf.cpp wrappers-example.cpp
+LOCAL_SRC_FILES := android-logger-streambuf.cpp nfd-wrapper.cpp
 LOCAL_LDLIBS := -llog
+LOCAL_SHARED_LIBRARIES := nfd-daemon
 include $(BUILD_SHARED_LIBRARY)
 
 include $(LOCAL_PATH_SAVED)/ndn-cxx.mk
diff --git a/app/src/main/jni/ndn-cxx.mk b/app/src/main/jni/ndn-cxx.mk
index 4ecb9be..1e93bdb 100644
--- a/app/src/main/jni/ndn-cxx.mk
+++ b/app/src/main/jni/ndn-cxx.mk
@@ -3,9 +3,9 @@
 
 include $(CLEAR_VARS)
 LOCAL_MODULE := ndn-cxx
-NDN_CXX_BOOST_LIBS = system filesystem date_time iostreams regex program_options chrono random
+NDN_CXX_BOOST_LIBS = system filesystem date_time iostreams program_options chrono random
 LOCAL_SHARED_LIBRARIES := cryptopp $(addsuffix _shared,$(addprefix boost_,$(NDN_CXX_BOOST_LIBS)))
-LOCAL_STATIC_LIBRARIES := sqlite3
+LOCAL_STATIC_LIBRARIES := sqlite3 boost_regex_static
 NDN_CXX_SRC_FILES := name.cpp util/dns.cpp util/time-unit-test-clock.cpp util/segment-fetcher.cpp util/config-file.cpp util/in-memory-storage.cpp util/in-memory-storage-lfu.cpp util/in-memory-storage-fifo.cpp util/ethernet.cpp util/crypto.cpp util/regex/regex-top-matcher.cpp util/signal-scoped-connection.cpp util/dummy-client-face.cpp util/scheduler.cpp util/indented-stream.cpp util/signal-connection.cpp util/in-memory-storage-persistent.cpp util/digest.cpp util/in-memory-storage-lru.cpp util/in-memory-storage-entry.cpp util/time.cpp util/random.cpp util/face-uri.cpp interest-filter.cpp signature.cpp transport/tcp-transport.cpp transport/unix-transport.cpp management/nfd-face-event-notification.cpp management/nfd-control-command.cpp management/nfd-command-options.cpp management/nfd-face-status.cpp management/nfd-control-response.cpp management/nfd-rib-entry.cpp management/nfd-controller.cpp management/nfd-forwarder-status.cpp management/nfd-channel-status.cpp management/nfd-fib-entry.cpp management/nfd-strategy-choice.cpp management/nfd-face-query-filter.cpp management/nfd-control-parameters.cpp exclude.cpp name-component.cpp face.cpp key-locator.cpp data.cpp interest.cpp selectors.cpp meta-info.cpp signature-info.cpp encoding/nfd-constants.cpp encoding/oid.cpp encoding/cryptopp/asn_ext.cpp encoding/block.cpp encoding/buffer.cpp security/sec-public-info-sqlite3.cpp security/signature-sha256-with-rsa.cpp security/public-key.cpp security/certificate-cache-ttl.cpp security/sec-rule-specific.cpp security/sec-tpm-file.cpp security/digest-sha256.cpp security/sec-public-info.cpp security/certificate.cpp security/identity-certificate.cpp security/certificate-subject-description.cpp security/certificate-extension.cpp security/sec-tpm.cpp security/validator.cpp security/sec-rule-relative.cpp security/key-params.cpp security/secured-bag.cpp security/key-chain.cpp security/signature-sha256-with-ecdsa.cpp security/validator-config.cpp security/validator-regex.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
diff --git a/app/src/main/jni/nfd-wrapper.cpp b/app/src/main/jni/nfd-wrapper.cpp
new file mode 100644
index 0000000..6a6e3cd
--- /dev/null
+++ b/app/src/main/jni/nfd-wrapper.cpp
@@ -0,0 +1,40 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2015 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.
+ *
+ * NFD Android 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 Android 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 Android, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "nfd-wrapper.hpp"
+#include "android-logger-streambuf.hpp"
+
+extern "C" {
+int
+main(int argc, char** argv);
+}
+
+#include <iostream>
+
+JNIEXPORT void JNICALL
+Java_net_named_1data_nfd_wrappers_NfdWrapper_startNfd(JNIEnv *, jclass)
+{
+
+}
+
+JNIEXPORT void JNICALL
+Java_net_named_1data_nfd_wrappers_NfdWrapper_stopNfd(JNIEnv *, jclass)
+{
+
+}
diff --git a/app/src/main/jni/nfd-wrapper.hpp b/app/src/main/jni/nfd-wrapper.hpp
new file mode 100644
index 0000000..f709a21
--- /dev/null
+++ b/app/src/main/jni/nfd-wrapper.hpp
@@ -0,0 +1,48 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2015 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.
+ *
+ * NFD Android 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 Android 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 Android, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class net_named_data_nfd_wrappers_NfdWrapper */
+
+#ifndef _Included_net_named_data_nfd_wrappers_NfdWrapper
+#define _Included_net_named_data_nfd_wrappers_NfdWrapper
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     net_named_data_nfd_wrappers_NfdWrapper
+ * Method:    startNfd
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_net_named_1data_nfd_wrappers_NfdWrapper_startNfd
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     net_named_data_nfd_wrappers_NfdWrapper
+ * Method:    stopNfd
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_net_named_1data_nfd_wrappers_NfdWrapper_stopNfd
+  (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/app/src/main/jni/wrappers-example.cpp b/app/src/main/jni/wrappers-example.cpp
deleted file mode 100644
index 5553258..0000000
--- a/app/src/main/jni/wrappers-example.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2015,  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 "wrappers-example.hpp"
-#include "android-logger-streambuf.hpp"
-
-#include <iostream>
-
-JNIEXPORT void JNICALL
-Java_net_named_1data_nfd_wrappers_Example_main(JNIEnv*, jclass)
-{
-  nfd_android::AndroidLoggerStreambuf newBuffer;
-  std::streambuf *backupCout = std::cout.rdbuf(&newBuffer);
-  std::streambuf *backupCerr = std::cerr.rdbuf(&newBuffer);
-
-  std::cout << "Test message to cout" << std::endl;
-  std::cerr << "Test message to cerr" << std::endl;
-
-  std::cerr.rdbuf(backupCerr);
-  std::cout.rdbuf(backupCout);
-}
diff --git a/app/src/main/jni/wrappers-example.hpp b/app/src/main/jni/wrappers-example.hpp
deleted file mode 100644
index 9bf11e3..0000000
--- a/app/src/main/jni/wrappers-example.hpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2015,  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/>.
- */
-
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include <jni.h>
-/* Header for class net_named_data_nfd_wrappers_Example */
-
-#ifndef _Included_net_named_data_nfd_wrappers_Example
-#define _Included_net_named_data_nfd_wrappers_Example
-#ifdef __cplusplus
-extern "C" {
-#endif
-/*
- * Class:     net_named_data_nfd_wrappers_Example
- * Method:    main
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_net_named_1data_nfd_wrappers_Example_main
-  (JNIEnv *, jclass);
-
-#ifdef __cplusplus
-}
-#endif
-#endif