Merge changes from topic "xfrmi-support" am: f928c1e4b9
am: 719761f60c
Change-Id: I13a826f5ae3c4cb700be789b369848685da1bc41
This commit is contained in:
@@ -65,10 +65,13 @@ public final class IpSecConfig implements Parcelable {
|
||||
// An interval, in seconds between the NattKeepalive packets
|
||||
private int mNattKeepaliveInterval;
|
||||
|
||||
// XFRM mark and mask
|
||||
// XFRM mark and mask; defaults to 0 (no mark/mask)
|
||||
private int mMarkValue;
|
||||
private int mMarkMask;
|
||||
|
||||
// XFRM interface id
|
||||
private int mXfrmInterfaceId;
|
||||
|
||||
/** Set the mode for this IPsec transform */
|
||||
public void setMode(int mode) {
|
||||
mMode = mode;
|
||||
@@ -125,14 +128,30 @@ public final class IpSecConfig implements Parcelable {
|
||||
mNattKeepaliveInterval = interval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the mark value
|
||||
*
|
||||
* <p>Internal (System server) use only. Marks passed in by users will be overwritten or
|
||||
* ignored.
|
||||
*/
|
||||
public void setMarkValue(int mark) {
|
||||
mMarkValue = mark;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the mark mask
|
||||
*
|
||||
* <p>Internal (System server) use only. Marks passed in by users will be overwritten or
|
||||
* ignored.
|
||||
*/
|
||||
public void setMarkMask(int mask) {
|
||||
mMarkMask = mask;
|
||||
}
|
||||
|
||||
public void setXfrmInterfaceId(int xfrmInterfaceId) {
|
||||
mXfrmInterfaceId = xfrmInterfaceId;
|
||||
}
|
||||
|
||||
// Transport or Tunnel
|
||||
public int getMode() {
|
||||
return mMode;
|
||||
@@ -190,6 +209,10 @@ public final class IpSecConfig implements Parcelable {
|
||||
return mMarkMask;
|
||||
}
|
||||
|
||||
public int getXfrmInterfaceId() {
|
||||
return mXfrmInterfaceId;
|
||||
}
|
||||
|
||||
// Parcelable Methods
|
||||
|
||||
@Override
|
||||
@@ -213,6 +236,7 @@ public final class IpSecConfig implements Parcelable {
|
||||
out.writeInt(mNattKeepaliveInterval);
|
||||
out.writeInt(mMarkValue);
|
||||
out.writeInt(mMarkMask);
|
||||
out.writeInt(mXfrmInterfaceId);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
@@ -235,6 +259,7 @@ public final class IpSecConfig implements Parcelable {
|
||||
mNattKeepaliveInterval = c.mNattKeepaliveInterval;
|
||||
mMarkValue = c.mMarkValue;
|
||||
mMarkMask = c.mMarkMask;
|
||||
mXfrmInterfaceId = c.mXfrmInterfaceId;
|
||||
}
|
||||
|
||||
private IpSecConfig(Parcel in) {
|
||||
@@ -255,6 +280,7 @@ public final class IpSecConfig implements Parcelable {
|
||||
mNattKeepaliveInterval = in.readInt();
|
||||
mMarkValue = in.readInt();
|
||||
mMarkMask = in.readInt();
|
||||
mXfrmInterfaceId = in.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -289,6 +315,8 @@ public final class IpSecConfig implements Parcelable {
|
||||
.append(mMarkValue)
|
||||
.append(", mMarkMask=")
|
||||
.append(mMarkMask)
|
||||
.append(", mXfrmInterfaceId=")
|
||||
.append(mXfrmInterfaceId)
|
||||
.append("}");
|
||||
|
||||
return strBuilder.toString();
|
||||
@@ -320,10 +348,10 @@ public final class IpSecConfig implements Parcelable {
|
||||
&& lhs.mNattKeepaliveInterval == rhs.mNattKeepaliveInterval
|
||||
&& lhs.mSpiResourceId == rhs.mSpiResourceId
|
||||
&& IpSecAlgorithm.equals(lhs.mEncryption, rhs.mEncryption)
|
||||
&& IpSecAlgorithm.equals(
|
||||
lhs.mAuthenticatedEncryption, rhs.mAuthenticatedEncryption)
|
||||
&& IpSecAlgorithm.equals(lhs.mAuthenticatedEncryption, rhs.mAuthenticatedEncryption)
|
||||
&& IpSecAlgorithm.equals(lhs.mAuthentication, rhs.mAuthentication)
|
||||
&& lhs.mMarkValue == rhs.mMarkValue
|
||||
&& lhs.mMarkMask == rhs.mMarkMask);
|
||||
&& lhs.mMarkMask == rhs.mMarkMask
|
||||
&& lhs.mXfrmInterfaceId == rhs.mXfrmInterfaceId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user