1 /* 2 ** Copyright 2017, The Android Open Source Project 3 ** 4 ** Licensed under the Apache License, Version 2.0 (the "License"); 5 ** you may not use this file except in compliance with the License. 6 ** You may obtain a copy of the License at 7 ** 8 ** http://www.apache.org/licenses/LICENSE-2.0 9 ** 10 ** Unless required by applicable law or agreed to in writing, software 11 ** distributed under the License is distributed on an "AS IS" BASIS, 12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 ** See the License for the specific language governing permissions and 14 ** limitations under the License. 15 */ 16 17 package android.net; 18 19 import android.net.LinkAddress; 20 import android.net.Network; 21 import android.net.IpSecConfig; 22 import android.net.IpSecUdpEncapResponse; 23 import android.net.IpSecSpiResponse; 24 import android.net.IpSecTransformResponse; 25 import android.net.IpSecTunnelInterfaceResponse; 26 import android.os.Bundle; 27 import android.os.IBinder; 28 import android.os.ParcelFileDescriptor; 29 30 /** 31 * @hide 32 */ 33 interface IIpSecService 34 { 35 IpSecSpiResponse allocateSecurityParameterIndex( 36 in String destinationAddress, int requestedSpi, in IBinder binder); 37 38 void releaseSecurityParameterIndex(int resourceId); 39 40 IpSecUdpEncapResponse openUdpEncapsulationSocket(int port, in IBinder binder); 41 42 void closeUdpEncapsulationSocket(int resourceId); 43 44 IpSecTunnelInterfaceResponse createTunnelInterface( 45 in String localAddr, 46 in String remoteAddr, 47 in Network underlyingNetwork, 48 in IBinder binder, 49 in String callingPackage); 50 51 void addAddressToTunnelInterface( 52 int tunnelResourceId, 53 in LinkAddress localAddr, 54 in String callingPackage); 55 56 void removeAddressFromTunnelInterface( 57 int tunnelResourceId, 58 in LinkAddress localAddr, 59 in String callingPackage); 60 61 void deleteTunnelInterface(int resourceId, in String callingPackage); 62 63 IpSecTransformResponse createTransform( 64 in IpSecConfig c, in IBinder binder, in String callingPackage); 65 66 void deleteTransform(int transformId); 67 68 void applyTransportModeTransform( 69 in ParcelFileDescriptor socket, int direction, int transformId); 70 71 void applyTunnelModeTransform( 72 int tunnelResourceId, int direction, int transformResourceId, in String callingPackage); 73 74 void removeTransportModeTransforms(in ParcelFileDescriptor socket); 75 } 76