mirror of
https://github.com/espressif/openthread.git
synced 2026-07-29 15:17:47 +00:00
[topology] move IsStateValidOrAttaching to Neighbor (#4419)
This commit is contained in:
committed by
Jonathan Hui
parent
636352431f
commit
5fd1083d14
@@ -41,18 +41,7 @@
|
||||
|
||||
namespace ot {
|
||||
|
||||
void Neighbor::GenerateChallenge(void)
|
||||
{
|
||||
Random::Crypto::FillBuffer(mValidPending.mPending.mChallenge, sizeof(mValidPending.mPending.mChallenge));
|
||||
}
|
||||
|
||||
void Child::Clear(void)
|
||||
{
|
||||
memset(reinterpret_cast<void *>(this), 0, sizeof(Child));
|
||||
SetState(kStateInvalid);
|
||||
}
|
||||
|
||||
bool Child::IsStateValidOrAttaching(void) const
|
||||
bool Neighbor::IsStateValidOrAttaching(void) const
|
||||
{
|
||||
bool rval = false;
|
||||
|
||||
@@ -75,6 +64,17 @@ bool Child::IsStateValidOrAttaching(void) const
|
||||
return rval;
|
||||
}
|
||||
|
||||
void Neighbor::GenerateChallenge(void)
|
||||
{
|
||||
Random::Crypto::FillBuffer(mValidPending.mPending.mChallenge, sizeof(mValidPending.mPending.mChallenge));
|
||||
}
|
||||
|
||||
void Child::Clear(void)
|
||||
{
|
||||
memset(reinterpret_cast<void *>(this), 0, sizeof(Child));
|
||||
SetState(kStateInvalid);
|
||||
}
|
||||
|
||||
void Child::ClearIp6Addresses(void)
|
||||
{
|
||||
memset(mMeshLocalIid, 0, sizeof(mMeshLocalIid));
|
||||
|
||||
@@ -157,6 +157,17 @@ public:
|
||||
*/
|
||||
bool IsStateValidOrRestoring(void) const { return (mState == kStateValid) || IsStateRestoring(); }
|
||||
|
||||
/**
|
||||
* This method indicates if the neighbor state is valid, attaching, or restored.
|
||||
*
|
||||
* The states `kStateRestored`, `kStateChildIdRequest`, `kStateChildUpdateRequest`, `kStateValid`, and
|
||||
* `kStateLinkRequest` are considered as valid, attaching, or restored.
|
||||
*
|
||||
* @returns TRUE if the neighbor state is valid, attaching, or restored, FALSE otherwise.
|
||||
*
|
||||
*/
|
||||
bool IsStateValidOrAttaching(void) const;
|
||||
|
||||
/**
|
||||
* This method gets the device mode flags.
|
||||
*
|
||||
@@ -480,17 +491,6 @@ public:
|
||||
*/
|
||||
void Clear(void);
|
||||
|
||||
/**
|
||||
* This method indicates if the child state is valid or being attached or being restored.
|
||||
*
|
||||
* The states `kStateRestored`, `kStateChildIdRequest`, `kStateChildUpdateRequest`, `kStateValid`, (and
|
||||
* `kStateLinkRequest) are considered as attached or being restored.
|
||||
*
|
||||
* @returns TRUE if the child is attached or being restored.
|
||||
*
|
||||
*/
|
||||
bool IsStateValidOrAttaching(void) const;
|
||||
|
||||
/**
|
||||
* This method clears the IPv6 address list for the child.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user