This will typically be used in mainline-presubmit TEST_MAPPING
configuration to exclude some tests.
This is necessary as some tests are flaky in mainline configurations
(when running on older devices), and they need to be disabled to meet
SLO requirements, but they are not flaky on presubmit using the latest
platform builds.
Test: m
Change-Id: Ia532d6d3f9833ddec613d79c0eb517d20a1c529a
Both encode and deocde methods support message compression which is
described in RFC1035 section 4.1.4. We can leverage both methods in
a follow-up CL to parse DHCPv4 option 119 and DNSSL RA option.
This cl also adds maxLabelCount argument for DnsRecordParser#parseName
to prevent the potential recursion from overflowing the stack.
Bug: 189865016
Test: atest NetworkStaticLibTests
Change-Id: I90101ecda64bfecb0233e80ea93c91c204fbf176
This structure is useful when building an RA with RIO for integration
tests and verify the device's provisioning behavior, for example, check
if devices in ULA networks can recover its IPv6 connectivity from
receiving a normal RA after losing IPv6 default route (e.g. received RA
with zero router lifetime).
Bug: 183601771
Test: m
Change-Id: I13b85000ea1633f56edc74e3d62b7a38b9a851bf
Example use case:
BPF_LOAD_SKB_PROTOCOL,
BPF2_ACCEPT_IF_EQUAL(ETH_P_ARP),
BPF2_REJECT_IF_NOT_EQUAL(ETH_P_IP),
BPF_LOAD_IPV4_BE16(frag_off),
BPF2_REJECT_IF_ANY_BITS_SET(IP_MF | IP_OFFMASK),
BPF_ACCEPT,
which is a sample program which accepts ARP plus non-fragmented IPv4.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ibe6f9f7941f11bc7b767a092d3d108fa0291f360
ticksToMilliSeconds is used to convert the clock ticks to milliseconds,
move it to a common utils class, we can call this method to convert the
rta_cacheinfo.rta_expires in user space as well to get when the default
route will expire.
Bug: 183601771
Test: atest NetworkStaticLibTests
Change-Id: Iabd510fe290f835a8fe690d91921d5b706a23b56
Parse the entire RTM_NEWADDR message instead of only parsing the nlmsg
header and Ifaddr header. Besides, that would be better to know which IP
address will be returned from kernel via netlink message, that's IPv4
and IPv6 loopback addresses.
Test: atest NetworkStaticLibTests
Change-Id: I3a01137db4a7774fa30ebdec5a1711697991b9fe
Both encode and deocde methods support message compression which is
described in RFC1035 section 4.1.4. We can leverage both methods in
a follow-up CL to parse DHCPv4 option 119 and DNSSL RA option.
This cl also adds maxLabelCount argument for DnsRecordParser#parseName
to prevent the potential recursion from overflowing the stack.
Bug: 189865016
Test: atest NetworkStaticLibTests
Change-Id: I624649c224f141848a475ac85c56012d138c5224
This allows other class to refer StructIfaddrMsg constructor as well,
otherwise, the default visibility is private.
Bug: 263222068
Test: atest NetworkStaticLibTests
Change-Id: If571b014ade51e3387748a4df0abcb49b59cb462
This annotation can be used to mark a test case that requires
the latest resolv module. Tests that don't run with the latest
resolv module (for example CtsNetTestCasesLatestSdk) can exclude
the testcases being flaky due to some known issues in old resolv
module.
Bug: 279846955
Test: TreeHugger
Change-Id: Ie19eed1c4aa17645c4eec45493e7999027a01205
Currently, DnsPacket calls DnsRecord constructor to create
DnsRecord instances from a ByteBuffer. However, invoking
DnsRecord constructor cannot create subclass instances of
DnsRecord.
To fix this, use a factory method to parse DnsRecord. This
factory method will peek the nsType field of the DnsRecord
as an argument, and it will use this field to determine which
subclass of DnsRecord to create.
This change is no-op, because it does not change the
functionality of DnsPacket. However, it does allow subsequent
changes to create subclass instances of DnsRecord in the future.
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.net.module.util.DnsPacketTest
Change-Id: Ibbdeaf6e5a844573f393f05609310658d8d225b3
The one in this file requires libbinder and cannot be used when
libbinder is not present (e.g., when compiling against the NDK).
This allows users of this code not to link against libbinder, and
have the resulting binary not depend on it:
$ m CtsNativeNetPlatformTestCases netd_integration_test
$ objdump -p out/target/product/vsoc_x86_64/testcases/netd_integration_test/x86_64/netd_integration_test64 | grep NEEDED | grep libbinder
NEEDED libbinder.so
NEEDED libbinder_ndk.so
$ objdump -p out/target/product/vsoc_x86_64/testcases/CtsNativeNetPlatformTestCases/x86_64/CtsNativeNetPlatformTestCases64 | grep NEEDED | grep libbinder
NEEDED libbinder_ndk.so
$
Bug: 268440865
Test: see other CL in topic
Merged-In: Icf982675aad4777677a36e357035809fb251d6e9
Change-Id: Icf982675aad4777677a36e357035809fb251d6e9
While at it enforce a min/max of 4 kiB and 256 MiB.
A bpf ringbuffer must be an integer multiple of page size
(which is at least 4kiB), so 4kB is forced.
256 MiB upper limit is probably higher than it should be,
but it's really only here to avoid the u32/s32 conversion
mess that happens for 2+ GiB.
Test: TreeHugger
Bug: 279819914
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I2216d2273b0956a86c4222dd6ecf7293e0bafd41
This allows it to be used from outside this header file,
and provides slightly more type safety.
Test: TreeHugger
Bug: 286369326
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I98e5e37a002188813b602e51fd4fcbb9ca4466cc
Then we can create an IaPrefixOption instance via constructor in the
NetworkStackIntegration test.
Bug: 260934173
Test: atest NetworkStackIntegrationTests
Change-Id: I05be1dde6ba5bda125631674c5c0f8634eb18924
This annotation can be used to exclude the testcases which requires the
latest NetworkStack module in the CTS/MTS suite.
Bug: 283200648
Test: atest CtsTetheringTestLatestSdk
Change-Id: Idaffed93af077c2998081142af7b3bfa311dcd90
The exception is thrown in some normal cases e.g. interrupt()
called when Os.read is blocked and waiting for the input.
Ignore such events.
Test: 1. atest NetworkStackCoverageMtsConfigTests on S device
2. atest com.android.cts.net.HostsideVpnTests
3. atest NetworkStatsIntegrationTest
Bug: 259632210
Change-Id: Ibff41312d9c7431c2b19f780844ab3a81b48f9e8
Change this constant to public so that the implementation of other
type of DNS record, such as SVCB record, can reuse this constant
instead of defining a duplicate one.
Bug: 240259333
Test: TreeHugger
Change-Id: Ic5c6ecfba4d16f19adb3794dd50c5fc876d9f82a
In order to return values from functions that are run on the handler
thread, use a ThrowingSupplier instead of a ThrowingRunnable.
Also maintain the case with ThrowingRunnable by overloading.
Test: NetworkStaticLibTests
Change-Id: Ic1b86f9f764997ce5d6848f04185194a961d1106
destroyLiveTcpSockets APIs are replacement of socketDestroy in
NetdNativeService which has logging for target uids and duration.
Logging them would be useful in debug.
So adding equivalent logging to destroyLiveTcpSockets APIs.
Test: atest com.android.cts.net.HostsideVpnTests#testSocketClosed
Test: atest ConnectivityManagerTest#testFirewallCloseSocketDenylistChainDeny
Bug: 270298713
Change-Id: I347d010541656c92a64029b1474fae601d6e5659