summaryrefslogtreecommitdiff
path: root/app/src/ovpn3
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2017-09-21 01:28:24 +0200
committercyBerta <cyberta@riseup.net>2017-09-21 01:28:24 +0200
commitd77b9aefea75491b50f28a6880906ba9496979f2 (patch)
tree669cd96c72836c66caee662b4224e35df205d8a0 /app/src/ovpn3
parent63a604651b9fdc24a0e18c7b95a00e9fe6bb157d (diff)
update ics-openvpn: update classes, manifest, resources and build script
Diffstat (limited to 'app/src/ovpn3')
-rw-r--r--app/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java98
1 files changed, 63 insertions, 35 deletions
diff --git a/app/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java b/app/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java
index e595106c..850983a9 100644
--- a/app/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java
+++ b/app/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());
+ }
+
}