| Hung-ying Tyan | 55567ef | 2009-06-03 23:56:34 +0800 | [diff] [blame] | 1 | /* |
| Hung-ying Tyan | d3aba7f | 2009-06-19 19:45:38 +0800 | [diff] [blame] | 2 | * Copyright (C) 2009, The Android Open Source Project |
| Hung-ying Tyan | 55567ef | 2009-06-03 23:56:34 +0800 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.net.vpn; |
| 18 | |
| Hung-ying Tyan | d3aba7f | 2009-06-19 19:45:38 +0800 | [diff] [blame] | 19 | import android.os.Parcel; |
| 20 | |
| Hung-ying Tyan | 55567ef | 2009-06-03 23:56:34 +0800 | [diff] [blame] | 21 | /** |
| 22 | * The profile for L2TP type of VPN. |
| 23 | * {@hide} |
| 24 | */ |
| Hung-ying Tyan | 0304325 | 2009-06-15 18:59:01 +0800 | [diff] [blame] | 25 | public class L2tpProfile extends VpnProfile { |
| Hung-ying Tyan | f94b644 | 2009-06-08 13:27:11 +0800 | [diff] [blame] | 26 | private static final long serialVersionUID = 1L; |
| 27 | |
| Hung-ying Tyan | d3aba7f | 2009-06-19 19:45:38 +0800 | [diff] [blame] | 28 | private boolean mSecret; |
| 29 | private String mSecretString; |
| 30 | |
| Hung-ying Tyan | 55567ef | 2009-06-03 23:56:34 +0800 | [diff] [blame] | 31 | @Override |
| 32 | public VpnType getType() { |
| 33 | return VpnType.L2TP; |
| 34 | } |
| Hung-ying Tyan | d3aba7f | 2009-06-19 19:45:38 +0800 | [diff] [blame] | 35 | |
| 36 | /** |
| 37 | * Enables/disables the secret for authenticating tunnel connection. |
| 38 | */ |
| 39 | public void setSecretEnabled(boolean enabled) { |
| 40 | mSecret = enabled; |
| 41 | } |
| 42 | |
| 43 | public boolean isSecretEnabled() { |
| 44 | return mSecret; |
| 45 | } |
| 46 | |
| 47 | public void setSecretString(String secret) { |
| 48 | mSecretString = secret; |
| 49 | } |
| 50 | |
| 51 | public String getSecretString() { |
| 52 | return mSecretString; |
| 53 | } |
| 54 | |
| 55 | @Override |
| 56 | protected void readFromParcel(Parcel in) { |
| 57 | super.readFromParcel(in); |
| 58 | mSecret = in.readInt() > 0; |
| 59 | mSecretString = in.readString(); |
| 60 | } |
| 61 | |
| 62 | @Override |
| 63 | public void writeToParcel(Parcel parcel, int flags) { |
| 64 | super.writeToParcel(parcel, flags); |
| 65 | parcel.writeInt(mSecret ? 1 : 0); |
| 66 | parcel.writeString(mSecretString); |
| 67 | } |
| Hung-ying Tyan | 55567ef | 2009-06-03 23:56:34 +0800 | [diff] [blame] | 68 | } |