blob: dbba0c500f6f6bf9b42212def9d6e0dce2dc191e [file] [log] [blame]
Hung-ying Tyan55567ef2009-06-03 23:56:34 +08001/*
Hung-ying Tyand3aba7f2009-06-19 19:45:38 +08002 * Copyright (C) 2009, The Android Open Source Project
Hung-ying Tyan55567ef2009-06-03 23:56:34 +08003 *
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
17package android.net.vpn;
18
Hung-ying Tyand3aba7f2009-06-19 19:45:38 +080019import android.os.Parcel;
20
Hung-ying Tyan55567ef2009-06-03 23:56:34 +080021/**
22 * The profile for L2TP type of VPN.
23 * {@hide}
24 */
Hung-ying Tyan03043252009-06-15 18:59:01 +080025public class L2tpProfile extends VpnProfile {
Hung-ying Tyanf94b6442009-06-08 13:27:11 +080026 private static final long serialVersionUID = 1L;
27
Hung-ying Tyand3aba7f2009-06-19 19:45:38 +080028 private boolean mSecret;
29 private String mSecretString;
30
Hung-ying Tyan55567ef2009-06-03 23:56:34 +080031 @Override
32 public VpnType getType() {
33 return VpnType.L2TP;
34 }
Hung-ying Tyand3aba7f2009-06-19 19:45:38 +080035
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 Tyan55567ef2009-06-03 23:56:34 +080068}