* changes:
Support prefix information option parsing in nduser netlink message.
Add PrefixInformation option struct to parse nduser option.
Create IpPrefix in PrefixInformationOption constructor
Patrick Rohrauthored and Gerrit Code Reviewcommited 2024-04-01 18:41:53 +00:00
This is helpful for user space to get the PIO option via netlink message
and check whether the P flag is set or not, this bit flag determines if
we should start DHCPv6 PD process for IPv6 provisioning.
Bug: 315069348
Test: atest NetworkStaticLibTests
Change-Id: Id94b6538c5d88fe43c262ab23c30ccd53c766a62
The constructor is invoked during Struct#parse() at which point we might
as well try to create the IpPrefix object which will be used later. If
this fails for some reason (UnknownHostException or ClassCastException),
the prefix is bogus and should not be used.
Bug: 315069348
Test: TH
Change-Id: I58eda41f98b774fe97389beb1b84e164634a20d3
PrefixInformationOption#build always gives the correct option length and
type, visible constructor is easiler to verify the incorrect parameters
in the test, for example, we will verify the code that parses the PIO
option in RA as a ND user option in netlink message.
Bug: 315069348
Test: TH
Change-Id: I6b88e6718cb873b15936c1f518d357c36c41ffde
* changes:
Make RtNetlinkRouteMessage constructor visible for testing.
Make StructRtMsg constructor visible for testing.
Make NduseroptMessage constructor visible for testing.
Xiao Maauthored and Gerrit Code Reviewcommited 2024-02-08 08:20:49 +00:00
This reverts commit b0f489021b.
Reason for revert: Currently reading trunk stable flag from mainline module is not supported. So reverting the CL to avoid confusion.
Change-Id: I0db04f28f378399aa299b325312a6af7f45d4f67
Motomu Utsumiauthored and Gerrit Code Reviewcommited 2024-02-08 03:06:34 +00:00
Refactor IpClientTest by parsing the netlink message directly instead
of netd callbacks, so we have to initialize a RtNetlinkRouteMessage
instance to trigger IPv4/v6 route updates in the unit test.
Bug: 318764217
Test: atest NetworkStackTests
Change-Id: Icfcc7ade636c89a63d897f4e9246410f6387b3c9
Refactor IpClientTest by parsing the netlink message directly instead
of netd callbacks, so we have to initialize a StructRtMsg instance to
fill in the RtNetlinkRouteMessage constructor.
Bug: 318764217
Test: atest NetworkStackTests
Change-Id: I1481cb8fab29ae94d48fa342ecf2b303a9701a31
Refactor IpClientTest by parsing the netlink message directly instead of
netd callbacks, so we have to initialize an NduseroptMessage instance to
trigger IPv6 RDNSS option update in the unit test.
Bug: 318764217
Test: atest NetworkStackTests
Change-Id: Ic2e8ca0d5e71b73c0dbdc3311e72486af371c899
Pass buffer size to netlinkSocketForProto to allow callers to specify
buffer size. The buffer size is not set if 0 is passed in.
Following callers of netlinkSocketForProto passes SOCKET_RECV_BUFFERSIZE
to keep same behavior as before:
* OffloadHardwareInterface.createConntrackSocket()
* NetlinkUtils.sendOneShotKernelMessage()
* IpSecXfrmController.Dependencies.newNetlinkSocket()
* InetDiagMessage.getConnectionOwnerUid()
Following callers pass 0 to not update the buffer size:
* TunInterfaceController - it uses the socket only for writing
* NetlinkUtils.createNetLinkInetDiagSocket() same behavior as before
Added a SOCKET_DUMP_RECV_BUFFERSIZE of 128k to be used by socket
requesting dump information from kernel:
* NetlinkUtils.getAndProcessNetlinkDumpMessages() - sends dump request
and expecting multiple reply messages.
Bug: 320420453
Test: atest NetworkStaticLibTests
atest FrameworksNetTests
Change-Id: I3dcb76963cf2646eb311602b50ab4e44b8ad3e8f
Usually we can call InterfaceController.setIPv4Address API to add an
IPv4 address on the interface, in fact it ends up calling the native
Netd API which doesn't support setting deprecation/expiration time. In
user space we already have the netlink infra to send RTM_NEWADDR for
IPv6 address, extend the function to support IPv4 as well, then we can
deprecate the Netd API in IpClient.
Bug: 129660498
Test: atest NetworkStaticLibTests
Change-Id: I9fc7ba8d7035e0ed1df8c1f2baef9ec7e1806be3
This commit addresses the review feeback of aosp/2864606
to add a wtf log for unexpected cases.
Bug: 320842025
Test: m
Change-Id: I1581b0e754b74aac72278a0db61d9836618d50b5
This can be used in the integration test to assert if an ARP packet
captured on the tap interface is broadcast or unicast request.
Bug: 315076572
Test: atest NetworkStaticLibTests
Change-Id: I52c0b18bf3fd2b64727912e54c045a8e8405d2f6
This change includes:
1. Refactor the logic in Tethering#dump into utils class.
2. Move the utils class to a common place which could be referenced
from other sub-modules.
3. Add @MonitorThreadLeak annotation to enforce
there is no thread leak problem.
Test: atest FrameworksNetTests NetworkStaticLibTests
Test: atest ConnectivityCoverageTests:com.android.networkstack.tethering.TetheringTest#testDumpTetheringLog
Test: adb shell dumpsys tethering (with hardcoded exception)
Fix: 312669345
Change-Id: Ia6fdfeeec2110afa0ec9e056e9db3843748845c3
This implements a basic border routing test case (ping) and demonstrates a
valid test environment for Thread Border Router test cases.
Later we can add more packet verifications and more test cases.
Bug: 295843010
Test: atest android.net.ThreadBorderRouterTest
Change-Id: Ifb9b6d45539143a227c2bc0ed69b5c3167ef9acd
* changes:
Use NetlinkUtil to process dump messages in InetDiagMessage.
Add mif6ctl struct definition.
Add mf6cctl struct definition.
Add Mrt6Msg struct for multicast routing support.
Add support to dump all multicast routes in NetlinkUtils
Yang Sunauthored and Gerrit Code Reviewcommited 2023-12-25 03:19:12 +00:00
Add nlAttrs parameter to store the remaining attributes data.
As a part of follow-up work from aosp/2354202, the TCP socket
parsing can be done by using existing InetDiagMessage class.
The missing piece in the InetDiagMessage class is the possible
netlink attributes fields that may be appended after an
InetDiagMessage.
Bug: 311119352
Bug: 265877161
Test: atest NetworkStaticLibTests
Change-Id: I9c34166124fd4efba2ab211bfb537ccce5e774a4
This is used to configure interfaces for multicast routing.
Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.structs.StructMif6ctlTest
Change-Id: Ic26cddab2d5a9f90f63b0828c3e133d830aa0db4
This is used to configure multicast routes.
Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.structs.StructMf6cctlTest
Change-Id: I57b36e6678262f48781b70ab77d49b920c7ddca2