* @param username username (gets owned)
* @param password password (gets owned)
*/
-static void initiate(char *local, char *gateway, char *username, char *password)
+static void initiate(char *type, char *local, char *gateway,
+ char *username, char *password)
{
private_charonservice_t *this = (private_charonservice_t*)charonservice;
DESTROY_IF(this->service);
this->service = android_service_create(local, gateway, username);
+ free(type);
}
/**
* Initiate SA
*/
JNI_METHOD(CharonVpnService, initiate, void,
- jstring jlocal_address, jstring jgateway, jstring jusername,
+ jstring jtype, jstring jlocal_address, jstring jgateway, jstring jusername,
jstring jpassword)
{
- char *local_address, *gateway, *username, *password;
+ char *type, *local_address, *gateway, *username, *password;
+ type = androidjni_convert_jstring(env, jtype);
local_address = androidjni_convert_jstring(env, jlocal_address);
gateway = androidjni_convert_jstring(env, jgateway);
username = androidjni_convert_jstring(env, jusername);
password = androidjni_convert_jstring(env, jpassword);
- initiate(local_address, gateway, username, password);
+ initiate(type, local_address, gateway, username, password);
}
Log.i(TAG, "charon started");
String local_address = getLocalIPv4Address();
- initiate(local_address != null ? local_address : "0.0.0.0",
+ initiate(mCurrentProfile.getVpnType().getIdentifier(),
+ local_address != null ? local_address : "0.0.0.0",
mCurrentProfile.getGateway(), mCurrentProfile.getUsername(),
mCurrentProfile.getPassword());
}
/**
* Initiate VPN, provided by libandroidbridge.so
*/
- public native void initiate(String local_address, String gateway,
+ public native void initiate(String type, String local_address, String gateway,
String username, String password);
/**