INetworkManagementService.aidl revision be23fba286e6772f2eb37ef25f252d7a73ef9dce
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.wifi.WifiConfiguration;
23
24/**
25 * @hide
26 */
27interface INetworkManagementService
28{
29    /**
30     ** GENERAL
31     **/
32
33    /**
34     * Register an observer to receive events
35     */
36    void registerObserver(INetworkManagementEventObserver obs);
37
38    /**
39     * Unregister an observer from receiving events.
40     */
41    void unregisterObserver(INetworkManagementEventObserver obs);
42
43    /**
44     * Returns a list of currently known network interfaces
45     */
46    String[] listInterfaces();
47
48    /**
49     * Retrieves the specified interface config
50     *
51     */
52    InterfaceConfiguration getInterfaceConfig(String iface);
53
54    /**
55     * Sets the configuration of the specified interface
56     */
57    void setInterfaceConfig(String iface, in InterfaceConfiguration cfg);
58
59    /**
60     * Shuts down the service
61     */
62    void shutdown();
63
64    /**
65     ** TETHERING RELATED
66     **/
67
68
69    /**
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
81     * arg is a set of start end pairs defining the ranges.
82     */
83    void startTethering(in String[] dhcpRanges);
84
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);
131
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     */
145    void attachPppd(String tty, String localAddr, String remoteAddr, String dns1Addr,
146            String dns2Addr);
147
148    /**
149     * Detaches a PPP server daemon from the specified TTY.
150     */
151    void detachPppd(String tty);
152
153    /**
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();
167
168    /**
169     * Start Wifi Access Point
170     */
171    void startAccessPoint(in WifiConfiguration wifiConfig, String wlanIface, String softapIface);
172
173    /**
174     * Stop Wifi Access Point
175     */
176    void stopAccessPoint();
177
178    /**
179     * Set Access Point config
180     */
181    void setAccessPoint(in WifiConfiguration wifiConfig, String wlanIface, String softapIface);
182
183    /**
184     * Read number of bytes sent over an interface
185     */
186    long getInterfaceTxCounter(String iface);
187
188    /**
189     * Read number of bytes received over an interface
190     */
191    long getInterfaceRxCounter(String iface);
192
193    /**
194     * Configures bandwidth throttling on an interface
195     */
196    void setInterfaceThrottle(String iface, int maxKbits, int rxKbps, int txKbps);
197
198    /**
199     * Returns the currently configured RX throttle values
200     * for the specified interface
201     */
202    int getInterfaceRxThrottle(String iface);
203
204    /**
205     * Returns the currently configured TX throttle values
206     * for the specified interface
207     */
208    int getInterfaceTxThrottle(String iface);
209
210}
211