summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/OpenVpnManagementThread.java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-05-03 22:51:47 +0200
committerArne Schwabe <arne@rfc2549.org>2012-05-03 22:51:47 +0200
commit2b3ea917b0a830e3ff4817c7240e0f1808ae58bc (patch)
tree2359f4fca5e51d2b7eb253728f62b74db7da0e69 /src/de/blinkt/openvpn/OpenVpnManagementThread.java
parent9cd2069d5d57fc605a8eae3e6f8a0b09b56d4c16 (diff)
parentd3c50d3637462d4e3e3a3c09d43d37ce5656f67a (diff)
Merge Merge try number 2
Diffstat (limited to 'src/de/blinkt/openvpn/OpenVpnManagementThread.java')
-rw-r--r--src/de/blinkt/openvpn/OpenVpnManagementThread.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/de/blinkt/openvpn/OpenVpnManagementThread.java b/src/de/blinkt/openvpn/OpenVpnManagementThread.java
index 02e5dc46..19f8d7e5 100644
--- a/src/de/blinkt/openvpn/OpenVpnManagementThread.java
+++ b/src/de/blinkt/openvpn/OpenVpnManagementThread.java
@@ -1,10 +1,13 @@
package de.blinkt.openvpn;
+import java.io.FileDescriptor;
import java.io.IOException;
import java.io.InputStream;
+import java.net.DatagramSocket;
import java.util.Vector;
import android.net.LocalSocket;
+import android.os.ParcelFileDescriptor;
import android.util.Log;
public class OpenVpnManagementThread implements Runnable {
@@ -12,11 +15,14 @@ public class OpenVpnManagementThread implements Runnable {
private static final String TAG = "openvpn";
private LocalSocket mSocket;
private VpnProfile mProfile;
+ private OpenVpnService mOpenVPNService;
+
private static Vector<OpenVpnManagementThread> active=new Vector<OpenVpnManagementThread>();
- public OpenVpnManagementThread(VpnProfile profile, LocalSocket mgmtsocket) {
+ public OpenVpnManagementThread(VpnProfile profile, LocalSocket mgmtsocket, OpenVpnService openVpnService) {
mProfile = profile;
mSocket = mgmtsocket;
+ mOpenVPNService = openVpnService;
}
@@ -102,6 +108,8 @@ private static Vector<OpenVpnManagementThread> active=new Vector<OpenVpnManageme
processPWCommand(argument);
} else if (cmd.equals("HOLD")) {
managmentCommand("hold release\n");
+ } else if (cmd.equals("PROTECT-FD")) {
+ protectFD(argument);
}
}
Log.i(TAG, "Got unrecognized command" + command);
@@ -109,6 +117,17 @@ private static Vector<OpenVpnManagementThread> active=new Vector<OpenVpnManageme
}
+ private void protectFD(String argument) {
+ try {
+ FileDescriptor[] fds = mSocket.getAncillaryFileDescriptors();
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+
private void processPWCommand(String argument) {
//argument has the form Need 'Private Key' password
int p1 =argument.indexOf('\'');