1 /*
2  * Copyright (C) 2020 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 com.android.internal.net.ipsec.ike.net;
18 
19 import android.net.LinkProperties;
20 import android.net.Network;
21 import android.net.NetworkCapabilities;
22 
23 /** IkeNetworkUpdater is an interface for updating the underlying Network for an IKE Session. */
24 public interface IkeNetworkUpdater {
25     /**
26      * Notify the IkeNetworkUpdater to use the specified Network as its underlying Network.
27      *
28      * <p>This may also be invoked if the LinkProperties for the specified Network drop the previous
29      * local address for the IKE Session.
30      *
31      * <p>Handling onUnderlyingNetworkUpdated will require mobility ability.
32      *
33      * @param network The Network to be used for the underlying Network
34      * @param linkProperties The LinkProperties of this Network
35      * @param networkCapabilities The NetworkCapabilities of this Network
36      */
onUnderlyingNetworkUpdated( Network network, LinkProperties linkProperties, NetworkCapabilities networkCapabilities)37     void onUnderlyingNetworkUpdated(
38             Network network,
39             LinkProperties linkProperties,
40             NetworkCapabilities networkCapabilities);
41 
42     /**
43      * Notify the IkeNetworkUpdater of the NetworkCapabilities change of the underlying network
44      *
45      * <p>Handling onCapabilitiesUpdated does not require mobility ability.
46      *
47      * @param networkCapabilities The updated NetworkCapabilities
48      */
onCapabilitiesUpdated(NetworkCapabilities networkCapabilities)49     void onCapabilitiesUpdated(NetworkCapabilities networkCapabilities);
50 
51     /** Notify the IkeNetworkUpdater that the underlying Network died. */
onUnderlyingNetworkDied()52     void onUnderlyingNetworkDied();
53 }
54