Merge "Add dump info to IpSecService" am: ec5fc4872e am: b47cb8b03c
am: c628b22fe5 Change-Id: I1a5d4c424a3c9e1638d86d177cbf98f0d1bce05d
This commit is contained in:
@@ -16,8 +16,10 @@
|
||||
package android.net;
|
||||
|
||||
import android.annotation.StringDef;
|
||||
import android.os.Build;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.android.internal.util.HexDump;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
@@ -182,4 +184,17 @@ public final class IpSecAlgorithm implements Parcelable {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringBuilder()
|
||||
.append("{mName=")
|
||||
.append(mName)
|
||||
.append(", mKey=")
|
||||
.append(Build.IS_DEBUGGABLE ? HexDump.toHexString(mKey) : "<hidden>")
|
||||
.append(", mTruncLenBits=")
|
||||
.append(mTruncLenBits)
|
||||
.append("}")
|
||||
.toString();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -47,9 +47,22 @@ public final class IpSecConfig implements Parcelable {
|
||||
|
||||
// Authentication Algorithm
|
||||
IpSecAlgorithm authentication;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringBuilder()
|
||||
.append("{spiResourceId=")
|
||||
.append(spiResourceId)
|
||||
.append(", encryption=")
|
||||
.append(encryption)
|
||||
.append(", authentication=")
|
||||
.append(authentication)
|
||||
.append("}")
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
Flow[] flow = new Flow[] {new Flow(), new Flow()};
|
||||
final Flow[] flow = new Flow[] {new Flow(), new Flow()};
|
||||
|
||||
// For tunnel mode IPv4 UDP Encapsulation
|
||||
// IpSecTransform#ENCAP_ESP_*, such as ENCAP_ESP_OVER_UDP_IKE
|
||||
@@ -166,6 +179,35 @@ public final class IpSecConfig implements Parcelable {
|
||||
encapRemotePort = in.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder strBuilder = new StringBuilder();
|
||||
strBuilder
|
||||
.append("{mode=")
|
||||
.append(mode == IpSecTransform.MODE_TUNNEL ? "TUNNEL" : "TRANSPORT")
|
||||
.append(", localAddress=")
|
||||
.append(localAddress)
|
||||
.append(", remoteAddress=")
|
||||
.append(remoteAddress)
|
||||
.append(", network=")
|
||||
.append(network)
|
||||
.append(", encapType=")
|
||||
.append(encapType)
|
||||
.append(", encapLocalPortResourceId=")
|
||||
.append(encapLocalPortResourceId)
|
||||
.append(", encapRemotePort=")
|
||||
.append(encapRemotePort)
|
||||
.append(", nattKeepaliveInterval=")
|
||||
.append(nattKeepaliveInterval)
|
||||
.append(", flow[OUT]=")
|
||||
.append(flow[IpSecTransform.DIRECTION_OUT])
|
||||
.append(", flow[IN]=")
|
||||
.append(flow[IpSecTransform.DIRECTION_IN])
|
||||
.append("}");
|
||||
|
||||
return strBuilder.toString();
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<IpSecConfig> CREATOR =
|
||||
new Parcelable.Creator<IpSecConfig>() {
|
||||
public IpSecConfig createFromParcel(Parcel in) {
|
||||
|
||||
@@ -67,10 +67,10 @@ public final class IpSecTransform implements AutoCloseable {
|
||||
public @interface TransformDirection {}
|
||||
|
||||
/** @hide */
|
||||
private static final int MODE_TUNNEL = 0;
|
||||
public static final int MODE_TUNNEL = 0;
|
||||
|
||||
/** @hide */
|
||||
private static final int MODE_TRANSPORT = 1;
|
||||
public static final int MODE_TRANSPORT = 1;
|
||||
|
||||
/** @hide */
|
||||
public static final int ENCAP_NONE = 0;
|
||||
|
||||
Reference in New Issue
Block a user