Test: verified that when the config is set to `false`, thread won't start up after reboots:
```
➜ main-aosp-2 adb shell ot-ctl state
leader
Done
➜ main-aosp-2 adb reboot
➜ main-aosp-2 adb shell ot-ctl state
/system/bin/sh: ot-ctl: inaccessible or not found
➜ main-aosp-2 adb root
➜ main-aosp-2 adb shell ot-ctl state
disabled
Done
```
Bug: 378587036
Change-Id: I4d1c90ab3121f39219cbaf795879a7ba91db02a3
It's default enabled that it waits for border routing establishment
before starting the SRP server. But there are also use cases where
the user may want to know what are the devices in the Thread network
before actually reach to the devices, or it doesn't depend on border
routing to reach to a Thread device.
Given that, this commit adds the support of starting SRP server
without waiting for border routing by adding a new
Runtime Resource Overlay configuration parameter:
config_thread_srp_server_wait_for_border_routing_enabled
Test: it's difficult to assert on the SRP server starts up timing. But manually verified that the SRP server starts without waiting for the routing manager when the RRO config is flipped:
```
01-09 20:18:35.835 7555 7555 I ot-daemon: [I] RoutingManager: RsSender: Sent RS 1/3
01-09 20:18:35.835 7555 7555 I ot-daemon: [I] RoutingManager: Received RS from fe80:0:0:0:98af:44ff:fe2e:fa80 on infra netif 17
01-09 20:18:35.835 7555 7555 I ot-daemon: [I] RoutingManager: Will evaluate routing policy in 00:00.150 (150 msec)
01-09 20:18:35.926 7555 7555 I ot-daemon: [I] NetDataPublshr: DNS/SRP service - State: Adding -> Added
01-09 20:18:35.926 7555 7555 I ot-daemon: [I] SrpServer-----: Start listening on port 53536
01-09 20:18:35.926 7555 7555 I ot-daemon: [I] NetworkData---: Sent ServerData
01-09 20:18:35.926 7555 7555 I ot-daemon: [I] NetworkData---: Received ServerData
01-09 20:18:35.926 7555 7555 I ot-daemon: [I] NetworkData---: Allocated Service ID = 1
01-09 20:18:35.926 7555 7555 I ot-daemon: [I] NetworkData---: Sent ServerData ack
01-09 20:18:35.926 7555 7555 I ot-daemon: [I] Notifier------: StateChanged (0x00000200) [NetData]
01-09 20:18:35.926 7555 7555 I ot-daemon: [I] Mle-----------: Send Data Response (ff02:0:0:0:0:0:0:1)
01-09 20:18:35.926 7555 7555 I ot-daemon: [I] BbrLeader-----: PBBR state: Unchanged
01-09 20:18:35.926 7555 7555 I ot-daemon: [I] BbrLeader-----: Rloc16:0x8800, seqno:69, delay:5, timeout:3600
01-09 20:18:35.926 7555 7555 I ot-daemon: [I] RoutingManager: Will evaluate routing policy in 00:03.558 (3558 msec)
01-09 20:18:35.926 7555 7555 I ot-daemon: [I] NetDataPublshr: DNS/SRP service (state:Added) in netdata - total:1, preferred:0, desired:2
```
Bug: 378587036
Change-Id: Ib768014f3c44dca89390cec823a1c2acac38ab0d
TestTunNetworkUtils is a centralized place to control the test TUN networks used by integration test. With this we can safely tear down all test networks in `teardown()` instead of tearing down the newly created network in `finally` clause.
Bug: 377640059
Change-Id: I57b34bb2644bd6a5bb73ed1573932f35de657c8f
This CL adds a test case for UDP traffic in InternetAccessTest. The test case verifies that a Thread device can send a UDP message to a UDP echo server and receive a reply.
Bug: 374232259
Change-Id: Id138248f1ed26c1cc5728cc06b42e3223c449125
This class is useful for creating a class that responds to specific type of UDP messages. E.g. DNS server and UDP echo server.
Bug: 356770473
Test: atest ThreadNetworkIntegrationTests:android.net.thread.InternetAccessTest
Change-Id: I6880bb825ac5077d4a73f9d986116c571863e1d8
This CL adds new test cases for verifying the Thread Border Router's
DNS Recursive Resolver feature: The DNS clients resolves google.com
successfully when the feature is enabled.
Bug: 354868095
Test: atest ThreadNetworkIntegrationTests:android.net.thread.InternetAccessTest
Change-Id: I1b021151c6843b30c3f47559ab20dec405af5dea
This CL implements the logic to maintain the NAT64 CIDR at ThreadNetworkControllerService. When NAT64 is enabled, the service needs to request a CIDR via RoutingCoordinatorManager#requestDownstreamAddress(). When NAT64 is disabled, the service needs to release the CIDR via RoutingCoordinatorManager#releaseDownstreamAddress().
Bug: 350699020
Change-Id: I16397fd48c2925efd9d4833a335cf73832b4f4d6
* Renamed TapPacketReader to PollPacketReader to better reflect its
functionality beyond TAP interface interaction.
* The class includes general logic for polling and sending packets to
file descriptors, making it suitable for wider use cases.
Test: TH
Change-Id: Icdf9a9d7ef6f49b589ed9cdbd05159ab95e7e5d9
ot-daemon restarts
This CL tries to fix issue by removing error-prone shortcircuit checks.
The checks skip configuring the ot-daemon if they think the new state
is equal to the old state. However, the old state mainainted in
ThreadNetworkControllerService may be stale which causes issues.
Bug: 372592886
Test: atest ThreadNetworkIntegrationTests
Change-Id: Icab25cf094f8bf33832b4097ab8ee77b54badc6b
This CL turns setConfiguration into a system API, including the
ThreadConfiguration#Builder
and the #setNat64Enabled method.
Bug: 368456504
Change-Id: I0ff2ed81271dcceea295d169a46a02f05aeda5d6
service
This CL implements the ThreadNetworkController#setConfiguration. When
the ThreadNetworkControllerService receives this call, the configuration
is passed to ot-daemon and triggers according OT APIs. On success, the
configuration is persisted to the local storage and triggers
OutcomeReceiver#onSuccess. On failure, it triggers
OutcomeReceiver#onError.
Bug: 368456504
Change-Id: I570ec3fead204cd3b6c05629ef409967245350b8
This CL adds the API for starting/stopping the ephemeral key mode, and
subscribing to the ephemeral key state changes.
Ephemeral key mode is started with a limit amount of time to allow
Thread credential sharing.
Bug: 348323500
Test: atest CtsThreadNetworkTestCases
Change-Id: I540c88ec4668291358fbe87a678d8f9d31a67e54