mirror of
https://github.com/espressif/openthread.git
synced 2026-06-06 05:24:51 +00:00
[mle] refactor Tx/RxMessage method definitions (#7812)
This commit is a cosmetic change and contains no change in the code logic. It is a follow-up from #7689 which added `Mle::Tx/RxMessage` types. This commit moves all `TxMessage` and `RxMessage` method definitions close to one another (at the end of `mle.cpp`).
This commit is contained in:
committed by
GitHub
parent
49b9846632
commit
d5926a2445
+658
-568
File diff suppressed because it is too large
Load Diff
@@ -4161,58 +4161,6 @@ void MleRouter::FillConnectivityTlv(ConnectivityTlv &aTlv)
|
||||
aTlv.SetSedDatagramCount(OPENTHREAD_CONFIG_DEFAULT_SED_DATAGRAM_COUNT);
|
||||
}
|
||||
|
||||
Error Mle::TxMessage::AppendConnectivityTlv(void)
|
||||
{
|
||||
ConnectivityTlv tlv;
|
||||
|
||||
tlv.Init();
|
||||
Get<MleRouter>().FillConnectivityTlv(tlv);
|
||||
|
||||
return tlv.AppendTo(*this);
|
||||
}
|
||||
|
||||
Error Mle::TxMessage::AppendAddresseRegisterationTlv(Child &aChild)
|
||||
{
|
||||
Error error;
|
||||
Tlv tlv;
|
||||
AddressRegistrationEntry entry;
|
||||
Lowpan::Context context;
|
||||
uint8_t length = 0;
|
||||
uint16_t startOffset = GetLength();
|
||||
|
||||
tlv.SetType(Tlv::kAddressRegistration);
|
||||
SuccessOrExit(error = Append(tlv));
|
||||
|
||||
for (const Ip6::Address &address : aChild.IterateIp6Addresses())
|
||||
{
|
||||
if (address.IsMulticast() || Get<NetworkData::Leader>().GetContext(address, context) != kErrorNone)
|
||||
{
|
||||
// uncompressed entry
|
||||
entry.SetUncompressed();
|
||||
entry.SetIp6Address(address);
|
||||
}
|
||||
else if (context.mContextId != kMeshLocalPrefixContextId)
|
||||
{
|
||||
// compressed entry
|
||||
entry.SetContextId(context.mContextId);
|
||||
entry.SetIid(address.GetIid());
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
SuccessOrExit(error = AppendBytes(&entry, entry.GetLength()));
|
||||
length += entry.GetLength();
|
||||
}
|
||||
|
||||
tlv.SetLength(length);
|
||||
Write(startOffset, tlv);
|
||||
|
||||
exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
void MleRouter::FillRouteTlv(RouteTlv &aTlv, Neighbor *aNeighbor)
|
||||
{
|
||||
uint8_t routerIdSequence = mRouterTable.GetRouterIdSequence();
|
||||
@@ -4314,26 +4262,6 @@ void MleRouter::FillRouteTlv(RouteTlv &aTlv, Neighbor *aNeighbor)
|
||||
aTlv.SetRouteDataLength(routerCount);
|
||||
}
|
||||
|
||||
Error Mle::TxMessage::AppendRouteTlv(Neighbor *aNeighbor)
|
||||
{
|
||||
RouteTlv tlv;
|
||||
|
||||
tlv.Init();
|
||||
Get<MleRouter>().FillRouteTlv(tlv, aNeighbor);
|
||||
|
||||
return tlv.AppendTo(*this);
|
||||
}
|
||||
|
||||
Error Mle::TxMessage::AppendActiveDatasetTlv(void)
|
||||
{
|
||||
return Get<MeshCoP::ActiveDatasetManager>().AppendMleDatasetTlv(*this);
|
||||
}
|
||||
|
||||
Error Mle::TxMessage::AppendPendingDatasetTlv(void)
|
||||
{
|
||||
return Get<MeshCoP::PendingDatasetManager>().AppendMleDatasetTlv(*this);
|
||||
}
|
||||
|
||||
bool MleRouter::HasMinDowngradeNeighborRouters(void)
|
||||
{
|
||||
uint8_t linkQuality;
|
||||
|
||||
Reference in New Issue
Block a user