mirror of
https://github.com/espressif/openthread.git
synced 2026-08-14 06:37:46 +00:00
[dua] add IsDomainUnicast() helper method (#5230)
This commit is contained in:
@@ -288,6 +288,11 @@ void Leader::UpdateDomainPrefixConfig(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
bool Leader::IsDomainUnicast(const Ip6::Address &aAddress) const
|
||||
{
|
||||
return HasDomainPrefix() && aAddress.PrefixMatch(mDomainPrefix.mPrefix) >= mDomainPrefix.mLength;
|
||||
}
|
||||
|
||||
} // namespace BackboneRouter
|
||||
} // namespace ot
|
||||
|
||||
|
||||
@@ -152,6 +152,17 @@ public:
|
||||
*/
|
||||
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:
|
||||
void UpdateBackboneRouterPrimary(void);
|
||||
void UpdateDomainPrefixConfig(void);
|
||||
|
||||
Reference in New Issue
Block a user