diff options
author | Xiao Ma <xiaom@google.com> | 2020-04-06 11:24:48 +0000 |
---|---|---|
committer | Xiao Ma <xiaom@google.com> | 2020-04-07 01:27:59 +0000 |
commit | f8783184b025b0ac2353b0f384cee1b3340f2f18 (patch) | |
tree | c287e023392d5ef7615dff3a33b4a9eebfdc2f2d /common/networkstackclient/src/android/net | |
parent | 520e8de52699c1264732c4b6c23aa89a7da669d5 (diff) |
Rename IDhcpLeaseCallbacks to IDhcpEventCallbacks for more generic.
This change renames IDhcpLeaseCallbacks, easier to expand in the
future and adds a new method onNewPrefixRequest which will be called
on DHCP server receives DHCPDECLINE message and request a new IPv4
prefix from IpServer.
Bug: 130741856
Test: atest NetworkStackTests NetworkStackNextTests
Merged-In: Ia7b08bb1e7feda08ffe9fbb8885dbc8b7bdd66c9
Change-Id: Ia7b08bb1e7feda08ffe9fbb8885dbc8b7bdd66c9
Diffstat (limited to 'common/networkstackclient/src/android/net')
-rw-r--r-- | common/networkstackclient/src/android/net/dhcp/IDhcpEventCallbacks.aidl (renamed from common/networkstackclient/src/android/net/dhcp/IDhcpLeaseCallbacks.aidl) | 16 | ||||
-rw-r--r-- | common/networkstackclient/src/android/net/dhcp/IDhcpServer.aidl | 4 |
2 files changed, 16 insertions, 4 deletions
diff --git a/common/networkstackclient/src/android/net/dhcp/IDhcpLeaseCallbacks.aidl b/common/networkstackclient/src/android/net/dhcp/IDhcpEventCallbacks.aidl index cf2dfa8..155c528 100644 --- a/common/networkstackclient/src/android/net/dhcp/IDhcpLeaseCallbacks.aidl +++ b/common/networkstackclient/src/android/net/dhcp/IDhcpEventCallbacks.aidl @@ -16,9 +16,10 @@ package android.net.dhcp; +import android.net.IpPrefix; import android.net.dhcp.DhcpLeaseParcelable; -oneway interface IDhcpLeaseCallbacks { +oneway interface IDhcpEventCallbacks { /** * Called when a lease is committed or released on the DHCP server. * @@ -27,4 +28,15 @@ oneway interface IDhcpLeaseCallbacks { * @param newLeases The new list of leases tracked by the server. */ void onLeasesChanged(in List<DhcpLeaseParcelable> newLeases); -}
\ No newline at end of file + + /** + * Called when DHCP server receives DHCPDECLINE message and only if a new IPv4 address prefix + * (e.g. a different subnet prefix) is requested. + * + * <p>When this callback is called, IpServer must call IDhcpServer#updateParams with a new + * prefix, as processing of DHCP packets should be paused until the new prefix and route + * configuration on IpServer is completed. + * @param currentPrefix The current prefix parameter serving on DHCP server. + */ + void onNewPrefixRequest(in IpPrefix currentPrefix); +} diff --git a/common/networkstackclient/src/android/net/dhcp/IDhcpServer.aidl b/common/networkstackclient/src/android/net/dhcp/IDhcpServer.aidl index dd93174..973ffb0 100644 --- a/common/networkstackclient/src/android/net/dhcp/IDhcpServer.aidl +++ b/common/networkstackclient/src/android/net/dhcp/IDhcpServer.aidl @@ -18,7 +18,7 @@ package android.net.dhcp; import android.net.INetworkStackStatusCallback; import android.net.dhcp.DhcpServingParamsParcel; -import android.net.dhcp.IDhcpLeaseCallbacks; +import android.net.dhcp.IDhcpEventCallbacks; /** @hide */ oneway interface IDhcpServer { @@ -29,7 +29,7 @@ oneway interface IDhcpServer { void start(in INetworkStackStatusCallback cb) = 0; void startWithCallbacks(in INetworkStackStatusCallback statusCb, - in IDhcpLeaseCallbacks leaseCb) = 3; + in IDhcpEventCallbacks eventCb) = 3; void updateParams(in DhcpServingParamsParcel params, in INetworkStackStatusCallback cb) = 1; void stop(in INetworkStackStatusCallback cb) = 2; |