INetworkManagementService.aidl revision 50fd36d7c38c40b087c8f3e3172478abe0c051d9
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 * Start Wifi Access Point 177 */ 178 void startAccessPoint(in WifiConfiguration wifiConfig, String wlanIface, String softapIface); 179 180 /** 181 * Stop Wifi Access Point 182 */ 183 void stopAccessPoint(); 184 185 /** 186 * Set Access Point config 187 */ 188 void setAccessPoint(in WifiConfiguration wifiConfig, String wlanIface, String softapIface); 189 190 /** 191 ** DATA USAGE RELATED 192 **/ 193 194 /** 195 * Return global network statistics summarized at an interface level, 196 * without any UID-level granularity. 197 */ 198 NetworkStats getNetworkStatsSummary(); 199 200 /** 201 * Return detailed network statistics with UID-level granularity, 202 * including interface and tag details. 203 */ 204 NetworkStats getNetworkStatsDetail(); 205 206 /** 207 * Return detailed network statistics for the requested UID, 208 * including interface and tag details. 209 */ 210 NetworkStats getNetworkStatsUidDetail(int uid); 211 212 /** 213 * Set an overall quota for a group of interfaces. 214 */ 215 void setInterfaceQuota(in String[] iface, long quota); 216 217 /** 218 * Control network activity of a UID over interfaces with a quota limit. 219 */ 220 void setUidNetworkRules(int uid, boolean rejectOnQuotaInterfaces); 221 222 /** 223 * Configures bandwidth throttling on an interface. 224 */ 225 void setInterfaceThrottle(String iface, int rxKbps, int txKbps); 226 227 /** 228 * Returns the currently configured RX throttle values 229 * for the specified interface 230 */ 231 int getInterfaceRxThrottle(String iface); 232 233 /** 234 * Returns the currently configured TX throttle values 235 * for the specified interface 236 */ 237 int getInterfaceTxThrottle(String iface); 238 239 void setBandwidthControlEnabled(boolean enabled); 240 241} 242