mirror of
https://github.com/espressif/openthread.git
synced 2026-10-11 10:17:35 +00:00
[slaac] add IsEnabled() method and public API otIp6IsSlaacEnabled (#3667)
This commit is contained in:
committed by
Jonathan Hui
parent
ce24abb7bb
commit
cce16b6dda
@@ -522,6 +522,17 @@ bool otIp6IsAddressUnspecified(const otIp6Address *aAddress);
|
|||||||
*/
|
*/
|
||||||
otError otIp6SelectSourceAddress(otInstance *aInstance, otMessageInfo *aMessageInfo);
|
otError otIp6SelectSourceAddress(otInstance *aInstance, otMessageInfo *aMessageInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function indicates whether the SLAAC module is enabled or not.
|
||||||
|
*
|
||||||
|
* This function requires the build-time feature `OPENTHREAD_CONFIG_ENABLE_SLAAC` to be enabled.
|
||||||
|
*
|
||||||
|
* @retval TRUE SLAAC module is enabled.
|
||||||
|
* @retval FALSE SLAAC module is disabled.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
bool otIp6IsSlaacEnabled(otInstance *aInstance);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function enables/disables the SLAAC module.
|
* This function enables/disables the SLAAC module.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -272,6 +272,11 @@ exit:
|
|||||||
|
|
||||||
#if OPENTHREAD_CONFIG_ENABLE_SLAAC
|
#if OPENTHREAD_CONFIG_ENABLE_SLAAC
|
||||||
|
|
||||||
|
bool otIp6IsSlaacEnabled(otInstance *aInstance)
|
||||||
|
{
|
||||||
|
return static_cast<Instance *>(aInstance)->Get<Utils::Slaac>().IsEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
void otIp6SetSlaacEnabled(otInstance *aInstance, bool aEnabled)
|
void otIp6SetSlaacEnabled(otInstance *aInstance, bool aEnabled)
|
||||||
{
|
{
|
||||||
Instance & instance = *static_cast<Instance *>(aInstance);
|
Instance & instance = *static_cast<Instance *>(aInstance);
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* This method enables the SLAAC module.
|
* This method enables the SLAAC module.
|
||||||
*
|
*
|
||||||
* When enabled, new SLAAC addresses are generated and added fron on-mesh prefixes in network data.
|
* When enabled, new SLAAC addresses are generated and added from on-mesh prefixes in network data.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void Enable(void);
|
void Enable(void);
|
||||||
@@ -99,6 +99,15 @@ public:
|
|||||||
*/
|
*/
|
||||||
void Disable(void);
|
void Disable(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method indicates whether SLAAC module is enabled or not.
|
||||||
|
*
|
||||||
|
* @retval TRUE SLAAC module is enabled.
|
||||||
|
* @retval FALSE SLAAC module is disabled.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
bool IsEnabled(void) const { return mEnabled; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This methods sets a SLAAC prefix filter handler.
|
* This methods sets a SLAAC prefix filter handler.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user