[mle] rename mesh local address methods to use Rloc and Eid (#10385)

This commit renames the methods for retrieving mesh local addresses to
`GetMeshLocalRloc()` and `GetMeshLocalEid()` (from `GetMeshLocal16()`
and `GetMeshLocal64()`, respectively) to align with the terminology
used in the Thread specification. Member and local variables are also
renamed accordingly.
This commit is contained in:
Abtin Keshavarzian
2024-06-14 10:06:25 -07:00
committed by GitHub
parent cba0f5ca2b
commit 3315c44bb3
17 changed files with 76 additions and 76 deletions
+2 -2
View File
@@ -145,12 +145,12 @@ exit:
const otIp6Address *otThreadGetRloc(otInstance *aInstance)
{
return &AsCoreType(aInstance).Get<Mle::MleRouter>().GetMeshLocal16();
return &AsCoreType(aInstance).Get<Mle::MleRouter>().GetMeshLocalRloc();
}
const otIp6Address *otThreadGetMeshLocalEid(otInstance *aInstance)
{
return &AsCoreType(aInstance).Get<Mle::MleRouter>().GetMeshLocal64();
return &AsCoreType(aInstance).Get<Mle::MleRouter>().GetMeshLocalEid();
}
const otMeshLocalPrefix *otThreadGetMeshLocalPrefix(otInstance *aInstance)
+1 -1
View File
@@ -98,7 +98,7 @@ void otUdpForwardReceive(otInstance *aInstance,
{
Ip6::MessageInfo messageInfo;
messageInfo.SetSockAddr(AsCoreType(aInstance).Get<Mle::MleRouter>().GetMeshLocal16());
messageInfo.SetSockAddr(AsCoreType(aInstance).Get<Mle::MleRouter>().GetMeshLocalRloc());
messageInfo.SetSockPort(aSockPort);
messageInfo.SetPeerAddr(AsCoreType(aPeerAddr));
messageInfo.SetPeerPort(aPeerPort);
+2 -2
View File
@@ -954,7 +954,7 @@ template <> void Commissioner::HandleTmf<kUriRelayRx>(Coap::Message &aMessage, c
aMessage.SetOffset(startOffset);
SuccessOrExit(error = aMessage.SetLength(endOffset));
joinerMessageInfo.SetPeerAddr(Get<Mle::MleRouter>().GetMeshLocal64());
joinerMessageInfo.SetPeerAddr(Get<Mle::MleRouter>().GetMeshLocalEid());
joinerMessageInfo.GetPeerAddr().SetIid(mJoinerIid);
joinerMessageInfo.SetPeerPort(mJoinerPort);
@@ -1048,7 +1048,7 @@ void Commissioner::SendJoinFinalizeResponse(const Coap::Message &aRequest, State
SuccessOrExit(error = Tlv::Append<StateTlv>(*message, aState));
joinerMessageInfo.SetPeerAddr(Get<Mle::MleRouter>().GetMeshLocal64());
joinerMessageInfo.SetPeerAddr(Get<Mle::MleRouter>().GetMeshLocalEid());
joinerMessageInfo.GetPeerAddr().SetIid(mJoinerIid);
joinerMessageInfo.SetPeerPort(mJoinerPort);
+1 -1
View File
@@ -278,7 +278,7 @@ void Client::Solicit(uint16_t aRloc16)
#else
messageInfo.GetPeerAddr().SetToRoutingLocator(Get<Mle::MleRouter>().GetMeshLocalPrefix(), aRloc16);
#endif
messageInfo.SetSockAddr(Get<Mle::MleRouter>().GetMeshLocal16());
messageInfo.SetSockAddr(Get<Mle::MleRouter>().GetMeshLocalRloc());
messageInfo.mPeerPort = kDhcpServerPort;
SuccessOrExit(error = mSocket.SendTo(*message, messageInfo));
+1 -1
View File
@@ -76,7 +76,7 @@ void MplOption::Init(SeedIdLength aSeedIdLength)
void Mpl::InitOption(MplOption &aOption, const Address &aAddress)
{
if (aAddress == Get<Mle::Mle>().GetMeshLocal16())
if (aAddress == Get<Mle::Mle>().GetMeshLocalRloc())
{
// Seed ID can be elided when `aAddress` is RLOC.
aOption.Init(MplOption::kSeedIdLength0);
+8 -8
View File
@@ -528,15 +528,15 @@ bool Client::ShouldUpdateHostAutoAddresses(void) const
{
bool shouldUpdate = false;
uint16_t registeredCount = 0;
Ip6::Netif::UnicastAddress &ml64 = Get<Mle::Mle>().GetMeshLocal64UnicastAddress();
Ip6::Netif::UnicastAddress &mlEid = Get<Mle::Mle>().GetMeshLocalEidUnicastAddress();
VerifyOrExit(mHostInfo.IsAutoAddressEnabled());
// Check all addresses on `ThreadNetif` excluding the mesh local
// EID (`ml64`). If any address should be registered but is not,
// EID (`mlEid`). If any address should be registered but is not,
// or if any address was registered earlier but no longer should
// be, the host information needs to be re-registered to update
// the addresses. If there is no eligible address, then `ml64`
// the addresses. If there is no eligible address, then `mlEid`
// should be registered, so its status is checked. Finally, the
// number of addresses that should be registered is verified
// against the previous value `mAutoHostAddressCount` to handle
@@ -544,7 +544,7 @@ bool Client::ShouldUpdateHostAutoAddresses(void) const
for (const Ip6::Netif::UnicastAddress &unicastAddress : Get<ThreadNetif>().GetUnicastAddresses())
{
if (&unicastAddress == &ml64)
if (&unicastAddress == &mlEid)
{
continue;
}
@@ -562,7 +562,7 @@ bool Client::ShouldUpdateHostAutoAddresses(void) const
if (registeredCount == 0)
{
ExitNow(shouldUpdate = !ml64.mSrpRegistered);
ExitNow(shouldUpdate = !mlEid.mSrpRegistered);
}
shouldUpdate = (registeredCount != mAutoHostAddressCount);
@@ -1350,10 +1350,10 @@ Error Client::AppendHostDescriptionInstruction(Message &aMessage, Info &aInfo)
if (mAutoHostAddressCount == 0)
{
Ip6::Netif::UnicastAddress &ml64 = Get<Mle::Mle>().GetMeshLocal64UnicastAddress();
Ip6::Netif::UnicastAddress &mlEid = Get<Mle::Mle>().GetMeshLocalEidUnicastAddress();
SuccessOrExit(error = AppendAaaaRecord(ml64.GetAddress(), aMessage, aInfo));
ml64.mSrpRegistered = true;
SuccessOrExit(error = AppendAaaaRecord(mlEid.GetAddress(), aMessage, aInfo));
mlEid.mSrpRegistered = true;
mAutoHostAddressCount++;
}
}
+2 -2
View File
@@ -787,7 +787,7 @@ void AddressResolver::HandleTmf<kUriAddressError>(Coap::Message &aMessage, const
for (Ip6::Netif::UnicastAddress &address : Get<ThreadNetif>().GetUnicastAddresses())
{
if (address.GetAddress() == target && Get<Mle::MleRouter>().GetMeshLocal64().GetIid() != meshLocalIid)
if (address.GetAddress() == target && Get<Mle::MleRouter>().GetMeshLocalEid().GetIid() != meshLocalIid)
{
// Target EID matches address and Mesh Local EID differs
#if OPENTHREAD_CONFIG_DUA_ENABLE
@@ -856,7 +856,7 @@ void AddressResolver::HandleTmf<kUriAddressQuery>(Coap::Message &aMessage, const
if (Get<ThreadNetif>().HasUnicastAddress(target))
{
SendAddressQueryResponse(target, Get<Mle::MleRouter>().GetMeshLocal64().GetIid(), nullptr,
SendAddressQueryResponse(target, Get<Mle::MleRouter>().GetMeshLocalEid().GetIid(), nullptr,
aMessageInfo.GetPeerAddr());
ExitNow();
}
+1 -1
View File
@@ -124,7 +124,7 @@ void AnycastLocator::HandleTmf<kUriAnycastLocate>(Coap::Message &aMessage, const
message = Get<Tmf::Agent>().NewResponseMessage(aMessage);
VerifyOrExit(message != nullptr);
SuccessOrExit(Tlv::Append<ThreadMeshLocalEidTlv>(*message, Get<Mle::Mle>().GetMeshLocal64().GetIid()));
SuccessOrExit(Tlv::Append<ThreadMeshLocalEidTlv>(*message, Get<Mle::Mle>().GetMeshLocalEid().GetIid()));
SuccessOrExit(Tlv::Append<ThreadRloc16Tlv>(*message, Get<Mle::Mle>().GetRloc16()));
SuccessOrExit(Get<Tmf::Agent>().SendMessage(*message, aMessageInfo));
+1 -1
View File
@@ -472,7 +472,7 @@ void DuaManager::PerformNextRegistration(void)
{
dua = GetDomainUnicastAddress();
SuccessOrExit(error = Tlv::Append<ThreadTargetTlv>(*message, dua));
SuccessOrExit(error = Tlv::Append<ThreadMeshLocalEidTlv>(*message, mle.GetMeshLocal64().GetIid()));
SuccessOrExit(error = Tlv::Append<ThreadMeshLocalEidTlv>(*message, mle.GetMeshLocalEid().GetIid()));
mDuaState = kRegistering;
mLastRegistrationTime = TimerMilli::GetNow();
}
+1 -1
View File
@@ -654,7 +654,7 @@ void MeshForwarder::SendDestinationUnreachable(uint16_t aMeshSource, const Ip6::
{
Ip6::MessageInfo messageInfo;
messageInfo.GetPeerAddr() = Get<Mle::MleRouter>().GetMeshLocal16();
messageInfo.GetPeerAddr() = Get<Mle::MleRouter>().GetMeshLocalRloc();
messageInfo.GetPeerAddr().GetIid().SetLocator(aMeshSource);
IgnoreError(Get<Ip6::Icmp>().SendError(Ip6::Icmp::Header::kTypeDstUnreach,
+37 -37
View File
@@ -123,15 +123,15 @@ Mle::Mle(Instance &aInstance)
mParentCandidate.Clear();
ResetCounters();
mLinkLocal64.InitAsThreadOrigin();
mLinkLocal64.GetAddress().SetToLinkLocalAddress(Get<Mac::Mac>().GetExtAddress());
mLinkLocalAddress.InitAsThreadOrigin();
mLinkLocalAddress.GetAddress().SetToLinkLocalAddress(Get<Mac::Mac>().GetExtAddress());
mMeshLocal64.InitAsThreadOriginMeshLocal();
mMeshLocal64.GetAddress().GetIid().GenerateRandom();
mMeshLocalEid.InitAsThreadOriginMeshLocal();
mMeshLocalEid.GetAddress().GetIid().GenerateRandom();
mMeshLocal16.InitAsThreadOriginMeshLocal();
mMeshLocal16.GetAddress().GetIid().SetToLocator(0);
mMeshLocal16.mRloc = true;
mMeshLocalRloc.InitAsThreadOriginMeshLocal();
mMeshLocalRloc.GetAddress().GetIid().SetToLocator(0);
mMeshLocalRloc.mRloc = true;
mLinkLocalAllThreadNodes.Clear();
mLinkLocalAllThreadNodes.GetAddress().mFields.m16[0] = BigEndian::HostSwap16(0xff32);
@@ -172,7 +172,7 @@ Error Mle::Disable(void)
Stop(kKeepNetworkDatasets);
SuccessOrExit(error = mSocket.Close());
Get<ThreadNetif>().RemoveUnicastAddress(mLinkLocal64);
Get<ThreadNetif>().RemoveUnicastAddress(mLinkLocalAddress);
exit:
return error;
@@ -193,7 +193,7 @@ Error Mle::Start(StartMode aMode)
SetStateDetached();
Get<ThreadNetif>().AddUnicastAddress(mMeshLocal64);
Get<ThreadNetif>().AddUnicastAddress(mMeshLocalEid);
Get<ThreadNetif>().SubscribeMulticast(mLinkLocalAllThreadNodes);
Get<ThreadNetif>().SubscribeMulticast(mRealmLocalAllThreadNodes);
@@ -246,8 +246,8 @@ void Mle::Stop(StopMode aMode)
SetStateDetached();
Get<ThreadNetif>().UnsubscribeMulticast(mRealmLocalAllThreadNodes);
Get<ThreadNetif>().UnsubscribeMulticast(mLinkLocalAllThreadNodes);
Get<ThreadNetif>().RemoveUnicastAddress(mMeshLocal16);
Get<ThreadNetif>().RemoveUnicastAddress(mMeshLocal64);
Get<ThreadNetif>().RemoveUnicastAddress(mMeshLocalRloc);
Get<ThreadNetif>().RemoveUnicastAddress(mMeshLocalEid);
SetRole(kRoleDisabled);
@@ -405,7 +405,7 @@ void Mle::Restore(void)
}
Get<Mac::Mac>().SetExtAddress(networkInfo.GetExtAddress());
mMeshLocal64.GetAddress().SetIid(networkInfo.GetMeshLocalIid());
mMeshLocalEid.GetAddress().SetIid(networkInfo.GetMeshLocalIid());
if (networkInfo.GetRloc16() == Mac::kShortAddrInvalid)
{
@@ -473,7 +473,7 @@ Error Mle::Store(void)
networkInfo.SetRloc16(GetRloc16());
networkInfo.SetPreviousPartitionId(mLeaderData.GetPartitionId());
networkInfo.SetExtAddress(Get<Mac::Mac>().GetExtAddress());
networkInfo.SetMeshLocalIid(mMeshLocal64.GetAddress().GetIid());
networkInfo.SetMeshLocalIid(mMeshLocalEid.GetAddress().GetIid());
networkInfo.SetVersion(kThreadVersion);
if (IsChild())
@@ -880,9 +880,9 @@ exit:
void Mle::UpdateLinkLocalAddress(void)
{
Get<ThreadNetif>().RemoveUnicastAddress(mLinkLocal64);
mLinkLocal64.GetAddress().GetIid().SetFromExtAddress(Get<Mac::Mac>().GetExtAddress());
Get<ThreadNetif>().AddUnicastAddress(mLinkLocal64);
Get<ThreadNetif>().RemoveUnicastAddress(mLinkLocalAddress);
mLinkLocalAddress.GetAddress().GetIid().SetFromExtAddress(Get<Mac::Mac>().GetExtAddress());
Get<ThreadNetif>().AddUnicastAddress(mLinkLocalAddress);
Get<Notifier>().Signal(kEventThreadLinkLocalAddrChanged);
}
@@ -909,12 +909,12 @@ void Mle::SetMeshLocalPrefix(const Ip6::NetworkPrefix &aMeshLocalPrefix)
// `ApplyNewMeshLocalPrefix()` call, but we apply the new prefix to
// them in case they are not yet added to the `Netif`. This ensures
// that addresses are always updated and other modules can retrieve
// them using methods such as `GetMeshLocal16()`, `GetMeshLocal64()`
// them using methods such as `GetMeshLocalRloc()`, `GetMeshLocalEid()`
// or `GetLinkLocalAllThreadNodesAddress()`, even if they have not
// yet been added to the `Netif`.
mMeshLocal64.GetAddress().SetPrefix(mMeshLocalPrefix);
mMeshLocal16.GetAddress().SetPrefix(mMeshLocalPrefix);
mMeshLocalEid.GetAddress().SetPrefix(mMeshLocalPrefix);
mMeshLocalRloc.GetAddress().SetPrefix(mMeshLocalPrefix);
mLinkLocalAllThreadNodes.GetAddress().SetMulticastNetworkPrefix(mMeshLocalPrefix);
mRealmLocalAllThreadNodes.GetAddress().SetMulticastNetworkPrefix(mMeshLocalPrefix);
@@ -933,9 +933,9 @@ Error Mle::SetMeshLocalIid(const Ip6::InterfaceIdentifier &aMlIid)
{
Error error = kErrorNone;
VerifyOrExit(!Get<ThreadNetif>().HasUnicastAddress(mMeshLocal64), error = kErrorInvalidState);
VerifyOrExit(!Get<ThreadNetif>().HasUnicastAddress(mMeshLocalEid), error = kErrorInvalidState);
mMeshLocal64.GetAddress().SetIid(aMlIid);
mMeshLocalEid.GetAddress().SetIid(aMlIid);
exit:
return error;
}
@@ -950,11 +950,11 @@ void Mle::SetRloc16(uint16_t aRloc16)
LogNote("RLOC16 %04x -> %04x", oldRloc16, aRloc16);
}
if (Get<ThreadNetif>().HasUnicastAddress(mMeshLocal16) &&
(mMeshLocal16.GetAddress().GetIid().GetLocator() != aRloc16))
if (Get<ThreadNetif>().HasUnicastAddress(mMeshLocalRloc) &&
(mMeshLocalRloc.GetAddress().GetIid().GetLocator() != aRloc16))
{
Get<ThreadNetif>().RemoveUnicastAddress(mMeshLocal16);
Get<Tmf::Agent>().ClearRequests(mMeshLocal16.GetAddress());
Get<ThreadNetif>().RemoveUnicastAddress(mMeshLocalRloc);
Get<Tmf::Agent>().ClearRequests(mMeshLocalRloc.GetAddress());
}
Get<Mac::Mac>().SetShortAddress(aRloc16);
@@ -965,8 +965,8 @@ void Mle::SetRloc16(uint16_t aRloc16)
// We can always call `AddUnicastAddress(mMeshLocat16)` and if
// the address is already added, it will perform no action.
mMeshLocal16.GetAddress().GetIid().SetLocator(aRloc16);
Get<ThreadNetif>().AddUnicastAddress(mMeshLocal16);
mMeshLocalRloc.GetAddress().GetIid().SetLocator(aRloc16);
Get<ThreadNetif>().AddUnicastAddress(mMeshLocalRloc);
#if OPENTHREAD_FTD
Get<AddressResolver>().RestartAddressQueries();
#endif
@@ -1016,7 +1016,7 @@ Error Mle::GetLocatorAddress(Ip6::Address &aAddress, uint16_t aLocator) const
VerifyOrExit(GetRloc16() != Mac::kShortAddrInvalid, error = kErrorDetached);
memcpy(&aAddress, &mMeshLocal16.GetAddress(), 14);
memcpy(&aAddress, &mMeshLocalRloc.GetAddress(), 14);
aAddress.GetIid().SetLocator(aLocator);
exit:
@@ -1052,7 +1052,7 @@ bool Mle::HasUnregisteredAddress(void)
for (const Ip6::Netif::UnicastAddress &addr : Get<ThreadNetif>().GetUnicastAddresses())
{
if (!addr.GetAddress().IsLinkLocal() && !IsRoutingLocator(addr.GetAddress()) &&
!IsAnycastLocator(addr.GetAddress()) && addr.GetAddress() != GetMeshLocal64())
!IsAnycastLocator(addr.GetAddress()) && addr.GetAddress() != GetMeshLocalEid())
{
ExitNow(retval = true);
}
@@ -1118,11 +1118,11 @@ void Mle::HandleNotifierEvents(Events aEvents)
if (aEvents.ContainsAny(kEventIp6AddressAdded | kEventIp6AddressRemoved))
{
if (!Get<ThreadNetif>().HasUnicastAddress(mMeshLocal64.GetAddress()))
if (!Get<ThreadNetif>().HasUnicastAddress(mMeshLocalEid.GetAddress()))
{
mMeshLocal64.GetAddress().GetIid().GenerateRandom();
mMeshLocalEid.GetAddress().GetIid().GenerateRandom();
Get<ThreadNetif>().AddUnicastAddress(mMeshLocal64);
Get<ThreadNetif>().AddUnicastAddress(mMeshLocalEid);
Get<Notifier>().Signal(kEventThreadMeshLocalAddrChanged);
}
@@ -3883,8 +3883,8 @@ void Mle::InformPreviousParent(void)
VerifyOrExit((message = Get<Ip6::Ip6>().NewMessage(0)) != nullptr, error = kErrorNoBufs);
SuccessOrExit(error = message->SetLength(0));
messageInfo.SetSockAddr(GetMeshLocal64());
messageInfo.SetPeerAddr(GetMeshLocal16());
messageInfo.SetSockAddr(GetMeshLocalEid());
messageInfo.SetPeerAddr(GetMeshLocalRloc());
messageInfo.GetPeerAddr().GetIid().SetLocator(mPreviousParentRloc);
SuccessOrExit(error = Get<Ip6::Ip6>().SendDatagram(*message, messageInfo, Ip6::kProtoNone));
@@ -4581,7 +4581,7 @@ Error Mle::TxMessage::AppendAddressRegistrationTlv(AddressRegistrationMode aMode
SuccessOrExit(error = Append(tlv));
// Prioritize ML-EID
SuccessOrExit(error = AppendCompressedAddressEntry(kMeshLocalPrefixContextId, Get<Mle>().GetMeshLocal64()));
SuccessOrExit(error = AppendCompressedAddressEntry(kMeshLocalPrefixContextId, Get<Mle>().GetMeshLocalEid()));
// Continue to append the other addresses if not `kAppendMeshLocalOnly` mode
VerifyOrExit(aMode != kAppendMeshLocalOnly);
@@ -4601,7 +4601,7 @@ Error Mle::TxMessage::AppendAddressRegistrationTlv(AddressRegistrationMode aMode
for (const Ip6::Netif::UnicastAddress &addr : Get<ThreadNetif>().GetUnicastAddresses())
{
if (addr.GetAddress().IsLinkLocal() || Get<Mle>().IsRoutingLocator(addr.GetAddress()) ||
Get<Mle>().IsAnycastLocator(addr.GetAddress()) || addr.GetAddress() == Get<Mle>().GetMeshLocal64())
Get<Mle>().IsAnycastLocator(addr.GetAddress()) || addr.GetAddress() == Get<Mle>().GetMeshLocalEid())
{
continue;
}
@@ -4803,7 +4803,7 @@ Error Mle::TxMessage::SendTo(const Ip6::Address &aDestination)
Ip6::MessageInfo messageInfo;
messageInfo.SetPeerAddr(aDestination);
messageInfo.SetSockAddr(Get<Mle>().mLinkLocal64.GetAddress());
messageInfo.SetSockAddr(Get<Mle>().mLinkLocalAddress.GetAddress());
messageInfo.SetPeerPort(kUdpPort);
messageInfo.SetHopLimit(kMleHopLimit);
+11 -11
View File
@@ -390,7 +390,7 @@ public:
* @returns A reference to the Thread link local address.
*
*/
const Ip6::Address &GetLinkLocalAddress(void) const { return mLinkLocal64.GetAddress(); }
const Ip6::Address &GetLinkLocalAddress(void) const { return mLinkLocalAddress.GetAddress(); }
/**
* Updates the link local address.
@@ -516,20 +516,20 @@ public:
uint16_t GetRloc16(void) const { return mRloc16; }
/**
* Returns a reference to the RLOC assigned to the Thread interface.
* Returns the mesh local RLOC IPv6 address assigned to the Thread interface.
*
* @returns A reference to the RLOC assigned to the Thread interface.
* @returns The mesh local RLOC IPv6 address.
*
*/
const Ip6::Address &GetMeshLocal16(void) const { return mMeshLocal16.GetAddress(); }
const Ip6::Address &GetMeshLocalRloc(void) const { return mMeshLocalRloc.GetAddress(); }
/**
* Returns a reference to the ML-EID assigned to the Thread interface.
* Returns the mesh local endpoint identifier (ML-EID) IPv6 address assigned to the Thread interface.
*
* @returns A reference to the ML-EID assigned to the Thread interface.
* @returns The ML-EID address.
*
*/
const Ip6::Address &GetMeshLocal64(void) const { return mMeshLocal64.GetAddress(); }
const Ip6::Address &GetMeshLocalEid(void) const { return mMeshLocalEid.GetAddress(); }
/**
* Returns a reference to the ML-EID as a `Netif::UnicastAddress`.
@@ -537,7 +537,7 @@ public:
* @returns A reference to the ML-EID.
*
*/
Ip6::Netif::UnicastAddress &GetMeshLocal64UnicastAddress(void) { return mMeshLocal64; }
Ip6::Netif::UnicastAddress &GetMeshLocalEidUnicastAddress(void) { return mMeshLocalEid; }
/**
* Returns the Router ID of the Leader.
@@ -1457,9 +1457,9 @@ private:
MsgTxTimer mMessageTransmissionTimer;
DetachGracefullyTimer mDetachGracefullyTimer;
Ip6::NetworkPrefix mMeshLocalPrefix;
Ip6::Netif::UnicastAddress mLinkLocal64;
Ip6::Netif::UnicastAddress mMeshLocal64;
Ip6::Netif::UnicastAddress mMeshLocal16;
Ip6::Netif::UnicastAddress mLinkLocalAddress;
Ip6::Netif::UnicastAddress mMeshLocalEid;
Ip6::Netif::UnicastAddress mMeshLocalRloc;
Ip6::Netif::MulticastAddress mLinkLocalAllThreadNodes;
Ip6::Netif::MulticastAddress mRealmLocalAllThreadNodes;
};
+2 -2
View File
@@ -510,7 +510,7 @@ void Publisher::DnsSrpServiceEntry::PublishUnicast(const Ip6::Address &aAddress,
void Publisher::DnsSrpServiceEntry::PublishUnicast(uint16_t aPort)
{
LogInfo("Publishing DNS/SRP service unicast (ml-eid, port:%d)", aPort);
Publish(Info::InfoUnicast(kTypeUnicastMeshLocalEid, Get<Mle::Mle>().GetMeshLocal64(), aPort));
Publish(Info::InfoUnicast(kTypeUnicastMeshLocalEid, Get<Mle::Mle>().GetMeshLocalEid(), aPort));
}
void Publisher::DnsSrpServiceEntry::Publish(const Info &aInfo)
@@ -546,7 +546,7 @@ void Publisher::DnsSrpServiceEntry::HandleNotifierEvents(Events aEvents)
{
if ((GetType() == kTypeUnicastMeshLocalEid) && aEvents.Contains(kEventThreadMeshLocalAddrChanged))
{
mInfo.SetAddress(Get<Mle::Mle>().GetMeshLocal64());
mInfo.SetAddress(Get<Mle::Mle>().GetMeshLocalEid());
if (GetState() == kAdded)
{
+2 -2
View File
@@ -42,7 +42,7 @@ namespace Tmf {
//----------------------------------------------------------------------------------------------------------------------
// MessageInfo
void MessageInfo::SetSockAddrToRloc(void) { SetSockAddr(Get<Mle::MleRouter>().GetMeshLocal16()); }
void MessageInfo::SetSockAddrToRloc(void) { SetSockAddr(Get<Mle::MleRouter>().GetMeshLocalRloc()); }
Error MessageInfo::SetSockAddrToRlocPeerAddrToLeaderAloc(void)
{
@@ -65,7 +65,7 @@ void MessageInfo::SetSockAddrToRlocPeerAddrToRealmLocalAllRoutersMulticast(void)
void MessageInfo::SetSockAddrToRlocPeerAddrTo(uint16_t aRloc16)
{
SetSockAddrToRloc();
SetPeerAddr(Get<Mle::MleRouter>().GetMeshLocal16());
SetPeerAddr(Get<Mle::MleRouter>().GetMeshLocalRloc());
GetPeerAddr().GetIid().SetLocator(aRloc16);
}
+2 -2
View File
@@ -98,7 +98,7 @@ Error MeshDiag::DiscoverTopology(const DiscoverConfig &aConfig, DiscoverCallback
continue;
}
destination = Get<Mle::MleRouter>().GetMeshLocal16();
destination = Get<Mle::MleRouter>().GetMeshLocalRloc();
destination.GetIid().SetLocator(Mle::Rloc16FromRouterId(routerId));
SuccessOrExit(error = Get<Client>().SendCommand(kUriDiagnosticGetRequest, Message::kPriorityLow, destination,
@@ -176,7 +176,7 @@ Error MeshDiag::SendQuery(uint16_t aRloc16, const uint8_t *aTlvs, uint8_t aTlvsL
VerifyOrExit(Mle::IsActiveRouter(aRloc16), error = kErrorInvalidArgs);
VerifyOrExit(Get<RouterTable>().IsAllocated(Mle::RouterIdFromRloc16(aRloc16)), error = kErrorNotFound);
destination = Get<Mle::MleRouter>().GetMeshLocal16();
destination = Get<Mle::MleRouter>().GetMeshLocalRloc();
destination.GetIid().SetLocator(aRloc16);
SuccessOrExit(error = Get<Client>().SendCommand(kUriDiagnosticGetQuery, Message::kPriorityNormal, destination,
+1 -1
View File
@@ -214,7 +214,7 @@ void TestChildIp6Address(void)
numAddresses = 0;
// First addresses uses the mesh local prefix (mesh-local address).
addresses[numAddresses] = sInstance->Get<Mle::MleRouter>().GetMeshLocal64();
addresses[numAddresses] = sInstance->Get<Mle::MleRouter>().GetMeshLocalEid();
addresses[numAddresses].SetIid(meshLocalIid);
numAddresses++;
+1 -1
View File
@@ -1097,7 +1097,7 @@ void TestSrpClientDelayedResponse(void)
break;
}
serverSockAddr.SetAddress(sInstance->Get<Mle::Mle>().GetMeshLocal16());
serverSockAddr.SetAddress(sInstance->Get<Mle::Mle>().GetMeshLocalRloc());
serverSockAddr.SetPort(kServerPort);
SuccessOrQuit(srpClient->Start(serverSockAddr));