INetworkManagementService.aidl revision 9a13f36cddaad01350bdb5f000167811a1d753c9
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.wifi.WifiConfiguration; 24 25/** 26 * @hide 27 */ 28interface INetworkManagementService 29{ 30 /** 31 ** GENERAL 32 **/ 33 34 /** 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 /** 45 * Returns a list of currently known network interfaces 46 */ 47 String[] listInterfaces(); 48 49 /** 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 /** 61 * Shuts down the service 62 */ 63 void shutdown(); 64 65 /** 66 ** TETHERING RELATED 67 **/ 68 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 81 * arg is a set of start end pairs defining the ranges. 82 */ 83 void startTethering(in String[] dhcpRanges); 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); 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 */ 145 void attachPppd(String tty, String localAddr, String remoteAddr, String dns1Addr, 146 String dns2Addr); 147 148 /** 149 * Detaches a PPP server daemon from the specified TTY. 150 */ 151 void detachPppd(String tty); 152 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(); 167 168 /** 169 * Start Wifi Access Point 170 */ 171 void startAccessPoint(in WifiConfiguration wifiConfig, String wlanIface, String softapIface); 172 173 /** 174 * Stop Wifi Access Point 175 */ 176 void stopAccessPoint(); 177 178 /** 179 * Set Access Point config 180 */ 181 void setAccessPoint(in WifiConfiguration wifiConfig, String wlanIface, String softapIface); 182 183 /** 184 ** DATA USAGE RELATED 185 **/ 186 187 /** 188 * Return global network statistics summarized at an interface level, 189 * without any UID-level granularity. 190 */ 191 NetworkStats getNetworkStatsSummary(); 192 193 /** 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. 201 */ 202 void setInterfaceThrottle(String iface, int rxKbps, int txKbps); 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); 215 216} 217