diff --git a/Tethering/Android.bp b/Tethering/Android.bp index bfba5cdfc5..638eb29829 100644 --- a/Tethering/Android.bp +++ b/Tethering/Android.bp @@ -47,6 +47,7 @@ java_defaults { "net-utils-framework-common", "net-utils-device-common", "net-utils-device-common-bpf", + "net-utils-device-common-ip", "net-utils-device-common-netlink", "netd-client", "tetheringstatsprotos", diff --git a/Tethering/src/android/net/ip/IpServer.java b/Tethering/src/android/net/ip/IpServer.java index da7ca56463..438b592832 100644 --- a/Tethering/src/android/net/ip/IpServer.java +++ b/Tethering/src/android/net/ip/IpServer.java @@ -44,7 +44,6 @@ import android.net.dhcp.DhcpServingParamsParcel; import android.net.dhcp.DhcpServingParamsParcelExt; import android.net.dhcp.IDhcpEventCallbacks; import android.net.dhcp.IDhcpServer; -import android.net.ip.IpNeighborMonitor.NeighborEvent; import android.net.ip.RouterAdvertisementDaemon.RaParams; import android.os.Handler; import android.os.Looper; @@ -64,6 +63,9 @@ import com.android.modules.utils.build.SdkLevel; import com.android.net.module.util.InterfaceParams; import com.android.net.module.util.NetdUtils; import com.android.net.module.util.SharedLog; +import com.android.net.module.util.ip.InterfaceController; +import com.android.net.module.util.ip.IpNeighborMonitor; +import com.android.net.module.util.ip.IpNeighborMonitor.NeighborEvent; import com.android.networkstack.tethering.BpfCoordinator; import com.android.networkstack.tethering.BpfCoordinator.ClientInfo; import com.android.networkstack.tethering.BpfCoordinator.Ipv6ForwardingRule; diff --git a/Tethering/src/com/android/networkstack/tethering/BpfCoordinator.java b/Tethering/src/com/android/networkstack/tethering/BpfCoordinator.java index 133ae01ea7..49442a6800 100644 --- a/Tethering/src/com/android/networkstack/tethering/BpfCoordinator.java +++ b/Tethering/src/com/android/networkstack/tethering/BpfCoordinator.java @@ -23,11 +23,11 @@ import static android.net.NetworkStats.SET_DEFAULT; import static android.net.NetworkStats.TAG_NONE; import static android.net.NetworkStats.UID_ALL; import static android.net.NetworkStats.UID_TETHERING; -import static android.net.ip.ConntrackMonitor.ConntrackEvent; import static android.net.netstats.provider.NetworkStatsProvider.QUOTA_UNLIMITED; import static android.system.OsConstants.ETH_P_IP; import static android.system.OsConstants.ETH_P_IPV6; +import static com.android.net.module.util.ip.ConntrackMonitor.ConntrackEvent; import static com.android.networkstack.tethering.BpfUtils.DOWNSTREAM; import static com.android.networkstack.tethering.BpfUtils.UPSTREAM; import static com.android.networkstack.tethering.TetheringConfiguration.DEFAULT_TETHER_OFFLOAD_POLL_INTERVAL_MS; @@ -40,8 +40,6 @@ import android.net.MacAddress; import android.net.NetworkStats; import android.net.NetworkStats.Entry; import android.net.TetherOffloadRuleParcel; -import android.net.ip.ConntrackMonitor; -import android.net.ip.ConntrackMonitor.ConntrackEventConsumer; import android.net.ip.IpServer; import android.net.netstats.provider.NetworkStatsProvider; import android.os.Handler; @@ -71,6 +69,8 @@ import com.android.net.module.util.bpf.Tether4Key; import com.android.net.module.util.bpf.Tether4Value; import com.android.net.module.util.bpf.TetherStatsKey; import com.android.net.module.util.bpf.TetherStatsValue; +import com.android.net.module.util.ip.ConntrackMonitor; +import com.android.net.module.util.ip.ConntrackMonitor.ConntrackEventConsumer; import com.android.net.module.util.netlink.ConntrackMessage; import com.android.net.module.util.netlink.NetlinkConstants; import com.android.net.module.util.netlink.NetlinkSocket; diff --git a/Tethering/tests/unit/src/android/net/ip/IpServerTest.java b/Tethering/tests/unit/src/android/net/ip/IpServerTest.java index ef143de02c..f242227fbc 100644 --- a/Tethering/tests/unit/src/android/net/ip/IpServerTest.java +++ b/Tethering/tests/unit/src/android/net/ip/IpServerTest.java @@ -83,8 +83,6 @@ import android.net.dhcp.DhcpServingParamsParcel; import android.net.dhcp.IDhcpEventCallbacks; import android.net.dhcp.IDhcpServer; import android.net.dhcp.IDhcpServerCallbacks; -import android.net.ip.IpNeighborMonitor.NeighborEvent; -import android.net.ip.IpNeighborMonitor.NeighborEventConsumer; import android.net.ip.RouterAdvertisementDaemon.RaParams; import android.os.Build; import android.os.Handler; @@ -105,6 +103,10 @@ import com.android.net.module.util.bpf.Tether4Key; import com.android.net.module.util.bpf.Tether4Value; import com.android.net.module.util.bpf.TetherStatsKey; import com.android.net.module.util.bpf.TetherStatsValue; +import com.android.net.module.util.ip.ConntrackMonitor; +import com.android.net.module.util.ip.IpNeighborMonitor; +import com.android.net.module.util.ip.IpNeighborMonitor.NeighborEvent; +import com.android.net.module.util.ip.IpNeighborMonitor.NeighborEventConsumer; import com.android.networkstack.tethering.BpfCoordinator; import com.android.networkstack.tethering.BpfCoordinator.Ipv6ForwardingRule; import com.android.networkstack.tethering.PrivateAddressCoordinator; diff --git a/Tethering/tests/unit/src/com/android/networkstack/tethering/BpfCoordinatorTest.java b/Tethering/tests/unit/src/com/android/networkstack/tethering/BpfCoordinatorTest.java index 20a222dd46..fa1d881e79 100644 --- a/Tethering/tests/unit/src/com/android/networkstack/tethering/BpfCoordinatorTest.java +++ b/Tethering/tests/unit/src/com/android/networkstack/tethering/BpfCoordinatorTest.java @@ -23,7 +23,6 @@ import static android.net.NetworkStats.SET_DEFAULT; import static android.net.NetworkStats.TAG_NONE; import static android.net.NetworkStats.UID_ALL; import static android.net.NetworkStats.UID_TETHERING; -import static android.net.ip.ConntrackMonitor.ConntrackEvent; import static android.net.netstats.provider.NetworkStatsProvider.QUOTA_UNLIMITED; import static android.system.OsConstants.ETH_P_IP; import static android.system.OsConstants.ETH_P_IPV6; @@ -33,6 +32,7 @@ import static android.system.OsConstants.NETLINK_NETFILTER; import static com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn; import static com.android.dx.mockito.inline.extended.ExtendedMockito.staticMockMarker; +import static com.android.net.module.util.ip.ConntrackMonitor.ConntrackEvent; import static com.android.net.module.util.netlink.ConntrackMessage.DYING_MASK; import static com.android.net.module.util.netlink.ConntrackMessage.ESTABLISHED_MASK; import static com.android.net.module.util.netlink.ConntrackMessage.Tuple; @@ -82,8 +82,6 @@ import android.net.NetworkCapabilities; import android.net.NetworkStats; import android.net.TetherOffloadRuleParcel; import android.net.TetherStatsParcel; -import android.net.ip.ConntrackMonitor; -import android.net.ip.ConntrackMonitor.ConntrackEventConsumer; import android.net.ip.IpServer; import android.os.Build; import android.os.Handler; @@ -104,6 +102,8 @@ import com.android.net.module.util.bpf.Tether4Key; import com.android.net.module.util.bpf.Tether4Value; import com.android.net.module.util.bpf.TetherStatsKey; import com.android.net.module.util.bpf.TetherStatsValue; +import com.android.net.module.util.ip.ConntrackMonitor; +import com.android.net.module.util.ip.ConntrackMonitor.ConntrackEventConsumer; import com.android.net.module.util.netlink.ConntrackMessage; import com.android.net.module.util.netlink.NetlinkConstants; import com.android.net.module.util.netlink.NetlinkSocket; diff --git a/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringTest.java b/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringTest.java index e90d27e820..b402bc3956 100644 --- a/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringTest.java +++ b/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringTest.java @@ -151,7 +151,6 @@ import android.net.dhcp.DhcpServingParamsParcel; import android.net.dhcp.IDhcpEventCallbacks; import android.net.dhcp.IDhcpServer; import android.net.ip.DadProxy; -import android.net.ip.IpNeighborMonitor; import android.net.ip.IpServer; import android.net.ip.RouterAdvertisementDaemon; import android.net.util.NetworkConstants; @@ -187,6 +186,7 @@ import com.android.internal.util.test.FakeSettingsProvider; import com.android.net.module.util.CollectionUtils; import com.android.net.module.util.InterfaceParams; import com.android.net.module.util.SharedLog; +import com.android.net.module.util.ip.IpNeighborMonitor; import com.android.networkstack.apishim.common.BluetoothPanShim; import com.android.networkstack.apishim.common.BluetoothPanShim.TetheredInterfaceCallbackShim; import com.android.networkstack.apishim.common.BluetoothPanShim.TetheredInterfaceRequestShim;