IpSecTransformState


public final class IpSecTransformState
extends Object implements Parcelable

java.lang.Object
   ↳ android.net.IpSecTransformState


This class represents a snapshot of the state of an IpSecTransform

This class provides the current state of an IpSecTransform, enabling link metric analysis by the caller. Use cases include understanding transform usage, such as packet and byte counts, as well as observing out-of-order delivery by checking the bitmap. Additionally, callers can query IpSecTransformStates at two timestamps. By comparing the changes in packet counts and sequence numbers, callers can estimate IPsec data loss in the inbound direction.

Summary

Nested classes

class IpSecTransformState.Builder

Builder class for testing purposes

Except for testing, IPsec callers normally do not instantiate IpSecTransformState themselves but instead get a reference via IpSecTransformState 

Inherited constants

Fields

public static final Creator<IpSecTransformState> CREATOR

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

long getByteCount()

Retrieve the number of bytes processed so far as an unsigned long

The byte count direction (inbound or outbound) aligns with the direction in which the IpSecTransform is applied to.

long getPacketCount()

Retrieve the number of packets processed so far as an unsigned long.

byte[] getReplayBitmap()

Retrieve the replay bitmap

This bitmap represents a replay window, allowing the caller to observe out-of-order delivery.

long getRxHighestSequenceNumber()

Retrieve the highest sequence number received so far as an unsigned long

long getTimestampMillis()

Retrieve the timestamp (milliseconds) when this state was created, as per SystemClock.elapsedRealtime()

long getTxHighestSequenceNumber()

Retrieve the highest sequence number sent so far as an unsigned long

void writeToParcel(Parcel out, int flags)

Flatten this object in to a Parcel.

Inherited methods

Fields

CREATOR

Added in API level 35
public static final Creator<IpSecTransformState> CREATOR

Public methods

describeContents

Added in API level 35
public int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel, int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or CONTENTS_FILE_DESCRIPTOR

getByteCount

Added in API level 35
public long getByteCount ()

Retrieve the number of bytes processed so far as an unsigned long

The byte count direction (inbound or outbound) aligns with the direction in which the IpSecTransform is applied to.

Returns
long

getPacketCount

Added in API level 35
public long getPacketCount ()

Retrieve the number of packets processed so far as an unsigned long.

The packet count direction (inbound or outbound) aligns with the direction in which the IpSecTransform is applied to.

Returns
long

getReplayBitmap

Added in API level 35
public byte[] getReplayBitmap ()

Retrieve the replay bitmap

This bitmap represents a replay window, allowing the caller to observe out-of-order delivery. The last bit represents the highest sequence number received so far and bits for the received packets will be marked as true.

The size of a replay bitmap will never change over the lifetime of an IpSecTransform

The replay bitmap is solely useful for inbound IpSecTransforms. For outbound IpSecTransforms, all bits will be unchecked.

Returns
byte[] This value cannot be null.

getRxHighestSequenceNumber

Added in API level 35
public long getRxHighestSequenceNumber ()

Retrieve the highest sequence number received so far as an unsigned long

Returns
long

getTimestampMillis

Added in API level 35
public long getTimestampMillis ()

Retrieve the timestamp (milliseconds) when this state was created, as per SystemClock.elapsedRealtime()

Returns
long

getTxHighestSequenceNumber

Added in API level 35
public long getTxHighestSequenceNumber ()

Retrieve the highest sequence number sent so far as an unsigned long

Returns
long

writeToParcel

Added in API level 35
public void writeToParcel (Parcel out, 
                int flags)

Flatten this object in to a Parcel.

Parameters
out Parcel: This value cannot be null.

flags int: Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES