mdns may be imported in other non-AOSP projects as a library, along with
its dependencies from net-utils-device-common. While all of
net-utils-device-common may not build against system API, this requires
the files used by mdns to build against system API.
Add a library to allow checking that the dependencies can still build
against system API.
Test: m
Bug: 272392042
Change-Id: I468f53b47ef55c23137594a79599b148084f4535
Since it just came up again, and I just verified this still works
Test: N/A
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I292c94cf9af63488ed30a6ac367ac83c8912e97e
Currently, the test http server will respond whenever
http request is read, no matter how much data was declared
in the Content-Length header. For tests that uses POST
request to test uplink traffic this is not good enough.
Invoke parseBody to read data from input stream to make
sure the http body is read.
Test: atest android.net.NetworkStatsIntegrationTest \
--rerun-until-failure 100
Bug: 139774492
Change-Id: I1b71f3e55747d104e4a8796611517d93f178321f
For testing purposes, a TestNetworkInterface provides a
FileDescriptor which allows content injection on the test
network. However, this could be hard to use because the
callers need to compose IP packets in order to inject
content to the test network.
In order to remove the need of composing the IP packets,
this class forwards IP packets between two
TestNetworkInterface instances. Thus, the TCP/IP headers
could be parsed/composed automatically by the protocol stack of
this additional TestNetworkInterface, while the payload is
supplied by the servers run on the interface.
Test: 1. atest android.net.NetworkStatsIntegrationTest
2. atest com.android.cts.net.HostsideVpnTests
Bug: 139774492
Change-Id: I8fe5a434d6d727a81d106a967dcdca157424e12e
StructInetDiagMsg#parse used absolute position to parse id and idiag_uid
fields.
This causes an issue when byte buffer contains multiple netlink messages
and parsed netlink message starts from the middle of byte buffer.
This CL fixes above issue and adds test for the case that single byte
buffer contains multiple netlink messages.
Test: atest NetworkStaticLibTests
Change-Id: I771daf17b4a606915d5edefd9f0e90ef01abf168
NLM_F_REPLACE is helpful when we only want to update the preferred and
valid lifetime for a specific IPv6 address. DHCPv6 prefix delegation
gives a concrete example, once client refreshes the delegated prefix
successfully in RENEW or REBIND state, it also needs to extend the
preferred and valid lifetime of an IPv6 address, otherwise, it becomes
depreacated when the lifetime expires. Add the NLM_F_REPLACE flag to
replace the existing matching address object with updated fields.
Bug: 260934173
Test: atest NetworkStaticLibsTests
Change-Id: Ic001ddf9cfb031a586bbe177819e7666eaf7cde0
This is also needed by integration test in NetworkStack module
in follow-up CLs. Move to a common place first.
This is a no-op refactoring.
Test: atest com.android.cts.net.HostsideVpnTests
Bug: 139774492
Change-Id: Ifc7ed4c93edfb0f6f8eb47231f6df40332d2c10c
main change is checksum of zero buffer is now 0 instead of
the equivalent, but technically incorrect 0xFFFF.
Test: TreeHugger
Bug: 265591307
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I1a8b0ace704009f82d3b7ad1c299bf8a6d8964d8
Adds constructors for RtNetlinkAddressMessage and StructIfaddrMsg to
make it possible to directly construct RtNetlinkAddressMessage in the
test cases.
Bug: 267980538
Test: m
Change-Id: I21bf0cbef888495dc9a165a0fe6d5b39135e4c18
This method is better removed, because it doesn't follow the
naming conventions we want to keep in this file. It also isn't
useful :
• There is only one use of it outside tests, and it's in the
same file. It's trivial to inline it.
• The method has a unit test, which becomes useless once the
method is inlined.
• There is a corresponding command in the interpreter, but it's
only used by the unit test and therefore can be removed once
the unit test is removed.
Test: TH
Bug: 157405399
Change-Id: Ib5b1369ac28e4577adc98204e42ff2f27729e64c
This is no longer used and is advantageously replaced
by a call to poll(), which has the same semantics.
Test: TH
Bug: 157405399
Change-Id: I3182fd3e3ac749e11a8f962ef1acfdca5d031b05
This is not useful because it has the exact same semantics
as poll() : it returns the first event that matches the
predicate within the timeout, or null if none.
Unfortunately the method can't be removed until all
uses in internal master are removed, so the actual
removal will have to wait for the next patch.
Test: TH
Bug: 157405399
Change-Id: I471c44568e359f8686dcb21ae04c76ca8095f02f
(and a few minor cleanups while at it)
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I657c3314fb0ad2519dc4d1b0743e1be6a81a887a
Adding a class that has maintains no-op implementation for all methods
in INetdEventListener to allow extending in a compatible way across
projects
Test: Builds, boots
Bug: 265742148
Change-Id: I46327d78a3685848e06f7a369e238d2952410296