summaryrefslogtreecommitdiff
path: root/remoteExample/src/main/aidl/de/blinkt
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2014-02-13 16:33:39 +0100
committerArne Schwabe <arne@rfc2549.org>2014-02-13 16:33:39 +0100
commit1ec9eb737e465de3d215b903c4c91c75696c75ec (patch)
tree2722801a7d2da03ba6c6ec865be7820e3adaae90 /remoteExample/src/main/aidl/de/blinkt
parentdfd5ef42cf6b68bd7ee7b522ac3c9a55cd54c889 (diff)
Implement demo to show OpenVPN for Android API
Diffstat (limited to 'remoteExample/src/main/aidl/de/blinkt')
-rw-r--r--remoteExample/src/main/aidl/de/blinkt/openvpn/api/APIVpnProfile.aidl3
-rw-r--r--remoteExample/src/main/aidl/de/blinkt/openvpn/api/IOpenVPNAPIService.aidl50
-rw-r--r--remoteExample/src/main/aidl/de/blinkt/openvpn/api/IOpenVPNStatusCallback.aidl13
3 files changed, 66 insertions, 0 deletions
diff --git a/remoteExample/src/main/aidl/de/blinkt/openvpn/api/APIVpnProfile.aidl b/remoteExample/src/main/aidl/de/blinkt/openvpn/api/APIVpnProfile.aidl
new file mode 100644
index 00000000..f6799659
--- /dev/null
+++ b/remoteExample/src/main/aidl/de/blinkt/openvpn/api/APIVpnProfile.aidl
@@ -0,0 +1,3 @@
+package de.blinkt.openvpn.api;
+
+parcelable APIVpnProfile;
diff --git a/remoteExample/src/main/aidl/de/blinkt/openvpn/api/IOpenVPNAPIService.aidl b/remoteExample/src/main/aidl/de/blinkt/openvpn/api/IOpenVPNAPIService.aidl
new file mode 100644
index 00000000..794e3aad
--- /dev/null
+++ b/remoteExample/src/main/aidl/de/blinkt/openvpn/api/IOpenVPNAPIService.aidl
@@ -0,0 +1,50 @@
+// IOpenVPNAPIService.aidl
+package de.blinkt.openvpn.api;
+
+import de.blinkt.openvpn.api.APIVpnProfile;
+import de.blinkt.openvpn.api.IOpenVPNStatusCallback;
+
+import android.content.Intent;
+import android.os.ParcelFileDescriptor;
+
+interface IOpenVPNAPIService {
+ List<APIVpnProfile> getProfiles();
+
+ void startProfile (String profileUUID);
+
+ /** Use a profile with all certificates etc. embedded */
+ boolean addVPNProfile (String name, String config);
+
+ /** start a profile using an config */
+ void startVPN (String inlineconfig);
+
+ /** This permission framework is used to avoid confused deputy style attack to the VPN
+ * calling this will give null if the app is allowed to use the external API and an Intent
+ * that can be launched to request permissions otherwise */
+ Intent prepare (String packagename);
+
+ /** Used to trigger to the Android VPN permission dialog (VPNService.prepare()) in advance,
+ * if this return null OpenVPN for ANdroid already has the permissions otherwise you can start the returned Intent
+ * to let OpenVPN for Android request the permission */
+ Intent prepareVPNService ();
+
+ /* Disconnect the VPN */
+ void disconnect();
+
+ /* Pause the VPN (same as using the pause feature in the notifcation bar) */
+ void pause();
+
+ /* Resume the VPN (same as using the pause feature in the notifcation bar) */
+ void resume();
+
+ /**
+ * Registers to receive OpenVPN Status Updates
+ */
+ void registerStatusCallback(IOpenVPNStatusCallback cb);
+
+ /**
+ * Remove a previously registered callback interface.
+ */
+ void unregisterStatusCallback(IOpenVPNStatusCallback cb);
+
+} \ No newline at end of file
diff --git a/remoteExample/src/main/aidl/de/blinkt/openvpn/api/IOpenVPNStatusCallback.aidl b/remoteExample/src/main/aidl/de/blinkt/openvpn/api/IOpenVPNStatusCallback.aidl
new file mode 100644
index 00000000..1dfa1381
--- /dev/null
+++ b/remoteExample/src/main/aidl/de/blinkt/openvpn/api/IOpenVPNStatusCallback.aidl
@@ -0,0 +1,13 @@
+package de.blinkt.openvpn.api;
+
+/**
+ * Example of a callback interface used by IRemoteService to send
+ * synchronous notifications back to its clients. Note that this is a
+ * one-way interface so the server does not block waiting for the client.
+ */
+oneway interface IOpenVPNStatusCallback {
+ /**
+ * Called when the service has a new status for you.
+ */
+ void newStatus(String uuid, String state, String message, String level);
+}