[slaac] simplify adding/removing addresses and other enhancements (#9579)

This commit makes the following smaller enhancements in `Slaac`
class:
- Adds a new `ShouldUseForSlaac()` method to check if a network data
  prefix should be used for SLAAC, checking flags and applying the
  filter if set.
- Introduces separate `RemoveAddresses()` and `AddAddresses()` methods
  to manage SLAAC addresses, replacing the previous `Update()` method.
- Adds helper methods to `RemoveAllAddresses()`, `RemoveAddress()` to
  remove a specific address, and `AddAddressFor(prefix)` to  generate
  and add an address for a given prefix.
- Simplifies `GenerateIid()` by removing unused input parameters.
This commit is contained in:
Abtin Keshavarzian
2023-11-07 12:43:02 -08:00
committed by GitHub
parent 3b30c842a2
commit a05954b01e
3 changed files with 151 additions and 155 deletions
+1 -1
View File
@@ -146,7 +146,7 @@ Error DuaManager::GenerateDomainUnicastAddressIid(void)
Error error;
uint8_t dadCounter = mDadCounter;
if ((error = Get<Utils::Slaac>().GenerateIid(mDomainUnicastAddress, nullptr, 0, &dadCounter)) == kErrorNone)
if ((error = Get<Utils::Slaac>().GenerateIid(mDomainUnicastAddress, dadCounter)) == kErrorNone)
{
if (dadCounter != mDadCounter)
{