mirror of
https://github.com/espressif/openthread.git
synced 2026-07-29 23:27:46 +00:00
[ip6] rename methods fully initializing an Ip6::Address/Prefix (#13169)
This commit renames several methods in `Ip6::Address`, `Ip6::InterfaceIdentifier`, `Ip6::Prefix`, and `Ip4::Address` that fully initialize the object from `Set...()` to `Init...()`. This creates a clear semantic distinction in the API: - `Init...()`: Fully (re-)initializing the object. - `Set...()`: Modifies a specific property or a sub-component of the object (e.g., `SetPrefix()`, `SetLocator()`, `SetSubnetId()`). Some examples of renames include: - `SetFromExtAddress()` -> `InitFromExtAddress()` - `SetToLocator()` -> `InitAsLocator()` - `SetToLinkLocalAddress()` -> `InitAsLinkLocalAddress()` - `SetToRoutingLocator()` -> `InitAsRoutingLocator()` - `SetToAnycastLocator()` -> `InitAsAnycastLocator()` - `SetToIp4Mapped()` -> `InitAsIp4Mapped()` All calls to these methods across the codebase have been updated to reflect the new names.
This commit is contained in:
@@ -552,7 +552,7 @@ void Mle::ScheduleUnicastAdvertisementTo(const Router &aRouter)
|
||||
{
|
||||
Ip6::Address destination;
|
||||
|
||||
destination.SetToLinkLocalAddress(aRouter.GetExtAddress());
|
||||
destination.InitAsLinkLocalAddress(aRouter.GetExtAddress());
|
||||
mDelayedSender.ScheduleAdvertisement(destination, GenerateRandomDelay(kMaxUnicastAdvertisementDelay));
|
||||
}
|
||||
|
||||
@@ -671,7 +671,7 @@ void Mle::SendLinkRequest(Router *aRouter)
|
||||
SuccessOrExit(error = message->AppendChallengeTlv(challenge));
|
||||
}
|
||||
|
||||
destination.SetToLinkLocalAddress(aRouter->GetExtAddress());
|
||||
destination.InitAsLinkLocalAddress(aRouter->GetExtAddress());
|
||||
aRouter->RestartLinkAcceptTimeout();
|
||||
}
|
||||
|
||||
@@ -870,7 +870,7 @@ Error Mle::SendLinkAccept(const LinkAcceptInfo &aInfo)
|
||||
}
|
||||
#endif
|
||||
|
||||
destination.SetToLinkLocalAddress(aInfo.mExtAddress);
|
||||
destination.InitAsLinkLocalAddress(aInfo.mExtAddress);
|
||||
|
||||
SuccessOrExit(error = message->SendTo(destination));
|
||||
|
||||
@@ -1809,7 +1809,7 @@ void Mle::SendParentResponse(const ParentResponseInfo &aInfo)
|
||||
SuccessOrExit(error = message->AppendConnectivityTlv());
|
||||
SuccessOrExit(error = message->AppendVersionTlv());
|
||||
|
||||
destination.SetToLinkLocalAddress(aInfo.mChildExtAddress);
|
||||
destination.InitAsLinkLocalAddress(aInfo.mChildExtAddress);
|
||||
|
||||
SuccessOrExit(error = message->SendTo(destination));
|
||||
|
||||
@@ -2868,7 +2868,7 @@ Error Mle::SendChildIdResponse(Child &aChild)
|
||||
}
|
||||
#endif
|
||||
|
||||
destination.SetToLinkLocalAddress(aChild.GetExtAddress());
|
||||
destination.InitAsLinkLocalAddress(aChild.GetExtAddress());
|
||||
SuccessOrExit(error = message->SendTo(destination));
|
||||
|
||||
SetChildStateToValid(aChild);
|
||||
@@ -2932,7 +2932,7 @@ Error Mle::SendChildUpdateRequestToChild(Child &aChild)
|
||||
SuccessOrExit(error = message->AppendChallengeTlv(aChild.GetChallenge()));
|
||||
}
|
||||
|
||||
destination.SetToLinkLocalAddress(aChild.GetExtAddress());
|
||||
destination.InitAsLinkLocalAddress(aChild.GetExtAddress());
|
||||
SuccessOrExit(error = message->SendTo(destination));
|
||||
|
||||
if (aChild.IsRxOnWhenIdle())
|
||||
|
||||
Reference in New Issue
Block a user