diff options
author | Takuo Kitame <kitame@gmail.com> | 2010-07-12 19:27:19 +0900 |
---|---|---|
committer | Chris Soyars <ctsoyars@gmail.com> | 2010-07-13 17:58:34 +0000 |
commit | 90f7c2ffab9d9cc1025ad9a98e1d55562ee8b50c (patch) | |
tree | 20766b8b74187219b6695a6bac7d0b8806cb3bbc /vpn | |
parent | 8955545ee7037c3e2d8e2d7e7c4e29da59447f92 (diff) | |
download | frameworks_base-90f7c2ffab9d9cc1025ad9a98e1d55562ee8b50c.zip frameworks_base-90f7c2ffab9d9cc1025ad9a98e1d55562ee8b50c.tar.gz frameworks_base-90f7c2ffab9d9cc1025ad9a98e1d55562ee8b50c.tar.bz2 |
OpenVPN: Added configurable options cipher, keysize and extra custom arguments.
It would possibly close issues 1177, 1476 and 1519
Diffstat (limited to 'vpn')
-rw-r--r-- | vpn/java/android/net/vpn/OpenvpnProfile.java | 49 |
1 files changed, 46 insertions, 3 deletions
diff --git a/vpn/java/android/net/vpn/OpenvpnProfile.java b/vpn/java/android/net/vpn/OpenvpnProfile.java index 34696fe..f1fd2f6 100644 --- a/vpn/java/android/net/vpn/OpenvpnProfile.java +++ b/vpn/java/android/net/vpn/OpenvpnProfile.java @@ -19,7 +19,7 @@ package android.net.vpn; import android.os.Parcel; /** - * The profile for Openvpn type of VPN. + * The profile for Openvpn type of VPN. * {@hide} */ public class OpenvpnProfile extends VpnProfile { @@ -57,6 +57,12 @@ public class OpenvpnProfile extends VpnProfile { private String mDevice = DEVICE_TUN; + private String mCipher; + + private int mKeySize; + + private String mExtra; + @Override public VpnType getType() { return VpnType.OPENVPN; @@ -145,11 +151,11 @@ public class OpenvpnProfile extends VpnProfile { public void setRedirectGateway(boolean b) { mRedirectGateway = b; } - + public boolean getRedirectGateway() { return mRedirectGateway; } - + public void setSupplyAddr(boolean b) { mSupplyAddr = b; } @@ -174,6 +180,37 @@ public class OpenvpnProfile extends VpnProfile { return mRemoteAddr; } + public void setCipher(String cipher) { + mCipher = cipher; + } + + public String getCipher() { + return mCipher; + } + + public void setKeySize(String keysize) { + try { + if (keysize.equals("0")) + mKeySize = 0; + else + mKeySize = Integer.parseInt(keysize); + } catch (NumberFormatException e) { + // no update + } + } + + public String getKeySize() { + return Integer.toString(mKeySize); + } + + public void setExtra(String extra) { + mExtra = extra; + } + + public String getExtra() { + return mExtra; + } + @Override protected void readFromParcel(Parcel in) { super.readFromParcel(in); @@ -188,6 +225,9 @@ public class OpenvpnProfile extends VpnProfile { mLocalAddr = in.readString(); mRemoteAddr = in.readString(); mDevice = in.readString(); + mCipher = in.readString(); + mKeySize = in.readInt(); + mExtra = in.readString(); } @Override @@ -204,5 +244,8 @@ public class OpenvpnProfile extends VpnProfile { parcel.writeString(mLocalAddr); parcel.writeString(mRemoteAddr); parcel.writeString(mDevice); + parcel.writeString(mCipher); + parcel.writeInt(mKeySize); + parcel.writeString(mExtra); } } |