mirror of
https://github.com/espressif/openthread.git
synced 2026-08-29 21:39:54 +00:00
[ip6-address] update and use Ip6::InterfaceIdentifier class (#5194)
This commit updates `Ip6::InterfaceIdentifier` class adding new helper methods to it (e.g., generate random IID, or convert IID to/from a MAC Extended Address). It also updates the `Ip6::Address` methods (related to getting/setting/checking IID) to use the `Ip6::InterfaceIdentifier` type. The larger change in this commit is to update other core classes and modules (`Lowpan`, `Mle`, `Settings`, 'AddressResolver', `Child`, etc.) to use the `Ip6::InterfaceIdentifier`/`Ip6::Address` type and their new/changed methods. This commit also adds a new `struct` type `otIp6AddressComponents` to the public OT API header `ip6.h`. This type represents the components of a (unicast) IPv6 address, i.e. a network prefix and an IID. The `otIp6Address` uses the new type as one of its `union` representations of an IPv6 address.
This commit is contained in:
@@ -114,7 +114,10 @@ void TestChildIp6Address(void)
|
||||
"fd00:1234::204c:3d7c:98f6:9a1b",
|
||||
};
|
||||
|
||||
const uint8_t meshLocalIid[] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88};
|
||||
const uint8_t meshLocalIidArray[] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88};
|
||||
Ip6::InterfaceIdentifier meshLocalIid;
|
||||
|
||||
meshLocalIid.SetBytes(meshLocalIidArray);
|
||||
|
||||
sInstance = testInitInstance();
|
||||
VerifyOrQuit(sInstance != nullptr, "Null instance");
|
||||
|
||||
Reference in New Issue
Block a user