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 {
allocateSecurityParameterIndex( in String destinationAddress, int requestedSpi, in IBinder binder)35     IpSecSpiResponse allocateSecurityParameterIndex(
36             in String destinationAddress, int requestedSpi, in IBinder binder);
37 
releaseSecurityParameterIndex(int resourceId)38     void releaseSecurityParameterIndex(int resourceId);
39 
openUdpEncapsulationSocket(int port, in IBinder binder)40     IpSecUdpEncapResponse openUdpEncapsulationSocket(int port, in IBinder binder);
41 
closeUdpEncapsulationSocket(int resourceId)42     void closeUdpEncapsulationSocket(int resourceId);
43 
createTunnelInterface( in String localAddr, in String remoteAddr, in Network underlyingNetwork, in IBinder binder, in String callingPackage)44     IpSecTunnelInterfaceResponse createTunnelInterface(
45             in String localAddr,
46             in String remoteAddr,
47             in Network underlyingNetwork,
48             in IBinder binder,
49             in String callingPackage);
50 
addAddressToTunnelInterface( int tunnelResourceId, in LinkAddress localAddr, in String callingPackage)51     void addAddressToTunnelInterface(
52             int tunnelResourceId,
53             in LinkAddress localAddr,
54             in String callingPackage);
55 
removeAddressFromTunnelInterface( int tunnelResourceId, in LinkAddress localAddr, in String callingPackage)56     void removeAddressFromTunnelInterface(
57             int tunnelResourceId,
58             in LinkAddress localAddr,
59             in String callingPackage);
60 
deleteTunnelInterface(int resourceId, in String callingPackage)61     void deleteTunnelInterface(int resourceId, in String callingPackage);
62 
createTransform( in IpSecConfig c, in IBinder binder, in String callingPackage)63     IpSecTransformResponse createTransform(
64             in IpSecConfig c, in IBinder binder, in String callingPackage);
65 
deleteTransform(int transformId)66     void deleteTransform(int transformId);
67 
applyTransportModeTransform( in ParcelFileDescriptor socket, int direction, int transformId)68     void applyTransportModeTransform(
69             in ParcelFileDescriptor socket, int direction, int transformId);
70 
applyTunnelModeTransform( int tunnelResourceId, int direction, int transformResourceId, in String callingPackage)71     void applyTunnelModeTransform(
72             int tunnelResourceId, int direction, int transformResourceId, in String callingPackage);
73 
removeTransportModeTransforms(in ParcelFileDescriptor socket)74     void removeTransportModeTransforms(in ParcelFileDescriptor socket);
75 }
76