From 3137acdd5a45285dab9903f9d41560c63eca8523 Mon Sep 17 00:00:00 2001 From: "Angelo Mantellini (manangel)" Date: Wed, 29 Mar 2017 18:00:06 +0200 Subject: first commit Change-Id: I8412b8e7d966c2fbc508b537fd9a9bbcfc628ca8 Signed-off-by: Angelo Mantellini (manangel) --- Makefile | 319 ++ README.md | 112 + ccnxandroidmetis/.gitignore | 1 + ccnxandroidmetis/MetisControl/build.gradle | 52 + ccnxandroidmetis/MetisControl/metis.keystore | Bin 0 -> 2237 bytes ccnxandroidmetis/MetisControl/proguard-rules.pro | 17 + .../MetisControl/src/main/AndroidManifest.xml | 44 + .../metiscontrol/ForwarderStatusActivity.java | 169 + .../ccnxsdk/metiscontrol/IMetisAddNewItem.java | 22 + .../ccnxsdk/metiscontrol/IMetisNamedFragment.java | 20 + .../ccnx/ccnxsdk/metiscontrol/MetisConstants.java | 76 + .../ccnx/ccnxsdk/metiscontrol/MetisService.java | 128 + .../ccnxsdk/metiscontrol/MetisStatusFragment.java | 426 +++ .../src/main/res/drawable/add_panel_border.xml | 9 + .../src/main/res/drawable/ic_plus_48.png | Bin 0 -> 836 bytes .../src/main/res/drawable/ic_plus_96.png | Bin 0 -> 1726 bytes .../main/res/layout/activity_forwarder_status.xml | 45 + .../main/res/layout/fragment_forwarder_status.xml | 16 + .../src/main/res/layout/fragment_metis_links.xml | 99 + .../src/main/res/layout/fragment_metis_routes.xml | 80 + .../src/main/res/layout/fragment_metis_script.xml | 54 + .../src/main/res/layout/fragment_metis_status.xml | 208 ++ .../src/main/res/layout/listitem_metis_links.xml | 50 + .../src/main/res/layout/listitem_metis_routes.xml | 43 + .../src/main/res/menu/menu_forwarder_status.xml | 10 + .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 5005 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 3062 bytes .../src/main/res/mipmap-mdpi/ic_notification.png | Bin 0 -> 2727 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 6969 bytes .../src/main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 10840 bytes .../src/main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 15229 bytes .../src/main/res/values-v21/styles.xml | 10 + .../src/main/res/values-w820dp/dimens.xml | 6 + .../MetisControl/src/main/res/values/colors.xml | 10 + .../MetisControl/src/main/res/values/dimens.xml | 7 + .../MetisControl/src/main/res/values/strings.xml | 37 + .../MetisControl/src/main/res/values/styles.xml | 20 + ccnxandroidmetis/build.gradle | 26 + ccnxandroidmetis/ccnxsupportlibrary/build.gradle | 66 + .../ccnxsupportlibrary/proguard-rules.pro | 17 + .../src/main/AndroidManifest.xml | 32 + .../com/metis/ccnx/ccnxsupportlibrary/Metis.java | 40 + .../ccnxsupportlibrary/src/main/jni/Android.mk | 19 + .../ccnxsupportlibrary/src/main/jni/Application.mk | 20 + .../src/main/jni/ccnxsupportlibrary/Android.mk | 121 + .../src/main/jni/ccnxsupportlibrary/Metis_wrap.c | 131 + .../src/main/jni/ccnxsupportlibrary/Metis_wrap.h | 24 + .../src/main/res/values/strings.xml | 3 + ccnxandroidmetis/gradle.properties | 18 + ccnxandroidmetis/gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 53636 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 + ccnxandroidmetis/gradlew | 160 + ccnxandroidmetis/gradlew.bat | 90 + ccnxandroidmetis/settings.gradle | 3 + config/MasterIDE-CMakeLists.txt | 29 + config/README | 21 + config/config.android | 34 + config/config.mk | 105 + config/modules/000-dependencies.mk | 6 + config/modules/000-distillery-update.mk | 21 + config/modules/000-gitModule.mk | 106 + config/modules/001-modules.mk | 62 + config/modules/002-cmake-modules.mk | 91 + config/modules/002-make-modules.mk | 50 + config/modules/100-distillery.mk | 2 + config/modules/110-longbow.mk | 1 + config/modules/120-libparc.mk | 1 + config/modules/210-libccnx-common.mk | 1 + config/modules/220-libccnx-transport-rta.mk | 1 + config/modules/230-libccnx-portal.mk | 1 + config/modules/510-Metis.mk | 1 + config/modules/610-libdash.mk | 1 + config/modules/610-libicnet.mk | 1 + config/modules/README | 3 + external/libcurl_android/jni/Android.mk | 1 + external/libcurl_android/jni/Application.mk | 6 + external/libcurl_android/jni/libcurl/Android.mk | 113 + external/libevent_files/Android.mk | 47 + external/libevent_files/AndroidManifest.xml | 0 external/libevent_files/Application.mk | 5 + external/libevent_files/android/event2/config.h | 440 +++ .../libevent_files/android/event2/event-config.h | 464 +++ external/libevent_files/arc4random.c | 555 ++++ external/libevent_files/evutil.c | 2190 +++++++++++++ external/libevent_files/evutil_rand.c | 182 ++ external/libxml2_android/jni/Android.mk | 1 + external/libxml2_android/jni/Application.mk | 6 + external/libxml2_android/jni/libxml2/Android.mk | 65 + external/libxml2_android/jni/libxml2/config.h | 333 ++ .../jni/libxml2/include/libxml/xmlversion.h | 489 +++ iget_android/.gitignore | 2 + iget_android/app/build.gradle | 185 ++ iget_android/app/iget.keystore | Bin 0 -> 2234 bytes iget_android/app/src/main/AndroidManifest.xml | 44 + .../main/java/com/iget/ccnx/DrawerFragment.java | 505 +++ .../src/main/java/com/iget/ccnx/MainActivity.java | 162 + .../src/main/java/com/iget/ccnx/MainFragment.java | 88 + .../java/com/iget/ccnx/service/CCNxService.java | 46 + .../app/src/main/java/com/iget/ccnx/utils/G.java | 75 + iget_android/app/src/main/jni/Android.mk | 118 + iget_android/app/src/main/jni/Application.mk | 21 + iget_android/app/src/main/jni/iget-wrapper.cpp | 137 + iget_android/app/src/main/jni/iget-wrapper.hpp | 40 + iget_android/app/src/main/play/contactEmail | 1 + iget_android/app/src/main/play/contactPhone | 0 iget_android/app/src/main/play/contactWebsite | 1 + iget_android/app/src/main/play/defaultLanguage | 1 + .../src/main/play/en-US/listing/fulldescription | 3 + .../src/main/play/en-US/listing/shortdescription | 1 + iget_android/app/src/main/play/en-US/listing/title | 1 + iget_android/app/src/main/play/en-US/listing/video | 0 .../main/res/drawable-hdpi/ic_action_discard.png | Bin 0 -> 450 bytes .../src/main/res/drawable-hdpi/ic_action_edit.png | Bin 0 -> 765 bytes .../src/main/res/drawable-hdpi/ic_action_new.png | Bin 0 -> 262 bytes .../main/res/drawable-hdpi/ic_action_refresh.png | Bin 0 -> 663 bytes .../main/res/drawable-hdpi/ic_action_settings.png | Bin 0 -> 807 bytes .../app/src/main/res/drawable-hdpi/ic_launcher.png | Bin 0 -> 9397 bytes .../app/src/main/res/drawable-hdpi/iget_app.png | Bin 0 -> 8569 bytes .../main/res/drawable-mdpi/ic_action_discard.png | Bin 0 -> 324 bytes .../src/main/res/drawable-mdpi/ic_action_edit.png | Bin 0 -> 522 bytes .../src/main/res/drawable-mdpi/ic_action_new.png | Bin 0 -> 185 bytes .../main/res/drawable-mdpi/ic_action_refresh.png | Bin 0 -> 508 bytes .../main/res/drawable-mdpi/ic_action_settings.png | Bin 0 -> 550 bytes .../app/src/main/res/drawable-mdpi/ic_launcher.png | Bin 0 -> 5237 bytes .../app/src/main/res/drawable-mdpi/iget_app.png | Bin 0 -> 8569 bytes .../main/res/drawable-xhdpi/ic_action_discard.png | Bin 0 -> 543 bytes .../src/main/res/drawable-xhdpi/ic_action_edit.png | Bin 0 -> 994 bytes .../src/main/res/drawable-xhdpi/ic_action_new.png | Bin 0 -> 234 bytes .../main/res/drawable-xhdpi/ic_action_refresh.png | Bin 0 -> 895 bytes .../main/res/drawable-xhdpi/ic_action_settings.png | Bin 0 -> 1124 bytes .../src/main/res/drawable-xhdpi/ic_launcher.png | Bin 0 -> 14383 bytes .../app/src/main/res/drawable-xhdpi/iget_app.png | Bin 0 -> 8569 bytes .../main/res/drawable-xxhdpi/ic_action_discard.png | Bin 0 -> 765 bytes .../main/res/drawable-xxhdpi/ic_action_edit.png | Bin 0 -> 1458 bytes .../src/main/res/drawable-xxhdpi/ic_action_new.png | Bin 0 -> 288 bytes .../main/res/drawable-xxhdpi/ic_action_refresh.png | Bin 0 -> 1239 bytes .../res/drawable-xxhdpi/ic_action_settings.png | Bin 0 -> 1661 bytes .../src/main/res/drawable-xxhdpi/ic_launcher.png | Bin 0 -> 19388 bytes .../app/src/main/res/drawable-xxhdpi/iget_app.png | Bin 0 -> 8569 bytes .../app/src/main/res/drawable-xxxhdpi/iget_app.png | Bin 0 -> 8569 bytes .../src/main/res/drawable/custom_white_button.xml | 11 + .../drawable/drawer_item_background_activated.xml | 7 + .../face_list_item_background_activated.xml | 7 + .../drawable/list_item_background_activated.xml | 7 + .../src/main/res/drawable/list_item_divider.xml | 11 + .../app/src/main/res/layout/activity_fragment.xml | 9 + .../app/src/main/res/layout/activity_main.xml | 26 + .../res/layout/activity_main_drawer_listview.xml | 11 + .../app/src/main/res/layout/dialog_create_face.xml | 28 + .../src/main/res/layout/dialog_create_route.xml | 40 + .../layout/fragment_face_detail_list_header.xml | 17 + .../res/layout/fragment_face_list_list_header.xml | 54 + .../src/main/res/layout/fragment_logcat_output.xml | 14 + .../layout/fragment_logcat_tags_list_header.xml | 17 + .../app/src/main/res/layout/fragment_main.xml | 57 + .../layout/fragment_route_detail_list_header.xml | 38 + .../res/layout/fragment_route_list_list_header.xml | 54 + .../src/main/res/layout/list_item_drawer_item.xml | 28 + .../res/layout/list_item_face_generic_item.xml | 22 + .../main/res/layout/list_item_face_status_item.xml | 23 + .../app/src/main/res/layout/list_item_log.xml | 12 + .../main/res/layout/list_item_route_info_item.xml | 23 + .../src/main/res/layout/list_item_route_item.xml | 23 + .../src/main/res/layout/list_item_setting_item.xml | 21 + .../app/src/main/res/menu/menu_face_list.xml | 20 + .../menu/menu_face_list_multiple_modal_menu.xml | 12 + iget_android/app/src/main/res/menu/menu_log.xml | 12 + .../app/src/main/res/menu/menu_logcat_settings.xml | 12 + .../menu_logcat_settings_multiple_modal_menu.xml | 12 + .../app/src/main/res/menu/menu_route_list.xml | 20 + iget_android/app/src/main/res/ndn_app.ai | 3388 ++++++++++++++++++++ .../app/src/main/res/values-sw600dp/dimens.xml | 5 + .../app/src/main/res/values-w820dp/dimens.xml | 6 + iget_android/app/src/main/res/values/colors.xml | 6 + iget_android/app/src/main/res/values/dimens.xml | 9 + iget_android/app/src/main/res/values/strings.xml | 75 + .../values/strings_logcat_settings_activity.xml | 52 + .../src/main/res/values/strings_main_activity.xml | 71 + iget_android/app/src/main/res/values/styles.xml | 82 + iget_android/app/src/main/res/xml/pref_face.xml | 16 + iget_android/app/src/main/res/xml/pref_routes.xml | 16 + iget_android/build.gradle | 23 + iget_android/gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 53636 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 + iget_android/gradlew | 160 + iget_android/gradlew.bat | 90 + iget_android/settings.gradle | 1 + scripts/compile_androidiget.sh | 16 + scripts/compile_androidmetis.sh | 16 + scripts/init.sh | 192 ++ src/libdash/Authors.txt | 10 + src/libdash/CMakeLists.txt | 187 ++ src/libdash/include/IAdaptationSet.h | 367 +++ src/libdash/include/IBaseUrl.h | 69 + src/libdash/include/IChunk.h | 88 + src/libdash/include/IConnection.h | 69 + src/libdash/include/IContentComponent.h | 83 + src/libdash/include/IDASHManager.h | 45 + src/libdash/include/IDASHMetrics.h | 48 + src/libdash/include/IDescriptor.h | 68 + src/libdash/include/IDownloadObserver.h | 58 + src/libdash/include/IDownloadObserver.h.save | 58 + src/libdash/include/IDownloadableChunk.h | 93 + src/libdash/include/IHTTPTransaction.h | 56 + src/libdash/include/IMPD.h | 207 ++ src/libdash/include/IMPDElement.h | 77 + src/libdash/include/IMetrics.h | 62 + src/libdash/include/IMultipleSegmentBase.h | 66 + src/libdash/include/INode.h | 97 + src/libdash/include/IPeriod.h | 156 + src/libdash/include/IProgramInformation.h | 69 + src/libdash/include/IRange.h | 53 + src/libdash/include/IRepresentation.h | 159 + src/libdash/include/IRepresentationBase.h | 181 ++ src/libdash/include/ISegment.h | 86 + src/libdash/include/ISegmentBase.h | 86 + src/libdash/include/ISegmentList.h | 58 + src/libdash/include/ISegmentTemplate.h | 148 + src/libdash/include/ISegmentTimeline.h | 50 + src/libdash/include/ISegmentURL.h | 94 + src/libdash/include/ISubRepresentation.h | 70 + src/libdash/include/ISubset.h | 54 + src/libdash/include/ITCPConnection.h | 40 + src/libdash/include/IThroughputMeasurement.h | 38 + src/libdash/include/ITimeline.h | 66 + src/libdash/include/IURLType.h | 61 + src/libdash/include/config.h | 37 + src/libdash/include/libdash.h | 31 + src/libdash/license.txt | 13 + src/libdash/mainpage.dox | 93 + src/libdash/source/defaults.mk | 7 + src/libdash/source/dllmain.cpp | 33 + src/libdash/source/helpers/Block.h | 59 + src/libdash/source/helpers/BlockStream.cpp | 290 ++ src/libdash/source/helpers/BlockStream.h | 55 + src/libdash/source/helpers/Path.cpp | 118 + src/libdash/source/helpers/Path.h | 33 + src/libdash/source/helpers/String.cpp | 53 + src/libdash/source/helpers/String.h | 31 + src/libdash/source/helpers/SyncedBlockStream.cpp | 250 ++ src/libdash/source/helpers/SyncedBlockStream.h | 57 + src/libdash/source/helpers/Time.cpp | 33 + src/libdash/source/helpers/Time.h | 35 + src/libdash/source/libdash.cpp | 20 + src/libdash/source/manager/DASHManager.cpp | 45 + src/libdash/source/manager/DASHManager.h | 35 + src/libdash/source/metrics/HTTPTransaction.cpp | 122 + src/libdash/source/metrics/HTTPTransaction.h | 68 + src/libdash/source/metrics/TCPConnection.cpp | 62 + src/libdash/source/metrics/TCPConnection.h | 49 + .../source/metrics/ThroughputMeasurement.cpp | 46 + src/libdash/source/metrics/ThroughputMeasurement.h | 43 + src/libdash/source/mpd/AbstractMPDElement.cpp | 41 + src/libdash/source/mpd/AbstractMPDElement.h | 41 + src/libdash/source/mpd/AdaptationSet.cpp | 343 ++ src/libdash/source/mpd/AdaptationSet.h | 138 + src/libdash/source/mpd/BaseUrl.cpp | 60 + src/libdash/source/mpd/BaseUrl.h | 49 + src/libdash/source/mpd/ContentComponent.cpp | 98 + src/libdash/source/mpd/ContentComponent.h | 62 + src/libdash/source/mpd/Descriptor.cpp | 39 + src/libdash/source/mpd/Descriptor.h | 43 + src/libdash/source/mpd/MPD.cpp | 212 ++ src/libdash/source/mpd/MPD.h | 107 + src/libdash/source/mpd/Metrics.cpp | 51 + src/libdash/source/mpd/Metrics.h | 51 + src/libdash/source/mpd/MultipleSegmentBase.cpp | 60 + src/libdash/source/mpd/MultipleSegmentBase.h | 51 + src/libdash/source/mpd/Period.cpp | 137 + src/libdash/source/mpd/Period.h | 79 + src/libdash/source/mpd/ProgramInformation.cpp | 67 + src/libdash/source/mpd/ProgramInformation.h | 52 + src/libdash/source/mpd/Range.cpp | 40 + src/libdash/source/mpd/Range.h | 42 + src/libdash/source/mpd/Representation.cpp | 116 + src/libdash/source/mpd/Representation.h | 75 + src/libdash/source/mpd/RepresentationBase.cpp | 175 + src/libdash/source/mpd/RepresentationBase.h | 89 + src/libdash/source/mpd/Segment.cpp | 138 + src/libdash/source/mpd/Segment.h | 69 + src/libdash/source/mpd/SegmentBase.cpp | 78 + src/libdash/source/mpd/SegmentBase.h | 56 + src/libdash/source/mpd/SegmentList.cpp | 50 + src/libdash/source/mpd/SegmentList.h | 47 + src/libdash/source/mpd/SegmentTemplate.cpp | 152 + src/libdash/source/mpd/SegmentTemplate.h | 61 + src/libdash/source/mpd/SegmentTimeline.cpp | 32 + src/libdash/source/mpd/SegmentTimeline.h | 40 + src/libdash/source/mpd/SegmentURL.cpp | 90 + src/libdash/source/mpd/SegmentURL.h | 56 + src/libdash/source/mpd/SubRepresentation.cpp | 55 + src/libdash/source/mpd/SubRepresentation.h | 50 + src/libdash/source/mpd/Subset.cpp | 30 + src/libdash/source/mpd/Subset.h | 41 + src/libdash/source/mpd/Timeline.cpp | 49 + src/libdash/source/mpd/Timeline.h | 46 + src/libdash/source/mpd/URLType.cpp | 57 + src/libdash/source/mpd/URLType.h | 48 + src/libdash/source/network/AbstractChunk.cpp | 271 ++ src/libdash/source/network/AbstractChunk.h | 100 + .../source/network/DownloadStateManager.cpp | 100 + src/libdash/source/network/DownloadStateManager.h | 50 + src/libdash/source/portable/MultiThreading.cpp | 112 + src/libdash/source/portable/MultiThreading.h | 70 + src/libdash/source/portable/Networking.h | 27 + src/libdash/source/sublibs.mk | 23 + src/libdash/source/targetver.h | 18 + src/libdash/source/xml/DOMHelper.cpp | 54 + src/libdash/source/xml/DOMHelper.h | 35 + src/libdash/source/xml/DOMParser.cpp | 160 + src/libdash/source/xml/DOMParser.h | 56 + src/libdash/source/xml/Node.cpp | 1029 ++++++ src/libdash/source/xml/Node.h | 105 + tools/bin/clion_wrapper.sh | 24 + tools/bin/export_ccnx_env.sh | 13 + tools/bin/getStatus.sh | 32 + tools/bin/gitAddUpstream.sh | 37 + tools/bin/gitCloneOneOf.sh | 38 + tools/bin/gitStatus.sh | 72 + update.sh | 30 + 320 files changed, 25624 insertions(+) create mode 100644 Makefile create mode 100644 README.md create mode 100644 ccnxandroidmetis/.gitignore create mode 100644 ccnxandroidmetis/MetisControl/build.gradle create mode 100644 ccnxandroidmetis/MetisControl/metis.keystore create mode 100644 ccnxandroidmetis/MetisControl/proguard-rules.pro create mode 100644 ccnxandroidmetis/MetisControl/src/main/AndroidManifest.xml create mode 100644 ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/ForwarderStatusActivity.java create mode 100644 ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/IMetisAddNewItem.java create mode 100644 ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/IMetisNamedFragment.java create mode 100644 ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/MetisConstants.java create mode 100644 ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/MetisService.java create mode 100644 ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/MetisStatusFragment.java create mode 100644 ccnxandroidmetis/MetisControl/src/main/res/drawable/add_panel_border.xml create mode 100644 ccnxandroidmetis/MetisControl/src/main/res/drawable/ic_plus_48.png create mode 100644 ccnxandroidmetis/MetisControl/src/main/res/drawable/ic_plus_96.png create mode 100644 ccnxandroidmetis/MetisControl/src/main/res/layout/activity_forwarder_status.xml create mode 100644 ccnxandroidmetis/MetisControl/src/main/res/layout/fragment_forwarder_status.xml create mode 100644 ccnxandroidmetis/MetisControl/src/main/res/layout/fragment_metis_links.xml create mode 100644 ccnxandroidmetis/MetisControl/src/main/res/layout/fragment_metis_routes.xml create mode 100644 ccnxandroidmetis/MetisControl/src/main/res/layout/fragment_metis_script.xml create mode 100644 ccnxandroidmetis/MetisControl/src/main/res/layout/fragment_metis_status.xml create mode 100644 ccnxandroidmetis/MetisControl/src/main/res/layout/listitem_metis_links.xml create mode 100644 ccnxandroidmetis/MetisControl/src/main/res/layout/listitem_metis_routes.xml create mode 100644 ccnxandroidmetis/MetisControl/src/main/res/menu/menu_forwarder_status.xml create mode 100644 ccnxandroidmetis/MetisControl/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 ccnxandroidmetis/MetisControl/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100755 ccnxandroidmetis/MetisControl/src/main/res/mipmap-mdpi/ic_notification.png create mode 100644 ccnxandroidmetis/MetisControl/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 ccnxandroidmetis/MetisControl/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 ccnxandroidmetis/MetisControl/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 ccnxandroidmetis/MetisControl/src/main/res/values-v21/styles.xml create mode 100644 ccnxandroidmetis/MetisControl/src/main/res/values-w820dp/dimens.xml create mode 100644 ccnxandroidmetis/MetisControl/src/main/res/values/colors.xml create mode 100644 ccnxandroidmetis/MetisControl/src/main/res/values/dimens.xml create mode 100644 ccnxandroidmetis/MetisControl/src/main/res/values/strings.xml create mode 100644 ccnxandroidmetis/MetisControl/src/main/res/values/styles.xml create mode 100644 ccnxandroidmetis/build.gradle create mode 100644 ccnxandroidmetis/ccnxsupportlibrary/build.gradle create mode 100644 ccnxandroidmetis/ccnxsupportlibrary/proguard-rules.pro create mode 100644 ccnxandroidmetis/ccnxsupportlibrary/src/main/AndroidManifest.xml create mode 100644 ccnxandroidmetis/ccnxsupportlibrary/src/main/java/com/metis/ccnx/ccnxsupportlibrary/Metis.java create mode 100644 ccnxandroidmetis/ccnxsupportlibrary/src/main/jni/Android.mk create mode 100644 ccnxandroidmetis/ccnxsupportlibrary/src/main/jni/Application.mk create mode 100644 ccnxandroidmetis/ccnxsupportlibrary/src/main/jni/ccnxsupportlibrary/Android.mk create mode 100644 ccnxandroidmetis/ccnxsupportlibrary/src/main/jni/ccnxsupportlibrary/Metis_wrap.c create mode 100644 ccnxandroidmetis/ccnxsupportlibrary/src/main/jni/ccnxsupportlibrary/Metis_wrap.h create mode 100644 ccnxandroidmetis/ccnxsupportlibrary/src/main/res/values/strings.xml create mode 100644 ccnxandroidmetis/gradle.properties create mode 100644 ccnxandroidmetis/gradle/wrapper/gradle-wrapper.jar create mode 100644 ccnxandroidmetis/gradle/wrapper/gradle-wrapper.properties create mode 100755 ccnxandroidmetis/gradlew create mode 100644 ccnxandroidmetis/gradlew.bat create mode 100644 ccnxandroidmetis/settings.gradle create mode 100644 config/MasterIDE-CMakeLists.txt create mode 100644 config/README create mode 100644 config/config.android create mode 100644 config/config.mk create mode 100644 config/modules/000-dependencies.mk create mode 100644 config/modules/000-distillery-update.mk create mode 100644 config/modules/000-gitModule.mk create mode 100644 config/modules/001-modules.mk create mode 100644 config/modules/002-cmake-modules.mk create mode 100644 config/modules/002-make-modules.mk create mode 100644 config/modules/100-distillery.mk create mode 100644 config/modules/110-longbow.mk create mode 100644 config/modules/120-libparc.mk create mode 100644 config/modules/210-libccnx-common.mk create mode 100644 config/modules/220-libccnx-transport-rta.mk create mode 100644 config/modules/230-libccnx-portal.mk create mode 100644 config/modules/510-Metis.mk create mode 100644 config/modules/610-libdash.mk create mode 100644 config/modules/610-libicnet.mk create mode 100644 config/modules/README create mode 100644 external/libcurl_android/jni/Android.mk create mode 100644 external/libcurl_android/jni/Application.mk create mode 100755 external/libcurl_android/jni/libcurl/Android.mk create mode 100644 external/libevent_files/Android.mk create mode 100644 external/libevent_files/AndroidManifest.xml create mode 100644 external/libevent_files/Application.mk create mode 100644 external/libevent_files/android/event2/config.h create mode 100644 external/libevent_files/android/event2/event-config.h create mode 100644 external/libevent_files/arc4random.c create mode 100644 external/libevent_files/evutil.c create mode 100644 external/libevent_files/evutil_rand.c create mode 100644 external/libxml2_android/jni/Android.mk create mode 100644 external/libxml2_android/jni/Application.mk create mode 100755 external/libxml2_android/jni/libxml2/Android.mk create mode 100644 external/libxml2_android/jni/libxml2/config.h create mode 100644 external/libxml2_android/jni/libxml2/include/libxml/xmlversion.h create mode 100644 iget_android/.gitignore create mode 100644 iget_android/app/build.gradle create mode 100644 iget_android/app/iget.keystore create mode 100644 iget_android/app/src/main/AndroidManifest.xml create mode 100644 iget_android/app/src/main/java/com/iget/ccnx/DrawerFragment.java create mode 100644 iget_android/app/src/main/java/com/iget/ccnx/MainActivity.java create mode 100644 iget_android/app/src/main/java/com/iget/ccnx/MainFragment.java create mode 100644 iget_android/app/src/main/java/com/iget/ccnx/service/CCNxService.java create mode 100644 iget_android/app/src/main/java/com/iget/ccnx/utils/G.java create mode 100644 iget_android/app/src/main/jni/Android.mk create mode 100644 iget_android/app/src/main/jni/Application.mk create mode 100644 iget_android/app/src/main/jni/iget-wrapper.cpp create mode 100644 iget_android/app/src/main/jni/iget-wrapper.hpp create mode 100644 iget_android/app/src/main/play/contactEmail create mode 100644 iget_android/app/src/main/play/contactPhone create mode 100644 iget_android/app/src/main/play/contactWebsite create mode 100644 iget_android/app/src/main/play/defaultLanguage create mode 100644 iget_android/app/src/main/play/en-US/listing/fulldescription create mode 100644 iget_android/app/src/main/play/en-US/listing/shortdescription create mode 100644 iget_android/app/src/main/play/en-US/listing/title create mode 100644 iget_android/app/src/main/play/en-US/listing/video create mode 100644 iget_android/app/src/main/res/drawable-hdpi/ic_action_discard.png create mode 100644 iget_android/app/src/main/res/drawable-hdpi/ic_action_edit.png create mode 100644 iget_android/app/src/main/res/drawable-hdpi/ic_action_new.png create mode 100644 iget_android/app/src/main/res/drawable-hdpi/ic_action_refresh.png create mode 100644 iget_android/app/src/main/res/drawable-hdpi/ic_action_settings.png create mode 100644 iget_android/app/src/main/res/drawable-hdpi/ic_launcher.png create mode 100644 iget_android/app/src/main/res/drawable-hdpi/iget_app.png create mode 100644 iget_android/app/src/main/res/drawable-mdpi/ic_action_discard.png create mode 100644 iget_android/app/src/main/res/drawable-mdpi/ic_action_edit.png create mode 100644 iget_android/app/src/main/res/drawable-mdpi/ic_action_new.png create mode 100644 iget_android/app/src/main/res/drawable-mdpi/ic_action_refresh.png create mode 100644 iget_android/app/src/main/res/drawable-mdpi/ic_action_settings.png create mode 100644 iget_android/app/src/main/res/drawable-mdpi/ic_launcher.png create mode 100644 iget_android/app/src/main/res/drawable-mdpi/iget_app.png create mode 100644 iget_android/app/src/main/res/drawable-xhdpi/ic_action_discard.png create mode 100644 iget_android/app/src/main/res/drawable-xhdpi/ic_action_edit.png create mode 100644 iget_android/app/src/main/res/drawable-xhdpi/ic_action_new.png create mode 100644 iget_android/app/src/main/res/drawable-xhdpi/ic_action_refresh.png create mode 100644 iget_android/app/src/main/res/drawable-xhdpi/ic_action_settings.png create mode 100644 iget_android/app/src/main/res/drawable-xhdpi/ic_launcher.png create mode 100644 iget_android/app/src/main/res/drawable-xhdpi/iget_app.png create mode 100644 iget_android/app/src/main/res/drawable-xxhdpi/ic_action_discard.png create mode 100644 iget_android/app/src/main/res/drawable-xxhdpi/ic_action_edit.png create mode 100644 iget_android/app/src/main/res/drawable-xxhdpi/ic_action_new.png create mode 100644 iget_android/app/src/main/res/drawable-xxhdpi/ic_action_refresh.png create mode 100644 iget_android/app/src/main/res/drawable-xxhdpi/ic_action_settings.png create mode 100644 iget_android/app/src/main/res/drawable-xxhdpi/ic_launcher.png create mode 100644 iget_android/app/src/main/res/drawable-xxhdpi/iget_app.png create mode 100644 iget_android/app/src/main/res/drawable-xxxhdpi/iget_app.png create mode 100644 iget_android/app/src/main/res/drawable/custom_white_button.xml create mode 100644 iget_android/app/src/main/res/drawable/drawer_item_background_activated.xml create mode 100644 iget_android/app/src/main/res/drawable/face_list_item_background_activated.xml create mode 100644 iget_android/app/src/main/res/drawable/list_item_background_activated.xml create mode 100644 iget_android/app/src/main/res/drawable/list_item_divider.xml create mode 100644 iget_android/app/src/main/res/layout/activity_fragment.xml create mode 100644 iget_android/app/src/main/res/layout/activity_main.xml create mode 100644 iget_android/app/src/main/res/layout/activity_main_drawer_listview.xml create mode 100644 iget_android/app/src/main/res/layout/dialog_create_face.xml create mode 100644 iget_android/app/src/main/res/layout/dialog_create_route.xml create mode 100644 iget_android/app/src/main/res/layout/fragment_face_detail_list_header.xml create mode 100644 iget_android/app/src/main/res/layout/fragment_face_list_list_header.xml create mode 100644 iget_android/app/src/main/res/layout/fragment_logcat_output.xml create mode 100644 iget_android/app/src/main/res/layout/fragment_logcat_tags_list_header.xml create mode 100644 iget_android/app/src/main/res/layout/fragment_main.xml create mode 100644 iget_android/app/src/main/res/layout/fragment_route_detail_list_header.xml create mode 100644 iget_android/app/src/main/res/layout/fragment_route_list_list_header.xml create mode 100644 iget_android/app/src/main/res/layout/list_item_drawer_item.xml create mode 100644 iget_android/app/src/main/res/layout/list_item_face_generic_item.xml create mode 100644 iget_android/app/src/main/res/layout/list_item_face_status_item.xml create mode 100644 iget_android/app/src/main/res/layout/list_item_log.xml create mode 100644 iget_android/app/src/main/res/layout/list_item_route_info_item.xml create mode 100644 iget_android/app/src/main/res/layout/list_item_route_item.xml create mode 100644 iget_android/app/src/main/res/layout/list_item_setting_item.xml create mode 100644 iget_android/app/src/main/res/menu/menu_face_list.xml create mode 100644 iget_android/app/src/main/res/menu/menu_face_list_multiple_modal_menu.xml create mode 100644 iget_android/app/src/main/res/menu/menu_log.xml create mode 100644 iget_android/app/src/main/res/menu/menu_logcat_settings.xml create mode 100644 iget_android/app/src/main/res/menu/menu_logcat_settings_multiple_modal_menu.xml create mode 100644 iget_android/app/src/main/res/menu/menu_route_list.xml create mode 100644 iget_android/app/src/main/res/ndn_app.ai create mode 100644 iget_android/app/src/main/res/values-sw600dp/dimens.xml create mode 100644 iget_android/app/src/main/res/values-w820dp/dimens.xml create mode 100644 iget_android/app/src/main/res/values/colors.xml create mode 100644 iget_android/app/src/main/res/values/dimens.xml create mode 100644 iget_android/app/src/main/res/values/strings.xml create mode 100644 iget_android/app/src/main/res/values/strings_logcat_settings_activity.xml create mode 100644 iget_android/app/src/main/res/values/strings_main_activity.xml create mode 100644 iget_android/app/src/main/res/values/styles.xml create mode 100644 iget_android/app/src/main/res/xml/pref_face.xml create mode 100644 iget_android/app/src/main/res/xml/pref_routes.xml create mode 100644 iget_android/build.gradle create mode 100644 iget_android/gradle/wrapper/gradle-wrapper.jar create mode 100644 iget_android/gradle/wrapper/gradle-wrapper.properties create mode 100755 iget_android/gradlew create mode 100644 iget_android/gradlew.bat create mode 100644 iget_android/settings.gradle create mode 100755 scripts/compile_androidiget.sh create mode 100755 scripts/compile_androidmetis.sh create mode 100755 scripts/init.sh create mode 100644 src/libdash/Authors.txt create mode 100644 src/libdash/CMakeLists.txt create mode 100644 src/libdash/include/IAdaptationSet.h create mode 100644 src/libdash/include/IBaseUrl.h create mode 100644 src/libdash/include/IChunk.h create mode 100644 src/libdash/include/IConnection.h create mode 100644 src/libdash/include/IContentComponent.h create mode 100644 src/libdash/include/IDASHManager.h create mode 100644 src/libdash/include/IDASHMetrics.h create mode 100644 src/libdash/include/IDescriptor.h create mode 100644 src/libdash/include/IDownloadObserver.h create mode 100644 src/libdash/include/IDownloadObserver.h.save create mode 100644 src/libdash/include/IDownloadableChunk.h create mode 100644 src/libdash/include/IHTTPTransaction.h create mode 100644 src/libdash/include/IMPD.h create mode 100644 src/libdash/include/IMPDElement.h create mode 100644 src/libdash/include/IMetrics.h create mode 100644 src/libdash/include/IMultipleSegmentBase.h create mode 100644 src/libdash/include/INode.h create mode 100644 src/libdash/include/IPeriod.h create mode 100644 src/libdash/include/IProgramInformation.h create mode 100644 src/libdash/include/IRange.h create mode 100644 src/libdash/include/IRepresentation.h create mode 100644 src/libdash/include/IRepresentationBase.h create mode 100644 src/libdash/include/ISegment.h create mode 100644 src/libdash/include/ISegmentBase.h create mode 100644 src/libdash/include/ISegmentList.h create mode 100644 src/libdash/include/ISegmentTemplate.h create mode 100644 src/libdash/include/ISegmentTimeline.h create mode 100644 src/libdash/include/ISegmentURL.h create mode 100644 src/libdash/include/ISubRepresentation.h create mode 100644 src/libdash/include/ISubset.h create mode 100644 src/libdash/include/ITCPConnection.h create mode 100644 src/libdash/include/IThroughputMeasurement.h create mode 100644 src/libdash/include/ITimeline.h create mode 100644 src/libdash/include/IURLType.h create mode 100644 src/libdash/include/config.h create mode 100644 src/libdash/include/libdash.h create mode 100644 src/libdash/license.txt create mode 100644 src/libdash/mainpage.dox create mode 100644 src/libdash/source/defaults.mk create mode 100644 src/libdash/source/dllmain.cpp create mode 100644 src/libdash/source/helpers/Block.h create mode 100644 src/libdash/source/helpers/BlockStream.cpp create mode 100644 src/libdash/source/helpers/BlockStream.h create mode 100644 src/libdash/source/helpers/Path.cpp create mode 100644 src/libdash/source/helpers/Path.h create mode 100644 src/libdash/source/helpers/String.cpp create mode 100644 src/libdash/source/helpers/String.h create mode 100644 src/libdash/source/helpers/SyncedBlockStream.cpp create mode 100644 src/libdash/source/helpers/SyncedBlockStream.h create mode 100644 src/libdash/source/helpers/Time.cpp create mode 100644 src/libdash/source/helpers/Time.h create mode 100644 src/libdash/source/libdash.cpp create mode 100644 src/libdash/source/manager/DASHManager.cpp create mode 100644 src/libdash/source/manager/DASHManager.h create mode 100644 src/libdash/source/metrics/HTTPTransaction.cpp create mode 100644 src/libdash/source/metrics/HTTPTransaction.h create mode 100644 src/libdash/source/metrics/TCPConnection.cpp create mode 100644 src/libdash/source/metrics/TCPConnection.h create mode 100644 src/libdash/source/metrics/ThroughputMeasurement.cpp create mode 100644 src/libdash/source/metrics/ThroughputMeasurement.h create mode 100644 src/libdash/source/mpd/AbstractMPDElement.cpp create mode 100644 src/libdash/source/mpd/AbstractMPDElement.h create mode 100644 src/libdash/source/mpd/AdaptationSet.cpp create mode 100644 src/libdash/source/mpd/AdaptationSet.h create mode 100644 src/libdash/source/mpd/BaseUrl.cpp create mode 100644 src/libdash/source/mpd/BaseUrl.h create mode 100644 src/libdash/source/mpd/ContentComponent.cpp create mode 100644 src/libdash/source/mpd/ContentComponent.h create mode 100644 src/libdash/source/mpd/Descriptor.cpp create mode 100644 src/libdash/source/mpd/Descriptor.h create mode 100644 src/libdash/source/mpd/MPD.cpp create mode 100644 src/libdash/source/mpd/MPD.h create mode 100644 src/libdash/source/mpd/Metrics.cpp create mode 100644 src/libdash/source/mpd/Metrics.h create mode 100644 src/libdash/source/mpd/MultipleSegmentBase.cpp create mode 100644 src/libdash/source/mpd/MultipleSegmentBase.h create mode 100644 src/libdash/source/mpd/Period.cpp create mode 100644 src/libdash/source/mpd/Period.h create mode 100644 src/libdash/source/mpd/ProgramInformation.cpp create mode 100644 src/libdash/source/mpd/ProgramInformation.h create mode 100644 src/libdash/source/mpd/Range.cpp create mode 100644 src/libdash/source/mpd/Range.h create mode 100644 src/libdash/source/mpd/Representation.cpp create mode 100644 src/libdash/source/mpd/Representation.h create mode 100644 src/libdash/source/mpd/RepresentationBase.cpp create mode 100644 src/libdash/source/mpd/RepresentationBase.h create mode 100644 src/libdash/source/mpd/Segment.cpp create mode 100644 src/libdash/source/mpd/Segment.h create mode 100644 src/libdash/source/mpd/SegmentBase.cpp create mode 100644 src/libdash/source/mpd/SegmentBase.h create mode 100644 src/libdash/source/mpd/SegmentList.cpp create mode 100644 src/libdash/source/mpd/SegmentList.h create mode 100644 src/libdash/source/mpd/SegmentTemplate.cpp create mode 100644 src/libdash/source/mpd/SegmentTemplate.h create mode 100644 src/libdash/source/mpd/SegmentTimeline.cpp create mode 100644 src/libdash/source/mpd/SegmentTimeline.h create mode 100644 src/libdash/source/mpd/SegmentURL.cpp create mode 100644 src/libdash/source/mpd/SegmentURL.h create mode 100644 src/libdash/source/mpd/SubRepresentation.cpp create mode 100644 src/libdash/source/mpd/SubRepresentation.h create mode 100644 src/libdash/source/mpd/Subset.cpp create mode 100644 src/libdash/source/mpd/Subset.h create mode 100644 src/libdash/source/mpd/Timeline.cpp create mode 100644 src/libdash/source/mpd/Timeline.h create mode 100644 src/libdash/source/mpd/URLType.cpp create mode 100644 src/libdash/source/mpd/URLType.h create mode 100644 src/libdash/source/network/AbstractChunk.cpp create mode 100644 src/libdash/source/network/AbstractChunk.h create mode 100644 src/libdash/source/network/DownloadStateManager.cpp create mode 100644 src/libdash/source/network/DownloadStateManager.h create mode 100644 src/libdash/source/portable/MultiThreading.cpp create mode 100644 src/libdash/source/portable/MultiThreading.h create mode 100644 src/libdash/source/portable/Networking.h create mode 100644 src/libdash/source/sublibs.mk create mode 100644 src/libdash/source/targetver.h create mode 100644 src/libdash/source/xml/DOMHelper.cpp create mode 100644 src/libdash/source/xml/DOMHelper.h create mode 100644 src/libdash/source/xml/DOMParser.cpp create mode 100644 src/libdash/source/xml/DOMParser.h create mode 100644 src/libdash/source/xml/Node.cpp create mode 100644 src/libdash/source/xml/Node.h create mode 100755 tools/bin/clion_wrapper.sh create mode 100755 tools/bin/export_ccnx_env.sh create mode 100644 tools/bin/getStatus.sh create mode 100644 tools/bin/gitAddUpstream.sh create mode 100755 tools/bin/gitCloneOneOf.sh create mode 100644 tools/bin/gitStatus.sh create mode 100755 update.sh diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..61a36eb2 --- /dev/null +++ b/Makefile @@ -0,0 +1,319 @@ + ############################################################################# + # Copyright (c) 2017 Cisco and/or its affiliates. + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at: + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + ############################################################################## + +DISTILLERY_VERSION=2.0 + +default.target: help + +all: init_depend install-all + +############################################################## +# Variables +# +# Set some variables +DISTILLERY_STAMP=.distillery.stamp +REBUILD_DEPENDS= + +############################################################## +# Load the configuration +# +# For more information please see config.default.mk +# +DISTILLERY_CONFIG_DIR ?= config + +##DISTILLERY_DEFAULT_CONFIG ?= ${DISTILLERY_CONFIG_DIR}/config.mk +##DISTILLERY_LOCAL_CONFIG ?= ${DISTILLERY_CONFIG_DIR}/local/config.mk +DISTILLERY_USER_CONFIG ?= ${DISTILLERY_CONFIG_DIR}/config.mk + +ifneq (,$(wildcard ${DISTILLERY_USER_CONFIG})) + include ${DISTILLERY_USER_CONFIG} + REBUILD_DEPENDS+=${DISTILLERY_USER_CONFIG} +else + DISTILLERY_USER_CONFIG+="[Not Found]" +endif + +ifneq (,$(wildcard ${DISTILLERY_LOCAL_CONFIG})) + include ${DISTILLERY_LOCAL_CONFIG} + REBUILD_DEPENDS+=${DISTILLERY_LOCAL_CONFIG} +endif + +include ${DISTILLERY_DEFAULT_CONFIG} + + +############################################################## +# Set the paths +# +# PATH: add our install dir, build dependencies and system dependencies +# LD_RUN_PATH: add our install dir + +export PATH := $(DISTILLERY_INSTALL_DIR)/bin:$(DISTILLERY_TOOLS_DIR)/bin:$(PATH) +#export LD_RUN_PATH := $(DISTILLERY_INSTALL_DIR)/lib +#export LD_LIBRARY_PATH := $(DISTILLERY_INSTALL_DIR)/lib +export CCNX_HOME +export FOUNDATION_HOME + + +############################################################## +# Modules +# +# Load the modules config. Please refer to that file for more information +DISTILLERY_MODULES_DIR=${DISTILLERY_CONFIG_DIR}/modules + +# The modules variable is a list of modules. It will be populated by the +# modules config files. +modules= +modules_dir= + include config/modules/000-distillery-update.mk + include config/modules/000-gitModule.mk + include config/modules/001-modules.mk + include config/modules/002-cmake-modules.mk + include config/modules/002-make-modules.mk + include config/modules/100-distillery.mk + include config/modules/110-longbow.mk + include config/modules/120-libparc.mk + include config/modules/210-libccnx-common.mk + include config/modules/220-libccnx-transport-rta.mk + include config/modules/230-libccnx-portal.mk + include config/modules/510-Metis.mk + include config/modules/610-libicnet.mk + include config/modules/610-libdash.mk + +# Load user defined modules +DISTILLERY_USER_MODULES_DIR=${DISTILLERY_USER_CONFIG_DIR}/modules +ifneq (,$(wildcard ${DISTILLERY_USER_MODULES_DIR})) + include ${DISTILLERY_USER_MODULES_DIR}/*.mk +else + DISTILLERY_USER_MODULES_DIR+="[Not Found]" +endif + +ifdef ${DISTILLERY_LOCAL_MODULES_DIR} + include ${DISTILLERY_LOCAL_MODULES_DIR}/*.mk +else + DISTILLERY_LOCAL_MODULES_DIR="[Undefined]" +endif + + +############################################################## +# Build variables and rules +# + +# We're going to create lists of targets as convenience +modules_clean=$(modules:=.clean) +modules_check=$(modules:=.check) +modules_step=$(modules:=.step) +modules_average-coverage=$(modules:=.average-coverage) + +# These are the basic build rules. They will call the module specific rules +install-all: install-directories pre-requisites ${modules} + +#distillery-sync: distillery-update ${DISTILLERY_ROOT_DIR}/tools/bin/syncOriginMasterWithCCNXUpstream +# @${DISTILLERY_ROOT_DIR}/tools/bin/syncOriginMasterWithCCNXUpstream + +init_depend: + ./scripts/init.sh ${ABI} ${DISTILLERY_INSTALL_DIR}; +android_metis: + ./scripts/compile_androidmetis.sh +android_metis_debug: + ./scripts/compile_androidmetis.sh DEBUG +android_iget: + ./scripts/compile_androidiget.sh +android_iget_debug: + ./scripts/compile_androidiget.sh DEBUG + +clobber: distclean + @rm -rf ${CONFIGURE_CACHE_FILE} + @rm -rf ${DISTILLERY_INSTALL_DIR}/bin + @rm -rf ${DISTILLERY_INSTALL_DIR}/lib + @rm -rf ${DISTILLERY_INSTALL_DIR}/include + @rm -rf ${DISTILLERY_INSTALL_DIR}/share + @rm -rf ${DISTILLERY_INSTALL_DIR}/etc + @rm -rf ${DISTILLERY_XCODE_DIR} + @rm -rf .*.stamp + +clean: ${modules_clean} + @rm -rf report.txt + +distclean: + @rm -rf ${DISTILLERY_BUILD_DIR} + @rm -rf report.txt + +#distillery-update: +# @echo "Fetching Distillery..." +# @git fetch --all +# @git pull + +distillery-upstream: + git remote add ${DISTILLERY_GITHUB_UPSTREAM_NAME} ${DISTILLERY_GITHUB_UPSTREAM_REPO} + +check: ${modules_check} + +step: ${modules_step} + +# From Distillery, 'make coverage' actually runs the summary version of coverage +# You can also run 'make .coverage' to get the output showing each file and its coverage. +coverage: ${modules_average-coverage} + +dependencies: + @${MAKE} -C dependencies + +dependencies.clean: + @${MAKE} -C dependencies clean + +dependencies.clobber: + @${MAKE} -C dependencies clobber + +pre-requisites: + +help: + @echo "Simple instructions: run \"make update step\"" + @echo + @echo "---- Basic build targets ----" + @echo "make help - This help message" + @echo "make info - Show basic information" + @echo "make status - Show status of modules" + @echo "make update - git clone and pull the different modules to the head of master" + @echo "make sync - fetch all remotes, merge upstream master, push to origin master" + @echo "make step - Module by module: configure, compile and install all software" + @echo " in the install directory (see make info) and run tests" + @echo "make all - Configure, compile and install all software in DISTILLERY_INSTALL_DIR" + @echo "make check - Run all the tests" + @echo "make clobber - Clean the build, remove the install software" + @echo + @echo "make sanity - Run simple sanity checks to test that the build is functional" + @echo + @echo "make coverage - Show the average coverage of each module." + @echo "make .coverage - Show the coverage of each file in the specified module." + @echo + @echo "---- Advanced targets ----" + @echo "make nuke-all-modules - DANGEROUS! Clean all the modules to git checkout (git clean -dfx)" + @echo " - You will lose all uncommitted changes" + @echo "make clean - Clean the build" + @echo "make distclean - Distclean the build" + @echo "make *-debug - make a target with DEBUG on (e.g. all-debug or check-debug)" + @echo "make *-release - make a target with RELEASE on (optimized)" + @echo "make *-nopants - make a target with NOPANTS on (no validation - use at your own risk)" + @echo + @echo "---- IDE support targets ----" + @echo "make xcode - Create xcode projects [only works on Mac]" + @echo "make MasterIDE.xcode - Makes an xcode uber-project (based on all-debug) that contains" + @echo " - the various sub-mdules" + @echo "make MasterIDE.xcodeopen - Makes MasterIDE.xcode and the starts xcode" + @echo "make MasterIDE.clionopen - Creates an uber CMakeLists.txt and starts CLion with the necessary" + @echo " - environment for development" + @echo + @echo "---- Basic module targets ----" + @echo "Module Directory = ${MODULES_DIRECTORY_DEFAULT}" + @echo "Modules Loaded = ${modules}" + @echo "GitModules Loaded = ${gitmodules}" + @echo "Per-module targets: \"Module\" \"Module.distclean\" \"Module.nuke\" \"Module-debug\"" + + +${DISTILLERY_STAMP}: ${REBUILD_DEPENDS} + touch $@ + +debug-%: export CMAKE_BUILD_TYPE_FLAG = -DCMAKE_BUILD_TYPE=DEBUG +debug-%: export DISTILLERY_BUILD_NAME = -debug +debug-%: + @${MAKE} $* + +%-debug: debug-% ; + +release-%: export CMAKE_BUILD_TYPE_FLAG = "-DCMAKE_BUILD_TYPE=RELEASE" +release-%: export DISTILLERY_BUILD_NAME = -release +release-%: + @${MAKE} $* + +%-release: release-% ; + +nopants-%: export CMAKE_BUILD_TYPE_FLAG = "-DCMAKE_BUILD_TYPE=NOPANTS" +nopants-%: export DISTILLERY_BUILD_NAME = -nopants +nopants-%: + @${MAKE} $* + +%-nopants: nopants-% ; + +releasedebug-%: export CMAKE_BUILD_TYPE_FLAG = "-DCMAKE_BUILD_TYPE=RELWITHDEBINFO" +releasedebug-%: export DISTILLERY_BUILD_NAME = -releasedebug +releasedebug-%: + @${MAKE} $* + +%-releasedebug: releasedebug-% ; + +install-directories: + @mkdir -p ${DISTILLERY_INSTALL_DIR}/include + @mkdir -p ${DISTILLERY_INSTALL_DIR}/lib + @mkdir -p ${DISTILLERY_INSTALL_DIR}/bin + +Distillery.report: + @echo '###################################' + @echo 'Distillery report' + @echo "#" `date "+%Y-%m-%d %H:%M:%S"` + @echo "#" `uname -sr` "-" `uname -pm` + @echo "#" `uname -n` + @echo "#" PATH=${PATH} + + @git status + @git log -1 + @git diff -U1 + +report.txt: + $(MAKE) report > report.txt + @cat report.txt + +distillery.checkout.error: + @echo + @echo =========================================================== + @echo + @echo DISTILLERY ERROR: You have not checked out a repository! + @echo Please make sure to run \"make update\" at least once + @echo + @echo Otherwise there is a misconfigured module, + @echo please check the module config files at .distillery/modules + @echo + @echo =========================================================== + @echo + + +info: + @echo "############ Distillery Info ##################" + @${MAKE} env + + +# env produces shell interpretable output. It is read by some scripts. +# DO NOT ALTER THE FORMAT +env: + @echo DISTILLERY_ROOT_DIR=${DISTILLERY_ROOT_DIR} + @echo DISTILLERY_SOURCE_DIR=${DISTILLERY_SOURCE_DIR} + @echo DISTILLERY_BUILD_DIR=${DISTILLERY_BUILD_DIR} + @echo DISTILLERY_DEFAULT_CONFIG=${DISTILLERY_DEFAULT_CONFIG} + @echo DISTILLERY_LOCAL_CONFIG=${DISTILLERY_LOCAL_CONFIG} + @echo DISTILLERY_USER_CONFIG=${DISTILLERY_USER_CONFIG} + @echo DISTILLERY_MODULES_DIR=${DISTILLERY_MODULES_DIR} + @echo DISTILLERY_LOCAL_MODULES_DIR=${DISTILLERY_LOCAL_MODULES_DIR} + @echo DISTILLERY_USER_MODULES_DIR=${DISTILLERY_USER_MODULES_DIR} + @echo DISTILLERY_INSTALL_DIR=${DISTILLERY_INSTALL_DIR} + @echo DISTILLERY_DEPENDENCIES_DIR=${DISTILLERY_DEPENDENCIES_DIR} + @echo DISTILLERY_EXTERN_DIR=${DISTILLERY_EXTERN_DIR} + @echo DISTILLERY_TOOLS_DIR=${DISTILLERY_TOOLS_DIR} + @echo DISTILLERY_GITHUB_URL=${DISTILLERY_GITHUB_URL} + @echo DISTILLERY_GITHUB_URL_USER=${DISTILLERY_GITHUB_URL_USER} + @echo DISTILLERY_GITHUB_UPSTREAM_URL=${DISTILLERY_GITHUB_UPSTREAM_URL} + @echo CCNX_DEPENDENCIES=${CCNX_DEPENDENCIES} + @echo LD_LIBRARY_PATH=${LD_LIBRARY_PATH} + @echo LD_RUN_PATH=${LD_RUN_PATH} + @echo CCNX_HOME=${CCNX_HOME} + @echo PATH=${PATH} + +.PHONY: dependencies diff --git a/README.md b/README.md new file mode 100644 index 00000000..e0c87cf0 --- /dev/null +++ b/README.md @@ -0,0 +1,112 @@ +############################################################################# +# Copyright (c) 2017 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +############################################################################## + +Android SDK + +This is the CCNx Distillery software distribution for Android. It is in charge of pulling +together all the necessary modules to build a full CCNx software suite for Android. + + +## Quick Start ## + + +Clone this distro + +``` +git clone -b androidsdk/master https://gerrit.fd.io/r/cicn androidSdk +cd androidSdk +``` + +Export Android Sdk path + +``` +export SDK_PATH=/Users/angelomantellini/Library/Android/sdk +``` + +Export Android Ndk path + +``` +export SDK_PATH=/Users/angelomantellini/Library/Android/sdk/ndk-bundle +``` + +Export Android Android CMAKE path + +``` +export SDK_PATH=/Users/angelomantellini/Library/Android/sdk/cmake/3.6.3155560/bin +``` + +If the previous variables are not set, Sdk, Ndk and CMake for android will be downloaded + +Compile everything (dependencies and CCNx modules) + +``` +make all +``` + +The CCNx software will be installed in androidSdk/usr + + +To compile Metis for android app (ccnxandroidmetis) + +``` +make android_metis +``` + +To install the application run + +``` +adb install -r ccnxandroidmetis/app/build/outputs/apk/app-armeabi-v7a-release.apk +``` + +To compile IGet for android app (ccnxandroidmetis) + +``` +make android_iget +``` + +To install the application run + +``` +adb install -r iget_android/app/build/outputs/apk/app-armeabi-v7a-release.apk +``` + + +## Platforms ## + +- Android + + + +## Getting Started ## + +To get simple help run `make`. This will give you a list of possible targets to +execute. You will basically want to download all the sources and compile. + +Here's a short summary: + +- `make init_depend` - Compile the CCNx dependencies each module in sequence +- `make all` - Compile all the software +- `make distclean` - Delete build directory (but not built executables) +- `make clobber` - Delete build directory and install directories. WARNING - If you configure this to install on a system directory this may delete system files! +- `make android_metis` - Compile the Metis for Android +- `make android_metis_debug` - Compile the Metis for Android in debug mode +- `make android_iget` - Compile the Metis for Android +- `make android_iget_debug` - Compile the Metis for Android in debug mode + + +## Configuration ## + +Distillery can be configured in multiple ways. Please check the config directory (specifically `config/config.mk`) for more information. + diff --git a/ccnxandroidmetis/.gitignore b/ccnxandroidmetis/.gitignore new file mode 100644 index 00000000..b1acfd93 --- /dev/null +++ b/ccnxandroidmetis/.gitignore @@ -0,0 +1 @@ +local.properties \ No newline at end of file diff --git a/ccnxandroidmetis/MetisControl/build.gradle b/ccnxandroidmetis/MetisControl/build.gradle new file mode 100644 index 00000000..a1e8ed15 --- /dev/null +++ b/ccnxandroidmetis/MetisControl/build.gradle @@ -0,0 +1,52 @@ + +apply plugin: 'com.android.application' + +android { + compileSdkVersion 23 + buildToolsVersion '25.0.0' + + defaultConfig { + applicationId "com.parc.ccnx.ccnxsdk" + minSdkVersion 15 + targetSdkVersion 23 + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } + + dexOptions { + preDexLibraries true + javaMaxHeapSize "2g" // Use gig increments depending on needs + //incremental true + } + + signingConfigs { + release { + storeFile file("metis.keystore") + storePassword "icn_metis" + keyAlias "metis" + keyPassword "icn_metis" + } + } + + buildTypes { + release { + signingConfig signingConfigs.release + } + } +} + + +dependencies { + compile project(':ccnxsupportlibrary') + compile fileTree(include: ['*.jar'], dir: 'libs') + testCompile 'junit:junit:4.12' + compile 'com.android.support:appcompat-v7:23.4.0' + compile 'com.android.support:design:23.4.0' + compile 'com.android.support:support-v4:23.4.0' +} diff --git a/ccnxandroidmetis/MetisControl/metis.keystore b/ccnxandroidmetis/MetisControl/metis.keystore new file mode 100644 index 00000000..3435fccd Binary files /dev/null and b/ccnxandroidmetis/MetisControl/metis.keystore differ diff --git a/ccnxandroidmetis/MetisControl/proguard-rules.pro b/ccnxandroidmetis/MetisControl/proguard-rules.pro new file mode 100644 index 00000000..c51dd9b5 --- /dev/null +++ b/ccnxandroidmetis/MetisControl/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /Users/walendo/Library/Android/sdk/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/ccnxandroidmetis/MetisControl/src/main/AndroidManifest.xml b/ccnxandroidmetis/MetisControl/src/main/AndroidManifest.xml new file mode 100644 index 00000000..272d9270 --- /dev/null +++ b/ccnxandroidmetis/MetisControl/src/main/AndroidManifest.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/ForwarderStatusActivity.java b/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/ForwarderStatusActivity.java new file mode 100644 index 00000000..7bc6bdb3 --- /dev/null +++ b/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/ForwarderStatusActivity.java @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.metis.ccnx.ccnxsdk.metiscontrol; + +import android.os.Bundle; +import android.support.design.widget.FloatingActionButton; +import android.support.v4.app.Fragment; +import android.support.v4.app.FragmentManager; +import android.support.v4.app.FragmentPagerAdapter; +import android.support.v4.view.ViewPager; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +public class ForwarderStatusActivity extends AppCompatActivity implements + MetisStatusFragment.OnFragmentVisibleListener { + + private static final String TAG = "CCNX FSA"; + + private SectionsPagerAdapter mSectionsPagerAdapter; + + private ViewPager mViewPager; + private Fragment mVisibleFragment; + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_forwarder_status); + + Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager()); + mViewPager = (ViewPager) findViewById(R.id.container); + mViewPager.setAdapter(mSectionsPagerAdapter); + + + final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); + + assert fab != null; + fab.setVisibility(View.GONE); + + fab.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + if (mVisibleFragment != null) { + if (mVisibleFragment instanceof IMetisAddNewItem) { + IMetisAddNewItem fragment = (IMetisAddNewItem) mVisibleFragment; + fragment.showAddNewItemDialog(); + } + } + } + }); + + } + + + @Override + + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.menu_forwarder_status, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + + int id = item.getItemId(); + + if (id == R.id.action_settings) { + return true; + } + + return super.onOptionsItemSelected(item); + } + + public static class PlaceholderFragment extends Fragment { + + private static final String ARG_SECTION_NUMBER = "section_number"; + + public PlaceholderFragment() { + } + + public static PlaceholderFragment newInstance(int sectionNumber) { + PlaceholderFragment fragment = new PlaceholderFragment(); + Bundle args = new Bundle(); + args.putInt(ARG_SECTION_NUMBER, sectionNumber); + fragment.setArguments(args); + return fragment; + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + View rootView = inflater.inflate(R.layout.fragment_forwarder_status, container, false); + TextView textView = (TextView) rootView.findViewById(R.id.section_label); + textView.setText(getString(R.string.section_format, getArguments().getInt(ARG_SECTION_NUMBER))); + return rootView; + } + } + + public class SectionsPagerAdapter extends FragmentPagerAdapter { + + public SectionsPagerAdapter(FragmentManager fm) { + super(fm); + } + + @Override + public Fragment getItem(int position) { + return MetisStatusFragment.newInstance(position + 1); + } + + @Override + public int getCount() { + return 1; + } + + @Override + public CharSequence getPageTitle(int position) { + return "SECTION 1"; + } + + + } + + public void onFragmentVisible(Fragment fragment) { + Log.d(TAG, "***** PAGE: " + fragment + " is now showing."); + mVisibleFragment = fragment; + + final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); + + if (fragment instanceof IMetisAddNewItem) { + fab.setVisibility(View.VISIBLE); + } else { + fab.setVisibility(View.INVISIBLE); + } + + String appName = getResources().getString(R.string.app_name); + + if (fragment instanceof IMetisNamedFragment) { + appName += " // " + ((IMetisNamedFragment) fragment).getFragmentName(); + } + + setTitle(appName); + + } + + + +} diff --git a/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/IMetisAddNewItem.java b/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/IMetisAddNewItem.java new file mode 100644 index 00000000..549f4a68 --- /dev/null +++ b/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/IMetisAddNewItem.java @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.metis.ccnx.ccnxsdk.metiscontrol; + +public interface IMetisAddNewItem { + + void showAddNewItemDialog(); + +} diff --git a/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/IMetisNamedFragment.java b/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/IMetisNamedFragment.java new file mode 100644 index 00000000..bc4cddca --- /dev/null +++ b/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/IMetisNamedFragment.java @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.metis.ccnx.ccnxsdk.metiscontrol; + +public interface IMetisNamedFragment { + public String getFragmentName(); +} diff --git a/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/MetisConstants.java b/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/MetisConstants.java new file mode 100644 index 00000000..7b9046ae --- /dev/null +++ b/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/MetisConstants.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.metis.ccnx.ccnxsdk.metiscontrol; + +public class MetisConstants { + + public static final int MetisDefaultListenerPort = 9695; + + public static final String MetisModule_Control = "Control"; + public static final String MetisModule_FIB = "FIB"; + public static final String MetisModule_PIT = "PIT"; + public static final String MetisModule_ContentStore = "ContentStore"; + public static final String MetisModule_TransportLinkAdapter = "TransportLinkAdapter"; + + public static final String CCNxNameMetis_Forwarder = "ccnx:/local/forwarder"; + public static final String CCNxNameMetis_Control = CCNxNameMetis_Forwarder + "/" + MetisModule_Control; + public static final String CCNxNameMetis_FIB = CCNxNameMetis_Forwarder + "/" + MetisModule_FIB; + public static final String CCNxNameMetis_PIT = CCNxNameMetis_Forwarder + "/" + MetisModule_PIT; + public static final String CCNxNameMetis_ContentStore = CCNxNameMetis_Forwarder + "/" + MetisModule_ContentStore; + ; + public static final String CCNxNameMetis_Link = CCNxNameMetis_Forwarder + "/" + MetisModule_TransportLinkAdapter; + + // General Commands + public static final int MetisCommandSegment = 3; + public static final String MetisCommand_Lookup = "lookup"; + public static final String MetisCommand_Add = "add"; + public static final String MetisCommand_List = "list"; + public static final String MetisCommand_Remove = "remove"; + public static final String MetisCommand_Resize = "resize"; + public static final String MetisCommand_Set = "set"; + public static final String MetisCommand_Quit = "quit"; + public static final String MetisCommand_Run = "spawn"; + public static final String MetisCommand_Stats = "stats"; + + public static final String MetisCommand_LogLevel = "level"; + public static final String MetisCommand_LogDebug = "debug"; + public static final String MetisCommand_LogInfo = "info"; + public static final String MetisCommand_LogError = "error"; + public static final String MetisCommand_LogAll = "all"; + public static final String MetisCommand_LogOff = "off"; + public static final String MetisCommand_LogNotice = "notice"; + ; + + // Module Specific Commands + public static final String CCNxNameMetisCommand_LinkConnect = CCNxNameMetis_Link + "/" + MetisCommand_Add; // create a connection to interface specified in payload, returns name + public static final String CCNxNameMetisCommand_LinkDisconnect = CCNxNameMetis_Link + "/" + MetisCommand_Remove; // remove a connection to interface specified in payload, by name + public static final String CCNxNameMetisCommand_LinkList = CCNxNameMetis_Link + "/" + MetisCommand_List; // list interfaces + + public static final String CCNxNameMetisCommand_FIBLookup = CCNxNameMetis_FIB + "/" + MetisCommand_Lookup; // return current FIB contents for name in payload + public static final String CCNxNameMetisCommand_FIBList = CCNxNameMetis_FIB + "/" + MetisCommand_List; // list current FIB contents + public static final String CCNxNameMetisCommand_FIBAddRoute = CCNxNameMetis_FIB + "/" + MetisCommand_Add; // add route for arguments in payload + public static final String CCNxNameMetisCommand_FIBRemoveRoute = CCNxNameMetis_FIB + "/" + MetisCommand_Remove; // remove route for arguments in payload + + public static final String CCNxNameMetisCommand_PITLookup = CCNxNameMetis_PIT + "/" + MetisCommand_Lookup; // return current PIT contents for name in payload + public static final String CCNxNameMetisCommand_PITList = CCNxNameMetis_PIT + "/" + MetisCommand_List; // list current PIT contents + + public static final String CCNxNameMetisCommand_ContentStoreResize = CCNxNameMetis_ContentStore + "/" + MetisCommand_Resize; // resize current content store to size in MB in payload + + public static final String CCNxNameMetisCommand_Quit = CCNxNameMetis_Control + "/" + MetisCommand_Quit; // ask the forwarder to exit + public static final String CCNxNameMetisCommand_Run = CCNxNameMetis_Control + "/" + MetisCommand_Run; // start a new forwarder instance + public static final String CCNxNameMetisCommand_Set = CCNxNameMetis_Control + "/" + MetisCommand_Set; // set a forwarder variable + public static final String CCNxNameMetisCommand_Stats = CCNxNameMetis_Control + "/" + MetisCommand_Stats; // get forwarder stats +}; diff --git a/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/MetisService.java b/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/MetisService.java new file mode 100644 index 00000000..ee5ef5be --- /dev/null +++ b/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/MetisService.java @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.metis.ccnx.ccnxsdk.metiscontrol; + +import android.app.Notification; +import android.app.PendingIntent; +import android.app.Service; +import android.content.Intent; +import android.os.IBinder; +import android.util.Log; + +import com.metis.ccnx.ccnxsupportlibrary.Metis; +import android.widget.TextView; + +import java.io.IOException; +import java.io.OutputStream; +import java.net.Socket; + +public class MetisService extends Service { + private final static String TAG = "CCNx.MetisService"; + + private static Thread sForwarderThread = null; + + public MetisService() { + } + + private String path; + + @Override + public IBinder onBind(Intent intent) { + return null; + } + + + @Override + public int onStartCommand(Intent intent, int flags, int startId) { + + Metis metis = Metis.getInstance(); + if (!metis.isRunning()) { + Log.d(TAG, "Starting Metis"); + String path = null; + if (intent != null && intent.getExtras() != null && intent.getExtras().get("path") != null) { + + path = intent.getExtras().get("path").toString(); + startForwarder(intent, path); + } else { + //TextView mPathTextView = (TextView) view.findViewById(R.id.pathText); + startForwarder(intent, "/storage/emulated/0/MetisConf/metis.cfg".toString()); + } + } else { + Log.d(TAG, "Metis already running."); + } + // Tell Android we want it restarted if it dies or is killed by the OS. + return Service.START_STICKY; + } + + + @Override + public void onDestroy() { + //get Metis instance + Metis metis = Metis.getInstance(); + Log.d(TAG, "Destroying"); + if (metis.isRunning()) { + Log.d(TAG, "Trying to stop Metis: " + metis.toString()); + metis.stop(); + stopForeground(true); + } + super.onDestroy(); + } + + protected Runnable mForwarderRunner = new Runnable() { + + //private String path; + @Override + public void run() { + Metis metis = Metis.getInstance(); + + metis.start(path); + } + + + }; + + + private void startForwarder(Intent intent, String path) { + + int NOTIFICATION_ID = 12345; + + Metis metis = Metis.getInstance(); + if (!metis.isRunning()) { + this.path = path; + sForwarderThread = new Thread(mForwarderRunner, "CCNx.MetisRunner"); + sForwarderThread.start(); + metis.isRunning(); + Intent resultIntent = new Intent(this, ForwarderStatusActivity.class); + + PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, resultIntent, 0); + + Notification notification = new Notification.Builder(getApplicationContext()) + .setContentTitle(getString(R.string.app_name)) + .setContentText("Metis is running") + // .setSmallIcon(R.drawable.ic_notification) + .setSmallIcon(R.mipmap.ic_notification) + .setWhen(System.currentTimeMillis()) + .setContentIntent(pendingIntent) + .build(); + + notification.flags |= Notification.FLAG_NO_CLEAR; + + startForeground(NOTIFICATION_ID, notification); + } + } + + +} diff --git a/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/MetisStatusFragment.java b/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/MetisStatusFragment.java new file mode 100644 index 00000000..370a53b4 --- /dev/null +++ b/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/MetisStatusFragment.java @@ -0,0 +1,426 @@ +/* + * Copyright (c) 2017 Cisco and/or its affiliates. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.metis.ccnx.ccnxsdk.metiscontrol; + +import android.content.Context; +import android.content.Intent; +import android.os.AsyncTask; +import android.os.Bundle; +import android.os.Handler; +import android.support.design.widget.Snackbar; +import android.support.v4.app.Fragment; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.AdapterView; +import android.widget.CompoundButton; +import android.widget.Spinner; +import android.widget.Switch; +import android.widget.TextView; + +import com.metis.ccnx.ccnxsupportlibrary.Metis; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.net.Inet4Address; +import java.net.InetAddress; +import java.nio.charset.Charset; +import java.util.List; + + +public class MetisStatusFragment extends Fragment implements IMetisNamedFragment { + + private static final String ARG_PAGER_INDEX = "metisstatus_pager_number"; + private static final String TAG = "CCNXMetis SF"; + + // TODO: Rename and change types of parameters + private int mPagerIndex; + + private Switch mSwitchMetisOnOff = null; + private Spinner mSpinnerLogLevel = null; + private Switch mSwitchContentStoreOnOff = null; + private TextView mTVNumInterests = null; + private TextView mTVNumContentObjects = null; + private TextView mTVNumInterestReturns = null; + private TextView mTVNumControlMessages = null; + private TextView mTVNumPITEntries = null; + private TextView mPathTextView = null; + + // Stats counters, updated by background task. + private long mNumInterests = 0; + private long mNumCOs = 0; + private long mNumInterestReturns = 0; + private long mNumControl = 0; + private long mNumPITENtries = 0; + + private boolean mIsStatsQueryRunning = false; + + + //private PortalFactory mPortalFactory = null; + + private OnFragmentVisibleListener mListener; + + + /** + * Create a Handler and a Runnable to be called every few seconds to query + * Metis (when running) for stats. + */ + private Handler mStatusUpdaterHandler = new Handler(); + private Runnable mStatusUpdateRunnable = new Runnable() { + @Override + public void run() { + // This runs on the main thread, so start an AsyncTask + // Repeat this the same runnable code block again another few seconds + //new GetStatusTask(null).execute(mPortalFactory); + //if (mIsStatsQueryRunning) { + //mStatusUpdaterHandler.postDelayed(mStatusUpdateRunnable, 2 * 1000); + //} + } + }; + + + public MetisStatusFragment() { + // Required empty public constructor + } + + /** + * Use this factory method to create a new instance of + * this fragment using the provided parameters. + * + * @return A new instance of fragment MetisStatusFragment. + */ + // TODO: Rename and change types and number of parameters + public static MetisStatusFragment newInstance(int pagerIndex) { + MetisStatusFragment fragment = new MetisStatusFragment(); + Bundle args = new Bundle(); + args.putInt(ARG_PAGER_INDEX, pagerIndex); + + fragment.setArguments(args); + + return fragment; + } + + @Override + public void onStart() { + Metis metis = Metis.getInstance(); + mSwitchMetisOnOff.setChecked(metis.isRunning()); + super.onStart(); + } + + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if (getArguments() != null) { + mPagerIndex = getArguments().getInt(ARG_PAGER_INDEX); + } + + + Log.d(TAG, "Creating new PortalFactory"); + //Identity identity = CCNxUtils.createCCNxIdentity(getContext(), + // "password", "ccnxsdkdemo", 1024, 30); + //mPortalFactory = new PortalFactory(identity); + } + + + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + View view = inflater.inflate(R.layout.fragment_metis_status, container, false); + + mSwitchMetisOnOff = (Switch) view.findViewById(R.id.switchMetisOnOff); + mSwitchContentStoreOnOff = (Switch) view.findViewById(R.id.switchMetisContentStoreOnOff); + mSpinnerLogLevel = (Spinner) view.findViewById(R.id.spinnerMetisLoggingLevel); + mPathTextView = (TextView) view.findViewById(R.id.pathText) ; + + mSpinnerLogLevel.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { + @Override + public void onItemSelected(AdapterView parent, View view, int position, long id) { + String loggingLevel = mSpinnerLogLevel.getSelectedItem().toString(); + updateMetisLoggingLevel(loggingLevel); + } + + @Override + public void onNothingSelected(AdapterView parent) { + + } + }); + + mSwitchMetisOnOff.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + if (isChecked) { + startMetis(); + //mSpinnerLogLevel.setEnabled(true); + //Log.d(TAG, "################# Start periodic query for stats"); + //if (!mIsStatsQueryRunning) { + // mStatusUpdaterHandler.postDelayed(mStatusUpdateRunnable, 500); + // mIsStatsQueryRunning = true; + // String loggingLevel = mSpinnerLogLevel.getSelectedItem().toString(); + // if (!loggingLevel.equalsIgnoreCase("off")) { + // updateMetisLoggingLevel(loggingLevel); + // } + //} + } else { + Log.d(TAG, "################# Stop periodic query for stats"); + //mStatusUpdaterHandler.removeCallbacks(mStatusUpdateRunnable); + //mIsStatsQueryRunning = false; + stopMetis(); + //mSpinnerLogLevel.setEnabled(false); + //mSpinnerLogLevel.setSelection(0); + } + } + }); + + mTVNumInterests = (TextView) view.findViewById(R.id.tvStatsNumInterests); + mTVNumContentObjects = (TextView) view.findViewById(R.id.tvStatsNumContentObjects); + mTVNumInterestReturns = (TextView) view.findViewById(R.id.tvStatsNumInterestReturns); + mTVNumControlMessages = (TextView) view.findViewById(R.id.tvStatsNumControl); + mTVNumPITEntries = (TextView) view.findViewById(R.id.tvStatsPITSize); + + mTVNumInterests.setText(String.valueOf(mNumInterests)); + mTVNumContentObjects.setText(String.valueOf(mNumCOs)); + mTVNumControlMessages.setText(String.valueOf(mNumControl)); + mTVNumInterestReturns.setText(String.valueOf(mNumInterestReturns)); + mTVNumPITEntries.setText(""); + + return view; + } + + private void startMetis() { + mPathTextView.setEnabled(false); + Metis metis = Metis.getInstance(); + if (!metis.isRunning()) { + Intent intent = new Intent(getActivity(), MetisService.class); + intent.putExtra("path", mPathTextView.getText()); + getActivity().startService(intent); + + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + createExternalListeners(); + } + }, 1000); + } + } + + private void stopMetis() { + mPathTextView.setEnabled(true); + Intent intent = new Intent(getActivity(), MetisService.class); + + getActivity().stopService(intent); + + } + + private void updateMetisLoggingLevel(String loggingLevel) { + /*Metis metis = Metis.getInstance(); + if (metis.isRunning()) { + // Send an Interest control message to Metis with the new logging level. + String commandURI = MetisConstants.CCNxNameMetisCommand_Set + "/" + MetisConstants.MetisCommand_LogLevel + "/" + loggingLevel; + Name name = new Name(commandURI); + SendInterestTask task = new SendInterestTask(name, null, new SendInterestTask.OnInterestSentListener() { + @Override + public void onInterestSent(Message message) { + if (message instanceof ContentObject) { + + String responseString = new String(((ContentObject) message).payload()); + Snackbar snackbar = Snackbar + .make(mSwitchMetisOnOff, responseString, Snackbar.LENGTH_SHORT); + + snackbar.show(); + } else { + Log.d(TAG, "Unexpected non-Content response from sent Interest"); + } + } + }); + + task.execute(mPortalFactory); + }*/ + } + + private void createExternalListeners() { + + /*Metis metis = Metis.getInstance(); + + if (metis.isRunning()) { + + List ipAddresses = CCNxUtils.getLocalIpAddress(); + + for (InetAddress addr : ipAddresses) { + + // For the moment, just listen on the IPV4 addresses. The V6 addresses should work, + // but it's not yet tested. + + if (addr instanceof Inet4Address) { + + String ipAddress = addr.getHostAddress(); + + Log.d(TAG, "Adding external listener on: " + ipAddress); + + String linkURI = "tcp://" + ipAddress + ":" + MetisConstants.MetisDefaultListenerPort + "/listener"; + + Name name = new Name(MetisConstants.CCNxNameMetisCommand_LinkConnect); + + SendInterestTask task = new SendInterestTask(name, linkURI.getBytes(), new SendInterestTask.OnInterestSentListener() { + @Override + public void onInterestSent(Message message) { + if (message instanceof ContentObject) { + + String responseString = new String(((ContentObject) message).payload()); + Snackbar snackbar = Snackbar + .make(mSwitchMetisOnOff, responseString, Snackbar.LENGTH_SHORT); + + snackbar.show(); + } else { + Log.d(TAG, "Unexpected non-Content response from sent Interest"); + } + } + }); + + task.execute(mPortalFactory); + } + } + }*/ + } + + + @Override + public void onAttach(Context context) { + super.onAttach(context); + if (context instanceof OnFragmentVisibleListener) { + mListener = (OnFragmentVisibleListener) context; + } else { + throw new RuntimeException(context.toString() + + " must implement OnFragmentInteractionListener"); + } + } + + + @Override + public void setUserVisibleHint(boolean isVisibleToUser) { + super.setUserVisibleHint(isVisibleToUser); + Metis metis = Metis.getInstance(); + + if (isVisibleToUser) { + mListener.onFragmentVisible(this); + + if (metis.isRunning()) { + // Begin updating stats. + if (!mIsStatsQueryRunning) { + mStatusUpdaterHandler.postDelayed(mStatusUpdateRunnable, 100); + mIsStatsQueryRunning = true; + } + } + } else { + mStatusUpdaterHandler.removeCallbacks(mStatusUpdateRunnable); + mIsStatsQueryRunning = false; + } + } + + @Override + public void onDetach() { + mStatusUpdaterHandler.removeCallbacks(mStatusUpdateRunnable); + mIsStatsQueryRunning = false; + super.onDetach(); + mListener = null; + } + + @Override + public String getFragmentName() { + return "Status"; + } + + public interface OnFragmentVisibleListener { + // TODO: Update argument type and name + void onFragmentVisible(Fragment which); + } + + /*private class GetStatusTask extends AsyncTask { + + private boolean mSuccess = false; + private PortalFactory mPortalFactory = null; + + + public GetStatusTask(String unused) { + } + + @Override + protected Integer doInBackground(PortalFactory... args) { + Thread.currentThread().setName("GetStatusTask-Async"); + + mPortalFactory = args[0]; + try { + Name controlName = new Name(MetisConstants.CCNxNameMetisCommand_Stats); + + Interest interest = new Interest(controlName); + + try { + Portal portal = mPortalFactory.getPortal(); + + portal.send(interest, 0L); + + Message m = portal.receive(0L); + + if (m instanceof ContentObject) { + mSuccess = true; + ContentObject co = (ContentObject) m; + byte[] payload = co.payload(); + + if (payload != null) { + String jsonString = new String(payload, Charset.defaultCharset()); + //Log.d(TAG, "Received: XX " + jsonString + " XX"); + try { + JSONObject jo = new JSONObject(jsonString); + //Log.d(TAG, "JSON2: " + jo.toString(2)); + + mNumInterests = jo.getLong("numProcessedInterests"); + mNumCOs = jo.getLong("numProcessedContentObjects"); + mNumControl = jo.getLong("numProcessedControlMessages"); + mNumInterestReturns = jo.getLong("numProcessedInterestReturns"); + } catch (JSONException ex) { + Log.e(TAG, "Could not parse returned JSON: " + ex.getMessage()); + } + } + } + portal.close(); + } catch (Portal.CommunicationsError ex) { + Log.e(TAG, "Error sending AddLink command: " + ex.getMessage()); + } + } catch (Exception ex) { + Log.e(TAG, "Error adding link: " + ex.getMessage()); + } + + return 1; + } + + @Override + protected void onPostExecute(Integer ignored) { + + if (mSuccess) { + mTVNumInterests.setText(String.valueOf(mNumInterests)); + mTVNumContentObjects.setText(String.valueOf(mNumCOs)); + mTVNumControlMessages.setText(String.valueOf(mNumControl)); + mTVNumInterestReturns.setText(String.valueOf(mNumInterestReturns)); + mTVNumPITEntries.setText(""); + } + } + }*/ + +} diff --git a/ccnxandroidmetis/MetisControl/src/main/res/drawable/add_panel_border.xml b/ccnxandroidmetis/MetisControl/src/main/res/drawable/add_panel_border.xml new file mode 100644 index 00000000..abb8d9a8 --- /dev/null +++ b/ccnxandroidmetis/MetisControl/src/main/res/drawable/add_panel_border.xml @@ -0,0 +1,9 @@ + + + + + + diff --git a/ccnxandroidmetis/MetisControl/src/main/res/drawable/ic_plus_48.png b/ccnxandroidmetis/MetisControl/src/main/res/drawable/ic_plus_48.png new file mode 100644 index 00000000..660a9e50 Binary files /dev/null and b/ccnxandroidmetis/MetisControl/src/main/res/drawable/ic_plus_48.png differ diff --git a/ccnxandroidmetis/MetisControl/src/main/res/drawable/ic_plus_96.png b/ccnxandroidmetis/MetisControl/src/main/res/drawable/ic_plus_96.png new file mode 100644 index 00000000..f73a233c Binary files /dev/null and b/ccnxandroidmetis/MetisControl/src/main/res/drawable/ic_plus_96.png differ diff --git a/ccnxandroidmetis/MetisControl/src/main/res/layout/activity_forwarder_status.xml b/ccnxandroidmetis/MetisControl/src/main/res/layout/activity_forwarder_status.xml new file mode 100644 index 00000000..5e627c02 --- /dev/null +++ b/ccnxandroidmetis/MetisControl/src/main/res/layout/activity_forwarder_status.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + diff --git a/ccnxandroidmetis/MetisControl/src/main/res/layout/fragment_forwarder_status.xml b/ccnxandroidmetis/MetisControl/src/main/res/layout/fragment_forwarder_status.xml new file mode 100644 index 00000000..943d2ad2 --- /dev/null +++ b/ccnxandroidmetis/MetisControl/src/main/res/layout/fragment_forwarder_status.xml @@ -0,0 +1,16 @@ + + + + + diff --git a/ccnxandroidmetis/MetisControl/src/main/res/layout/fragment_metis_links.xml b/ccnxandroidmetis/MetisControl/src/main/res/layout/fragment_metis_links.xml new file mode 100644 index 00000000..1041eeb4 --- /dev/null +++ b/ccnxandroidmetis/MetisControl/src/main/res/layout/fragment_metis_links.xml @@ -0,0 +1,99 @@ + + + + + + + + + +