[ip6-address] add a type flag to addresses (#5019)

Add a origin flag to addresses so that applications are able to behave
differently on the type of address (System, SLAAC, DHCPv6, Manual).

Bumping OpenThread API version number.

Signed-off-by: Markus Becker <[email protected]>
This commit is contained in:
Markus Becker
2020-06-15 18:24:14 -07:00
committed by GitHub
parent ae4dfca5dd
commit bad53a2e95
12 changed files with 52 additions and 25 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 (4)
#define OPENTHREAD_API_VERSION (5)
/**
* @addtogroup api-instance
+13
View File
@@ -115,6 +115,18 @@ struct otIp6Prefix
*/
typedef struct otIp6Prefix otIp6Prefix;
/**
* IPv6 Address origins
*
*/
enum
{
OT_ADDRESS_ORIGIN_THREAD = 0, ///< Thread assigned address (ALOC, RLOC, MLEID, etc)
OT_ADDRESS_ORIGIN_SLAAC = 1, ///< SLAAC assigned address
OT_ADDRESS_ORIGIN_DHCPV6 = 2, ///< DHCPv6 assigned address
OT_ADDRESS_ORIGIN_MANUAL = 3, ///< Manually assigned address
};
/**
* This structure represents an IPv6 network interface unicast address.
*
@@ -123,6 +135,7 @@ typedef struct otNetifAddress
{
otIp6Address mAddress; ///< The IPv6 unicast address.
uint8_t mPrefixLength; ///< The Prefix length (in bits).
uint8_t mAddressOrigin; ///< The IPv6 address origin.
bool mPreferred : 1; ///< TRUE if the address is preferred, FALSE otherwise.
bool mValid : 1; ///< TRUE if the address is valid, FALSE otherwise.
bool mScopeOverrideValid : 1; ///< TRUE if the mScopeOverride value is valid, FALSE otherwise.