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