INetworkManagementService.aidl revision cb30b22ff507a5a9a5d9c584f8b082f5e96c4d02
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 18package android.os; 19 20import android.net.InterfaceConfiguration; 21import android.net.INetworkManagementEventObserver; 22import android.net.NetworkStats; 23import android.net.RouteInfo; 24import android.net.wifi.WifiConfiguration; 25 26/** 27 * @hide 28 */ 29interface INetworkManagementService 30{ 31 /** 32 ** GENERAL 33 **/ 34 35 /** 36 * Register an observer to receive events 37 */ 38 void registerObserver(INetworkManagementEventObserver obs); 39 40 /** 41 * Unregister an observer from receiving events. 42 */ 43 void unregisterObserver(INetworkManagementEventObserver obs); 44 45 /** 46 * Returns a list of currently known network interfaces 47 */ 48 String[] listInterfaces(); 49 50 /** 51 * Retrieves the specified interface config 52 * 53 */ 54 InterfaceConfiguration getInterfaceConfig(String iface); 55 56 /** 57 * Sets the configuration of the specified interface 58 */ 59 void setInterfaceConfig(String iface, in InterfaceConfiguration cfg); 60 61 /** 62 * Clear all IP addresses on the specified interface 63 */ 64 void clearInterfaceAddresses(String iface); 65 66 /** 67 * Retrieves the network routes currently configured on the specified 68 * interface 69 */ 70 RouteInfo[] getRoutes(String iface); 71 72 /** 73 * Add the specified route to the interface. 74 */ 75 void addRoute(String iface, in RouteInfo route); 76 77 /** 78 * Remove the specified route from the interface. 79 */ 80 void removeRoute(String iface, in RouteInfo route); 81 82 /** 83 * Shuts down the service 84 */ 85 void shutdown(); 86 87 /** 88 ** TETHERING RELATED 89 **/ 90 91 /** 92 * Returns true if IP forwarding is enabled 93 */ 94 boolean getIpForwardingEnabled(); 95 96 /** 97 * Enables/Disables IP Forwarding 98 */ 99 void setIpForwardingEnabled(boolean enabled); 100 101 /** 102 * Start tethering services with the specified dhcp server range 103 * arg is a set of start end pairs defining the ranges. 104 */ 105 void startTethering(in String[] dhcpRanges); 106 107 /** 108 * Stop currently running tethering services 109 */ 110 void stopTethering(); 111 112 /** 113 * Returns true if tethering services are started 114 */ 115 boolean isTetheringStarted(); 116 117 /** 118 * Tethers the specified interface 119 */ 120 void tetherInterface(String iface); 121 122 /** 123 * Untethers the specified interface 124 */ 125 void untetherInterface(String iface); 126 127 /** 128 * Returns a list of currently tethered interfaces 129 */ 130 String[] listTetheredInterfaces(); 131 132 /** 133 * Sets the list of DNS forwarders (in order of priority) 134 */ 135 void setDnsForwarders(in String[] dns); 136 137 /** 138 * Returns the list of DNS fowarders (in order of priority) 139 */ 140 String[] getDnsForwarders(); 141 142 /** 143 * Enables Network Address Translation between two interfaces. 144 * The address and netmask of the external interface is used for 145 * the NAT'ed network. 146 */ 147 void enableNat(String internalInterface, String externalInterface); 148 149 /** 150 * Disables Network Address Translation between two interfaces. 151 */ 152 void disableNat(String internalInterface, String externalInterface); 153 154 /** 155 ** PPPD 156 **/ 157 158 /** 159 * Returns the list of currently known TTY devices on the system 160 */ 161 String[] listTtys(); 162 163 /** 164 * Attaches a PPP server daemon to the specified TTY with the specified 165 * local/remote addresses. 166 */ 167 void attachPppd(String tty, String localAddr, String remoteAddr, String dns1Addr, 168 String dns2Addr); 169 170 /** 171 * Detaches a PPP server daemon from the specified TTY. 172 */ 173 void detachPppd(String tty); 174 175 /** 176 * Load firmware for operation in the given mode. Currently the three 177 * modes supported are "AP", "STA" and "P2P". 178 */ 179 void wifiFirmwareReload(String wlanIface, String mode); 180 181 /** 182 * Start Wifi Access Point 183 */ 184 void startAccessPoint(in WifiConfiguration wifiConfig, String wlanIface, String softapIface); 185 186 /** 187 * Stop Wifi Access Point 188 */ 189 void stopAccessPoint(String wlanIface); 190 191 /** 192 * Set Access Point config 193 */ 194 void setAccessPoint(in WifiConfiguration wifiConfig, String wlanIface, String softapIface); 195 196 /** 197 ** DATA USAGE RELATED 198 **/ 199 200 /** 201 * Return global network statistics summarized at an interface level, 202 * without any UID-level granularity. 203 */ 204 NetworkStats getNetworkStatsSummary(); 205 206 /** 207 * Return detailed network statistics with UID-level granularity, 208 * including interface and tag details. 209 */ 210 NetworkStats getNetworkStatsDetail(); 211 212 /** 213 * Return detailed network statistics for the requested UID, 214 * including interface and tag details. 215 */ 216 NetworkStats getNetworkStatsUidDetail(int uid); 217 218 /** 219 * Set quota for an interface. 220 */ 221 void setInterfaceQuota(String iface, long quotaBytes); 222 223 /** 224 * Remove quota for an interface. 225 */ 226 void removeInterfaceQuota(String iface); 227 228 /** 229 * Set alert for an interface; requires that iface already has quota. 230 */ 231 void setInterfaceAlert(String iface, long alertBytes); 232 233 /** 234 * Remove alert for an interface. 235 */ 236 void removeInterfaceAlert(String iface); 237 238 /** 239 * Set alert across all interfaces. 240 */ 241 void setGlobalAlert(long alertBytes); 242 243 /** 244 * Control network activity of a UID over interfaces with a quota limit. 245 */ 246 void setUidNetworkRules(int uid, boolean rejectOnQuotaInterfaces); 247 248 /** 249 * Return status of bandwidth control module. 250 */ 251 boolean isBandwidthControlEnabled(); 252 253 /** 254 * Configures bandwidth throttling on an interface. 255 */ 256 void setInterfaceThrottle(String iface, int rxKbps, int txKbps); 257 258 /** 259 * Returns the currently configured RX throttle values 260 * for the specified interface 261 */ 262 int getInterfaceRxThrottle(String iface); 263 264 /** 265 * Returns the currently configured TX throttle values 266 * for the specified interface 267 */ 268 int getInterfaceTxThrottle(String iface); 269 270 /** 271 * Sets the name of the default interface in the DNS resolver. 272 */ 273 void setDefaultInterfaceForDns(String iface); 274 275 /** 276 * Bind name servers to an interface in the DNS resolver. 277 */ 278 void setDnsServersForInterface(String iface, in String[] servers); 279 280 /** 281 * Flush the DNS cache associated with the default interface. 282 */ 283 void flushDefaultDnsCache(); 284 285 /** 286 * Flush the DNS cache associated with the specified interface. 287 */ 288 void flushInterfaceDnsCache(String iface); 289} 290