INetworkManagementService.aidl revision 572b7048a6ed6cf6c5f6bc6c9d542dc377d601ff
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.RouteInfo; 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 * Retrieves the network routes currently configured on the specified 62 * interface 63 */ 64 RouteInfo[] getRoutes(String iface); 65 66 /** 67 * Add the specified route to the interface. 68 */ 69 void addRoute(String iface, in RouteInfo route); 70 71 /** 72 * Remove the specified route from the interface. 73 */ 74 void removeRoute(String iface, in RouteInfo route); 75 76 /** 77 * Shuts down the service 78 */ 79 void shutdown(); 80 81 /** 82 ** TETHERING RELATED 83 **/ 84 85 86 /** 87 * Returns true if IP forwarding is enabled 88 */ 89 boolean getIpForwardingEnabled(); 90 91 /** 92 * Enables/Disables IP Forwarding 93 */ 94 void setIpForwardingEnabled(boolean enabled); 95 96 /** 97 * Start tethering services with the specified dhcp server range 98 * arg is a set of start end pairs defining the ranges. 99 */ 100 void startTethering(in String[] dhcpRanges); 101 102 /** 103 * Stop currently running tethering services 104 */ 105 void stopTethering(); 106 107 /** 108 * Returns true if tethering services are started 109 */ 110 boolean isTetheringStarted(); 111 112 /** 113 * Tethers the specified interface 114 */ 115 void tetherInterface(String iface); 116 117 /** 118 * Untethers the specified interface 119 */ 120 void untetherInterface(String iface); 121 122 /** 123 * Returns a list of currently tethered interfaces 124 */ 125 String[] listTetheredInterfaces(); 126 127 /** 128 * Sets the list of DNS forwarders (in order of priority) 129 */ 130 void setDnsForwarders(in String[] dns); 131 132 /** 133 * Returns the list of DNS fowarders (in order of priority) 134 */ 135 String[] getDnsForwarders(); 136 137 /** 138 * Enables Network Address Translation between two interfaces. 139 * The address and netmask of the external interface is used for 140 * the NAT'ed network. 141 */ 142 void enableNat(String internalInterface, String externalInterface); 143 144 /** 145 * Disables Network Address Translation between two interfaces. 146 */ 147 void disableNat(String internalInterface, String externalInterface); 148 149 /** 150 ** PPPD 151 **/ 152 153 /** 154 * Returns the list of currently known TTY devices on the system 155 */ 156 String[] listTtys(); 157 158 /** 159 * Attaches a PPP server daemon to the specified TTY with the specified 160 * local/remote addresses. 161 */ 162 void attachPppd(String tty, String localAddr, String remoteAddr, String dns1Addr, 163 String dns2Addr); 164 165 /** 166 * Detaches a PPP server daemon from the specified TTY. 167 */ 168 void detachPppd(String tty); 169 170 /** 171 * Turn on USB RNDIS support - this will turn off thinks like adb/mass-storage 172 */ 173 void startUsbRNDIS(); 174 175 /** 176 * Turn off USB RNDIS support 177 */ 178 void stopUsbRNDIS(); 179 180 /** 181 * Check the status of USB RNDIS support 182 */ 183 boolean isUsbRNDISStarted(); 184 185 /** 186 * Start Wifi Access Point 187 */ 188 void startAccessPoint(in WifiConfiguration wifiConfig, String wlanIface, String softapIface); 189 190 /** 191 * Stop Wifi Access Point 192 */ 193 void stopAccessPoint(); 194 195 /** 196 * Set Access Point config 197 */ 198 void setAccessPoint(in WifiConfiguration wifiConfig, String wlanIface, String softapIface); 199 200 /** 201 * Read number of bytes sent over an interface 202 */ 203 long getInterfaceTxCounter(String iface); 204 205 /** 206 * Read number of bytes received over an interface 207 */ 208 long getInterfaceRxCounter(String iface); 209 210 /** 211 * Configures bandwidth throttling on an interface 212 */ 213 void setInterfaceThrottle(String iface, int rxKbps, int txKbps); 214 215 /** 216 * Returns the currently configured RX throttle values 217 * for the specified interface 218 */ 219 int getInterfaceRxThrottle(String iface); 220 221 /** 222 * Returns the currently configured TX throttle values 223 * for the specified interface 224 */ 225 int getInterfaceTxThrottle(String iface); 226 227 /** 228 * Sets the name fo the default interface in the DNS resolver. 229 */ 230 void setDefaultInterfaceForDns(String iface); 231 232 /** 233 * Bind name servers to an interface in the DNS resolver. 234 */ 235 void setDnsServersForInterface(String iface, in String[] servers); 236 237 /** 238 * Flush the DNS cache associated with the default interface. 239 */ 240 void flushDefaultDnsCache(); 241 242 /** 243 * Flush the DNS cache associated with the specified interface. 244 */ 245 void flushInterfaceDnsCache(String iface); 246} 247