X-Git-Url: https://git.strongswan.org/?p=strongswan.git;a=blobdiff_plain;f=src%2Ffrontends%2Fandroid%2Fsrc%2Forg%2Fstrongswan%2Fandroid%2Flogic%2FCharonVpnService.java;h=54ca247cc8d485429eb5e0d3bc93c5026a0ad11a;hp=6b454654aa838ed8c7a7a1a6f5e6a47414ad89ed;hb=c6c39c783bd713fe2c159be7445a82f8b8c9c3e5;hpb=dffee9e2b0496ba2a5989e419be9131b37c245e7 diff --git a/src/frontends/android/src/org/strongswan/android/logic/CharonVpnService.java b/src/frontends/android/src/org/strongswan/android/logic/CharonVpnService.java index 6b45465..54ca247 100644 --- a/src/frontends/android/src/org/strongswan/android/logic/CharonVpnService.java +++ b/src/frontends/android/src/org/strongswan/android/logic/CharonVpnService.java @@ -194,6 +194,11 @@ public class CharonVpnService extends VpnService implements Runnable initializeCharon(); Log.i(TAG, "charon started"); + + String local_address = getLocalIPv4Address(); + initiate(local_address != null ? local_address : "0.0.0.0", + mCurrentProfile.getGateway(), mCurrentProfile.getUsername(), + mCurrentProfile.getPassword()); } } catch (InterruptedException ex) @@ -404,6 +409,12 @@ public class CharonVpnService extends VpnService implements Runnable public native void deinitializeCharon(); /** + * Initiate VPN, provided by libandroidbridge.so + */ + public native void initiate(String local_address, String gateway, + String username, String password); + + /** * Helper function that retrieves a local IPv4 address. * * @return string representation of an IPv4 address, or null if none found