[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:
Abtin Keshavarzian
2020-07-07 18:02:34 -07:00
committed by GitHub
parent e29143b089
commit eee173af0b
32 changed files with 521 additions and 505 deletions
+4 -1
View File
@@ -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");