DHCP: Add a native method for making a DHCP socket.

Bug: 19704592
Change-Id: Iadd60d39c93aaabd2917e76791101a7d313b34be
This commit is contained in:
Lorenzo Colitti 2015-03-06 19:57:39 +09:00
commit c70fbac892

View file

@ -16,9 +16,11 @@
package android.net;
import java.io.FileDescriptor;
import java.net.InetAddress;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.util.Collection;
import java.util.Locale;
@ -138,6 +140,11 @@ public class NetworkUtils {
*/
public native static String getDhcpError();
/**
* Attaches a socket filter that accepts DHCP packets to the given socket.
*/
public native static void attachDhcpFilter(FileDescriptor fd) throws SocketException;
/**
* Binds the current process to the network designated by {@code netId}. All sockets created
* in the future (and not explicitly bound via a bound {@link SocketFactory} (see