blob: fe36786a43a8ff4d462bda73ef49314dd336a8f4 [file] [log] [blame]
San Mehat873f2142010-01-14 10:25:07 -08001/* //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
San Mehated4fc8a2010-01-22 12:28:36 -080020import android.net.InterfaceConfiguration;
San Mehat4d02d002010-01-22 16:07:46 -080021import android.net.INetworkManagementEventObserver;
Jeff Sharkey9a13f362011-04-26 16:25:36 -070022import android.net.NetworkStats;
Irfan Sheriff9ab518ad2010-03-12 15:48:17 -080023import android.net.wifi.WifiConfiguration;
San Mehated4fc8a2010-01-22 12:28:36 -080024
San Mehat873f2142010-01-14 10:25:07 -080025/**
26 * @hide
27 */
28interface INetworkManagementService
29{
30 /**
31 ** GENERAL
32 **/
33
34 /**
San Mehat4d02d002010-01-22 16:07:46 -080035 * 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 Mehat873f2142010-01-14 10:25:07 -080045 * Returns a list of currently known network interfaces
46 */
47 String[] listInterfaces();
48
49 /**
San Mehated4fc8a2010-01-22 12:28:36 -080050 * 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 Mehat873f2142010-01-14 10:25:07 -080061 * Shuts down the service
62 */
63 void shutdown();
64
65 /**
66 ** TETHERING RELATED
67 **/
68
San Mehat873f2142010-01-14 10:25:07 -080069 /**
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 Greenwaltbfb7bfa2010-03-24 16:03:21 -070081 * arg is a set of start end pairs defining the ranges.
San Mehat873f2142010-01-14 10:25:07 -080082 */
Robert Greenwaltbfb7bfa2010-03-24 16:03:21 -070083 void startTethering(in String[] dhcpRanges);
San Mehat873f2142010-01-14 10:25:07 -080084
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 Mehat72759df2010-01-19 13:50:37 -0800131
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 Greenwaltd0e18ff2010-01-26 11:40:34 -0800145 void attachPppd(String tty, String localAddr, String remoteAddr, String dns1Addr,
146 String dns2Addr);
San Mehat72759df2010-01-19 13:50:37 -0800147
148 /**
149 * Detaches a PPP server daemon from the specified TTY.
150 */
151 void detachPppd(String tty);
152
Robert Greenwaltce1200d2010-02-18 11:25:54 -0800153 /**
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 Sheriff5321aef2010-02-12 12:35:59 -0800167
168 /**
169 * Start Wifi Access Point
170 */
Irfan Sheriffc2f54c22010-03-18 14:02:22 -0700171 void startAccessPoint(in WifiConfiguration wifiConfig, String wlanIface, String softapIface);
Irfan Sheriff5321aef2010-02-12 12:35:59 -0800172
173 /**
174 * Stop Wifi Access Point
175 */
176 void stopAccessPoint();
177
Irfan Sheriffc2f54c22010-03-18 14:02:22 -0700178 /**
179 * Set Access Point config
180 */
181 void setAccessPoint(in WifiConfiguration wifiConfig, String wlanIface, String softapIface);
San Mehat91cac642010-03-31 14:31:36 -0700182
183 /**
Jeff Sharkey9a13f362011-04-26 16:25:36 -0700184 ** DATA USAGE RELATED
185 **/
San Mehat91cac642010-03-31 14:31:36 -0700186
187 /**
Jeff Sharkey9a13f362011-04-26 16:25:36 -0700188 * Return global network statistics summarized at an interface level,
189 * without any UID-level granularity.
San Mehat91cac642010-03-31 14:31:36 -0700190 */
Jeff Sharkey9a13f362011-04-26 16:25:36 -0700191 NetworkStats getNetworkStatsSummary();
San Mehat91cac642010-03-31 14:31:36 -0700192
193 /**
Jeff Sharkey9a13f362011-04-26 16:25:36 -0700194 * 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 Mehat91cac642010-03-31 14:31:36 -0700201 */
San Mehatf0db6e12010-04-07 15:22:10 -0700202 void setInterfaceThrottle(String iface, int rxKbps, int txKbps);
San Mehat91cac642010-03-31 14:31:36 -0700203
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 Mehatbe23fba2010-04-02 11:50:05 -0700215
San Mehat873f2142010-01-14 10:25:07 -0800216}