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