[dua] support to specify iid for domain unicast address (#4900)

This commit is contained in:
Rongli Sun
2020-06-09 10:38:13 -07:00
committed by GitHub
parent b28d7c4a45
commit b51d9100e6
15 changed files with 779 additions and 15 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ extern "C" {
* @note This number versions both OpenThread platform and user APIs.
*
*/
#define OPENTHREAD_API_VERSION (2)
#define OPENTHREAD_API_VERSION (3)
/**
* @addtogroup api-instance
+18
View File
@@ -57,6 +57,24 @@ extern "C" {
#define OT_IP6_IID_SIZE 8 ///< Size of an IPv6 Interface Identifier (bytes)
#define OT_IP6_ADDRESS_SIZE 16 ///< Size of an IPv6 address (bytes)
/**
* @struct otIp6InterfaceIdentifier
*
* This structure represents the Interface Identifier of an IPv6 address.
*
*/
OT_TOOL_PACKED_BEGIN
struct otIp6InterfaceIdentifier
{
uint8_t m8[OT_IP6_IID_SIZE]; ///< The Interface Identifier of an IPv6 address.
} OT_TOOL_PACKED_END;
/**
* This structure represents the Interface Identifier of an IPv6 address.
*
*/
typedef struct otIp6InterfaceIdentifier otIp6InterfaceIdentifier;
/**
* @struct otIp6Address
*
+31 -2
View File
@@ -477,7 +477,7 @@ otError otThreadSetNetworkName(otInstance *aInstance, const char *aNetworkName);
/**
* Get the Thread Domain Name.
*
* This function is only availble since Thread 1.2.
* This function is only available since Thread 1.2.
*
* @param[in] aInstance A pointer to an OpenThread instance.
*
@@ -491,7 +491,7 @@ const char *otThreadGetDomainName(otInstance *aInstance);
/**
* Set the Thread Domain Name.
*
* This function is only availble since Thread 1.2.
* This function is only available since Thread 1.2.
* This function succeeds only when Thread protocols are disabled.
*
* @param[in] aInstance A pointer to an OpenThread instance.
@@ -505,6 +505,35 @@ const char *otThreadGetDomainName(otInstance *aInstance);
*/
otError otThreadSetDomainName(otInstance *aInstance, const char *aDomainName);
/**
* Set/Clear the Interface Identifier manually specified for the Thread Domain Unicast Address.
*
* This function is only available since Thread 1.2 when `OPENTHREAD_CONFIG_DUA_ENABLE` is enabled.
*
* @param[in] aInstance A pointer to an OpenThread instance.
* @param[in] aIid A pointer to the Interface Identifier to set or NULL to clear.
*
* @retval OT_ERROR_NONE Successfully set/cleared the Interface Identifier.
* @retval OT_ERROR_INVALID_ARGS The specified Interface Identifier is reserved.
*
* @sa otThreadGetFixedDuaInterfaceIdentifier
*/
otError otThreadSetFixedDuaInterfaceIdentifier(otInstance *aInstance, const otIp6InterfaceIdentifier *aIid);
/**
* Get the Interface Identifier manually specified for the Thread Domain Unicast Address.
*
* This function is only available since Thread 1.2 when `OPENTHREAD_CONFIG_DUA_ENABLE` is enabled.
*
* @param[in] aInstance A pointer to an OpenThread instance.
*
* @returns A pointer to the Interface Identifier which was set manually, or NULL if none was set.
*
* @sa otThreadSetFixedDuaInterfaceIdentifier
*
*/
const otIp6InterfaceIdentifier *otThreadGetFixedDuaInterfaceIdentifier(otInstance *aInstance);
/**
* Get the thrKeySequenceCounter.
*