1 /**
2  * Copyright (c) 2019, 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 package android.net.ip;
17 
18 import android.net.Layer2PacketParcelable;
19 import android.net.LinkProperties;
20 import android.net.ip.IIpClient;
21 import android.net.DhcpResultsParcelable;
22 
23 /** @hide */
24 oneway interface IIpClientCallbacks {
onIpClientCreated(in IIpClient ipClient)25     void onIpClientCreated(in IIpClient ipClient);
26 
onPreDhcpAction()27     void onPreDhcpAction();
onPostDhcpAction()28     void onPostDhcpAction();
29 
30     // This is purely advisory and not an indication of provisioning
31     // success or failure.  This is only here for callers that want to
32     // expose DHCPv4 results to other APIs (e.g., WifiInfo#setInetAddress).
33     // DHCPv4 or static IPv4 configuration failure or success can be
34     // determined by whether or not the passed-in DhcpResults object is
35     // null or not.
onNewDhcpResults(in DhcpResultsParcelable dhcpResults)36     void onNewDhcpResults(in DhcpResultsParcelable dhcpResults);
37 
onProvisioningSuccess(in LinkProperties newLp)38     void onProvisioningSuccess(in LinkProperties newLp);
onProvisioningFailure(in LinkProperties newLp)39     void onProvisioningFailure(in LinkProperties newLp);
40 
41     // Invoked on LinkProperties changes.
onLinkPropertiesChange(in LinkProperties newLp)42     void onLinkPropertiesChange(in LinkProperties newLp);
43 
44     // Called when the internal IpReachabilityMonitor (if enabled) has
45     // detected the loss of a critical number of required neighbors.
onReachabilityLost(in String logMsg)46     void onReachabilityLost(in String logMsg);
47 
48     // Called when the IpClient state machine terminates.
onQuit()49     void onQuit();
50 
51     // Install an APF program to filter incoming packets.
installPacketFilter(in byte[] filter)52     void installPacketFilter(in byte[] filter);
53 
54     // Asynchronously read back the APF program & data buffer from the wifi driver.
55     // Due to Wifi HAL limitations, the current implementation only supports dumping the entire
56     // buffer. In response to this request, the driver returns the data buffer asynchronously
57     // by sending an IpClient#EVENT_READ_PACKET_FILTER_COMPLETE message.
startReadPacketFilter()58     void startReadPacketFilter();
59 
60     // If multicast filtering cannot be accomplished with APF, this function will be called to
61     // actuate multicast filtering using another means.
setFallbackMulticastFilter(boolean enabled)62     void setFallbackMulticastFilter(boolean enabled);
63 
64     // Enabled/disable Neighbor Discover offload functionality. This is
65     // called, for example, whenever 464xlat is being started or stopped.
setNeighborDiscoveryOffload(boolean enable)66     void setNeighborDiscoveryOffload(boolean enable);
67 
68     // Invoked on starting preconnection process.
onPreconnectionStart(in List<Layer2PacketParcelable> packets)69     void onPreconnectionStart(in List<Layer2PacketParcelable> packets);
70 }
71