mirror of
https://github.com/espressif/openthread.git
synced 2026-08-29 13:29:54 +00:00
[net] SRP client implementation (#6038)
This commit adds support for SRP (Service Registration Protocol) client in OpenThread. The implementation allows a user to provide host info (host name and a list of host IPv6 addresses) along with a list of services to be registered with an SRP server. Services and/or host addresses can be added or removed during operation of client. Users can get the list of services and host info and their current state (indicating, for example, if service is registered with server, being registered or being removed, etc). Users can also provide a callback to get notified whenever there is change or an error. When there is a new request (e.g., a new service is added/removed) that requires an update, the SRP client will wait for a short delay before preparing and sending an SRP update message to server. This allows user to provide more changes that are then all sent in the same update message. The implementation handles retries in case of different errors and failures. An exponentially increasing retry wait interval (with configurable min, max, and growth factor) is implemented. The implementation also manages the lease renew time for each service and refreshes (re-registers) services with server before lease is expired. It supports "opportunistic early refresh" mechanism such that when sending an SRP update, the services that are not yet expired but are close, are allowed to refresh early and are included in the SRP update. This helps place more services on the same lease refresh schedule reducing number of messages sent to the SRP server. This behavior (whether to allow early refresh or not, and its related parameters) can be controlled through a set of OT config definitions.
This commit is contained in:
committed by
Jonathan Hui
parent
de62590edb
commit
966baf5e6b
@@ -183,6 +183,9 @@ void Notifier::EmitEvents(void)
|
||||
#if OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE
|
||||
Get<BorderRouter::RoutingManager>().HandleNotifierEvents(events);
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE
|
||||
Get<Srp::Client>().HandleNotifierEvents(events);
|
||||
#endif
|
||||
|
||||
for (ExternalCallback &callback : mExternalCallbacks)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user