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; |
Jeff Sharkey | 9a13f36 | 2011-04-26 16:25:36 -0700 | [diff] [blame] | 22 | import android.net.NetworkStats; |
Irfan Sheriff | 9ab518ad | 2010-03-12 15:48:17 -0800 | [diff] [blame] | 23 | import android.net.wifi.WifiConfiguration; |
San Mehat | ed4fc8a | 2010-01-22 12:28:36 -0800 | [diff] [blame] | 24 | |
San Mehat | 873f214 | 2010-01-14 10:25:07 -0800 | [diff] [blame] | 25 | /** |
| 26 | * @hide |
| 27 | */ |
| 28 | interface INetworkManagementService |
| 29 | { |
| 30 | /** |
| 31 | ** GENERAL |
| 32 | **/ |
| 33 | |
| 34 | /** |
San Mehat | 4d02d00 | 2010-01-22 16:07:46 -0800 | [diff] [blame] | 35 | * Register an observer to receive events |
| 36 | */ |
| 37 | void registerObserver(INetworkManagementEventObserver obs); |
| 38 | |
| 39 | /** |
| 40 | * Unregister an observer from receiving events. |
| 41 | */ |
| 42 | void unregisterObserver(INetworkManagementEventObserver obs); |
| 43 | |
| 44 | /** |
San Mehat | 873f214 | 2010-01-14 10:25:07 -0800 | [diff] [blame] | 45 | * Returns a list of currently known network interfaces |
| 46 | */ |
| 47 | String[] listInterfaces(); |
| 48 | |
| 49 | /** |
San Mehat | ed4fc8a | 2010-01-22 12:28:36 -0800 | [diff] [blame] | 50 | * Retrieves the specified interface config |
| 51 | * |
| 52 | */ |
| 53 | InterfaceConfiguration getInterfaceConfig(String iface); |
| 54 | |
| 55 | /** |
| 56 | * Sets the configuration of the specified interface |
| 57 | */ |
| 58 | void setInterfaceConfig(String iface, in InterfaceConfiguration cfg); |
| 59 | |
| 60 | /** |
San Mehat | 873f214 | 2010-01-14 10:25:07 -0800 | [diff] [blame] | 61 | * Shuts down the service |
| 62 | */ |
| 63 | void shutdown(); |
| 64 | |
| 65 | /** |
| 66 | ** TETHERING RELATED |
| 67 | **/ |
| 68 | |
San Mehat | 873f214 | 2010-01-14 10:25:07 -0800 | [diff] [blame] | 69 | /** |
| 70 | * Returns true if IP forwarding is enabled |
| 71 | */ |
| 72 | boolean getIpForwardingEnabled(); |
| 73 | |
| 74 | /** |
| 75 | * Enables/Disables IP Forwarding |
| 76 | */ |
| 77 | void setIpForwardingEnabled(boolean enabled); |
| 78 | |
| 79 | /** |
| 80 | * Start tethering services with the specified dhcp server range |
Robert Greenwalt | bfb7bfa | 2010-03-24 16:03:21 -0700 | [diff] [blame] | 81 | * arg is a set of start end pairs defining the ranges. |
San Mehat | 873f214 | 2010-01-14 10:25:07 -0800 | [diff] [blame] | 82 | */ |
Robert Greenwalt | bfb7bfa | 2010-03-24 16:03:21 -0700 | [diff] [blame] | 83 | void startTethering(in String[] dhcpRanges); |
San Mehat | 873f214 | 2010-01-14 10:25:07 -0800 | [diff] [blame] | 84 | |
| 85 | /** |
| 86 | * Stop currently running tethering services |
| 87 | */ |
| 88 | void stopTethering(); |
| 89 | |
| 90 | /** |
| 91 | * Returns true if tethering services are started |
| 92 | */ |
| 93 | boolean isTetheringStarted(); |
| 94 | |
| 95 | /** |
| 96 | * Tethers the specified interface |
| 97 | */ |
| 98 | void tetherInterface(String iface); |
| 99 | |
| 100 | /** |
| 101 | * Untethers the specified interface |
| 102 | */ |
| 103 | void untetherInterface(String iface); |
| 104 | |
| 105 | /** |
| 106 | * Returns a list of currently tethered interfaces |
| 107 | */ |
| 108 | String[] listTetheredInterfaces(); |
| 109 | |
| 110 | /** |
| 111 | * Sets the list of DNS forwarders (in order of priority) |
| 112 | */ |
| 113 | void setDnsForwarders(in String[] dns); |
| 114 | |
| 115 | /** |
| 116 | * Returns the list of DNS fowarders (in order of priority) |
| 117 | */ |
| 118 | String[] getDnsForwarders(); |
| 119 | |
| 120 | /** |
| 121 | * Enables Network Address Translation between two interfaces. |
| 122 | * The address and netmask of the external interface is used for |
| 123 | * the NAT'ed network. |
| 124 | */ |
| 125 | void enableNat(String internalInterface, String externalInterface); |
| 126 | |
| 127 | /** |
| 128 | * Disables Network Address Translation between two interfaces. |
| 129 | */ |
| 130 | void disableNat(String internalInterface, String externalInterface); |
San Mehat | 72759df | 2010-01-19 13:50:37 -0800 | [diff] [blame] | 131 | |
| 132 | /** |
| 133 | ** PPPD |
| 134 | **/ |
| 135 | |
| 136 | /** |
| 137 | * Returns the list of currently known TTY devices on the system |
| 138 | */ |
| 139 | String[] listTtys(); |
| 140 | |
| 141 | /** |
| 142 | * Attaches a PPP server daemon to the specified TTY with the specified |
| 143 | * local/remote addresses. |
| 144 | */ |
Robert Greenwalt | d0e18ff | 2010-01-26 11:40:34 -0800 | [diff] [blame] | 145 | void attachPppd(String tty, String localAddr, String remoteAddr, String dns1Addr, |
| 146 | String dns2Addr); |
San Mehat | 72759df | 2010-01-19 13:50:37 -0800 | [diff] [blame] | 147 | |
| 148 | /** |
| 149 | * Detaches a PPP server daemon from the specified TTY. |
| 150 | */ |
| 151 | void detachPppd(String tty); |
| 152 | |
Robert Greenwalt | ce1200d | 2010-02-18 11:25:54 -0800 | [diff] [blame] | 153 | /** |
| 154 | * Turn on USB RNDIS support - this will turn off thinks like adb/mass-storage |
| 155 | */ |
| 156 | void startUsbRNDIS(); |
| 157 | |
| 158 | /** |
| 159 | * Turn off USB RNDIS support |
| 160 | */ |
| 161 | void stopUsbRNDIS(); |
| 162 | |
| 163 | /** |
| 164 | * Check the status of USB RNDIS support |
| 165 | */ |
| 166 | boolean isUsbRNDISStarted(); |
Irfan Sheriff | 5321aef | 2010-02-12 12:35:59 -0800 | [diff] [blame] | 167 | |
| 168 | /** |
| 169 | * Start Wifi Access Point |
| 170 | */ |
Irfan Sheriff | c2f54c2 | 2010-03-18 14:02:22 -0700 | [diff] [blame] | 171 | void startAccessPoint(in WifiConfiguration wifiConfig, String wlanIface, String softapIface); |
Irfan Sheriff | 5321aef | 2010-02-12 12:35:59 -0800 | [diff] [blame] | 172 | |
| 173 | /** |
| 174 | * Stop Wifi Access Point |
| 175 | */ |
| 176 | void stopAccessPoint(); |
| 177 | |
Irfan Sheriff | c2f54c2 | 2010-03-18 14:02:22 -0700 | [diff] [blame] | 178 | /** |
| 179 | * Set Access Point config |
| 180 | */ |
| 181 | void setAccessPoint(in WifiConfiguration wifiConfig, String wlanIface, String softapIface); |
San Mehat | 91cac64 | 2010-03-31 14:31:36 -0700 | [diff] [blame] | 182 | |
| 183 | /** |
Jeff Sharkey | 9a13f36 | 2011-04-26 16:25:36 -0700 | [diff] [blame] | 184 | ** DATA USAGE RELATED |
| 185 | **/ |
San Mehat | 91cac64 | 2010-03-31 14:31:36 -0700 | [diff] [blame] | 186 | |
| 187 | /** |
Jeff Sharkey | 9a13f36 | 2011-04-26 16:25:36 -0700 | [diff] [blame] | 188 | * Return global network statistics summarized at an interface level, |
| 189 | * without any UID-level granularity. |
San Mehat | 91cac64 | 2010-03-31 14:31:36 -0700 | [diff] [blame] | 190 | */ |
Jeff Sharkey | 9a13f36 | 2011-04-26 16:25:36 -0700 | [diff] [blame] | 191 | NetworkStats getNetworkStatsSummary(); |
San Mehat | 91cac64 | 2010-03-31 14:31:36 -0700 | [diff] [blame] | 192 | |
| 193 | /** |
Jeff Sharkey | 9a13f36 | 2011-04-26 16:25:36 -0700 | [diff] [blame] | 194 | * Return detailed network statistics with UID-level granularity, |
| 195 | * including interface and tag details. |
| 196 | */ |
| 197 | NetworkStats getNetworkStatsDetail(); |
| 198 | |
| 199 | /** |
| 200 | * Configures bandwidth throttling on an interface. |
San Mehat | 91cac64 | 2010-03-31 14:31:36 -0700 | [diff] [blame] | 201 | */ |
San Mehat | f0db6e1 | 2010-04-07 15:22:10 -0700 | [diff] [blame] | 202 | void setInterfaceThrottle(String iface, int rxKbps, int txKbps); |
San Mehat | 91cac64 | 2010-03-31 14:31:36 -0700 | [diff] [blame] | 203 | |
| 204 | /** |
| 205 | * Returns the currently configured RX throttle values |
| 206 | * for the specified interface |
| 207 | */ |
| 208 | int getInterfaceRxThrottle(String iface); |
| 209 | |
| 210 | /** |
| 211 | * Returns the currently configured TX throttle values |
| 212 | * for the specified interface |
| 213 | */ |
| 214 | int getInterfaceTxThrottle(String iface); |
San Mehat | be23fba | 2010-04-02 11:50:05 -0700 | [diff] [blame] | 215 | |
San Mehat | 873f214 | 2010-01-14 10:25:07 -0800 | [diff] [blame] | 216 | } |