summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/OpenVpnManagementThread.java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-05-03 22:18:56 +0200
committerArne Schwabe <arne@rfc2549.org>2012-05-03 22:18:56 +0200
commitc3e7e4fbab09a55a7e433f76f290be75d77bcb28 (patch)
tree069e25f914563249f15c14e49dc24f11dfd99e9b /src/de/blinkt/openvpn/OpenVpnManagementThread.java
parent3d54881bc78b893ab286681338dd7b9b69d871b3 (diff)
add delete Profile support
add Config Parser begin openvpn config => Vpn Profile Converter
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('\'');