summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorBenedict Wong <benedictwong@google.com>2018-03-01 18:53:07 -0800
committerBenedict Wong <benedictwong@google.com>2018-03-16 10:25:43 -0700
commitecc9f7cc08804e3fa15fea04ae94ea1bc74edbfe (patch)
tree01da858f7ac6c4ee216a617a8c2753bcc3aab6f0 /core/java
parent03664c94aecd84e159f4a23aa6250bdfd4aa9de2 (diff)
Added implementation for VTI add/remove address
This change adds implementation details for add/remove addresses onto a VTI. Bug: 73675031 Test: New tests added, passing on Walleye Change-Id: Idde9d943a5285d2c13c5c6b0f7b8a9faf718e6a5
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/net/IIpSecService.aidl5
-rw-r--r--core/java/android/net/IpSecManager.java16
2 files changed, 15 insertions, 6 deletions
diff --git a/core/java/android/net/IIpSecService.aidl b/core/java/android/net/IIpSecService.aidl
index 3ce0283d7f23..3a3ddcc48360 100644
--- a/core/java/android/net/IIpSecService.aidl
+++ b/core/java/android/net/IIpSecService.aidl
@@ -16,6 +16,7 @@
package android.net;
+import android.net.LinkAddress;
import android.net.Network;
import android.net.IpSecConfig;
import android.net.IpSecUdpEncapResponse;
@@ -48,11 +49,11 @@ interface IIpSecService
void addAddressToTunnelInterface(
int tunnelResourceId,
- String localAddr);
+ in LinkAddress localAddr);
void removeAddressFromTunnelInterface(
int tunnelResourceId,
- String localAddr);
+ in LinkAddress localAddr);
void deleteTunnelInterface(int resourceId);
diff --git a/core/java/android/net/IpSecManager.java b/core/java/android/net/IpSecManager.java
index b60984771a2d..f1beef1f21c4 100644
--- a/core/java/android/net/IpSecManager.java
+++ b/core/java/android/net/IpSecManager.java
@@ -660,10 +660,14 @@ public final class IpSecManager {
* tunneled traffic.
*
* @param address the local address for traffic inside the tunnel
- * @throws IOException if the address could not be added
* @hide
*/
- public void addAddress(LinkAddress address) throws IOException {
+ public void addAddress(LinkAddress address) {
+ try {
+ mService.addAddressToTunnelInterface(mResourceId, address);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
}
/**
@@ -672,10 +676,14 @@ public final class IpSecManager {
* <p>Remove an address which was previously added to the IpSecTunnelInterface
*
* @param address to be removed
- * @throws IOException if the address could not be removed
* @hide
*/
- public void removeAddress(LinkAddress address) throws IOException {
+ public void removeAddress(LinkAddress address) {
+ try {
+ mService.removeAddressFromTunnelInterface(mResourceId, address);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
}
private IpSecTunnelInterface(@NonNull IIpSecService service,