Merge changes Ib80f814f,Ic605e489

* changes:
  Use new API - getIpSecNetIdRange() in IpSecService
  Add a new API to get the network ID range of IPSec tunnel interface
This commit is contained in:
Lucas Lin
2021-03-12 03:30:32 +00:00
committed by Gerrit Code Review
2 changed files with 18 additions and 0 deletions

View File

@@ -5053,4 +5053,21 @@ public class ConnectivityManager {
throw e.rethrowFromSystemServer();
}
}
// The first network ID of IPSec tunnel interface.
private static final int TUN_INTF_NETID_START = 0xFC00;
// The network ID range of IPSec tunnel interface.
private static final int TUN_INTF_NETID_RANGE = 0x0400;
/**
* Get the network ID range reserved for IPSec tunnel interfaces.
*
* @return A Range which indicates the network ID range of IPSec tunnel interface.
* @hide
*/
@SystemApi(client = MODULE_LIBRARIES)
@NonNull
public static Range<Integer> getIpSecNetIdRange() {
return new Range(TUN_INTF_NETID_START, TUN_INTF_NETID_START + TUN_INTF_NETID_RANGE - 1);
}
}