mirror of
https://github.com/espressif/openthread.git
synced 2026-09-07 17:50:09 +00:00
[api] add API to test whether the IPv6 address is a link local unicast address (#11902)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user