[api] add API to extract an extended address from an IPv6 address (#11933)

The application of the P2P module may only record the P2P peer's
link-local address for communication. This commit adds an API to
convert the peer's link-local unicast address to the peer's extended
address for tearing down the P2P link.
This commit is contained in:
Zhanglong Xia
2025-10-27 09:26:31 -07:00
committed by GitHub
parent 35cacd6d5f
commit 317321fef2
3 changed files with 14 additions and 1 deletions
+5
View File
@@ -178,6 +178,11 @@ void otIp6FormLinkLocalAddressFromExtAddress(const otExtAddress *aExtAddress, ot
AsCoreType(aAddress).SetToLinkLocalAddress(AsCoreType(aExtAddress));
}
void otIp6ExtractExtAddressFromIp6AddressIid(const otIp6Address *aAddress, otExtAddress *aExtAddress)
{
AsCoreType(aExtAddress).SetFromIid(AsCoreType(aAddress).GetIid());
}
bool otIp6ArePrefixesEqual(const otIp6Prefix *aFirst, const otIp6Prefix *aSecond)
{
return AsCoreType(aFirst) == AsCoreType(aSecond);