diff options
Diffstat (limited to 'core/java/android/net/NetworkUtils.java')
-rw-r--r-- | core/java/android/net/NetworkUtils.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/core/java/android/net/NetworkUtils.java b/core/java/android/net/NetworkUtils.java index 8a678d6..76534ef 100644 --- a/core/java/android/net/NetworkUtils.java +++ b/core/java/android/net/NetworkUtils.java @@ -38,8 +38,22 @@ public class NetworkUtils { /** Bring the named network interface down. */ public native static int disableInterface(String interfaceName); - /** Reset any sockets that are connected via the named interface. */ - public native static int resetConnections(String interfaceName); + /** Setting bit 0 indicates reseting of IPv4 addresses required */ + public static final int RESET_IPV4_ADDRESSES = 0x01; + + /** Setting bit 1 indicates reseting of IPv4 addresses required */ + public static final int RESET_IPV6_ADDRESSES = 0x02; + + /** Reset all addresses */ + public static final int RESET_ALL_ADDRESSES = RESET_IPV4_ADDRESSES | RESET_IPV6_ADDRESSES; + + /** + * Reset IPv6 or IPv4 sockets that are connected via the named interface. + * + * @param interfaceName is the interface to reset + * @param mask {@see #RESET_IPV4_ADDRESSES} and {@see #RESET_IPV6_ADDRESSES} + */ + public native static int resetConnections(String interfaceName, int mask); /** * Start the DHCP client daemon, in order to have it request addresses |