mirror of
https://github.com/espressif/openthread.git
synced 2026-10-01 21:37:39 +00:00
[dua] add IsDomainUnicast() helper method (#5230)
This commit is contained in:
@@ -288,6 +288,11 @@ void Leader::UpdateDomainPrefixConfig(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Leader::IsDomainUnicast(const Ip6::Address &aAddress) const
|
||||||
|
{
|
||||||
|
return HasDomainPrefix() && aAddress.PrefixMatch(mDomainPrefix.mPrefix) >= mDomainPrefix.mLength;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace BackboneRouter
|
} // namespace BackboneRouter
|
||||||
} // namespace ot
|
} // namespace ot
|
||||||
|
|
||||||
|
|||||||
@@ -152,6 +152,17 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool HasDomainPrefix(void) const { return (mDomainPrefix.mLength > 0); }
|
bool HasDomainPrefix(void) const { return (mDomainPrefix.mLength > 0); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method indicates whether or not the address is a Domain Unicast Address.
|
||||||
|
*
|
||||||
|
* @param[in] aAddress A reference to the address.
|
||||||
|
*
|
||||||
|
* @retval true @p aAddress is a domain unicast address.
|
||||||
|
* @retval false @p aAddress is not a domain unicast address.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
bool IsDomainUnicast(const Ip6::Address &aAddress) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void UpdateBackboneRouterPrimary(void);
|
void UpdateBackboneRouterPrimary(void);
|
||||||
void UpdateDomainPrefixConfig(void);
|
void UpdateDomainPrefixConfig(void);
|
||||||
|
|||||||
Reference in New Issue
Block a user