summaryrefslogtreecommitdiff
path: root/main/src/ovpn3/java/de/blinkt
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2016-09-26 18:15:53 +0200
committerArne Schwabe <arne@rfc2549.org>2016-09-26 18:16:13 +0200
commitccfc4d3a763d27a99c0fe0bf4be59ec74521a36a (patch)
treed734b1c955aa9bb1c2e5f453671a63fbd15b8934 /main/src/ovpn3/java/de/blinkt
parent2d0661fde86ff4a4cb5630451ff714318542dfbd (diff)
Update OpenVPN 3 code for released code
Diffstat (limited to 'main/src/ovpn3/java/de/blinkt')
-rw-r--r--main/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java98
1 files changed, 63 insertions, 35 deletions
diff --git a/main/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java b/main/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java
index e595106c..850983a9 100644
--- a/main/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java
+++ b/main/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java
@@ -22,7 +22,7 @@ public class OpenVPNThreadv3 extends ClientAPI_OpenVPNClient implements Runnable
static {
/*System.loadLibrary("crypto");
System.loadLibrary("ssl");*/
- System.loadLibrary("polarssl-dynamic");
+ //System.loadLibrary("polarssl-dynamic");
System.loadLibrary("ovpn3");
}
@@ -77,7 +77,8 @@ public class OpenVPNThreadv3 extends ClientAPI_OpenVPNClient implements Runnable
statuspoller.stop();
}
- @Override
+
+ @Override
public boolean tun_builder_set_remote_address(String address, boolean ipv6) {
mService.setMtu(1500);
return true;
@@ -94,9 +95,8 @@ public class OpenVPNThreadv3 extends ClientAPI_OpenVPNClient implements Runnable
return true;
}
- @Override
- public boolean tun_builder_add_route(String address, int prefix_length,
- boolean ipv6) {
+ @Override
+ public boolean tun_builder_add_route(String address, int prefix_length, int metric, boolean ipv6) {
if (address.equals("remote_host"))
return false;
@@ -107,7 +107,20 @@ public class OpenVPNThreadv3 extends ClientAPI_OpenVPNClient implements Runnable
return true;
}
- @Override
+ @Override
+ public boolean tun_builder_exclude_route(String address, int prefix_length, int metric, boolean ipv6) {
+ if(ipv6)
+ mService.addRoutev6(address + "/" + prefix_length, "wifi0");
+ else {
+ //TODO
+ mService.addRoute(address, String.valueOf(prefix_length), "1.2.3.4" , "wifi0");
+ }
+ return true;
+ }
+
+
+
+ @Override
public boolean tun_builder_add_search_domain(String domain) {
mService.setDomain(domain);
return true;
@@ -126,15 +139,15 @@ public class OpenVPNThreadv3 extends ClientAPI_OpenVPNClient implements Runnable
- @Override
- public boolean tun_builder_add_address(String address, int prefix_length,
- boolean ipv6) {
- if(!ipv6)
- mService.setLocalIP(new CIDRIP(address, prefix_length));
- else
- mService.setLocalIPv6(address+ "/" + prefix_length);
- return true;
- }
+
+ @Override
+ public boolean tun_builder_add_address(String address, int prefix_length, String gateway, boolean ipv6, boolean net30) {
+ if(!ipv6)
+ mService.setLocalIP(new CIDRIP(address, prefix_length));
+ else
+ mService.setLocalIPv6(address+ "/" + prefix_length);
+ return true;
+ }
@Override
public boolean tun_builder_new() {
@@ -142,19 +155,19 @@ public class OpenVPNThreadv3 extends ClientAPI_OpenVPNClient implements Runnable
return true;
}
- @Override
- public boolean tun_builder_reroute_gw(String server_address,
- boolean server_address_ipv6, boolean ipv4, boolean ipv6, long flags) {
- // ignore
- return true;
- }
- @Override
- public boolean tun_builder_exclude_route(String address, int prefix_length,
- boolean ipv6) {
- //ignore
- return true;
- }
+ @Override
+ public boolean tun_builder_set_layer(int layer) {
+ return layer == 3;
+ }
+
+
+ @Override
+ public boolean tun_builder_reroute_gw(boolean ipv4, boolean ipv6, long flags) {
+ //ignore
+ return true;
+ }
+
private boolean setConfig(String vpnconfig) {
@@ -228,11 +241,20 @@ public class OpenVPNThreadv3 extends ClientAPI_OpenVPNClient implements Runnable
mService =openVpnService;
}
- @Override
- public void pause(pauseReason pauseReason)
- {
- pause();
- }
+
+ @Override
+ public boolean stopVPN(boolean replaceConnection) {
+ return false;
+ }
+
+ @Override
+ public void networkChange(boolean sameNetwork) {
+
+ }
+
+ @Override
+ public void setPauseCallback(PausedStateCallback callback) {
+ }
@Override
public void log(ClientAPI_LogInfo arg0) {
@@ -262,9 +284,10 @@ public class OpenVPNThreadv3 extends ClientAPI_OpenVPNClient implements Runnable
return true;
}
- public boolean stopVPN() {
- stop();
- return true;
+
+ @Override
+ public void stop() {
+ super.stop();
}
@Override
@@ -272,4 +295,9 @@ public class OpenVPNThreadv3 extends ClientAPI_OpenVPNClient implements Runnable
reconnect(1);
}
+ @Override
+ public void pause(pauseReason reason) {
+ super.pause(reason.toString());
+ }
+
}