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