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 perNmissions and
14  * limitations under the License.
15  */
16 
17 package android.net.dhcp;
18 
19 import android.net.IpPrefix;
20 import android.net.dhcp.DhcpLeaseParcelable;
21 
22 oneway interface IDhcpEventCallbacks {
23     /**
24      * Called when a lease is committed or released on the DHCP server.
25      *
26      * <p>This only reports lease changes after assigning a lease, or after releasing a lease
27      * following a DHCPRELEASE: this callback will not be fired when a lease just expires.
28      * @param newLeases The new list of leases tracked by the server.
29      */
onLeasesChanged(in List<DhcpLeaseParcelable> newLeases)30     void onLeasesChanged(in List<DhcpLeaseParcelable> newLeases);
31 
32     /**
33      * Called when DHCP server receives DHCPDECLINE message and only if a new IPv4 address prefix
34      * (e.g. a different subnet prefix) is requested.
35      *
36      * <p>When this callback is called, IpServer must call IDhcpServer#updateParams with a new
37      * prefix, as processing of DHCP packets should be paused until the new prefix and route
38      * configuration on IpServer is completed.
39      * @param currentPrefix The current prefix parameter serving on DHCP server.
40      */
onNewPrefixRequest(in IpPrefix currentPrefix)41     void onNewPrefixRequest(in IpPrefix currentPrefix);
42 }
43