diff options
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/net/NetworkUtils.java | 39 | ||||
| -rw-r--r-- | core/java/android/net/util/SocketUtils.java | 41 |
2 files changed, 0 insertions, 80 deletions
diff --git a/core/java/android/net/NetworkUtils.java b/core/java/android/net/NetworkUtils.java index d2d886ba9a7f..dd3fff89cf80 100644 --- a/core/java/android/net/NetworkUtils.java +++ b/core/java/android/net/NetworkUtils.java @@ -24,7 +24,6 @@ import android.util.Log; import android.util.Pair; import java.io.FileDescriptor; -import java.io.IOException; import java.math.BigInteger; import java.net.Inet4Address; import java.net.Inet6Address; @@ -45,32 +44,6 @@ public class NetworkUtils { private static final String TAG = "NetworkUtils"; /** - * Attaches a socket filter that accepts DHCP packets to the given socket. - */ - @UnsupportedAppUsage - public native static void attachDhcpFilter(FileDescriptor fd) throws SocketException; - - /** - * Attaches a socket filter that accepts ICMPv6 router advertisements to the given socket. - * @param fd the socket's {@link FileDescriptor}. - * @param packetType the hardware address type, one of ARPHRD_*. - */ - @UnsupportedAppUsage - public native static void attachRaFilter(FileDescriptor fd, int packetType) throws SocketException; - - /** - * Attaches a socket filter that accepts L2-L4 signaling traffic required for IP connectivity. - * - * This includes: all ARP, ICMPv6 RS/RA/NS/NA messages, and DHCPv4 exchanges. - * - * @param fd the socket's {@link FileDescriptor}. - * @param packetType the hardware address type, one of ARPHRD_*. - */ - @UnsupportedAppUsage - public native static void attachControlPacketFilter(FileDescriptor fd, int packetType) - throws SocketException; - - /** * Attaches a socket filter that drops all of incoming packets. * @param fd the socket's {@link FileDescriptor}. */ @@ -178,18 +151,6 @@ public class NetworkUtils { public static native void resNetworkCancel(FileDescriptor fd); /** - * Add an entry into the ARP cache. - */ - public static void addArpEntry(Inet4Address ipv4Addr, MacAddress ethAddr, String ifname, - FileDescriptor fd) throws IOException { - addArpEntry(ethAddr.toByteArray(), ipv4Addr.getAddress(), ifname, fd); - } - - private static native void addArpEntry(byte[] ethAddr, byte[] netAddr, String ifname, - FileDescriptor fd) throws IOException; - - - /** * Get the tcp repair window associated with the {@code fd}. * * @param fd the tcp socket's {@link FileDescriptor}. diff --git a/core/java/android/net/util/SocketUtils.java b/core/java/android/net/util/SocketUtils.java index 6f8aece848f8..d06677d5d57f 100644 --- a/core/java/android/net/util/SocketUtils.java +++ b/core/java/android/net/util/SocketUtils.java @@ -23,7 +23,6 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; import android.annotation.TestApi; -import android.net.MacAddress; import android.net.NetworkUtils; import android.system.ErrnoException; import android.system.NetlinkSocketAddress; @@ -35,9 +34,7 @@ import libcore.io.IoBridge; import java.io.FileDescriptor; import java.io.IOException; -import java.net.Inet4Address; import java.net.SocketAddress; -import java.net.SocketException; /** * Collection of utilities to interact with raw sockets. @@ -99,43 +96,5 @@ public final class SocketUtils { IoBridge.closeAndSignalBlockedThreads(fd); } - /** - * Attaches a socket filter that accepts DHCP packets to the given socket. - */ - public static void attachDhcpFilter(@NonNull FileDescriptor fd) throws SocketException { - NetworkUtils.attachDhcpFilter(fd); - } - - /** - * Attaches a socket filter that accepts ICMPv6 router advertisements to the given socket. - * @param fd the socket's {@link FileDescriptor}. - * @param packetType the hardware address type, one of ARPHRD_*. - */ - public static void attachRaFilter(@NonNull FileDescriptor fd, int packetType) - throws SocketException { - NetworkUtils.attachRaFilter(fd, packetType); - } - - /** - * Attaches a socket filter that accepts L2-L4 signaling traffic required for IP connectivity. - * - * This includes: all ARP, ICMPv6 RS/RA/NS/NA messages, and DHCPv4 exchanges. - * - * @param fd the socket's {@link FileDescriptor}. - * @param packetType the hardware address type, one of ARPHRD_*. - */ - public static void attachControlPacketFilter(@NonNull FileDescriptor fd, int packetType) - throws SocketException { - NetworkUtils.attachControlPacketFilter(fd, packetType); - } - - /** - * Add an entry into the ARP cache. - */ - public static void addArpEntry(@NonNull Inet4Address ipv4Addr, @NonNull MacAddress ethAddr, - @NonNull String ifname, @NonNull FileDescriptor fd) throws IOException { - NetworkUtils.addArpEntry(ipv4Addr, ethAddr, ifname, fd); - } - private SocketUtils() {} } |
