[api] add API to test whether the IPv6 address is a link local unicast address (#11902)

This commit is contained in:
Zhanglong Xia
2025-09-12 20:42:14 -07:00
committed by GitHub
parent bddd77d803
commit 19898c72a0
3 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ extern "C" {
*
* @note This number versions both OpenThread platform and user APIs.
*/
#define OPENTHREAD_API_VERSION (535)
#define OPENTHREAD_API_VERSION (536)
/**
* @addtogroup api-instance
+10
View File
@@ -556,6 +556,16 @@ const uint16_t *otIp6GetUnsecurePorts(otInstance *aInstance, uint8_t *aNumEntrie
*/
bool otIp6IsAddressEqual(const otIp6Address *aFirst, const otIp6Address *aSecond);
/**
* Test whether or not the IPv6 address is a link-local unicast address.
*
* @param[in] aAddress A pointer to the IPv6 address to test.
*
* @retval TRUE If the IPv6 address is a link-local unicast address.
* @retval FALSE If the IPv6 address is not a link-local unicast address.
*/
bool otIp6IsLinkLocalUnicast(const otIp6Address *aAddress);
/**
* Test if two IPv6 prefixes are the same.
*
+2
View File
@@ -171,6 +171,8 @@ bool otIp6IsAddressEqual(const otIp6Address *aFirst, const otIp6Address *aSecond
return AsCoreType(aFirst) == AsCoreType(aSecond);
}
bool otIp6IsLinkLocalUnicast(const otIp6Address *aAddress) { return AsCoreType(aAddress).IsLinkLocalUnicast(); }
bool otIp6ArePrefixesEqual(const otIp6Prefix *aFirst, const otIp6Prefix *aSecond)
{
return AsCoreType(aFirst) == AsCoreType(aSecond);