From f8783184b025b0ac2353b0f384cee1b3340f2f18 Mon Sep 17 00:00:00 2001 From: Xiao Ma Date: Mon, 6 Apr 2020 11:24:48 +0000 Subject: 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 --- .../src/android/net/dhcp/IDhcpEventCallbacks.aidl | 42 ++++++++++++++++++++++ .../src/android/net/dhcp/IDhcpLeaseCallbacks.aidl | 30 ---------------- .../src/android/net/dhcp/IDhcpServer.aidl | 4 +-- 3 files changed, 44 insertions(+), 32 deletions(-) create mode 100644 common/networkstackclient/src/android/net/dhcp/IDhcpEventCallbacks.aidl delete mode 100644 common/networkstackclient/src/android/net/dhcp/IDhcpLeaseCallbacks.aidl (limited to 'common/networkstackclient/src') diff --git a/common/networkstackclient/src/android/net/dhcp/IDhcpEventCallbacks.aidl b/common/networkstackclient/src/android/net/dhcp/IDhcpEventCallbacks.aidl new file mode 100644 index 0000000..155c528 --- /dev/null +++ b/common/networkstackclient/src/android/net/dhcp/IDhcpEventCallbacks.aidl @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2020, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing perNmissions and + * limitations under the License. + */ + +package android.net.dhcp; + +import android.net.IpPrefix; +import android.net.dhcp.DhcpLeaseParcelable; + +oneway interface IDhcpEventCallbacks { + /** + * Called when a lease is committed or released on the DHCP server. + * + *

This only reports lease changes after assigning a lease, or after releasing a lease + * following a DHCPRELEASE: this callback will not be fired when a lease just expires. + * @param newLeases The new list of leases tracked by the server. + */ + void onLeasesChanged(in List newLeases); + + /** + * Called when DHCP server receives DHCPDECLINE message and only if a new IPv4 address prefix + * (e.g. a different subnet prefix) is requested. + * + *

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/IDhcpLeaseCallbacks.aidl b/common/networkstackclient/src/android/net/dhcp/IDhcpLeaseCallbacks.aidl deleted file mode 100644 index cf2dfa8..0000000 --- a/common/networkstackclient/src/android/net/dhcp/IDhcpLeaseCallbacks.aidl +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (c) 2020, The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing perNmissions and - * limitations under the License. - */ - -package android.net.dhcp; - -import android.net.dhcp.DhcpLeaseParcelable; - -oneway interface IDhcpLeaseCallbacks { - /** - * Called when a lease is committed or released on the DHCP server. - * - *

This only reports lease changes after assigning a lease, or after releasing a lease - * following a DHCPRELEASE: this callback will not be fired when a lease just expires. - * @param newLeases The new list of leases tracked by the server. - */ - void onLeasesChanged(in List newLeases); -} \ No newline at end of file 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; -- cgit v1.2.3