diff options
author | Parménides GV <parmegv@sdf.org> | 2014-12-20 20:14:23 +0100 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2014-12-23 19:58:02 +0100 |
commit | d6190becb1c48ee912b11a4206116d0fd4c90772 (patch) | |
tree | 1a8d7f85690ce56196855fa969e86b1e53d813f3 /app/src/main/java/de/blinkt/openvpn/core/Connection.java | |
parent | b1219330faf64b2cd4330d44390fdec137b659b7 (diff) |
Update ics-openvpn to 1006
Diffstat (limited to 'app/src/main/java/de/blinkt/openvpn/core/Connection.java')
-rw-r--r-- | app/src/main/java/de/blinkt/openvpn/core/Connection.java | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/app/src/main/java/de/blinkt/openvpn/core/Connection.java b/app/src/main/java/de/blinkt/openvpn/core/Connection.java new file mode 100644 index 00000000..b10664ce --- /dev/null +++ b/app/src/main/java/de/blinkt/openvpn/core/Connection.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2012-2014 Arne Schwabe + * Distributed under the GNU GPL v2 with additional terms. For full terms see the file doc/LICENSE.txt + */ + +package de.blinkt.openvpn.core; + +import android.text.TextUtils; + +import java.io.Serializable; + +public class Connection implements Serializable, Cloneable { + public String mServerName = "openvpn.blinkt.de"; + public String mServerPort = "1194"; + public boolean mUseUdp = true; + public String mCustomConfiguration=""; + public boolean mUseCustomConfig=false; + public boolean mEnabled=true; + + private static final long serialVersionUID = 92031902903829089L; + + + public String getConnectionBlock() { + String cfg=""; + + // Server Address + cfg += "remote "; + cfg += mServerName; + cfg += " "; + cfg += mServerPort; + if (mUseUdp) + cfg += " udp\n"; + else + cfg += " tcp-client\n"; + + if (!TextUtils.isEmpty(mCustomConfiguration) && mUseCustomConfig) { + cfg += mCustomConfiguration; + cfg += "\n"; + } + return cfg; + } + + @Override + public Connection clone() throws CloneNotSupportedException { + return (Connection) super.clone(); + } + + public boolean isOnlyRemote() { + return TextUtils.isEmpty(mCustomConfiguration) || !mUseCustomConfig; + } +} |