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