mirror of
https://github.com/espressif/openthread.git
synced 2026-07-07 04:44:47 +00:00
[tmf] add AnycastLocator module (#6513)
This commit adds a new class `AnycastLocator` which can be used to
locate the closest destination of an anycast IPv6 address (i.e., find
the related mesh local EID and RLOC16). The closest destination is
determined based on the the current routing table and path costs
within the Thread mesh.
The implementation uses a CoAP confirmable post request to a newly
added URI path ("a/yl"). The destination IPv6 address of such as
request message is set to the anycast address to be located. The
receiver of the request message sends a CoAP response which includes
the "Mesh Local EID" and "Thread RLOC16" TLVs.
This commit also adds support this new feature in CLI (adding a new
`locate <anycast-addr>` command).
Finally this commit adds `test_anycast_locator.py` to test behavior of
the new feature.
This commit is contained in:
committed by
GitHub
parent
961fd9ae95
commit
95fa6220d7
@@ -486,4 +486,19 @@ void otThreadRegisterParentResponseCallback(otInstance * aInst
|
||||
AsCoreType(aInstance).Get<Mle::MleRouter>().RegisterParentResponseStatsCallback(aCallback, aContext);
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_TMF_ANYCAST_LOCATOR_ENABLE
|
||||
otError otThreadLocateAnycastDestination(otInstance * aInstance,
|
||||
const otIp6Address * aAnycastAddress,
|
||||
otThreadAnycastLocatorCallback aCallback,
|
||||
void * aContext)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<AnycastLocator>().Locate(AsCoreType(aAnycastAddress), aCallback, aContext);
|
||||
}
|
||||
|
||||
bool otThreadIsAnycastLocateInProgress(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<AnycastLocator>().IsInProgress();
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // OPENTHREAD_FTD || OPENTHREAD_MTD
|
||||
|
||||
Reference in New Issue
Block a user