aboutsummaryrefslogtreecommitdiff
path: root/src/agent
AgeCommit message (Collapse)Author
2022-07-26[infra-netif] select infrastructure link among multiple candidates (#1353)Simon Lin
This commit implements a general Infrastructure Link Selection that allows otbr-agent to select one network interface among multiple network interface candidates (specified by multiple `-B` arguments) as the infrastructure link. The Infrastructure Link Selection uses following rules: - The network link in the most usable state is selected - Prefer `up and running` to `up` - Prefer `up` to `down` - Prefer `down` to `invalid` - Once an interface is selected, it's preferred if either is true: - The interface is still `up and running` - No other interface is `up and running` - The interface has been `up and running` within last 10 seconds `otbr-agent` uses Infrastructure Link Selection to select the correct infrastructure link: - Run Infrastructure Link Selection when started to select the infrastructure link - Run Infrastructure Link Selection when network interface states change is detected. otbr-agent would quit if a different infrastructure link is selected, expecting the system to restart it to use the new infrastructure link. Note: - The Infrastructure Link Selection mechanism is effectively disabled if less than two infrastructure link names are specified. - The current implementation only works for Linux platforms.
2022-06-27[dbus] add D-BUS API `GetMdnsInfo` (#1400)whd
2022-06-09[agent] add command-line arg to disable auto attach (#1402)jinran-google
2022-05-24[agent] remove potential data race on `sShouldTerminate` (#1383)Simon Lin
This commit remove potential data race on `sShouldTerminate`, which is accessed in both main loop and the signal handler.
2022-05-09[agent] refine booting logs (#1365)Simon Lin
Use `NOTE` log level instead of `INFO` since the log information is important.
2022-05-01[platform] de-init application in `otPlatReset` and verify `Publisher` state ↵whd
in public methods (#1339) When `otPlatReset` is called on `otbr-agent`, it should de-init the old `otbr::Application` so that the resources will be properly disposed, otherwise there will be dangling resources. Also, `otbr::Application` should de-init the TREL module when itself is de-initing. One example is that if we call `ot-ctl factoryreset`, the old `otbr::Application` won't be destructed so that the publisher will keep the old mDNS service registrations until the process exits. In such a situation, there will be two different MeshCoP services published by the same `otbr-agent` process. Also, this commit adds a verification at `Publisher` public methods to ensure that `Publisher` is at `kReady` state.
2022-04-06[agent] remove `InstanceParams` class (#1325)Simon Lin
This commit removes the `InstanceParams` to make the code more clean.
2022-03-09[cmake] add `OTBR_NOTIFY_UPSTART` option (#1290)Simon Lin
2022-01-25[certification] disable auto Thread attaching for Reference Device (#1217)Simon Lin
This commit enhances `OTBR_NO_AUTO_ATTACH` option to disable auto Thread attaching for Reference Device: - Use `-DOTBR_NO_AUTO_ATTACH=1` to disable auto Thread attaching
2022-01-21[agent] notify service manager when ready (#1186)Yakun Xu
This commit notifies service managers(systemd or upstart(ChromeOS)) that Thread service is ready. This commit also enhances systemd unit file so that otbr-agent will depends on d-bus socket unit.
2022-01-18[agent] de-initialize `Application` and OpenThread instance (#1183)Simon Lin
Background: - OpenThread Instance was the last member to destruct in Application, and otSysDeinit will be called when destructing OpenThread Instance. However, otSysDeinit may call methods of other Application members, which have been destructed at the moment. This commit introduces the Deinit() method to ControllerOpenThread and other classes to make sure OpenThread are properly de-initialized before destructing Application. The advantages are: - ControllerOpenThread initializes OT instance in Init, so adding Deinit makes it symmetrical with Init. - Provide a predictable runtime environment (Application object fully constructed) for OT instance from otSysInit to otSysDeinit, making sure OT can safely access Application members during its lifetime.
2022-01-05[agent] refactor radio version printing (#1173)Simon Lin
This commit refactors radio version printing: - Use a dedicated function for printing radio version. - Make `ControllerOpenThread` a member of `Application` so that `Application` is always properly constructed before initializing OpenThread instances.
2022-01-03[utils] add `NonCopyable` (#1177)Simon Lin
This commit uses `NonCopyable` to make sure certain objects are never copied.
2021-12-15[border-agent] make border agent feature configurable (#1150)Kangping
The Thread Border Agent feature is for advertising the MeshCoP mDNS service (i.e. `_meshcop._udp`). There may be cases this function is not supported, so making it optional.
2021-12-14[main] add `Application` class (#1146)Simon Lin
This commit adds the `Application` class for better managing different program components.
2021-12-08[border-router] start mDNS daemon before starting otbr-agent (#1141)whd
This commit updates the .service file to start the mDNS daemon before starting otbr-agent.
2021-11-30[agent] set dry-run option in Thread config if printRadioVersion is true (#1028)Li Cao
`otbr-agent` will exit directly if `--radio-version` is passed in parameters. This PR sets the DryRun option in PosixConfig when `radio-version` is set. In this way, the posix instance will only initialize very few things to avoid permission issues.
2021-11-26[utils] cleanup useless agent_instance.hpp (#1116)Kangping
2021-11-04[docs] unify spaces in documentations (#1074)kangping
This commit unifies the spaces: - Use 1 space after tags (e.g. @param @returns). - Use 2 spaces between the parameter/retval and comment. - Capitalizing the first char of the param and return value comment.
2021-10-25[build] rename the macro OPENTHREAD_ENABLE_ANDROID_PROPERTY (#1061)Zhanglong Xia
This commit renames the macro name OPENTHREAD_ENABLE_ANDROID_PROPERTY to OTBR_CONFIG_ANDROID_PROPERTY_ENABLE and declares the variabe `aInstance` as a unused variable to avoid compile error.
2021-10-20[common] add mainloop manager (#1044)Zhanglong Xia
This commit adds a mainloop manager to manage all mainloop processors. This commit also adds a class `br::vendor::VendorServer` to allow other users to implement their server in otbr-agent.
2021-10-18[android] set the default log level based on the properity ro.build.type (#1048)Zhanglong Xia
2021-10-12[build] refactor ot-br-agent (#1025)Jiaming Wang
Added library otbr-border-agent and otbr-sdp-proxy. Functionality of ot-br-posix remains unchanged.
2021-10-04[advertising-proxy] harden duplicate SRP update handling (#1020)Damian Królik
Currently, handlers called after completing an asynchronous update of a DNS host or service simply decrement the number of outstanding operations. It may lead to incorrect handling of several SRP updates related to a single host, sent within a short period of time, such as the ones below: UPDATE1: EXISTING_HOST SERVICE1 UPDATE2: EXISTING_HOST SERVICE1 It may happen that both UPDATE1.EXISTING_HOST and UPDATE2.EXISTING_HOST decrement the number of outstanding operations for UPDATE1 and UPDATE1 is considered completed even before UPDATE1.EXISTING_HOST.SERVICE1 is published. Moreover, since the handlers can be called synchronously in certain scenarios, it may occur that an update object is released before PublishHostAndItsServices() exits which may lead to accessing an invalid memory location. Make sure that the handlers are called in the main loop. Due the the mentioned problems, an SRP client may not receive a response for UPDATE2 and keep re-sending the same update. Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
2021-09-20[logging] fix OpenThread dynamic logging (#1016)kangping
OTBR is providing custom otPlatLog function which overwrites the default posix logging function. The problem is that the OTBR otPlatLog function will filter out logs based on current OTBR log level, this will result in the situation that we cannot print more OT logs with command ot-ctl log level <level-value> (when dynamic logging is enabled).
2021-09-17Revert "[advertising-proxy] handle duplicate hosts/services in SRP updates ↵Simon Lin
(#1008)" (#1014) This reverts commit 685a1e0f483febc26127c8c2f2bd8f922b682a06.
2021-09-10[advertising-proxy] handle duplicate hosts/services in SRP updates (#1008)Simon Lin
This commit fixes a bug that Advertising Proxy failed to handle duplicate hosts and services in multiple outstanding SRP updates.
2021-09-08[crypto] update otThreadGetNetworkKey and otThreadGetPskc usage (#992)hemanth-silabs
To align with ARM PSA changes.
2021-08-12[mdns] rename "MDNS" to "mDNS" (#960)kangping
Per RFC 6762, the name should be "mDNS".
2021-08-12[agent] fix initialization issue for openthread#6886 (#954)Simon Lin
2021-08-05[border-agent] name meshcop service after "VendorName_ProductName" (#946)whd
The recommended format of service instance is VendorName ProductName._meshcop._udp_.local.. However, it's quite tricky to handle the space in service name properly. Also, the space in the name will be converted to \032 after the registration, which is not a very elegant form. Therefore, set VendorName_ProductName._meshcop._udp_.local. as the default service name.
2021-07-12[dns-sd] support service subtypes in advertising proxy (#922)Damian Królik
After recent changes in the SRP client & server SRP services can now have a base DNS type (such as _meshcop._udp) or a subtype such as _subtype1._sub._meshcop._udp. * Make advertising-proxy group the services by the base type and pass a list of the subtype labels to the DNS publisher. * Update both the mDNSResponder and Avahi implementations so that it is possible publish a services with additional subtypes and to update the subtypes. * Add unit tests.
2021-07-06[adproxy] erase outstanding updates before notifying the SRP server (#918)kangping
2021-06-21[adproxy] re-register all services when the mDNS publisher becomes ready (#888)whd
When mDNS daemon restarts, the mDNS library may need to re-advertise all hosts and services. This commit extracts this functionality and makes it a public method. Also, on kReady, SRP server will publish all registered hosts and services. This is helpful when the advertising proxy reconnects to the mDNS provider.
2021-06-16[network-key] change name from `master` to `network` (#889)Jonathan Hui
2021-06-07[dns] fix potential discovery proxy crash (#867)Simon Lin
This commit fixes potential Discovery Proxy crash when the mDNS implementation replied with an empty host name.
2021-05-20[dnssd] use queries in dns-sd server rather than local map (#841)Jiacheng Guo
The newly introduces `otDnssdGetQuery` apis allows platform implementations to use the queries stored in the dns-sd server. Remove the local map to reduce complexity.
2021-05-20[dnssd] fix printing string after its destruction (#857)whd
2021-05-12[dbus] use pseudo reset in DBus APIs (#845)jinran-google
2021-05-05[trel] enable TREL by default (#803)Simon Lin
2021-04-30[dns] handle instance names with dots (#783)Simon Lin
2021-04-29[logging] add the log tag to the logging APIs (#746)Zhanglong Xia
2021-04-21[border-agent] make pretty (#806)Jonathan Hui
2021-04-20[border-agent] use dynamic port (#792)Yakun Xu
2021-04-10[advertising-proxy] replace SRP Host pointer with service update ID (#774)kangping
2021-04-08[dnssd] implement DNS-SD Discovery Proxy (#706)Simon Lin
This commit implements DNS-SD Discovery Proxy (RFC 8766) over mDNSResponder.
2021-04-05[dbus] add "Detach" API (#767)jinran-google
2021-03-21[agent] print thread version at start (#743)kangping
2021-03-19[agent] remove CLI initialization (#722)Yakun Xu
2021-03-17[border-agent] advertise more meshcop service TXT entries (#721)kangping
This commit refactors the Border Agent module to advertise the full list of TXT entries of the _meshcop._udp mDNS service. The event emitter is removed and we rely on the otThreadStateChanged event to notify changes of extended PAN ID, network name and backbone router state.