Send SIGTERM with timeout first, if fail, SIGKILL.
Bug: 212345928
Test: connect/disconnect to IPv6 only network and ping 8.8.8.8
repeat 3 times
Change-Id: I5125a3ac7e8ab6d4e8ae7fc7134b8ac8e42ce5dd
ParcelFileDescriptor rely on garbage collection to close handler.
When there is any error during starting clat or quick on/off
IPv6 only network, the file descriptor may not be able to be closed
before next clatStart is called. This may be problematic. For
example, the same v4- tun interface has not closed yet and clatStart
has been called again.
Test: connect/disconnect to IPv6 only network and ping 8.8.8.8
repeat 10 times
Change-Id: I8e1c66206dc221827a039213ecc86d5cbd777dff
provide clatd stop function which stops clatd by pid.
Bug: 212345928
Test: flash and boot
Run "atest ClatCoordinatorTest" in a follow commit.
Change-Id: Icd9c4f9038bf75113fbc5608f213145e58a061d9
launch clatd with the given cli arguments.
Bug: 212345928
Test: flash and boot
- run "atest ClatCoordinatorTest" in a follow commit.
- manual test
1. Connect to ipv6-only wifi.
2. Try IPv4 traffic.
$ ping 8.8.8.8
Change-Id: Ie57a7c7a9d3d77396e91fa9f94c02f1ad05487c1
Two reason for renaming:
1. Avoid module name collision in sc-mainline-prod branch.
2. The libnetdbpf was misnamed before.
Bug: 202086915
Test: atest libnetworkstats_test FrameworksNetTests
ConnectivityCoverageTests FrameworksNetSmokeTests
CtsAppOpsTestCases
Change-Id: I87fcf4b1a9d58780a45743a9aa91b9b936e54266
This CL provides native methods to access BPF maps via a native library.
Bug: 202086915
Test: m; flash; boot;
Change-Id: I2e5d03d0c2e31ba11996d1b28ead9b552397fe29
Delete tagSocket(), privilegedTagSocket() and untagSocket() revelant
test cases since thay are moved out of TrafficController in
aosp/1849156.
Bug: 202086915
Test: atest traffic_controller_unit_test passed
Change-Id: I605577ee4d7076f0c8ad75888a4d32bff90f6104
Remove eBPF offload at clat stopping if possible.
Bug: 212345928
Test: build only
because need to test with clatd launched
Change-Id: I6ace77694c0e6fe68d16e80e3c8198aa41385fd2
Move native functions from ClatdController and TcUtils to libclat
for jni ClatdCoordinator.
Bug: 212345928
Test: atest libclat_test
Change-Id: Ia4b344b07537d57c3e4ff1285b0e7b17e0c63c3e
Tethering module.
Delete tagSocket(), privilegedTagSocket() and untagSocket() since
they are moved out of TrafficController in aosp/1849156.
Bug: 202086915
Test: m; flash; boot;
Change-Id: Ifeaeb060fbf1add9f06748e7846b9e11e0345bda
Delete tagSocket(), privilegedTagSocket() and untagSocket() since
they are moved out of TrafficController in aosp/1849156.
Test: m
Change-Id: I6162c758446f597eb79734e00348dc8b1fe2d422
BpfNetMaps provide interfaces and native methods for
manipulating BPF maps by calling jni library of traffic controller.
DO NOT TOUCH BpfNetMaps before aosp/1945136 and aosp/1948169 get merged.
Bug: 202086915
Test: build and flash
Change-Id: Iaff8ac71100b3f76b444f3b83616556d0ee6eadf
- rename JNI functions with prefix native_*
- throw exception while JNI function gets invalid address argument
- throw exception while JNI function returns invalid address
Bug: 212345928
Test: flash and boot
Run "atest ClatCoordinatorTest" in a followup commit
Change-Id: I6745a61525c6f72a61fbde0b21b3f7abcdf2446a
Update our packet socket filter to reflect the new 464xlat IP address
Bug: 212345928
Test: flash and boot
Run "atest ClatCoordinatorTest" in a followup commit
Change-Id: Ic50dc122731f311ad00ab8bff5472cb3bc41f5f1
Start translating packets to the new prefix.
Bug: 212345928
Test: flash and boot
Run "atest ClatCoordinatorTest" in a followup commit.
Change-Id: I38729c23fce72428919b33ac531ede9593337a0a
Move the raw socket initialization from netd to mainline because
mainline module is going to launch clatd. Need to provide raw
socket for writing local 464xlat IPv6 packets.
Bug: 212345928
Test: flash and boot
Run "atest ClatCoordinatorTest" in a followup commit.
Change-Id: I6d1da4f1b400eeed87771ae8197b0c58ec50804b
Move the packet socket initialization from netd to jni because
mainline module is going to launch clatd. Need to provide packet
socket for reading local 464xlat IPv6 packets.
Bug: 212345928
Test: flash and boot
Run "atest ClatCoordinatorTest" in a followup commit.
Change-Id: I1cef6e099403f883d668081fb5e917863f5a3c2a
Apply mtu and selected IPv4 address to tun interface.
Then, bring up the tun interface.
Bug: 212345928
Test: flash and boot
Run "atest ClatCoordinatorTest" in a followup commit.
Change-Id: I24a2a91e2b084be28820a7a63b265c5f56293334
Detect the available mtu for clat. The native mtu detect function
is moved from netd to libclat which is called by jni. The java
adjust mtu function is moved from netd native code.
Bug: 212345928
Test: flash and boot
Run "atest ClatCoordinatorTest" in a followup commit.
Change-Id: Icf5f57c7e7b947997b76152722e46acdd9d95c1a
Open the v4-... tun interface for clat. The native function
is moved from netd to jni.
Bug: 212345928
Test: flash and boot
Run "atest ClatCoordinatorTest" in a followup commit.
Change-Id: I3f3c587275125ce3fc7481006947211f17dbb2d4
Select a local 464xlat IPv6 address for clatd. The IPv6 address has
checksum-neutral IID. The native function is moved from netd to
libclat. Its test is moved from netd as well.
Bug: 212345928
Test: flash and boot
Run "atest ClatCoordinatorTest" in a followup commit.
Change-Id: I11520e5c086e475999847d829dd6341b14199b39
Introduce ClatCoordinator to replace netd/ClatdController.
This is a startup commit. Starting clatd needs to prepare local
464xlat ipv4 address, local 464xlat ipv6 address, tun interface,
clat read/write sockets. These will be implemented from this
and followup commits. This commit implements that prepare local
464xlat ipv4 address.
Bug: 212345928
Test: flash and boot
Run "atest ClatCoordinatorTest" in a followup commit.
Change-Id: I486db8aef0181ee1aedd7cd7702f95d5a1cef812
configure_packet_socket() is moved from ClatdController. Only change
the failure return value from errno to -errno. The remaining parts
are the same.
The test is modified from ClatdControllerTest::ConfigureIpv6Address.
Simply set socket filter to an interface and check that the packet
socket is bound to the interface. We can't check the socket filter
because there is no way to fetch it from the kernel.
Bug: 212345928
Test: build and boot
atest libclat_test
Change-Id: Ia33c21051b040829c7d2aa55ed5b7de8766c98c5
detect_mtu() is moved from ClatdController without behavior
change. The unique_fd for socket fd is replaced by primitive int
because libbase is not supported in mainline.
Bug: 212345928
Test: build and boot
atest libclat_test
Change-Id: Ib9c1a9d4b9e1c141d88164e8489c5044fdf70685
isIpv4AddressFree() is moved from ClatdController without behavior
change.
selectIpv4Address() and its test are moved from ClatdController as well.
They have been refactored slightly for testing because function pointer
of isIpv4AddressFreeFunc is not a global variable anymore. We can't set
global function pointer to change selectIpv4Address() behavior for
testing. Instead isIpv4AddressFree is sent as an argument of function
pointer. For public caller, selectIpv4Address() has no behavior change.
For test caller, they can call an internal selectIpv4AddressInternal
(.., fn) to change isIpv4AddrFreeFn function pointer for testing.
Bug: 212345928
Test: build and boot
atest libclat_test
Change-Id: Iab5e6fd5ebbccf10e7b3be2251b45949cf3f3464
generateIpv6Address() is moved from ClatdController without behavior
change. The unique_fd for socket fd is replaced by primitive int
because libbase is not supported in mainline.
Bug: 212345928
Test: build and boot
atest libclat_test
Change-Id: I42e152e6fe3ad577a0274e1d55e737318f61176d
Introduce the library libclat to implement clat functions for jni.
It is helpful for unit test.
makeChecksumNeutral() and its test are moved from ClatdController
without behavior change.
Bug: 212345928
Test: build and boot
atest libclat_test
Change-Id: I1c0981d98141fc1cc07b2d3a0f3cbddf38683ff3
This CL should be reverted before T sdk finalized.
This API is temporary added for the NetworkStatsFactory which is platform
code but will be moved into connectivity (tethering) mainline module.
Bug: 209935649
Test: atest CtsHostsideNetworkTests
Change-Id: I5894450f3089b2ea105722a18ddf8f1eed1c28a0
To deprecated firewallReplaceUidChain netd binder and move the
functionality to tethering (connectivity) mainline module, expose
replaceFirewallChain to support the caller outside the module.
Currently the API are still call to netd. Will replace with the
implementation inside tethering (connectivity) module.
Bug: 209935649
Test: atest CtsHostsideNetworkTests
Change-Id: If7a87548b0a3acda00a1455da4e4ff24a630ddc7
To deprecated firewallEnableChildChain netd binder and move the
functionality to tethering (connectivity) mainline module, expose
setFirewallChainEnabled to support the caller outside the module.
Currently the API are still call to netd. Will replace with the
implementation inside tethering (connectivity) module.
Bug: 209935649
Test: atest CtsHostsideNetworkTests
Change-Id: I9b64c9d12260521489a87fbeae5afbee2a8ea8f6