San Mehat | 4d02d00 | 2010-01-22 16:07:46 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2009 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 android.net; |
| 18 | |
Lorenzo Colitti | 5ad421a | 2013-11-17 15:05:02 +0900 | [diff] [blame] | 19 | import android.net.LinkAddress; |
Lorenzo Colitti | c18cbfd | 2014-06-13 21:21:03 +0900 | [diff] [blame] | 20 | import android.net.RouteInfo; |
Lorenzo Colitti | 5ad421a | 2013-11-17 15:05:02 +0900 | [diff] [blame] | 21 | |
San Mehat | 4d02d00 | 2010-01-22 16:07:46 -0800 | [diff] [blame] | 22 | /** |
| 23 | * Callback class for receiving events from an INetworkManagementService |
| 24 | * |
| 25 | * @hide |
| 26 | */ |
| 27 | interface INetworkManagementEventObserver { |
| 28 | /** |
Mike J. Chen | 6143f5f | 2011-06-23 15:17:51 -0700 | [diff] [blame] | 29 | * Interface configuration status has changed. |
San Mehat | 4d02d00 | 2010-01-22 16:07:46 -0800 | [diff] [blame] | 30 | * |
| 31 | * @param iface The interface. |
Mike J. Chen | 6143f5f | 2011-06-23 15:17:51 -0700 | [diff] [blame] | 32 | * @param up True if the interface has been enabled. |
San Mehat | 4d02d00 | 2010-01-22 16:07:46 -0800 | [diff] [blame] | 33 | */ |
Mike J. Chen | 6143f5f | 2011-06-23 15:17:51 -0700 | [diff] [blame] | 34 | void interfaceStatusChanged(String iface, boolean up); |
| 35 | |
| 36 | /** |
Mike J. Chen | f59c7d0 | 2011-06-23 15:33:15 -0700 | [diff] [blame] | 37 | * Interface physical-layer link state has changed. For Ethernet, |
Mike J. Chen | 6143f5f | 2011-06-23 15:17:51 -0700 | [diff] [blame] | 38 | * this method is invoked when the cable is plugged in or unplugged. |
| 39 | * |
| 40 | * @param iface The interface. |
| 41 | * @param up True if the physical link-layer connection signal is valid. |
| 42 | */ |
Mike J. Chen | f59c7d0 | 2011-06-23 15:33:15 -0700 | [diff] [blame] | 43 | void interfaceLinkStateChanged(String iface, boolean up); |
San Mehat | 4d02d00 | 2010-01-22 16:07:46 -0800 | [diff] [blame] | 44 | |
| 45 | /** |
| 46 | * An interface has been added to the system |
| 47 | * |
| 48 | * @param iface The interface. |
| 49 | */ |
| 50 | void interfaceAdded(String iface); |
| 51 | |
| 52 | /** |
| 53 | * An interface has been removed from the system |
| 54 | * |
| 55 | * @param iface The interface. |
| 56 | */ |
| 57 | void interfaceRemoved(String iface); |
JP Abgrall | 12b933d | 2011-07-14 18:09:22 -0700 | [diff] [blame] | 58 | |
Lorenzo Colitti | 5c7daac | 2013-08-05 10:39:37 +0900 | [diff] [blame] | 59 | |
| 60 | /** |
Lorenzo Colitti | 6448394 | 2013-11-15 18:43:52 +0900 | [diff] [blame] | 61 | * An interface address has been added or updated. |
Lorenzo Colitti | 5c7daac | 2013-08-05 10:39:37 +0900 | [diff] [blame] | 62 | * |
Lorenzo Colitti | 5c7daac | 2013-08-05 10:39:37 +0900 | [diff] [blame] | 63 | * @param iface The interface. |
Lorenzo Colitti | 6448394 | 2013-11-15 18:43:52 +0900 | [diff] [blame] | 64 | * @param address The address. |
Lorenzo Colitti | 5c7daac | 2013-08-05 10:39:37 +0900 | [diff] [blame] | 65 | */ |
Lorenzo Colitti | 6448394 | 2013-11-15 18:43:52 +0900 | [diff] [blame] | 66 | void addressUpdated(String iface, in LinkAddress address); |
Lorenzo Colitti | 5c7daac | 2013-08-05 10:39:37 +0900 | [diff] [blame] | 67 | |
| 68 | /** |
Lorenzo Colitti | 6448394 | 2013-11-15 18:43:52 +0900 | [diff] [blame] | 69 | * An interface address has been removed. |
Lorenzo Colitti | 5c7daac | 2013-08-05 10:39:37 +0900 | [diff] [blame] | 70 | * |
Lorenzo Colitti | 5c7daac | 2013-08-05 10:39:37 +0900 | [diff] [blame] | 71 | * @param iface The interface. |
Lorenzo Colitti | 6448394 | 2013-11-15 18:43:52 +0900 | [diff] [blame] | 72 | * @param address The address. |
Lorenzo Colitti | 5c7daac | 2013-08-05 10:39:37 +0900 | [diff] [blame] | 73 | */ |
Lorenzo Colitti | 6448394 | 2013-11-15 18:43:52 +0900 | [diff] [blame] | 74 | void addressRemoved(String iface, in LinkAddress address); |
Lorenzo Colitti | 5c7daac | 2013-08-05 10:39:37 +0900 | [diff] [blame] | 75 | |
JP Abgrall | 12b933d | 2011-07-14 18:09:22 -0700 | [diff] [blame] | 76 | /** |
| 77 | * A networking quota limit has been reached. The quota might not |
| 78 | * be specific to an interface. |
| 79 | * |
| 80 | * @param limitName The name of the limit that triggered. |
| 81 | * @param iface The interface on which the limit was detected. |
| 82 | */ |
| 83 | void limitReached(String limitName, String iface); |
| 84 | |
Haoyu Bai | db3c867 | 2012-06-20 14:29:57 -0700 | [diff] [blame] | 85 | /** |
| 86 | * Interface data activity status is changed. |
| 87 | * |
| 88 | * @param iface The interface. |
| 89 | * @param active True if the interface is actively transmitting data, false if it is idle. |
Ashish Sharma | 0535a9f | 2014-03-12 18:42:23 -0700 | [diff] [blame] | 90 | * @param tsNanos Elapsed realtime in nanos when the state of the network interface changed. |
Haoyu Bai | db3c867 | 2012-06-20 14:29:57 -0700 | [diff] [blame] | 91 | */ |
Ashish Sharma | 0535a9f | 2014-03-12 18:42:23 -0700 | [diff] [blame] | 92 | void interfaceClassDataActivityChanged(String label, boolean active, long tsNanos); |
Lorenzo Colitti | 5ae4a53 | 2013-10-31 11:59:46 +0900 | [diff] [blame] | 93 | |
| 94 | /** |
| 95 | * Information about available DNS servers has been received. |
| 96 | * |
| 97 | * @param iface The interface on which the information was received. |
| 98 | * @param lifetime The time in seconds for which the DNS servers may be used. |
| 99 | * @param servers The IP addresses of the DNS servers. |
| 100 | */ |
| 101 | void interfaceDnsServerInfo(String iface, long lifetime, in String[] servers); |
Lorenzo Colitti | c18cbfd | 2014-06-13 21:21:03 +0900 | [diff] [blame] | 102 | |
| 103 | /** |
| 104 | * A route has been added or updated. |
| 105 | */ |
| 106 | void routeUpdated(in RouteInfo route); |
| 107 | |
| 108 | /** |
| 109 | * A route has been removed. |
| 110 | */ |
| 111 | void routeRemoved(in RouteInfo route); |
San Mehat | 4d02d00 | 2010-01-22 16:07:46 -0800 | [diff] [blame] | 112 | } |