├── .gitignore ├── BUILDING.md ├── CHANGELOG.txt ├── ClientTesting ├── bin │ └── run_sender.sh ├── build.gradle └── src │ └── main │ └── kotlin │ └── mil │ └── navy │ └── nrl │ └── xop │ └── client │ ├── SmackRecvr.kt │ └── SmackSender.kt ├── LICENSE ├── README.md ├── RUNNING.md ├── android-daemon-service ├── app-release.aar └── build.gradle ├── build.gradle ├── docs └── GcsIntegration.txt ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── run.sh ├── scripts ├── create_xogpkg.sh ├── moveXOPapk.sh └── run_xop_android ├── settings.gradle ├── vm_config ├── README.md ├── deploy_vm.sh ├── nrl_xmpp_overlay.service ├── sshkeys │ ├── id_rsa_nrl_xo_vm │ └── id_rsa_nrl_xo_vm.pub └── vm.properties ├── xop-android ├── .gitignore ├── build.gradle ├── libs │ └── asmack-android-8-0.8.5.jar ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ ├── bin │ │ └── armeabi-v7a │ │ │ ├── gcsd-android │ │ │ └── mgen │ └── data │ │ ├── gcsd-config.besteffort.json │ │ ├── gcsd-config.json │ │ ├── gcsd-config.norm.json │ │ └── mcm.mgn │ ├── java │ └── mil │ │ └── navy │ │ └── nrl │ │ └── xop │ │ └── android │ │ ├── GCSDaemonService.java │ │ ├── MGENDaemonService.java │ │ ├── XOPActivity.java │ │ ├── XOPPreferencesActivity.java │ │ └── XOPService.java │ └── res │ ├── drawable-hdpi │ └── ic_launcher.png │ ├── drawable-mdpi │ └── ic_launcher.png │ ├── drawable-xhdpi │ └── ic_launcher.png │ ├── drawable-xxhdpi │ └── ic_launcher.png │ ├── drawable │ ├── ic_action_copy.png │ ├── ic_action_settings.png │ ├── icon.png │ ├── indicator_green.xml │ ├── indicator_red.xml │ └── indicator_yellow.xml │ ├── layout │ ├── activity_xop.xml │ ├── main_layout.xml │ ├── popup.xml │ ├── popup_spinner.xml │ ├── pref_layout.xml │ └── version_layout.xml │ ├── menu │ ├── main_activity_actions.xml │ └── menu_xo.xml │ ├── raw │ ├── cacerts.bks │ ├── keystore.bks │ └── logging.properties │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── dimens.xml │ ├── strings.xml │ ├── styles.xml │ └── version.xml └── xop ├── .gitignore ├── bin ├── list_nets.bat ├── list_nets.sh ├── run_test.sh ├── start_tcpdump.sh ├── start_xop.bat ├── start_xop.sh ├── start_xop_x86.bat ├── test_clientconnection.sh ├── test_gateway.sh ├── test_transport.sh └── xop.rc.sh ├── build.gradle ├── config ├── cacerts.bks ├── cacerts.jks ├── clientkeystore ├── gateway-logging.properties ├── keystore.bks ├── keystore.jks ├── logging.properties ├── nrlxogstore ├── nrlxogtruststore ├── te.properties ├── test-logging.properties ├── transport.properties ├── xop-de.properties ├── xop.fin.properties ├── xop.ncia.properties ├── xop.properties ├── xop.properties.0.9.2 ├── xop.properties.cwix └── xop.properties.openfire ├── jniLibs ├── darwin │ └── libmil_navy_nrl_norm.dylib ├── x86 │ ├── libmil_navy_nrl_norm.so │ ├── libnorm.so │ ├── libnorm.so.1 │ ├── libsqlite4java-osx-10.4.jnilib │ ├── libsqlite4java-osx.jnilib │ ├── mil_navy_nrl_norm.dll │ ├── norm-1.dll │ └── sqlite4java-win32-x86.dll └── x86_64 │ ├── libmil_navy_nrl_norm.dylib │ ├── libmil_navy_nrl_norm.so │ ├── libnorm.so │ ├── libnorm.so.1 │ ├── mil_navy_nrl_norm.dll │ ├── norm-1.dll │ └── sqlite4java-win32-x64.dll ├── libs-desktop ├── javassist-3.12.0.GA.jar ├── jersey-core-1.12.jar ├── jersey-json-1.12.jar ├── jersey-server-1.12.jar ├── jersey-simple-server-1.12.jar ├── js.jar └── jsr311-api-1.1.1.jar ├── libs-protosd ├── flexjson.jar ├── gson-2.2.4.jar ├── indi-jmdns.mcmod.jar ├── jmdns-mdnsmod-1.7-3.4.1b.jar ├── org.restlet.jar └── protosd.jar ├── libs ├── json-simple-1.1.1.jar ├── norm.jar └── te-api.jar └── src ├── main ├── java │ └── edu │ │ └── drexel │ │ └── xop │ │ ├── Run.java │ │ ├── client │ │ ├── AuthenticationProvider.java │ │ ├── SAXTerminatorException.java │ │ ├── XMLProcessor.java │ │ ├── XOPConnection.java │ │ └── local │ │ │ ├── ClientListenerThread.java │ │ │ ├── ClientXMLProcessor.java │ │ │ ├── LocalClientConnection.java │ │ │ └── UnauthenticatedClientHandler.java │ │ ├── core │ │ ├── ClientManager.java │ │ ├── LocalXMPPClient.java │ │ ├── ProxyUtils.java │ │ ├── XMPPClient.java │ │ ├── XOProxy.java │ │ └── roster │ │ │ ├── RosterList.java │ │ │ └── RosterListManager.java │ │ ├── gateway │ │ ├── AuthorizingGatewayConnection.java │ │ ├── AuthorizingGatewayXMLHandler.java │ │ ├── AuthorizingGatewayXMLProcessor.java │ │ ├── GatewayConnection.java │ │ ├── GatewayPing.java │ │ ├── GatewayUtil.java │ │ ├── GatewayXMLHandler.java │ │ ├── GatewayXMLProcessor.java │ │ ├── InitiatingGatewayConnection.java │ │ ├── InitiatingGatewayXMLHandler.java │ │ ├── InitiatingGatewayXMLProcessor.java │ │ ├── ReceivingGatewayConnection.java │ │ ├── ReceivingGatewayXMLHandler.java │ │ ├── ReceivingGatewayXMLProcessor.java │ │ ├── S2SReceivingListenerThread.java │ │ └── ServerDialbackSession.java │ │ ├── net │ │ ├── SDListener.java │ │ ├── SDListenerImpl.java │ │ ├── SDManager.java │ │ ├── XopNet.java │ │ ├── XopNetImpl.java │ │ ├── basicsds │ │ │ └── BasicSDManager.java │ │ ├── protosd │ │ │ ├── ProtoSDManager.java │ │ │ ├── XopDOListener.java │ │ │ └── discoverable │ │ │ │ ├── GatewayDO.java │ │ │ │ ├── MucOccupantDO.java │ │ │ │ ├── MucRoomDO.java │ │ │ │ └── PresenceDO.java │ │ └── transport │ │ │ ├── AbstractBasicTransportService.java │ │ │ ├── BasicOneToOneTransportService.java │ │ │ ├── BasicTransportService.java │ │ │ ├── OneToOneTransportService.java │ │ │ └── XOPTransportService.java │ │ ├── packet │ │ ├── AbstractPacketProcessor.java │ │ ├── AbstractPresenceManager.java │ │ ├── LocalPacketProcessor.java │ │ ├── LocalPresenceManager.java │ │ ├── PacketProcessor.java │ │ ├── TransportPacketProcessor.java │ │ ├── TransportPresenceManager.java │ │ └── iq │ │ │ ├── BindIqHandler.java │ │ │ ├── DiscoIqHandler.java │ │ │ ├── IqManager.java │ │ │ ├── PingIqHandler.java │ │ │ ├── SessionIqHandler.java │ │ │ └── VCardIqHandler.java │ │ ├── room │ │ ├── Room.java │ │ ├── RoomManager.java │ │ └── TransportManager.java │ │ ├── stream │ │ ├── StreamClientHandler.java │ │ ├── StreamListenerThread.java │ │ └── jingle │ │ │ ├── JingleManager.java │ │ │ └── JingleSession.java │ │ └── util │ │ ├── Base64.java │ │ ├── CONSTANTS.java │ │ ├── MessageCompressionUtils.java │ │ ├── Utils.java │ │ ├── XOP.java │ │ ├── XOPKEYS.java │ │ ├── XopProperties.java │ │ ├── addressing │ │ ├── MulticastAddressPool.java │ │ └── MulticastRange.java │ │ └── logger │ │ ├── LogListener.java │ │ ├── LogRead.java │ │ ├── LogUtils.java │ │ ├── TextLogFormatter.java │ │ └── XopLogFormatter.java └── kotlin │ └── mil │ └── navy │ └── nrl │ └── xop │ ├── client │ └── ClientConnection.kt │ ├── transport │ └── reliable │ │ ├── NORMNode.kt │ │ ├── NormPresenceTransport.kt │ │ ├── NormTransport.kt │ │ ├── TransportMetadata.kt │ │ ├── XopNormService.kt │ │ └── XopNormServiceRunner.kt │ └── util │ ├── ListNets.kt │ └── addressing │ ├── GroupPortPool.kt │ └── NetUtils.kt └── test ├── java ├── edu │ └── drexel │ │ └── xop │ │ ├── ClientTest.java │ │ ├── core │ │ └── ClientManagerTest.java │ │ └── net │ │ ├── MockSDManager.java │ │ └── MockXopNet.java └── mil │ └── navy │ └── nrl │ └── itd │ └── xo │ └── net │ └── test │ └── NormTransportTest.java └── kotlin └── mil └── navy └── nrl └── xop ├── client └── ClientConnectionTest.kt ├── transport └── reliable │ ├── NORMNodeKtTest.kt │ ├── NormPresenceTransportTest.kt │ ├── NormTransportKtTest.kt │ ├── XopNormServiceTest.kt │ └── XopNormTransportTest.kt └── util └── addressing └── GroupPortPoolKtTest.kt /.gitignore: -------------------------------------------------------------------------------- 1 | revision.txt 2 | xop/config/*logging* 3 | *.iml 4 | .idea 5 | .gradle 6 | /local.properties 7 | /.idea/workspace.xml 8 | /.idea/libraries 9 | .DS_Store 10 | ClientTesting/build 11 | build 12 | dist* 13 | logs 14 | *.log 15 | zips 16 | -------------------------------------------------------------------------------- /BUILDING.md: -------------------------------------------------------------------------------- 1 | XOP Building 2 | Duc Nguyen (dn53@drexel.edu) 3 | ==== 4 | 5 | # Background 6 | 7 | Building XOP has migrated from using Apache Ant to using Gradle to better 8 | support building distributions for multiple platforms, Linux and Android. 9 | 10 | For more information on Gradle, go to http://www.gradle.org 11 | 12 | # Building and Running XOP for Linux 13 | 14 | To build and run: 15 | 16 | $ ./gradlew deployXOP 17 | $ cd dist 18 | $ ./run.sh 19 | 20 | # Building and Running XOP for Android 21 | 22 | To build and install on a device: 23 | 24 | $ ./gradlew installDebug 25 | 26 | 27 | -------------------------------------------------------------------------------- /ClientTesting/bin/run_sender.sh: -------------------------------------------------------------------------------- 1 | 2 | DIST_DIR=build/distributions 3 | if [ -d $DIST_DIR/ClientTesting ]; then 4 | rm -rf $DIST_DIR/ClientTesting 5 | fi 6 | cd $DIST_DIR 7 | unzip ClientTesting.zip 8 | cd ClientTesting 9 | 10 | ./bin/ClientTesting $@ 11 | -------------------------------------------------------------------------------- /ClientTesting/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'application' 2 | apply plugin: 'kotlin' 3 | //apply plugin: 'java' 4 | 5 | mainClassName = 'mil.navy.nrl.xop.client.SmackSenderKt' 6 | applicationName = 'ClientTesting' 7 | 8 | dependencies { 9 | implementation project(':xop') 10 | 11 | compile 'org.json:json:20180813' 12 | compile 'dom4j:dom4j:1.6.1' 13 | compile 'org.slf4j:slf4j-api:1.5.11' 14 | compile 'org.slf4j:slf4j-simple:1.5.11' 15 | compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 16 | compile "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version" 17 | compile( 18 | "org.igniterealtime.smack:smack-java7:4.3.0", 19 | "org.igniterealtime.smack:smack-tcp:4.3.0", 20 | "org.igniterealtime.smack:smack-extensions:4.3.0" 21 | ) 22 | // Required -- JUnit 4 framework 23 | testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1' 24 | testRuntime( 25 | "org.junit.platform:junit-platform-launcher:1.3.1", 26 | "org.junit.jupiter:junit-jupiter-engine:5.3.1" 27 | ) 28 | } 29 | 30 | 31 | // For building kotlin 32 | buildscript { 33 | ext.kotlin_version = '1.3.0' 34 | ext.coroutines_version = '1.0.0' 35 | repositories { 36 | mavenCentral() 37 | maven { url "https://kotlin.bintray.com/kotlinx" } 38 | } 39 | dependencies { 40 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 41 | } 42 | } 43 | 44 | compileKotlin { 45 | kotlinOptions { 46 | jvmTarget = "1.8" 47 | } 48 | 49 | } 50 | compileTestKotlin { 51 | kotlinOptions { 52 | jvmTarget = "1.8" 53 | } 54 | 55 | } 56 | 57 | task runSender { 58 | 59 | } -------------------------------------------------------------------------------- /ClientTesting/src/main/kotlin/mil/navy/nrl/xop/client/SmackSender.kt: -------------------------------------------------------------------------------- 1 | package mil.navy.nrl.xop.client 2 | 3 | import kotlinx.coroutines.* 4 | import mil.navy.nrl.xop.util.addressing.getBindAddress 5 | import org.jivesoftware.smack.ConnectionConfiguration 6 | import org.jivesoftware.smack.SmackException 7 | import org.jivesoftware.smack.chat.ChatManager 8 | import org.jivesoftware.smack.tcp.XMPPTCPConnection 9 | import org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration 10 | import org.jxmpp.jid.impl.JidCreate 11 | import java.security.SecureRandom 12 | import javax.net.ssl.SSLContext 13 | import javax.net.ssl.TrustManager 14 | import javax.net.ssl.X509TrustManager 15 | import kotlin.system.exitProcess 16 | 17 | private val sslContext = SSLContext.getInstance("TLS") 18 | private val XOPDOMAIN = "xo.nrl.navy.mil" 19 | 20 | fun main(args: Array) = runBlocking { 21 | if (args.size != 3) { 22 | println("Usage SmackSender (object : X509TrustManager { 32 | override fun getAcceptedIssuers(): Array? { 33 | return null 34 | } 35 | 36 | override fun checkClientTrusted( 37 | certs: Array, 38 | authType: String 39 | ) { 40 | } 41 | 42 | override fun checkServerTrusted( 43 | certs: Array, 44 | authType: String 45 | ) { 46 | } 47 | }), SecureRandom()) 48 | 49 | val config = XMPPTCPConnectionConfiguration.builder() 50 | .setXmppDomain(XOPDOMAIN) 51 | .setUsernameAndPassword("user", "anypassword") 52 | .setHostAddress(bindAddress) 53 | // .setHost("172.16.0.1") 54 | .setResource("resource") 55 | .setPort(5222) 56 | .setSecurityMode(ConnectionConfiguration.SecurityMode.required) 57 | .setCustomSSLContext(sslContext) 58 | .setHostnameVerifier { _, _ -> true } // needed to disable hostname checking of the certificate 59 | .build() 60 | 61 | val user2 = "user2" 62 | val jidUser2 = "$user2@${XOPDOMAIN}" 63 | val config2 = XMPPTCPConnectionConfiguration.builder() 64 | .setXmppDomain(XOPDOMAIN) 65 | .setUsernameAndPassword(user2, "anypassword") 66 | .setHost("172.16.0.1") 67 | .setResource("resource") 68 | .setPort(5222) 69 | .setSecurityMode(ConnectionConfiguration.SecurityMode.required) 70 | .setCustomSSLContext(sslContext) 71 | .setHostnameVerifier { _, _ -> true } // needed to disable hostname checking of the certificate 72 | .build() 73 | 74 | var recvmsg = "" 75 | val chatmsg = "hello" 76 | 77 | val con1scope = launch { 78 | val connection = XMPPTCPConnection(config) 79 | var connected = false 80 | while (!connected) { 81 | try { 82 | println("attempting to connect conn1") 83 | connection.connect() 84 | connected = true 85 | println("Connected conn1 ") 86 | } catch (e: SmackException.ConnectionException) { 87 | println("not connected waiting 1s") 88 | delay(1000L) 89 | } 90 | } 91 | connection.login() 92 | val chatManager = ChatManager.getInstanceFor(connection) 93 | 94 | chatManager.addChatListener { chat, createdLocally -> 95 | println("user1 createdLocally $createdLocally, chat: {$chat} ") 96 | } 97 | 98 | // chatManager.addChatListener { from, message, chat -> 99 | // println("user1 incoming msg $from $message $chat") 100 | // recvmsg = message.body 101 | // } 102 | val toJID = JidCreate.entityBareFrom(jidUser2) 103 | val chat = chatManager.createChat(toJID) 104 | println("sending $chatmsg to $toJID") 105 | chat.sendMessage(chatmsg) 106 | println("sent $chatmsg to $toJID") 107 | 108 | println("disconnecting") 109 | connection.disconnect() 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | * 3 | * AUTHORIZATION TO USE AND DISTRIBUTE 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that: 7 | * 8 | * (1) source code distributions retain this paragraph in its entirety, 9 | * 10 | * (2) distributions including binary code include this paragraph in 11 | * its entirety in the documentation or other materials provided 12 | * with the distribution. 13 | * 14 | * "This product includes software written and developed 15 | * by Code 5520 of the Naval Research Laboratory (NRL)." 16 | * 17 | * The name of NRL, the name(s) of NRL employee(s), or any entity 18 | * of the United States Government may not be used to endorse or 19 | * promote products derived from this software, nor does the 20 | * inclusion of the NRL written and developed software directly or 21 | * indirectly suggest NRL or United States Government endorsement 22 | * of this product. 23 | * 24 | * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR 25 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 26 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 27 | * 28 | ********************************************************************/ -------------------------------------------------------------------------------- /RUNNING.md: -------------------------------------------------------------------------------- 1 | # Run 2 | To run, in the xop/dist directory: 3 | 4 | ./start_xop.sh [configuration options] 5 | 6 | # Configuring XOP 7 | After building XO, there will be a default configuration file, config/xop.properties that 8 | XO will load upon startup. To override: 9 | 10 | > ./start_xop.sh -Dproperties.file=path_to_properties 11 | 12 | Use commandline properties starting with '-D' to override properties in the 13 | config/xop.properties file. e.g. 14 | 15 | > ./start_xop.sh -Dxop.transport.nodeid=100 16 | 17 | ''Specifying command-line system properties WILL take precedence over the 18 | `config/xop.properties` file.'' 19 | 20 | ### Create configuration file 21 | If you would like to create a xop.properties file, there is a helper script to generate default properties: 22 | 23 | java -cp xop.jar edu.drexel.xop.util.XopProperties > dist/config/xop.properties 24 | 25 | ### Common commandline parameters 26 | 27 | -Dxop.enable.gateway=true|false 28 | 29 | -Dxop.transport.nodeid= 30 | 31 | -Djava.util.logging.config.file= 32 | 33 | ## Logging 34 | Logging can be configured by modifying the `config/logging.properties` file 35 | prior to building and execution. 36 | 37 | Demos and experiments should set all logging levels to INFO. Further 38 | instructions for using the `config/logging.properties` file is specified in the 39 | file. 40 | 41 | You can also specify your own logging.properties at the command line: 42 | 43 | ./run.sh -Djava.util.logging.config.file=config/logging.properties 44 | 45 | or: 46 | 47 | java -Djava.util.logging.config.file=config/logging.properties -jar xop.jar 48 | 49 | ## Federating with Openfire or other XMPP server 50 | A XOP instance within a MANET can use an external interface to maintain a persistent 51 | connection to an enterprise XMPP server, e.g. Openfire. This XOP instance will 52 | forward XMPP Presence, IQ, and Messages to/from a standard XMPP server. 53 | 54 | ### Configuring XOP for Gatewaying 55 | 56 | - Import Openfire server certificates into the keystore used by XOP 57 | - edit the following properties: 58 | - xop.enable.gateway=true 59 | - xop.gateway.server= 60 | 61 | - Add DNS entries or modify the /etc/hosts files with hostnames or 62 | 63 | - Ensure the servername maps correctly to the openfire server and ip address of the server 64 | - e.g. include in /etc/hosts: 65 | - ensure the gatewayed XOP instance has the hostname of the proxied 66 | - e.g. include in /etc/hosts: proxy 67 | 68 | ### Configuring Openfire 69 | 70 | - Enable the following properties: 71 | - Dialback protocol (XEP-220) 72 | - server self-signed certificates 73 | - server tls enabled 74 | 75 | -------------------------------------------------------------------------------- /android-daemon-service/app-release.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USNavalResearchLaboratory/xmpp-overlay/0f00856b375c31c2f92fab5128924ac88f3fbe52/android-daemon-service/app-release.aar -------------------------------------------------------------------------------- /android-daemon-service/build.gradle: -------------------------------------------------------------------------------- 1 | configurations.maybeCreate("default") 2 | artifacts.add("default", file('app-release.aar')) -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | google() 6 | jcenter() 7 | } 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.3.1' 10 | 11 | // NOTE: Do not place your application dependencies here; they belong 12 | // in the individual module build.gradle files 13 | } 14 | } 15 | 16 | allprojects { 17 | repositories { 18 | google() 19 | jcenter() 20 | mavenCentral() 21 | maven { url "https://kotlin.bintray.com/kotlinx" } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /docs/GcsIntegration.txt: -------------------------------------------------------------------------------- 1 | This version of XO is integrated with the TDIS Group Communication Service (GCS). XO can be configured to use GCS as the discovery service and as the transport service. 2 | 3 | ========== 4 | New class: 5 | ========== 6 | com.boeing.rt.gcs.xop.GCSXoTransport - the transport service that uses GCS. This service is referenced by the TransportManager and the OneToOneTransportManager in the same manner as they use the Transport Engine. 7 | 8 | ======================= 9 | New/Modified libraries: 10 | ======================= 11 | gc-client.jar - the GCS java client library. This library is used by 12 | protosd.jar - this is a version of the protosd library that has been integrated with a Group Communications Discovery client. 13 | 14 | 15 | =================== 16 | New XOP properties: 17 | =================== 18 | xop.sds.service - controls whether to use INDI ("protosd") or GCS ("groupcomms")for discovery. The default is "groupcomms". 19 | 20 | xop.transport.service - controls whether to use the Transport Engine ("transport-engine") or GCS ("groupcomms") for data dissemination. The default is "groupcomms" 21 | 22 | 23 | xop.gc.agent.address - the address of the Group Communciations Agent (daemon). The default is "localhost" 24 | 25 | xop.gc.agent.port - the port number used by the agent. The default is 56789. 26 | 27 | xop.gc.discovery.group - the group number that GCS will use for discovery messages. The default is 0. 28 | 29 | 30 | xop.gc.rooms.safe (default = empty) 31 | xop.gc.rooms.agreed (default = empty) 32 | xop.gc.rooms.ordered (default = empty) 33 | xop.gc.rooms.reliable (default = empty) 34 | xop.gc.rooms.besteffort (default = *) 35 | - These are properties that set the service class for individual chat rooms. Each is a list of chat room names that will be provided with that level of service, or '*' to catch all rooms that are not listed in properies for higher level services. (High to low: safe, agreed, ordered, reliable, besteffort). 36 | - For example, if the properties are set as: 37 | xop.transport.gc.rooms.reliable=* 38 | xop.transport.gc.rooms.ordered=testroom, fiforoom 39 | xop.transport.gc.rooms.agreed=causalroom 40 | Then, all messages for chat room causalroom will be presented to chat members in agreed order, all messages to chat rooms testroom and fiforoom will be ordered per sender, while all messages to all other chat rooms will be given a reliable class of service. 41 | 42 | 43 | Renamed XOP properties: 44 | Transport engine properties under xop.transport have been moved to xop.transport.te: 45 | xop.transport.te.address 46 | xop.transport.te.port 47 | xop.transport.te.reliable 48 | xop.transport.te.ordered 49 | xop.transport.te.persist.time 50 | 51 | 52 | =========== 53 | Running XOP 54 | =========== 55 | In order to use GCS for discover or for transport service, the GCS Agent (daemon) needs to be running. To run the agent, 56 | gcsd -i -f 57 | 58 | See https://pf.itd.nrl.navy.mil/svnroot/gcs/README for details on configuring GCS and on the run options. Note that the GCS port defined int he xop.properties must be consistent with the port defined in the GCS configuration file. 59 | 60 | Once the GCS Agent is running on a node, XO may be started. 61 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | org.gradle.jvmargs=-Xmx1536m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | org.gradle.daemon=true 21 | # Configuration on demand is not supported by the current version of the Android Gradle plugin 22 | # since you are using Gradle version 4.6 or above. 23 | # Suggestion: disable configuration on demand by setting org.gradle.configureondemand=false 24 | # in your gradle.properties file or use a Gradle version less than 4.6. 25 | # org.gradle.configureondemand=false 26 | kotlin.code.style=official -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USNavalResearchLaboratory/xmpp-overlay/0f00856b375c31c2f92fab5128924ac88f3fbe52/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Aug 08 05:02:34 EDT 2018 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-all.zip 7 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PARAMS="" 4 | 5 | function ctrl_c { 6 | echo killing GCSD with id $1 7 | kill $1 8 | } 9 | 10 | USE_GCS=0 11 | while getopts "g:" opt; do 12 | case $opt in 13 | g) 14 | GCSID=$OPTARG 15 | echo "Running with GCS GCSID=$GCSID" 16 | USE_GCS=1 17 | gcsd -i ${GCSID} -f gcsd-config.json > gcs_${GCSID}.log 2>&1 & 18 | gcsd_pid=$! 19 | echo "Running GCS has PID: $gcsd_pid" 20 | trap "ctrl_c ${gcsd_pid}" INT 21 | shift $((OPTIND -1)) 22 | PARAMS=$* 23 | break 24 | ;; 25 | \? ) 26 | echo "Not starting GCSD. ${opt}" 27 | PARAMS=$* 28 | break 29 | esac 30 | done 31 | 32 | 33 | XOP_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 34 | #XOP_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/dist 35 | XOP_DIST_PATH=$XOP_PATH/dist 36 | 37 | sleep 1 38 | echo "*** Starting XOP" 39 | # Need these for NORM 40 | SYSTEM_PROPERTIES="-Djava.library.path=$XOP_DIST_PATH/libs/ -Dxop.path=$XOP_DIST_PATH" 41 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$XOP_DIST_PATH/libs/ 42 | 43 | # Add all the files to our classpath 44 | export CLASSPATH=$CLASSPATH:$XOP_DIST_PATH/xop.jar:. 45 | for jar in `ls $XOP_DIST_PATH/libs/*.jar`; do 46 | export CLASSPATH=$CLASSPATH:$jar 47 | done 48 | 49 | cd $XOP_DIST_PATH 50 | #java $SYSTEM_PROPERTIES -Dxop.enable.gateway=$1 -Dxop.gateway.bindinterfaces=$2 -Dxop.bind.interface=$3 -Dxop.gateway.servers=c4ad038.ciav.cmil.mil -jar xop-all.jar 51 | echo "java $SYSTEM_PROPERTIES $PARAMS $JMX_PROPS -jar xop-all.jar " 52 | java $SYSTEM_PROPERTIES $PARAMS $JMX_PROPS -jar xop-all.jar 53 | #java $SYSTEM_PROPERTIES $PARAMS $JMX_PROPS -javaagent:xop.jar $OTHER_PROPS -jar xop.jar 54 | echo "*** XOP stopped." 55 | #echo "*** RUN ./kill_te.sh TO SHUTDOWN TRANSPORT ENGINE ***" 56 | -------------------------------------------------------------------------------- /scripts/create_xogpkg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 2019-06-14: Creates a zipfile of xop distribution 4 | 5 | destfilename=$1 6 | dt=`date +%Y%m%d-%H%M%S` 7 | 8 | #mkdir -p ${destfilename}.${dt} 9 | destdir=zips 10 | cp -ar dist/ ${destdir}/${destfilename}.${dt} 11 | cd zips 12 | tar zcf ${destfilename}.${dt}.tgz ${destfilename}.${dt} 13 | echo "created ${destfilename}.${dt}.tgz ${destfilename}.${dt}" 14 | zip -rq ${destfilename}.${dt}.zip ${destfilename}.${dt} 15 | echo "removing ${destfilename}.${dt}" 16 | rm -rf ${destfilename}.${dt} 17 | cd .. 18 | 19 | -------------------------------------------------------------------------------- /scripts/moveXOPapk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SCRIPTDIR=`pwd` 4 | APK_OUTPUT_DIR=${SCRIPTDIR}/xop-android/build/outputs/apk 5 | APK_NAME=xop-android-debug.apk 6 | 7 | BASE_DEST_DIR=/media/sf_workspace/ToFromVirtualBox 8 | DEST_DIR=$1 9 | 10 | dt=`date +%Y%m%d-%H%M%S` 11 | NAME=xop.${dt}.apk 12 | 13 | echo "Copying ${APK_OUTPUT_DIR}/${APK_NAME} to ${BASE_DEST_DIR}/${DEST_DIR}/${NAME}" 14 | cp ${APK_OUTPUT_DIR}/${APK_NAME} ${BASE_DEST_DIR}/${DEST_DIR}/${NAME} 15 | echo "Done!" 16 | -------------------------------------------------------------------------------- /scripts/run_xop_android: -------------------------------------------------------------------------------- 1 | am startservice mil.navy.nrl.xop/mil.navy.nrl.xop.android.XOPService 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':xop', ':xop-android', ':android-daemon-service', ':ClientTesting' //, ':te-api', ':te', ':te-android' 2 | //project (':xo-gcs').projectDir = new File('../xo-gcs') 3 | //project (':te').projectDir = new File('../../transport-engine/trunk/te') 4 | //project (':te-api').projectDir = new File('../../transport-engine/trunk/te-api') 5 | //project (':te-android').projectDir = new File('../../../transport-engine-nrl/te-android') 6 | -------------------------------------------------------------------------------- /vm_config/README.md: -------------------------------------------------------------------------------- 1 | Enable the service 2 | 3 | ```bash 4 | sudo systemctl enable nrl_xmpp_overlay.service 5 | ``` 6 | 7 | Deploy binaries to the VM 8 | 9 | # Virtual Machine # 10 | Ubuntu 18.04.2 server 11 | baseline software and services: 12 | - openjdk 8 jre 13 | - ssh server 14 | 15 | ## Connect to VM ## 16 | username: xo 17 | password: xo 18 | 19 | ssh key for xo user is also available 20 | `ssh -i sshkeys/id_rsa_nrl_xo_vm xo@` 21 | 22 | ## Configure XO Service ## 23 | 24 | Enable the service 25 | ``` 26 | sudo systemctl enable /home/xo/nrl_xmpp_overlay.service 27 | ``` 28 | 29 | Ensure the syslog user can write to the log dir: 30 | Create/Edit file: `/etc/rsyslog.d/60-nrl_xo.conf` 31 | ``` 32 | :programname, isequal, "NRLXO" /home/xo/logs/xop.log 33 | & stop 34 | ``` 35 | 36 | Add the `syslog` user to the `xo` group 37 | 38 | ## Updating VM ## 39 | 40 | In `vm_config` 41 | 42 | ``` 43 | ./deploy_vm.sh 44 | ``` 45 | -------------------------------------------------------------------------------- /vm_config/deploy_vm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | keyloc="./sshkeys" 4 | key="-i ${keyloc}/id_rsa_nrl_xo_vm" 5 | 6 | dist_loc="../dist-nogcs" 7 | vm_user="xo" 8 | vm_dst="192.168.56.102" 9 | 10 | run_cmd="ssh ${key} ${vm_user}@${vm_dst}" 11 | 12 | echo "back up old xop" 13 | ${run_cmd} "rm -rf xop_bak && mv xop xop_bak" 14 | 15 | echo "push ${dist_loc} to remote xop dir" 16 | scp ${key} -rq ${dist_loc} ${vm_user}@${vm_dst}:xop 17 | 18 | echo "copy vm.properties to config" 19 | scp ${key} -rq vm.properties ${vm_user}@${vm_dst}:xop/config/. 20 | 21 | echo "restart xo" 22 | ${run_cmd} 'sudo systemctl restart nrl_xmpp_overlay.service' 23 | 24 | ${run_cmd} 'sudo systemctl status nrl_xmpp_overlay.service' 25 | -------------------------------------------------------------------------------- /vm_config/nrl_xmpp_overlay.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | After=network.target 3 | 4 | [Service] 5 | Type=simple 6 | User=xo 7 | Group=xo 8 | WorkingDirectory=/home/xo/xop 9 | ExecStart=/home/xo/xop/start_xop.sh -Dproperties.file=/home/xo/xop/config/vm.properties 10 | StandardOutput=syslog 11 | StandardError=syslog 12 | SyslogIdentifier=NRLXO 13 | StandardOutput=file:/home/xo/logs/xop-out.log 14 | StandardError=file:/home/xo/logs/xop-err.log 15 | #LogLevelMax=info 16 | 17 | 18 | [Install] 19 | WantedBy=default.target 20 | -------------------------------------------------------------------------------- /vm_config/sshkeys/id_rsa_nrl_xo_vm: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpAIBAAKCAQEAzva+a+eqo8GQA4PUp7YNujn3YBz47WIvoaUaASLfu74kMZP4 3 | kflIpxEtGq9dSufKbHSaDC7R0Uadh+kb6if/WbkB7isJ1KvlQ4Brn1EdT0AwGGTk 4 | dQgYylBZ73OnG4jeWDYx2mZUcSE1LzZEcByOkVNjRCUHvzcS8qIuKbBm1dpcUfQt 5 | TSq2LLlJgK3dXIK3vHa3DoEhB3bPQ6ALzdhlaW7bNWbwS2WaRz/3Ul8bP7aOyRHx 6 | y25dnqAQgY2iafNSeGqt37D65BmGkCg/Zak124jRbBKq/5bq/oEVOD3caeqpnomc 7 | MdzWi8AVReZ8z3ErEjomOUEi1+bc0/AJiWtfywIDAQABAoIBACO54jscPY+RDTwe 8 | GKpuucXo1bQIrEvGBDTiHDAQBhERjIvmYCVKo+j7BQ8zMGaKxp2cLy9lMaDvkKfy 9 | bHgqOWESl6u2UDcfCS9yzqEszmNs0CCV4f31zNm3rx6vlywgn0kY6dgqi+8PbW/d 10 | 7UhxFYcuntcXkVPHvQSXTGKz6byGaqY1PHB6ymiivYhN/Yp4Nb3ehVnkFrelVLo6 11 | Q83jOklm5GQDUFjcc/iJqDCRy/N0dMoXz6kDmiaPO7tE0jq9MEr7v1QJInpKHIhT 12 | 02m9zegrxWC5l3FZK8I1xg9XuPePD5hORZ5xbz4D9AuTvkJwR4T4QH7uRPrZzajO 13 | lbp9rfkCgYEA63CXOoz3lsBvRtLD5mo8uL4UzQzxpZAY1oRNjzBvbr/akTYcX0ui 14 | uForjtdpdBCIDNxAun1jrSvQC5xw2LM9ViJ5D1U0JUT4EM2WNmWbjfHxvi+X52Xs 15 | YRvUcjYjqCsvuu7aRo+9FXn1MncLaziQrI6dVBHeGIuW2lvqYtRC0a8CgYEA4QmN 16 | 8plLp6lcZ2Y2xThtrqjW7Dyt/qyck8PNiqn34h+ynctAa6hT9bQzAiuT894je1Pg 17 | xINCQw6aeQPI3nOhKpuYLt9ha1jVC+R12HLSZiGJMPWVh7nJBGl2WBTd2JG7bT20 18 | 246jr/l8F0uACV74tT9kTmHMFdYJWdMwKJ455qUCgYBStotqlnulCpYNW55XJJuQ 19 | i7bjEtkSQT14n6Jf27RKRDyVJ11wXTIdchA7bpItpGEno3laCxMpk2rTqXI7rzyt 20 | Ng8xw80+Cqzbul47Xhb4FzfGiRHkyXnx48UPGtYMDqAGHEOy5myXTvFFeW0ZjhXF 21 | iZTcJCrSlLe6nvAJKGkRIQKBgQCvKKOvF/jWKLH+3YV2HwTodQzM1jJMT4iUT0y2 22 | SLPj8u4xehnLcjrfvYISh17i653Mia4i51P1I/HCjdqUo4XnxzI+EasfRgaV+h5r 23 | +nuf+SxyykS4XziC0Z/G0X8X6d7sGaKjXrQz7cnTy/V91claMlxd0itrN60RmJsc 24 | koPY7QKBgQCz3LbZjFRsITUjxyt+RFn20yQxvugMRuXfePeUdMT5EHxH7MHKwKNp 25 | 7H5JKh3u64wlHEF2gSipvMnEHF8uU0JRyUA9W7upE5OBhoXNJJx34aqU6fnIC+2X 26 | XnI3yTfnbCSYVule645Cr/11xtNHIyKT+925YIhq34TqY+sJVTammg== 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /vm_config/sshkeys/id_rsa_nrl_xo_vm.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDO9r5r56qjwZADg9Sntg26OfdgHPjtYi+hpRoBIt+7viQxk/iR+UinES0ar11K58psdJoMLtHRRp2H6RvqJ/9ZuQHuKwnUq+VDgGufUR1PQDAYZOR1CBjKUFnvc6cbiN5YNjHaZlRxITUvNkRwHI6RU2NEJQe/NxLyoi4psGbV2lxR9C1NKrYsuUmArd1cgre8drcOgSEHds9DoAvN2GVpbts1ZvBLZZpHP/dSXxs/to7JEfHLbl2eoBCBjaJp81J4aq3fsPrkGYaQKD9lqTXbiNFsEqr/lur+gRU4Pdxp6qmeiZwx3NaLwBVF5nzPcSsSOiY5QSLX5tzT8AmJa1/L duc@dellxps13 2 | -------------------------------------------------------------------------------- /xop-android/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /xop-android/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | repositories { 4 | jcenter() 5 | } 6 | 7 | android { 8 | signingConfigs { 9 | } 10 | compileSdkVersion 28 11 | buildToolsVersion '28.0.3' 12 | defaultConfig { 13 | applicationId 'mil.navy.nrl.xop.android' 14 | minSdkVersion 26 15 | targetSdkVersion 28 16 | versionCode 1 17 | versionName "0.10.0" 18 | buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L" 19 | } 20 | compileOptions { 21 | sourceCompatibility JavaVersion.VERSION_1_8 22 | targetCompatibility JavaVersion.VERSION_1_8 23 | } 24 | buildTypes { 25 | release { 26 | // minifyEnabled false 27 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 28 | } 29 | } 30 | productFlavors { 31 | } 32 | packagingOptions { 33 | exclude 'META-INF/LICENSE.txt' 34 | exclude 'test-logging.properties' 35 | exclude 'META-INF/jersey-module-version' 36 | } 37 | lintOptions { 38 | abortOnError false 39 | } 40 | } 41 | 42 | dependencies { 43 | implementation fileTree(include: ['*.jar'], dir: 'libs') 44 | implementation project(':xop') 45 | implementation project(':android-daemon-service') 46 | } 47 | -------------------------------------------------------------------------------- /xop-android/libs/asmack-android-8-0.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USNavalResearchLaboratory/xmpp-overlay/0f00856b375c31c2f92fab5128924ac88f3fbe52/xop-android/libs/asmack-android-8-0.8.5.jar -------------------------------------------------------------------------------- /xop-android/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/duc/lib/android-sdk-macosx/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /xop-android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 17 | 18 | 19 | 20 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /xop-android/src/main/assets/bin/armeabi-v7a/gcsd-android: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USNavalResearchLaboratory/xmpp-overlay/0f00856b375c31c2f92fab5128924ac88f3fbe52/xop-android/src/main/assets/bin/armeabi-v7a/gcsd-android -------------------------------------------------------------------------------- /xop-android/src/main/assets/bin/armeabi-v7a/mgen: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USNavalResearchLaboratory/xmpp-overlay/0f00856b375c31c2f92fab5128924ac88f3fbe52/xop-android/src/main/assets/bin/armeabi-v7a/mgen -------------------------------------------------------------------------------- /xop-android/src/main/assets/data/gcsd-config.besteffort.json: -------------------------------------------------------------------------------- 1 | { 2 | "gcsd": { 3 | "daemon": false, 4 | "verbose": 0, 5 | 6 | "client-interface": { 7 | "transport": { 8 | "protocol": "tcp", 9 | "local-address": "0.0.0.0", 10 | "local-port": 56789 11 | } 12 | }, 13 | 14 | "group-communication-agent": { 15 | "id": null, 16 | 17 | "ttl": 64, 18 | "multicast-interface": "eth0", 19 | "use-unicast": false, 20 | 21 | "membership": { 22 | "transport": { 23 | "protocol": "udp", 24 | "group": "225.239.241.251", 25 | "port": 56789 26 | }, 27 | 28 | "hello-interval": 1.0, 29 | "dead-interval": 8.5, 30 | "one-way-limit": 10, 31 | 32 | "lead": { 33 | "proposal-ack-wait-time": 1.0, 34 | "proposal-tries": 4 35 | }, 36 | 37 | "non-lead": { 38 | "proposal-wait-time": 1.0, 39 | "proposal-wait-tries": 3, 40 | 41 | "confirmation-wait-time": 2.0, 42 | "confirmation-wait-tries": 2 43 | } 44 | }, 45 | 46 | "unreliable-messaging": { 47 | "transport": { 48 | "protocol": "udp", 49 | "group": "225.239.241.251", 50 | "port": 56789 51 | } 52 | }, 53 | 54 | "reliable-messaging": { 55 | "outstanding-message-limit": 0, 56 | "nack-delay-msec": 100, 57 | "nack-retry-delay-msec": 1000, 58 | 59 | "transport": { 60 | "protocol": "udp", 61 | "group": "225.239.241.251", 62 | "port": 56789 63 | } 64 | } 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /xop-android/src/main/assets/data/gcsd-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "gcsd": { 3 | "daemon": false, 4 | "verbose": 0, 5 | 6 | "client-interface": { 7 | "transport": { 8 | "protocol": "tcp", 9 | "local-address": "0.0.0.0", 10 | "local-port": 56789 11 | } 12 | }, 13 | 14 | "group-communication-agent": { 15 | "id": null, 16 | 17 | "ttl": 64, 18 | "multicast-interface": "eth0", 19 | "use-unicast": false, 20 | 21 | "membership": { 22 | "transport": { 23 | "protocol": "udp", 24 | "group": "225.239.241.251", 25 | "port": 56789 26 | }, 27 | 28 | "hello-interval": 1.0, 29 | "dead-interval": 8.5, 30 | "one-way-limit": 10, 31 | 32 | "lead": { 33 | "proposal-ack-wait-time": 1.0, 34 | "proposal-tries": 4 35 | }, 36 | 37 | "non-lead": { 38 | "proposal-wait-time": 1.0, 39 | "proposal-wait-tries": 3, 40 | 41 | "confirmation-wait-time": 2.0, 42 | "confirmation-wait-tries": 2 43 | } 44 | }, 45 | 46 | "unreliable-messaging": { 47 | "transport": { 48 | "protocol": "udp", 49 | "group": "225.239.241.251", 50 | "port": 56789 51 | } 52 | }, 53 | 54 | "reliable-messaging": { 55 | "outstanding-message-limit": 0, 56 | "nack-delay-msec": 5000, 57 | "nack-retry-delay-msec": 5000, 58 | 59 | "transport": { 60 | "protocol": "norm", 61 | "group": "225.239.241.251", 62 | "port": 56797, 63 | "norm-parameters": { 64 | "debug-level": 0, 65 | "congestion-control-mode": "fixed", 66 | "transmit-rate": 64000.0, 67 | "transmit-segment-size": 1400, 68 | "transmit-block-size": 16, 69 | "transmit-num-parity": 4, 70 | "transmit-buffer-size": 1048576, 71 | "transmit-cache-limit": 512, 72 | "transmit-cache-size": 1048576, 73 | "receive-buffer-size": 1048576 74 | } 75 | } 76 | } 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /xop-android/src/main/assets/data/gcsd-config.norm.json: -------------------------------------------------------------------------------- 1 | { 2 | "gcsd": { 3 | "daemon": false, 4 | "verbose": 0, 5 | 6 | "client-interface": { 7 | "transport": { 8 | "protocol": "tcp", 9 | "local-address": "0.0.0.0", 10 | "local-port": 56789 11 | } 12 | }, 13 | 14 | "group-communication-agent": { 15 | "id": null, 16 | 17 | "ttl": 64, 18 | "multicast-interface": "eth0", 19 | "use-unicast": false, 20 | 21 | "membership": { 22 | "transport": { 23 | "protocol": "udp", 24 | "group": "225.239.241.251", 25 | "port": 56789 26 | }, 27 | 28 | "hello-interval": 1.0, 29 | "dead-interval": 8.5, 30 | "one-way-limit": 10, 31 | 32 | "lead": { 33 | "proposal-ack-wait-time": 1.0, 34 | "proposal-tries": 4 35 | }, 36 | 37 | "non-lead": { 38 | "proposal-wait-time": 1.0, 39 | "proposal-wait-tries": 3, 40 | 41 | "confirmation-wait-time": 2.0, 42 | "confirmation-wait-tries": 2 43 | } 44 | }, 45 | 46 | "unreliable-messaging": { 47 | "transport": { 48 | "protocol": "udp", 49 | "group": "225.239.241.251", 50 | "port": 56789 51 | } 52 | }, 53 | 54 | "reliable-messaging": { 55 | "outstanding-message-limit": 0, 56 | "nack-delay-msec": 1500, 57 | "nack-retry-delay-msec": 5000, 58 | 59 | "transport": { 60 | "protocol": "norm", 61 | "group": "225.239.241.252", 62 | "port": 56797, 63 | "norm-parameters": { 64 | "debug-level": 9, 65 | "congestion-control-mode": "fixed", 66 | "transmit-rate": 64000.0, 67 | "transmit-segment-size": 1400, 68 | "transmit-block-size": 16, 69 | "transmit-num-parity": 4, 70 | "transmit-buffer-size": 1048576, 71 | "transmit-cache-limit": 512, 72 | "transmit-cache-size": 1048576, 73 | "receive-buffer-size": 1048576 74 | } 75 | } 76 | } 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /xop-android/src/main/assets/data/mcm.mgn: -------------------------------------------------------------------------------- 1 | 0.0 LISTEN UDP 56797 2 | 0.0 JOIN 224.239.241.251 INTERFACE eth0 3 | 0.0 ON 5 UDP SRC 4006 DST 224.239.241.251/56797 INTERFACE eth0 PERIODIC [0.25 100] 4 | -------------------------------------------------------------------------------- /xop-android/src/main/java/mil/navy/nrl/xop/android/GCSDaemonService.java: -------------------------------------------------------------------------------- 1 | package mil.navy.nrl.xop.android; 2 | 3 | 4 | import android.app.Notification; 5 | import android.app.PendingIntent; 6 | import android.content.Intent; 7 | import android.content.SharedPreferences; 8 | import android.util.Log; 9 | import android.widget.Toast; 10 | 11 | import edu.drexel.informatics.daemon.DaemonService; 12 | import mil.navy.nrl.xop.android.R; 13 | 14 | /** 15 | * GCSD daemon service, uses android-daemon-service from BellerophonMobile 16 | * Created by duc on 7/28/17. 17 | */ 18 | 19 | public class GCSDaemonService extends DaemonService { 20 | public static String GCSD_ID = "GCSD_ID"; 21 | 22 | private SharedPreferences sharedPref; 23 | 24 | @Override 25 | public void onCreate(){ 26 | super.onCreate(); 27 | Log.i(getDaemonLogTag(), "Creating GCSDaemonService"); 28 | sharedPref = getSharedPreferences("xopSHAREDPREFS", 0); 29 | } 30 | 31 | @Override 32 | protected String getBinaryName() { 33 | return "gcsd-android"; 34 | } 35 | 36 | @Override 37 | protected String getDaemonLogTag() { 38 | return "gcsd"; 39 | } 40 | 41 | @Override 42 | protected String[] getBinaryArguments() { 43 | String gcsdId = sharedPref.getString(GCSD_ID,"0"); 44 | String bindInterface = sharedPref.getString(getString(R.string.xop_bind_interface),"eth0"); 45 | Log.i(getDaemonLogTag(), "gcsdId: "+ gcsdId); 46 | Log.i(getDaemonLogTag(), "bindInterface: "+ bindInterface); 47 | String[] retVal = new String[] {"-f", getAssetPath()+"/data/gcsd-config.json", "-i", gcsdId, "-I", bindInterface}; 48 | return retVal; 49 | } 50 | 51 | @Override 52 | public int onStartCommand(Intent intent, int flags, int startId){ 53 | super.onStartCommand(intent, flags, startId); 54 | String gcsdId = sharedPref.getString(GCSD_ID,"0"); 55 | String bindInterface = sharedPref.getString(getString(R.string.xop_bind_interface),"eth0"); 56 | String tickerText = getText(R.string.gcsd_ticker_text).toString().replace("$1", bindInterface).replace("$2", gcsdId); 57 | PendingIntent pendingIntent = PendingIntent.getService(this, 0, intent, flags); 58 | 59 | Notification notification = new Notification.Builder(this) 60 | .setContentTitle(getText(R.string.gcsd_title)) 61 | //.setContentTitle(getText(R.string.gcsd_message)) 62 | //.setContentText(getText(R.string.gcsd_message)) 63 | .setContentText(tickerText) 64 | .setSmallIcon(R.drawable.icon) 65 | .setContentIntent(pendingIntent) 66 | //.setTicker(tickerText) 67 | .build(); 68 | this.startForeground(47, notification); 69 | Toast.makeText(getApplicationContext(), "GCSD Running!", Toast.LENGTH_SHORT).show(); 70 | 71 | return START_STICKY; 72 | } 73 | 74 | @Override 75 | public void onDestroy(){ 76 | super.onDestroy(); 77 | this.stopForeground(true); 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /xop-android/src/main/java/mil/navy/nrl/xop/android/MGENDaemonService.java: -------------------------------------------------------------------------------- 1 | package mil.navy.nrl.xop.android; 2 | 3 | import android.app.Notification; 4 | import android.app.PendingIntent; 5 | import android.content.Intent; 6 | import android.content.SharedPreferences; 7 | import android.util.Log; 8 | 9 | import java.util.LinkedList; 10 | import java.util.List; 11 | 12 | import edu.drexel.informatics.daemon.DaemonService; 13 | import mil.navy.nrl.xop.android.R; 14 | 15 | public class MGENDaemonService extends DaemonService { 16 | public static String MGEN_PORT = "MGEN_PORT"; 17 | public static String MGEN_ADDRESS = "MGEN_ADDRESS"; 18 | public static String MGEN_IFACE = "MGEN_IFACE"; 19 | 20 | private SharedPreferences sharedPref; 21 | 22 | @Override 23 | public void onCreate() { 24 | super.onCreate(); 25 | Log.i(getDaemonLogTag(), "Creating MGENDaemonService"); 26 | sharedPref = getSharedPreferences("xopSHAREDPREFS", 0); 27 | } 28 | 29 | @Override 30 | protected String getBinaryName() { 31 | return "mgen"; 32 | } 33 | 34 | @Override 35 | protected String getDaemonLogTag() { 36 | return "mgen"; 37 | } 38 | 39 | @Override 40 | protected String[] getBinaryArguments() { 41 | // ipv4 INPUT /data/local/tmp/mcm.mgn 42 | String[] retVal = buildMGENEvents(); 43 | return retVal; 44 | } 45 | 46 | private String[] buildMGENEvents() { 47 | String bindInterface = sharedPref.getString(getString(R.string.xop_bind_interface), "eth0"); 48 | Log.i(getDaemonLogTag(), "bindInterface: " + bindInterface); 49 | String mgenPort = sharedPref.getString(getString(R.string.mgen_port), "56797"); 50 | String address = sharedPref.getString(getString(R.string.mgen_address), "225.239.240.251"); 51 | List params = new LinkedList<>(); 52 | 53 | String listenEvent = "\"LISTEN UDP $1\"".replace("$1", mgenPort); 54 | String joinEvent = "\"JOIN $ADDRESS INTERFACE $INTERFACE\"" 55 | .replace("$ADDRESS", address).replace("$INTERFACE", bindInterface); 56 | String trafficGenEvent = "\"ON 5 UDP SRC 4006 DST $ADDRESS/$LISTENPORT INTERFACE $INTERFACE PERIODIC [0.25 100]]\"" 57 | .replace("$ADDRESS", address).replace("$INTERFACE", bindInterface).replace("$LISTENPORT", mgenPort); 58 | String[] events = new String[]{listenEvent, joinEvent, trafficGenEvent}; 59 | for (String event : events) { 60 | params.add("event"); 61 | params.add(event); 62 | } 63 | params.add("OUTPUT"); 64 | long ts = System.currentTimeMillis(); 65 | params.add("/sdcard/mcm-" + ts + ".out"); 66 | Log.d(getDaemonLogTag(), "params: " + params.toArray()); 67 | return params.toArray(new String[]{}); 68 | } 69 | 70 | @Override 71 | public int onStartCommand(Intent intent, int flags, int startId) { 72 | super.onStartCommand(intent, flags, startId); 73 | String tickerText = getText(R.string.mgen_ticker_text).toString(); 74 | PendingIntent pendingIntent = PendingIntent.getService(this, 0, intent, flags); 75 | Log.d(getDaemonLogTag(), "Starting MGEN"); 76 | Notification notification = new Notification.Builder(this) 77 | .setContentTitle(getText(R.string.mgen_title)) 78 | .setContentText(tickerText) 79 | .setSmallIcon(R.drawable.icon) 80 | .setContentIntent(pendingIntent) 81 | //.setTicker(tickerText) 82 | .build(); 83 | this.startForeground(53, notification); 84 | return START_STICKY; 85 | } 86 | 87 | @Override 88 | public void onDestroy() { 89 | super.onDestroy(); 90 | this.stopForeground(true); 91 | 92 | 93 | } 94 | 95 | } 96 | -------------------------------------------------------------------------------- /xop-android/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USNavalResearchLaboratory/xmpp-overlay/0f00856b375c31c2f92fab5128924ac88f3fbe52/xop-android/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /xop-android/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USNavalResearchLaboratory/xmpp-overlay/0f00856b375c31c2f92fab5128924ac88f3fbe52/xop-android/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /xop-android/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USNavalResearchLaboratory/xmpp-overlay/0f00856b375c31c2f92fab5128924ac88f3fbe52/xop-android/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /xop-android/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USNavalResearchLaboratory/xmpp-overlay/0f00856b375c31c2f92fab5128924ac88f3fbe52/xop-android/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /xop-android/src/main/res/drawable/ic_action_copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USNavalResearchLaboratory/xmpp-overlay/0f00856b375c31c2f92fab5128924ac88f3fbe52/xop-android/src/main/res/drawable/ic_action_copy.png -------------------------------------------------------------------------------- /xop-android/src/main/res/drawable/ic_action_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USNavalResearchLaboratory/xmpp-overlay/0f00856b375c31c2f92fab5128924ac88f3fbe52/xop-android/src/main/res/drawable/ic_action_settings.png -------------------------------------------------------------------------------- /xop-android/src/main/res/drawable/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USNavalResearchLaboratory/xmpp-overlay/0f00856b375c31c2f92fab5128924ac88f3fbe52/xop-android/src/main/res/drawable/icon.png -------------------------------------------------------------------------------- /xop-android/src/main/res/drawable/indicator_green.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /xop-android/src/main/res/drawable/indicator_red.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /xop-android/src/main/res/drawable/indicator_yellow.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /xop-android/src/main/res/layout/activity_xop.xml: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /xop-android/src/main/res/layout/popup.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 22 | 23 | 27 | 31 | 32 | -------------------------------------------------------------------------------- /xop-android/src/main/res/layout/popup_spinner.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 20 | 21 | 26 | 27 |