mirror of
https://github.com/espressif/openthread.git
synced 2026-08-10 20:57:47 +00:00
[mle] replace "FED" with "FTD child" when applicable (#10718)
This commit replaces uses of the term "FED" in comments and method names with "FTD child" where the logic applies to any FTD child (i.e., both FED and REED). This clarifies the behavior and aligns the code with Thread specification terminology.
This commit is contained in:
@@ -2460,7 +2460,7 @@ void Mle::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageIn
|
||||
#if OPENTHREAD_FTD
|
||||
if (neighbor == nullptr)
|
||||
{
|
||||
// As an FED, we may have rx-only neighbors. We find and set
|
||||
// As an FTD child, we may have rx-only neighbors. We find and set
|
||||
// `neighbor` to perform security processing (frame counter
|
||||
// and key sequence checks) for messages from such neighbors.
|
||||
|
||||
@@ -2521,9 +2521,9 @@ void Mle::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageIn
|
||||
{
|
||||
// Clear the `neighbor` if it is a rx-only one before calling
|
||||
// `Handle{Msg}()`, except for a subset of MLE messages such
|
||||
// as MLE Advertisement. This ensures that, as an FED, we are
|
||||
// selective about which messages to process from rx-only
|
||||
// neighbors.
|
||||
// as MLE Advertisement. This ensures that, as an FTD child,
|
||||
// we are selective about which messages to process from
|
||||
// rx-only neighbors.
|
||||
|
||||
switch (command)
|
||||
{
|
||||
@@ -2807,7 +2807,7 @@ void Mle::HandleAdvertisement(RxInfo &aRxInfo)
|
||||
SetLeaderData(leaderData);
|
||||
|
||||
#if OPENTHREAD_FTD
|
||||
SuccessOrExit(error = Get<MleRouter>().ReadAndProcessRouteTlvOnFed(aRxInfo, mParent.GetRouterId()));
|
||||
SuccessOrExit(error = Get<MleRouter>().ReadAndProcessRouteTlvOnFtdChild(aRxInfo, mParent.GetRouterId()));
|
||||
#endif
|
||||
|
||||
mRetrieveNewNetworkData = true;
|
||||
@@ -2853,7 +2853,7 @@ void Mle::HandleDataResponse(RxInfo &aRxInfo)
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_FTD
|
||||
SuccessOrExit(error = Get<MleRouter>().ReadAndProcessRouteTlvOnFed(aRxInfo, mParent.GetRouterId()));
|
||||
SuccessOrExit(error = Get<MleRouter>().ReadAndProcessRouteTlvOnFtdChild(aRxInfo, mParent.GetRouterId()));
|
||||
#endif
|
||||
|
||||
error = HandleLeaderData(aRxInfo);
|
||||
@@ -3355,7 +3355,8 @@ void Mle::HandleChildIdResponse(RxInfo &aRxInfo)
|
||||
SetLeaderData(leaderData);
|
||||
|
||||
#if OPENTHREAD_FTD
|
||||
SuccessOrExit(error = Get<MleRouter>().ReadAndProcessRouteTlvOnFed(aRxInfo, RouterIdFromRloc16(sourceAddress)));
|
||||
SuccessOrExit(error =
|
||||
Get<MleRouter>().ReadAndProcessRouteTlvOnFtdChild(aRxInfo, RouterIdFromRloc16(sourceAddress)));
|
||||
#endif
|
||||
|
||||
mParentCandidate.CopyTo(mParent);
|
||||
|
||||
@@ -1111,12 +1111,12 @@ Error MleRouter::ProcessRouteTlv(const RouteTlv &aRouteTlv, RxInfo &aRxInfo)
|
||||
return error;
|
||||
}
|
||||
|
||||
Error MleRouter::ReadAndProcessRouteTlvOnFed(RxInfo &aRxInfo, uint8_t aParentId)
|
||||
Error MleRouter::ReadAndProcessRouteTlvOnFtdChild(RxInfo &aRxInfo, uint8_t aParentId)
|
||||
{
|
||||
// This method reads and processes Route TLV from message on an
|
||||
// FED if message contains one. It returns `kErrorNone` when
|
||||
// successfully processed or if there is no Route TLV in the
|
||||
// message.
|
||||
// FTD child if message contains one. It returns `kErrorNone`
|
||||
// when successfully processed or if there is no Route TLV in
|
||||
// the message.
|
||||
//
|
||||
// It MUST be used only when device is acting as a child and
|
||||
// for a message received from device's current parent.
|
||||
@@ -1130,7 +1130,7 @@ Error MleRouter::ReadAndProcessRouteTlvOnFed(RxInfo &aRxInfo, uint8_t aParentId)
|
||||
{
|
||||
case kErrorNone:
|
||||
SuccessOrExit(error = ProcessRouteTlv(routeTlv, aRxInfo));
|
||||
mRouterTable.UpdateRoutesOnFed(routeTlv, aParentId);
|
||||
mRouterTable.UpdateRouterOnFtdChild(routeTlv, aParentId);
|
||||
mRequestRouteTlv = false;
|
||||
break;
|
||||
case kErrorNotFound:
|
||||
@@ -1289,7 +1289,7 @@ Error MleRouter::HandleAdvertisement(RxInfo &aRxInfo, uint16_t aSourceAddress, c
|
||||
mRouterRoleTransition.StartTimeout();
|
||||
}
|
||||
|
||||
mRouterTable.UpdateRoutesOnFed(routeTlv, routerId);
|
||||
mRouterTable.UpdateRouterOnFtdChild(routeTlv, routerId);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3349,8 +3349,8 @@ void MleRouter::HandleAddressSolicitResponse(Coap::Message *aMessage,
|
||||
|
||||
// We keep the router table next hop and cost as what we had as a
|
||||
// REED, i.e., our parent was the next hop towards all other
|
||||
// routers and we tracked its cost towards them. As FED, we may
|
||||
// have established links with a subset of neighboring routers.
|
||||
// routers and we tracked its cost towards them. As an FTD child,
|
||||
// we may have established links with a subset of neighboring routers.
|
||||
// We ensure to clear these links to avoid using them (since will
|
||||
// be rejected by the neighbor).
|
||||
|
||||
|
||||
@@ -620,7 +620,7 @@ private:
|
||||
static bool IsMessageChildUpdateRequest(const Message &aMessage);
|
||||
|
||||
Error ProcessRouteTlv(const RouteTlv &aRouteTlv, RxInfo &aRxInfo);
|
||||
Error ReadAndProcessRouteTlvOnFed(RxInfo &aRxInfo, uint8_t aParentId);
|
||||
Error ReadAndProcessRouteTlvOnFtdChild(RxInfo &aRxInfo, uint8_t aParentId);
|
||||
|
||||
void StopAdvertiseTrickleTimer(void);
|
||||
uint32_t DetermineAdvertiseIntervalMax(void) const;
|
||||
|
||||
@@ -681,7 +681,7 @@ exit:
|
||||
return;
|
||||
}
|
||||
|
||||
void RouterTable::UpdateRoutesOnFed(const Mle::RouteTlv &aRouteTlv, uint8_t aParentId)
|
||||
void RouterTable::UpdateRouterOnFtdChild(const Mle::RouteTlv &aRouteTlv, uint8_t aParentId)
|
||||
{
|
||||
for (uint8_t routerId = 0, index = 0; routerId <= Mle::kMaxRouterId;
|
||||
index += aRouteTlv.IsRouterIdSet(routerId) ? 1 : 0, routerId++)
|
||||
|
||||
@@ -368,15 +368,15 @@ public:
|
||||
void UpdateRoutes(const Mle::RouteTlv &aRouteTlv, uint8_t aNeighborId);
|
||||
|
||||
/**
|
||||
* Updates the routes on an FED based on a received `RouteTlv` from the parent.
|
||||
* Updates the routes on an FTD child based on a received `RouteTlv` from the parent.
|
||||
*
|
||||
* MUST be called when device is an FED child and @p aRouteTlv is received from its current parent.
|
||||
* MUST be called when device is an FTD child and @p aRouteTlv is received from its current parent.
|
||||
*
|
||||
* @param[in] aRouteTlv The received `RouteTlv` from parent.
|
||||
* @param[in] aParentId The Router ID of parent.
|
||||
*
|
||||
*/
|
||||
void UpdateRoutesOnFed(const Mle::RouteTlv &aRouteTlv, uint8_t aParentId);
|
||||
void UpdateRouterOnFtdChild(const Mle::RouteTlv &aRouteTlv, uint8_t aParentId);
|
||||
|
||||
/**
|
||||
* Gets the allocated Router ID set.
|
||||
|
||||
Reference in New Issue
Block a user