mirror of
https://github.com/espressif/openthread.git
synced 2026-08-05 18:37:45 +00:00
[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:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user