San Mehat | 873f214 | 2010-01-14 10:25:07 -0800 | [diff] [blame] | 1 | /* //device/java/android/android/os/INetworkManagementService.aidl |
| 2 | ** |
| 3 | ** Copyright 2007, The Android Open Source Project |
| 4 | ** |
| 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | ** you may not use this file except in compliance with the License. |
| 7 | ** You may obtain a copy of the License at |
| 8 | ** |
| 9 | ** http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | ** |
| 11 | ** Unless required by applicable law or agreed to in writing, software |
| 12 | ** distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | ** See the License for the specific language governing permissions and |
| 15 | ** limitations under the License. |
| 16 | */ |
| 17 | |
| 18 | package android.os; |
| 19 | |
San Mehat | ed4fc8a | 2010-01-22 12:28:36 -0800 | [diff] [blame] | 20 | import android.net.InterfaceConfiguration; |
San Mehat | 4d02d00 | 2010-01-22 16:07:46 -0800 | [diff] [blame] | 21 | import android.net.INetworkManagementEventObserver; |
Lorenzo Colitti | b57edc5 | 2014-08-22 17:10:50 -0700 | [diff] [blame] | 22 | import android.net.Network; |
Jeff Sharkey | 9a13f36 | 2011-04-26 16:25:36 -0700 | [diff] [blame] | 23 | import android.net.NetworkStats; |
Robert Greenwalt | 59b1a4e | 2011-05-10 15:05:02 -0700 | [diff] [blame] | 24 | import android.net.RouteInfo; |
Paul Jensen | 6bc2c2c | 2014-05-07 15:27:40 -0400 | [diff] [blame] | 25 | import android.net.UidRange; |
Irfan Sheriff | 9ab518ad | 2010-03-12 15:48:17 -0800 | [diff] [blame] | 26 | import android.net.wifi.WifiConfiguration; |
Dianne Hackborn | 77b987f | 2014-02-26 16:20:52 -0800 | [diff] [blame] | 27 | import android.os.INetworkActivityListener; |
San Mehat | ed4fc8a | 2010-01-22 12:28:36 -0800 | [diff] [blame] | 28 | |
San Mehat | 873f214 | 2010-01-14 10:25:07 -0800 | [diff] [blame] | 29 | /** |
| 30 | * @hide |
| 31 | */ |
| 32 | interface INetworkManagementService |
| 33 | { |
| 34 | /** |
| 35 | ** GENERAL |
| 36 | **/ |
| 37 | |
| 38 | /** |
San Mehat | 4d02d00 | 2010-01-22 16:07:46 -0800 | [diff] [blame] | 39 | * Register an observer to receive events |
| 40 | */ |
| 41 | void registerObserver(INetworkManagementEventObserver obs); |
| 42 | |
| 43 | /** |
| 44 | * Unregister an observer from receiving events. |
| 45 | */ |
| 46 | void unregisterObserver(INetworkManagementEventObserver obs); |
| 47 | |
| 48 | /** |
San Mehat | 873f214 | 2010-01-14 10:25:07 -0800 | [diff] [blame] | 49 | * Returns a list of currently known network interfaces |
| 50 | */ |
| 51 | String[] listInterfaces(); |
| 52 | |
| 53 | /** |
San Mehat | ed4fc8a | 2010-01-22 12:28:36 -0800 | [diff] [blame] | 54 | * Retrieves the specified interface config |
| 55 | * |
| 56 | */ |
| 57 | InterfaceConfiguration getInterfaceConfig(String iface); |
| 58 | |
| 59 | /** |
| 60 | * Sets the configuration of the specified interface |
| 61 | */ |
| 62 | void setInterfaceConfig(String iface, in InterfaceConfiguration cfg); |
| 63 | |
| 64 | /** |
Irfan Sheriff | f560061 | 2011-06-16 10:26:28 -0700 | [diff] [blame] | 65 | * Clear all IP addresses on the specified interface |
| 66 | */ |
| 67 | void clearInterfaceAddresses(String iface); |
| 68 | |
| 69 | /** |
Irfan Sheriff | 7244c97 | 2011-08-05 20:40:45 -0700 | [diff] [blame] | 70 | * Set interface down |
| 71 | */ |
| 72 | void setInterfaceDown(String iface); |
| 73 | |
| 74 | /** |
| 75 | * Set interface up |
| 76 | */ |
| 77 | void setInterfaceUp(String iface); |
| 78 | |
| 79 | /** |
Irfan Sheriff | 7329361 | 2011-09-14 12:31:56 -0700 | [diff] [blame] | 80 | * Set interface IPv6 privacy extensions |
| 81 | */ |
| 82 | void setInterfaceIpv6PrivacyExtensions(String iface, boolean enable); |
| 83 | |
| 84 | /** |
repo sync | 7960d9f | 2011-09-29 12:40:02 -0700 | [diff] [blame] | 85 | * Disable IPv6 on an interface |
| 86 | */ |
| 87 | void disableIpv6(String iface); |
| 88 | |
| 89 | /** |
| 90 | * Enable IPv6 on an interface |
| 91 | */ |
| 92 | void enableIpv6(String iface); |
| 93 | |
| 94 | /** |
Lorenzo Colitti | e21a26b | 2014-10-28 15:24:03 +0900 | [diff] [blame] | 95 | * Enables or enables IPv6 ND offload. |
| 96 | */ |
| 97 | void setInterfaceIpv6NdOffload(String iface, boolean enable); |
| 98 | |
| 99 | /** |
Robert Greenwalt | 59b1a4e | 2011-05-10 15:05:02 -0700 | [diff] [blame] | 100 | * Retrieves the network routes currently configured on the specified |
| 101 | * interface |
| 102 | */ |
| 103 | RouteInfo[] getRoutes(String iface); |
| 104 | |
| 105 | /** |
| 106 | * Add the specified route to the interface. |
| 107 | */ |
Sreeram Ramachandran | b2829fa | 2014-04-15 19:07:12 -0700 | [diff] [blame] | 108 | void addRoute(int netId, in RouteInfo route); |
Robert Greenwalt | 59b1a4e | 2011-05-10 15:05:02 -0700 | [diff] [blame] | 109 | |
| 110 | /** |
| 111 | * Remove the specified route from the interface. |
| 112 | */ |
Sreeram Ramachandran | b2829fa | 2014-04-15 19:07:12 -0700 | [diff] [blame] | 113 | void removeRoute(int netId, in RouteInfo route); |
Robert Greenwalt | 3b28e9a | 2011-11-02 14:37:19 -0700 | [diff] [blame] | 114 | |
| 115 | /** |
sy.yun | 9d9b74a | 2013-09-02 05:24:09 +0900 | [diff] [blame] | 116 | * Set the specified MTU size |
| 117 | */ |
| 118 | void setMtu(String iface, int mtu); |
| 119 | |
| 120 | /** |
San Mehat | 873f214 | 2010-01-14 10:25:07 -0800 | [diff] [blame] | 121 | * Shuts down the service |
| 122 | */ |
| 123 | void shutdown(); |
| 124 | |
| 125 | /** |
| 126 | ** TETHERING RELATED |
| 127 | **/ |
| 128 | |
San Mehat | 873f214 | 2010-01-14 10:25:07 -0800 | [diff] [blame] | 129 | /** |
| 130 | * Returns true if IP forwarding is enabled |
| 131 | */ |
| 132 | boolean getIpForwardingEnabled(); |
| 133 | |
| 134 | /** |
| 135 | * Enables/Disables IP Forwarding |
| 136 | */ |
| 137 | void setIpForwardingEnabled(boolean enabled); |
| 138 | |
| 139 | /** |
| 140 | * Start tethering services with the specified dhcp server range |
Robert Greenwalt | bfb7bfa | 2010-03-24 16:03:21 -0700 | [diff] [blame] | 141 | * arg is a set of start end pairs defining the ranges. |
San Mehat | 873f214 | 2010-01-14 10:25:07 -0800 | [diff] [blame] | 142 | */ |
Robert Greenwalt | bfb7bfa | 2010-03-24 16:03:21 -0700 | [diff] [blame] | 143 | void startTethering(in String[] dhcpRanges); |
San Mehat | 873f214 | 2010-01-14 10:25:07 -0800 | [diff] [blame] | 144 | |
| 145 | /** |
| 146 | * Stop currently running tethering services |
| 147 | */ |
| 148 | void stopTethering(); |
| 149 | |
| 150 | /** |
| 151 | * Returns true if tethering services are started |
| 152 | */ |
| 153 | boolean isTetheringStarted(); |
| 154 | |
| 155 | /** |
| 156 | * Tethers the specified interface |
| 157 | */ |
| 158 | void tetherInterface(String iface); |
| 159 | |
| 160 | /** |
| 161 | * Untethers the specified interface |
| 162 | */ |
| 163 | void untetherInterface(String iface); |
| 164 | |
| 165 | /** |
| 166 | * Returns a list of currently tethered interfaces |
| 167 | */ |
| 168 | String[] listTetheredInterfaces(); |
| 169 | |
| 170 | /** |
| 171 | * Sets the list of DNS forwarders (in order of priority) |
| 172 | */ |
Lorenzo Colitti | b57edc5 | 2014-08-22 17:10:50 -0700 | [diff] [blame] | 173 | void setDnsForwarders(in Network network, in String[] dns); |
San Mehat | 873f214 | 2010-01-14 10:25:07 -0800 | [diff] [blame] | 174 | |
| 175 | /** |
Lorenzo Colitti | b57edc5 | 2014-08-22 17:10:50 -0700 | [diff] [blame] | 176 | * Returns the list of DNS forwarders (in order of priority) |
San Mehat | 873f214 | 2010-01-14 10:25:07 -0800 | [diff] [blame] | 177 | */ |
| 178 | String[] getDnsForwarders(); |
| 179 | |
| 180 | /** |
Lorenzo Colitti | 35e36db | 2015-02-26 01:25:36 +0900 | [diff] [blame] | 181 | * Enables unidirectional packet forwarding from {@code fromIface} to |
| 182 | * {@code toIface}. |
| 183 | */ |
| 184 | void startInterfaceForwarding(String fromIface, String toIface); |
| 185 | |
| 186 | /** |
| 187 | * Disables unidirectional packet forwarding from {@code fromIface} to |
| 188 | * {@code toIface}. |
| 189 | */ |
| 190 | void stopInterfaceForwarding(String fromIface, String toIface); |
| 191 | |
| 192 | /** |
San Mehat | 873f214 | 2010-01-14 10:25:07 -0800 | [diff] [blame] | 193 | * Enables Network Address Translation between two interfaces. |
| 194 | * The address and netmask of the external interface is used for |
| 195 | * the NAT'ed network. |
| 196 | */ |
| 197 | void enableNat(String internalInterface, String externalInterface); |
| 198 | |
| 199 | /** |
| 200 | * Disables Network Address Translation between two interfaces. |
| 201 | */ |
| 202 | void disableNat(String internalInterface, String externalInterface); |
San Mehat | 72759df | 2010-01-19 13:50:37 -0800 | [diff] [blame] | 203 | |
| 204 | /** |
| 205 | ** PPPD |
| 206 | **/ |
| 207 | |
| 208 | /** |
| 209 | * Returns the list of currently known TTY devices on the system |
| 210 | */ |
| 211 | String[] listTtys(); |
| 212 | |
| 213 | /** |
| 214 | * Attaches a PPP server daemon to the specified TTY with the specified |
| 215 | * local/remote addresses. |
| 216 | */ |
Robert Greenwalt | d0e18ff | 2010-01-26 11:40:34 -0800 | [diff] [blame] | 217 | void attachPppd(String tty, String localAddr, String remoteAddr, String dns1Addr, |
| 218 | String dns2Addr); |
San Mehat | 72759df | 2010-01-19 13:50:37 -0800 | [diff] [blame] | 219 | |
| 220 | /** |
| 221 | * Detaches a PPP server daemon from the specified TTY. |
| 222 | */ |
| 223 | void detachPppd(String tty); |
| 224 | |
Robert Greenwalt | ce1200d | 2010-02-18 11:25:54 -0800 | [diff] [blame] | 225 | /** |
Irfan Sheriff | cb30b22 | 2011-07-29 20:54:52 -0700 | [diff] [blame] | 226 | * Load firmware for operation in the given mode. Currently the three |
| 227 | * modes supported are "AP", "STA" and "P2P". |
| 228 | */ |
| 229 | void wifiFirmwareReload(String wlanIface, String mode); |
| 230 | |
| 231 | /** |
Irfan Sheriff | 5321aef | 2010-02-12 12:35:59 -0800 | [diff] [blame] | 232 | * Start Wifi Access Point |
| 233 | */ |
Irfan Sheriff | 9054275 | 2012-06-19 15:44:35 -0700 | [diff] [blame] | 234 | void startAccessPoint(in WifiConfiguration wifiConfig, String iface); |
Irfan Sheriff | 5321aef | 2010-02-12 12:35:59 -0800 | [diff] [blame] | 235 | |
| 236 | /** |
| 237 | * Stop Wifi Access Point |
| 238 | */ |
Irfan Sheriff | 9054275 | 2012-06-19 15:44:35 -0700 | [diff] [blame] | 239 | void stopAccessPoint(String iface); |
Irfan Sheriff | 5321aef | 2010-02-12 12:35:59 -0800 | [diff] [blame] | 240 | |
Irfan Sheriff | c2f54c2 | 2010-03-18 14:02:22 -0700 | [diff] [blame] | 241 | /** |
| 242 | * Set Access Point config |
| 243 | */ |
Irfan Sheriff | 9054275 | 2012-06-19 15:44:35 -0700 | [diff] [blame] | 244 | void setAccessPoint(in WifiConfiguration wifiConfig, String iface); |
San Mehat | 91cac64 | 2010-03-31 14:31:36 -0700 | [diff] [blame] | 245 | |
| 246 | /** |
Jeff Sharkey | 9a13f36 | 2011-04-26 16:25:36 -0700 | [diff] [blame] | 247 | ** DATA USAGE RELATED |
| 248 | **/ |
San Mehat | 91cac64 | 2010-03-31 14:31:36 -0700 | [diff] [blame] | 249 | |
| 250 | /** |
Jeff Sharkey | 9a13f36 | 2011-04-26 16:25:36 -0700 | [diff] [blame] | 251 | * Return global network statistics summarized at an interface level, |
| 252 | * without any UID-level granularity. |
San Mehat | 91cac64 | 2010-03-31 14:31:36 -0700 | [diff] [blame] | 253 | */ |
Jeff Sharkey | e8914c3 | 2012-05-01 16:26:09 -0700 | [diff] [blame] | 254 | NetworkStats getNetworkStatsSummaryDev(); |
| 255 | NetworkStats getNetworkStatsSummaryXt(); |
San Mehat | 91cac64 | 2010-03-31 14:31:36 -0700 | [diff] [blame] | 256 | |
| 257 | /** |
Jeff Sharkey | 9a13f36 | 2011-04-26 16:25:36 -0700 | [diff] [blame] | 258 | * Return detailed network statistics with UID-level granularity, |
| 259 | * including interface and tag details. |
| 260 | */ |
| 261 | NetworkStats getNetworkStatsDetail(); |
| 262 | |
| 263 | /** |
Jeff Sharkey | eedcb95 | 2011-05-17 14:55:15 -0700 | [diff] [blame] | 264 | * Return detailed network statistics for the requested UID, |
| 265 | * including interface and tag details. |
| 266 | */ |
| 267 | NetworkStats getNetworkStatsUidDetail(int uid); |
| 268 | |
| 269 | /** |
Jeff Sharkey | e4984be | 2013-09-10 21:03:27 -0700 | [diff] [blame] | 270 | * Return summary of network statistics all tethering interfaces. |
Jeff Sharkey | cdd02c5d | 2011-09-16 01:52:49 -0700 | [diff] [blame] | 271 | */ |
Jeff Sharkey | e4984be | 2013-09-10 21:03:27 -0700 | [diff] [blame] | 272 | NetworkStats getNetworkStatsTethering(); |
Jeff Sharkey | cdd02c5d | 2011-09-16 01:52:49 -0700 | [diff] [blame] | 273 | |
| 274 | /** |
Jeff Sharkey | b3f19ca | 2011-06-29 23:54:13 -0700 | [diff] [blame] | 275 | * Set quota for an interface. |
Ashish Sharma | 50fd36d | 2011-06-15 19:34:53 -0700 | [diff] [blame] | 276 | */ |
Jeff Sharkey | 41ff7ec | 2011-07-25 15:21:22 -0700 | [diff] [blame] | 277 | void setInterfaceQuota(String iface, long quotaBytes); |
Jeff Sharkey | b3f19ca | 2011-06-29 23:54:13 -0700 | [diff] [blame] | 278 | |
| 279 | /** |
| 280 | * Remove quota for an interface. |
| 281 | */ |
| 282 | void removeInterfaceQuota(String iface); |
Ashish Sharma | 50fd36d | 2011-06-15 19:34:53 -0700 | [diff] [blame] | 283 | |
| 284 | /** |
Jeff Sharkey | 41ff7ec | 2011-07-25 15:21:22 -0700 | [diff] [blame] | 285 | * Set alert for an interface; requires that iface already has quota. |
| 286 | */ |
| 287 | void setInterfaceAlert(String iface, long alertBytes); |
| 288 | |
| 289 | /** |
| 290 | * Remove alert for an interface. |
| 291 | */ |
| 292 | void removeInterfaceAlert(String iface); |
| 293 | |
| 294 | /** |
| 295 | * Set alert across all interfaces. |
| 296 | */ |
| 297 | void setGlobalAlert(long alertBytes); |
| 298 | |
| 299 | /** |
Ashish Sharma | 50fd36d | 2011-06-15 19:34:53 -0700 | [diff] [blame] | 300 | * Control network activity of a UID over interfaces with a quota limit. |
| 301 | */ |
| 302 | void setUidNetworkRules(int uid, boolean rejectOnQuotaInterfaces); |
| 303 | |
Jeff Sharkey | 605eb79 | 2014-11-04 13:34:06 -0800 | [diff] [blame] | 304 | void setUidCleartextNetworkPolicy(int uid, int policy); |
| 305 | |
Ashish Sharma | 50fd36d | 2011-06-15 19:34:53 -0700 | [diff] [blame] | 306 | /** |
Jeff Sharkey | 63d27a9 | 2011-08-03 17:04:22 -0700 | [diff] [blame] | 307 | * Return status of bandwidth control module. |
| 308 | */ |
| 309 | boolean isBandwidthControlEnabled(); |
| 310 | |
| 311 | /** |
Haoyu Bai | 0412423 | 2012-06-28 15:26:19 -0700 | [diff] [blame] | 312 | * Sets idletimer for an interface. |
| 313 | * |
| 314 | * This either initializes a new idletimer or increases its |
| 315 | * reference-counting if an idletimer already exists for given |
| 316 | * {@code iface}. |
| 317 | * |
Dianne Hackborn | 77b987f | 2014-02-26 16:20:52 -0800 | [diff] [blame] | 318 | * {@code type} is the type of the interface, such as TYPE_MOBILE. |
Haoyu Bai | 0412423 | 2012-06-28 15:26:19 -0700 | [diff] [blame] | 319 | * |
| 320 | * Every {@code addIdleTimer} should be paired with a |
| 321 | * {@link removeIdleTimer} to cleanup when the network disconnects. |
| 322 | */ |
Dianne Hackborn | 77b987f | 2014-02-26 16:20:52 -0800 | [diff] [blame] | 323 | void addIdleTimer(String iface, int timeout, int type); |
Haoyu Bai | 0412423 | 2012-06-28 15:26:19 -0700 | [diff] [blame] | 324 | |
| 325 | /** |
| 326 | * Removes idletimer for an interface. |
| 327 | */ |
| 328 | void removeIdleTimer(String iface); |
| 329 | |
| 330 | /** |
Paul Jensen | 13e817d | 2014-04-10 14:16:37 -0400 | [diff] [blame] | 331 | * Bind name servers to a network in the DNS resolver. |
Mattias Falk | 7475c0c | 2011-04-04 16:10:36 +0200 | [diff] [blame] | 332 | */ |
Paul Jensen | 13e817d | 2014-04-10 14:16:37 -0400 | [diff] [blame] | 333 | void setDnsServersForNetwork(int netId, in String[] servers, String domains); |
Mattias Falk | 7475c0c | 2011-04-04 16:10:36 +0200 | [diff] [blame] | 334 | |
Paul Jensen | b69a3a8 | 2014-08-06 15:34:26 -0400 | [diff] [blame] | 335 | /** |
| 336 | * Flush the DNS cache associated with the specified network. |
| 337 | */ |
| 338 | void flushNetworkDnsCache(int netId); |
| 339 | |
Jeff Sharkey | c268f0b | 2012-08-24 10:25:31 -0700 | [diff] [blame] | 340 | void setFirewallEnabled(boolean enabled); |
| 341 | boolean isFirewallEnabled(); |
Jeff Sharkey | 2c09298 | 2012-08-24 11:44:40 -0700 | [diff] [blame] | 342 | void setFirewallInterfaceRule(String iface, boolean allow); |
| 343 | void setFirewallEgressSourceRule(String addr, boolean allow); |
| 344 | void setFirewallEgressDestRule(String addr, int port, boolean allow); |
Amith Yamasani | 15e47235 | 2015-04-24 19:06:07 -0700 | [diff] [blame] | 345 | void setFirewallUidRule(int uid, int rule); |
Mattias Falk | 8b47b36 | 2011-08-23 14:15:13 +0200 | [diff] [blame] | 346 | |
| 347 | /** |
Paul Jensen | 6bc2c2c | 2014-05-07 15:27:40 -0400 | [diff] [blame] | 348 | * Set all packets from users in ranges to go through VPN specified by netId. |
Chad Brubaker | 3277620a | 2013-06-12 13:37:30 -0700 | [diff] [blame] | 349 | */ |
Paul Jensen | 6bc2c2c | 2014-05-07 15:27:40 -0400 | [diff] [blame] | 350 | void addVpnUidRanges(int netId, in UidRange[] ranges); |
Chad Brubaker | 3277620a | 2013-06-12 13:37:30 -0700 | [diff] [blame] | 351 | |
| 352 | /** |
Paul Jensen | 6bc2c2c | 2014-05-07 15:27:40 -0400 | [diff] [blame] | 353 | * Clears the special VPN rules for users in ranges and VPN specified by netId. |
Chad Brubaker | 3277620a | 2013-06-12 13:37:30 -0700 | [diff] [blame] | 354 | */ |
Paul Jensen | 6bc2c2c | 2014-05-07 15:27:40 -0400 | [diff] [blame] | 355 | void removeVpnUidRanges(int netId, in UidRange[] ranges); |
Chad Brubaker | 3277620a | 2013-06-12 13:37:30 -0700 | [diff] [blame] | 356 | |
| 357 | /** |
Lorenzo Colitti | 9543946 | 2014-10-09 13:44:48 +0900 | [diff] [blame] | 358 | * Start the clatd (464xlat) service on the given interface. |
Lorenzo Colitti | 7975184 | 2013-02-28 16:16:03 +0900 | [diff] [blame] | 359 | */ |
| 360 | void startClatd(String interfaceName); |
| 361 | |
| 362 | /** |
Lorenzo Colitti | 9543946 | 2014-10-09 13:44:48 +0900 | [diff] [blame] | 363 | * Stop the clatd (464xlat) service on the given interface. |
Lorenzo Colitti | 7975184 | 2013-02-28 16:16:03 +0900 | [diff] [blame] | 364 | */ |
Lorenzo Colitti | 9543946 | 2014-10-09 13:44:48 +0900 | [diff] [blame] | 365 | void stopClatd(String interfaceName); |
Lorenzo Colitti | 7975184 | 2013-02-28 16:16:03 +0900 | [diff] [blame] | 366 | |
| 367 | /** |
Lorenzo Colitti | 9543946 | 2014-10-09 13:44:48 +0900 | [diff] [blame] | 368 | * Determine whether the clatd (464xlat) service has been started on the given interface. |
Lorenzo Colitti | 7975184 | 2013-02-28 16:16:03 +0900 | [diff] [blame] | 369 | */ |
Lorenzo Colitti | 9543946 | 2014-10-09 13:44:48 +0900 | [diff] [blame] | 370 | boolean isClatdStarted(String interfaceName); |
Dianne Hackborn | 77b987f | 2014-02-26 16:20:52 -0800 | [diff] [blame] | 371 | |
| 372 | /** |
| 373 | * Start listening for mobile activity state changes. |
| 374 | */ |
| 375 | void registerNetworkActivityListener(INetworkActivityListener listener); |
| 376 | |
| 377 | /** |
| 378 | * Stop listening for mobile activity state changes. |
| 379 | */ |
| 380 | void unregisterNetworkActivityListener(INetworkActivityListener listener); |
| 381 | |
| 382 | /** |
| 383 | * Check whether the mobile radio is currently active. |
| 384 | */ |
| 385 | boolean isNetworkActive(); |
Robert Greenwalt | 9ba9c58 | 2014-03-19 17:56:12 -0700 | [diff] [blame] | 386 | |
| 387 | /** |
Paul Jensen | 6bc2c2c | 2014-05-07 15:27:40 -0400 | [diff] [blame] | 388 | * Setup a new physical network. |
Robert Greenwalt | 9ba9c58 | 2014-03-19 17:56:12 -0700 | [diff] [blame] | 389 | */ |
Paul Jensen | 6bc2c2c | 2014-05-07 15:27:40 -0400 | [diff] [blame] | 390 | void createPhysicalNetwork(int netId); |
| 391 | |
| 392 | /** |
| 393 | * Setup a new VPN. |
| 394 | */ |
Sreeram Ramachandran | 8cd33ed | 2014-07-23 15:23:15 -0700 | [diff] [blame] | 395 | void createVirtualNetwork(int netId, boolean hasDNS, boolean secure); |
Robert Greenwalt | 9ba9c58 | 2014-03-19 17:56:12 -0700 | [diff] [blame] | 396 | |
| 397 | /** |
Paul Jensen | 992f252 | 2014-04-28 10:33:11 -0400 | [diff] [blame] | 398 | * Remove a network. |
Robert Greenwalt | 9ba9c58 | 2014-03-19 17:56:12 -0700 | [diff] [blame] | 399 | */ |
| 400 | void removeNetwork(int netId); |
Robert Greenwalt | 568891d | 2014-04-04 13:38:00 -0700 | [diff] [blame] | 401 | |
Paul Jensen | 992f252 | 2014-04-28 10:33:11 -0400 | [diff] [blame] | 402 | /** |
| 403 | * Add an interface to a network. |
| 404 | */ |
| 405 | void addInterfaceToNetwork(String iface, int netId); |
| 406 | |
| 407 | /** |
| 408 | * Remove an Interface from a network. |
| 409 | */ |
| 410 | void removeInterfaceFromNetwork(String iface, int netId); |
| 411 | |
Robert Greenwalt | 913c895 | 2014-04-07 17:36:35 -0700 | [diff] [blame] | 412 | void addLegacyRouteForNetId(int netId, in RouteInfo routeInfo, int uid); |
Robert Greenwalt | 568891d | 2014-04-04 13:38:00 -0700 | [diff] [blame] | 413 | |
Sreeram Ramachandran | f047f2a | 2014-04-15 16:04:26 -0700 | [diff] [blame] | 414 | void setDefaultNetId(int netId); |
Robert Greenwalt | 568891d | 2014-04-04 13:38:00 -0700 | [diff] [blame] | 415 | void clearDefaultNetId(); |
| 416 | |
Sreeram Ramachandran | e4a05af | 2014-09-24 09:16:19 -0700 | [diff] [blame] | 417 | void setPermission(String permission, in int[] uids); |
Robert Greenwalt | 568891d | 2014-04-04 13:38:00 -0700 | [diff] [blame] | 418 | void clearPermission(in int[] uids); |
Paul Jensen | 6bc2c2c | 2014-05-07 15:27:40 -0400 | [diff] [blame] | 419 | |
| 420 | /** |
| 421 | * Allow UID to call protect(). |
| 422 | */ |
| 423 | void allowProtect(int uid); |
| 424 | |
| 425 | /** |
| 426 | * Deny UID from calling protect(). |
| 427 | */ |
| 428 | void denyProtect(int uid); |
Sreeram Ramachandran | a77760d | 2014-07-17 17:09:07 -0700 | [diff] [blame] | 429 | |
| 430 | void addInterfaceToLocalNetwork(String iface, in List<RouteInfo> routes); |
| 431 | void removeInterfaceFromLocalNetwork(String iface); |
San Mehat | 873f214 | 2010-01-14 10:25:07 -0800 | [diff] [blame] | 432 | } |