INetworkManagementService.aidl revision 7960d9f888e31602e17b8856c77a3826bf8c841e
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     * Set interface down
68     */
69    void setInterfaceDown(String iface);
70
71    /**
72     * Set interface up
73     */
74    void setInterfaceUp(String iface);
75
76    /**
77     * Set interface IPv6 privacy extensions
78     */
79    void setInterfaceIpv6PrivacyExtensions(String iface, boolean enable);
80
81    /**
82     * Disable IPv6 on an interface
83     */
84    void disableIpv6(String iface);
85
86    /**
87     * Enable IPv6 on an interface
88     */
89    void enableIpv6(String iface);
90
91    /**
92     * Retrieves the network routes currently configured on the specified
93     * interface
94     */
95    RouteInfo[] getRoutes(String iface);
96
97    /**
98     * Add the specified route to the interface.
99     */
100    void addRoute(String iface, in RouteInfo route);
101
102    /**
103     * Remove the specified route from the interface.
104     */
105    void removeRoute(String iface, in RouteInfo route);
106
107    /**
108     * Shuts down the service
109     */
110    void shutdown();
111
112    /**
113     ** TETHERING RELATED
114     **/
115
116    /**
117     * Returns true if IP forwarding is enabled
118     */
119    boolean getIpForwardingEnabled();
120
121    /**
122     * Enables/Disables IP Forwarding
123     */
124    void setIpForwardingEnabled(boolean enabled);
125
126    /**
127     * Start tethering services with the specified dhcp server range
128     * arg is a set of start end pairs defining the ranges.
129     */
130    void startTethering(in String[] dhcpRanges);
131
132    /**
133     * Stop currently running tethering services
134     */
135    void stopTethering();
136
137    /**
138     * Returns true if tethering services are started
139     */
140    boolean isTetheringStarted();
141
142    /**
143     * Tethers the specified interface
144     */
145    void tetherInterface(String iface);
146
147    /**
148     * Untethers the specified interface
149     */
150    void untetherInterface(String iface);
151
152    /**
153     * Returns a list of currently tethered interfaces
154     */
155    String[] listTetheredInterfaces();
156
157    /**
158     * Sets the list of DNS forwarders (in order of priority)
159     */
160    void setDnsForwarders(in String[] dns);
161
162    /**
163     * Returns the list of DNS fowarders (in order of priority)
164     */
165    String[] getDnsForwarders();
166
167    /**
168     *  Enables Network Address Translation between two interfaces.
169     *  The address and netmask of the external interface is used for
170     *  the NAT'ed network.
171     */
172    void enableNat(String internalInterface, String externalInterface);
173
174    /**
175     *  Disables Network Address Translation between two interfaces.
176     */
177    void disableNat(String internalInterface, String externalInterface);
178
179    /**
180     ** PPPD
181     **/
182
183    /**
184     * Returns the list of currently known TTY devices on the system
185     */
186    String[] listTtys();
187
188    /**
189     * Attaches a PPP server daemon to the specified TTY with the specified
190     * local/remote addresses.
191     */
192    void attachPppd(String tty, String localAddr, String remoteAddr, String dns1Addr,
193            String dns2Addr);
194
195    /**
196     * Detaches a PPP server daemon from the specified TTY.
197     */
198    void detachPppd(String tty);
199
200    /**
201     * Load firmware for operation in the given mode. Currently the three
202     * modes supported are "AP", "STA" and "P2P".
203     */
204    void wifiFirmwareReload(String wlanIface, String mode);
205
206    /**
207     * Start Wifi Access Point
208     */
209    void startAccessPoint(in WifiConfiguration wifiConfig, String wlanIface, String softapIface);
210
211    /**
212     * Stop Wifi Access Point
213     */
214    void stopAccessPoint(String wlanIface);
215
216    /**
217     * Set Access Point config
218     */
219    void setAccessPoint(in WifiConfiguration wifiConfig, String wlanIface, String softapIface);
220
221    /**
222     ** DATA USAGE RELATED
223     **/
224
225    /**
226     * Return global network statistics summarized at an interface level,
227     * without any UID-level granularity.
228     */
229    NetworkStats getNetworkStatsSummary();
230
231    /**
232     * Return detailed network statistics with UID-level granularity,
233     * including interface and tag details.
234     */
235    NetworkStats getNetworkStatsDetail();
236
237    /**
238     * Return detailed network statistics for the requested UID,
239     * including interface and tag details.
240     */
241    NetworkStats getNetworkStatsUidDetail(int uid);
242
243    /**
244     * Return summary of network statistics for the requested pairs of
245     * tethering interfaces.  Even indexes are remote interface, and odd
246     * indexes are corresponding local interfaces.
247     */
248    NetworkStats getNetworkStatsTethering(in String[] ifacePairs);
249
250    /**
251     * Set quota for an interface.
252     */
253    void setInterfaceQuota(String iface, long quotaBytes);
254
255    /**
256     * Remove quota for an interface.
257     */
258    void removeInterfaceQuota(String iface);
259
260    /**
261     * Set alert for an interface; requires that iface already has quota.
262     */
263    void setInterfaceAlert(String iface, long alertBytes);
264
265    /**
266     * Remove alert for an interface.
267     */
268    void removeInterfaceAlert(String iface);
269
270    /**
271     * Set alert across all interfaces.
272     */
273    void setGlobalAlert(long alertBytes);
274
275    /**
276     * Control network activity of a UID over interfaces with a quota limit.
277     */
278    void setUidNetworkRules(int uid, boolean rejectOnQuotaInterfaces);
279
280    /**
281     * Return status of bandwidth control module.
282     */
283    boolean isBandwidthControlEnabled();
284
285    /**
286     * Configures bandwidth throttling on an interface.
287     */
288    void setInterfaceThrottle(String iface, int rxKbps, int txKbps);
289
290    /**
291     * Returns the currently configured RX throttle values
292     * for the specified interface
293     */
294    int getInterfaceRxThrottle(String iface);
295
296    /**
297     * Returns the currently configured TX throttle values
298     * for the specified interface
299     */
300    int getInterfaceTxThrottle(String iface);
301
302    /**
303     * Sets the name of the default interface in the DNS resolver.
304     */
305    void setDefaultInterfaceForDns(String iface);
306
307    /**
308     * Bind name servers to an interface in the DNS resolver.
309     */
310    void setDnsServersForInterface(String iface, in String[] servers);
311
312    /**
313     * Flush the DNS cache associated with the default interface.
314     */
315    void flushDefaultDnsCache();
316
317    /**
318     * Flush the DNS cache associated with the specified interface.
319     */
320    void flushInterfaceDnsCache(String iface);
321}
322